frmsh.cxx (721f296a) frmsh.cxx (0c259c9f)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 21 unchanged lines hidden (view full) ---

30#include <svtools/imapobj.hxx>
31#include <svl/srchitem.hxx>
32#include <svtools/imap.hxx>
33#include <sfx2/viewfrm.hxx>
34#include <basic/sbstar.hxx>
35#include <svl/rectitem.hxx>
36#include <svl/ptitem.hxx>
37#include <svl/stritem.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 21 unchanged lines hidden (view full) ---

30#include <svtools/imapobj.hxx>
31#include <svl/srchitem.hxx>
32#include <svtools/imap.hxx>
33#include <sfx2/viewfrm.hxx>
34#include <basic/sbstar.hxx>
35#include <svl/rectitem.hxx>
36#include <svl/ptitem.hxx>
37#include <svl/stritem.hxx>
38#include <svl/intitem.hxx>
39#include <svl/eitem.hxx>
38#include <editeng/colritem.hxx>
39#include <editeng/bolnitem.hxx>
40#include <editeng/boxitem.hxx>
41#include <editeng/protitem.hxx>
42#include <sfx2/dispatch.hxx>
43#include <sfx2/request.hxx>
44#include <sfx2/objface.hxx>
45#include <sfx2/sidebar/EnumContext.hxx>

--- 332 unchanged lines hidden (view full) ---

378 if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem))
379 {
380 aMgr.SetAttrSet( *pArgs );
381 if(SID_ATTR_ULSPACE == nSlot && SID_ATTR_ULSPACE == nSlot)
382 bCopyToFmt = sal_True;
383 }
384 }
385 break;
40#include <editeng/colritem.hxx>
41#include <editeng/bolnitem.hxx>
42#include <editeng/boxitem.hxx>
43#include <editeng/protitem.hxx>
44#include <sfx2/dispatch.hxx>
45#include <sfx2/request.hxx>
46#include <sfx2/objface.hxx>
47#include <sfx2/sidebar/EnumContext.hxx>

--- 332 unchanged lines hidden (view full) ---

380 if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem))
381 {
382 aMgr.SetAttrSet( *pArgs );
383 if(SID_ATTR_ULSPACE == nSlot && SID_ATTR_ULSPACE == nSlot)
384 bCopyToFmt = sal_True;
385 }
386 }
387 break;
388
389 case SID_ATTR_TRANSFORM:
390 {
391 bool bApplyNewSize = false;
392
393 Size aNewSize = aMgr.GetSize();
394 if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_WIDTH, FALSE, &pItem ) )
395 {
396 aNewSize.setWidth( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
397 bApplyNewSize = true;
398 }
399
400 if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_HEIGHT, FALSE, &pItem ) )
401 {
402 aNewSize.setHeight( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
403 bApplyNewSize = true;
404 }
405
406 if ( bApplyNewSize )
407 {
408 aMgr.SetSize( aNewSize );
409 }
410 else
411 {
412 bUpdateMgr = sal_False;
413 }
414
415 }
416 break;
417
386 case FN_FORMAT_FRAME_DLG:
387 case FN_PROPERTY_WRAP_DLG:
388 {
389 const int nSel = rSh.GetSelectionType();
390 if (nSel & nsSelectionType::SEL_GRF)
391 {
392 rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG);
393 bUpdateMgr = sal_False;

--- 239 unchanged lines hidden (view full) ---

633 rSh.SetObjTitle(aTitle);
634 }
635
636 delete pDlg;
637 }
638 }
639 break;
640 // <--
418 case FN_FORMAT_FRAME_DLG:
419 case FN_PROPERTY_WRAP_DLG:
420 {
421 const int nSel = rSh.GetSelectionType();
422 if (nSel & nsSelectionType::SEL_GRF)
423 {
424 rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG);
425 bUpdateMgr = sal_False;

--- 239 unchanged lines hidden (view full) ---

665 rSh.SetObjTitle(aTitle);
666 }
667
668 delete pDlg;
669 }
670 }
671 break;
672 // <--
641 default:
642 ASSERT( !this, "falscher Dispatcher" );
643 return;
644 }
645 // Vorlagen-AutoUpdate
646 SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
647 if ( bUpdateMgr )
648 {
649 if(bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt())
650 {
651 rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
652 }
653 else
654 aMgr.UpdateFlyFrm();
655 }
673 default:
674 ASSERT( !this, "falscher Dispatcher" );
675 return;
676 }
677 if ( bUpdateMgr )
678 {
679 SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
680 if ( bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt() )
681 {
682 rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
683 }
684 else
685 {
686 aMgr.UpdateFlyFrm();
687 }
688 }
656
657}
658
659/*--------------------------------------------------------------------
660 Beschreibung:
661 --------------------------------------------------------------------*/
662
663

--- 197 unchanged lines hidden (view full) ---

861 break;
862 case SID_FRAME_TO_TOP:
863 case SID_FRAME_TO_BOTTOM:
864 case FN_FRAME_UP:
865 case FN_FRAME_DOWN:
866 if ( bParentCntProt )
867 rSet.DisableItem( nWhich );
868 break;
689
690}
691
692/*--------------------------------------------------------------------
693 Beschreibung:
694 --------------------------------------------------------------------*/
695
696

--- 197 unchanged lines hidden (view full) ---

894 break;
895 case SID_FRAME_TO_TOP:
896 case SID_FRAME_TO_BOTTOM:
897 case FN_FRAME_UP:
898 case FN_FRAME_DOWN:
899 if ( bParentCntProt )
900 rSet.DisableItem( nWhich );
901 break;
902
903 case SID_ATTR_TRANSFORM:
904 {
905 rSet.DisableItem( nWhich );
906 }
907 break;
908
909 case SID_ATTR_TRANSFORM_PROTECT_SIZE:
910 {
911 const sal_uInt8 eProtection = rSh.IsSelObjProtected( FLYPROTECT_SIZE );
912 if ( ( eProtection & FLYPROTECT_CONTENT ) ||
913 ( eProtection & FLYPROTECT_SIZE ) )
914 {
915 rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_True ) );
916 }
917 else
918 {
919 rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_False ) );
920 }
921 }
922 break;
923
924 case SID_ATTR_TRANSFORM_WIDTH:
925 {
926 rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, aMgr.GetSize().getWidth() ) );
927 }
928 break;
929
930 case SID_ATTR_TRANSFORM_HEIGHT:
931 {
932 rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, aMgr.GetSize().getHeight() ) );
933 }
934 break;
935
869 case FN_FORMAT_FRAME_DLG:
870 {
871 const int nSel = rSh.GetSelectionType();
872 if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
936 case FN_FORMAT_FRAME_DLG:
937 {
938 const int nSel = rSh.GetSelectionType();
939 if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
873 rSet.DisableItem( nWhich );
940 rSet.DisableItem( nWhich );
874 }
875 break;
941 }
942 break;
876 // --> OD 2009-07-07 #i73249#
943
877 case FN_TITLE_DESCRIPTION_SHAPE:
878 {
879 SwWrtShell &rWrtSh = GetShell();
880 SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList();
881 if ( !pSdrView ||
882 pSdrView->GetMarkedObjectCount() != 1 )
883 {
884 rSet.DisableItem( nWhich );
885 }
886
887 }
888 break;
944 case FN_TITLE_DESCRIPTION_SHAPE:
945 {
946 SwWrtShell &rWrtSh = GetShell();
947 SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList();
948 if ( !pSdrView ||
949 pSdrView->GetMarkedObjectCount() != 1 )
950 {
951 rSet.DisableItem( nWhich );
952 }
953
954 }
955 break;
889 // <--
890 default:
891 /* do nothing */;
892 break;
893 }
894 nWhich = aIter.NextWhich();
895 }
896 }
956
957 default:
958 /* do nothing */;
959 break;
960 }
961 nWhich = aIter.NextWhich();
962 }
963 }
897}
898
899/*--------------------------------------------------------------------
900 Beschreibung: Ctor fuer FrameShell
901 --------------------------------------------------------------------*/
902
903
904SwFrameShell::SwFrameShell(SwView &_rView) :

--- 252 unchanged lines hidden ---
964}
965
966/*--------------------------------------------------------------------
967 Beschreibung: Ctor fuer FrameShell
968 --------------------------------------------------------------------*/
969
970
971SwFrameShell::SwFrameShell(SwView &_rView) :

--- 252 unchanged lines hidden ---