diff options
author | Christian Lippka <christian.lippka@sun.com> | 2010-01-13 19:12:02 +0100 |
---|---|---|
committer | Christian Lippka <christian.lippka@sun.com> | 2010-01-13 19:12:02 +0100 |
commit | cc1e430e1a6bdaad393720867db0ea5738439177 (patch) | |
tree | f3a1027b35f496944acd019371fe3f46107bbf9c /sd/source/ui/view/ViewShellImplementation.cxx | |
parent | ab98df64183f82536da9a36e36de1534c33bcd8f (diff) |
toolbar menu rendering finetuning
Diffstat (limited to 'sd/source/ui/view/ViewShellImplementation.cxx')
-rw-r--r-- | sd/source/ui/view/ViewShellImplementation.cxx | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 75b728c7849b..6795c37bb2e8 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -322,30 +322,44 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( rRequest.Done (); } +void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind ePageKind ) +{ + const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE, FALSE, TYPE(SfxUInt32Item) ) ); + const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT, FALSE, TYPE(SfxUInt32Item) ) ); + SdPage* pPage = 0; + if( pWhatPage ) + { + SdDrawDocument* pDocument = mrViewShell.GetDoc(); + if( pDocument ) + pPage = pDocument->GetSdPage(static_cast<USHORT>(pWhatPage->GetValue()), ePageKind); + } + if( pPage == 0 ) + pPage = mrViewShell.getCurrentPage(); -void ViewShell::Implementation::AssignLayout ( - SdPage* pPage, - AutoLayout aLayout) -{ - // Transform the given request into the four argument form that is - // understood by ProcessModifyPageSlot(). - SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin()); - BYTE aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE)); - BYTE aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE)); - SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers()); - SfxRequest aRequest (mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE); - aRequest.AppendItem(SfxStringItem (ID_VAL_PAGENAME, pPage->GetName())); - aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout)); - aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground))); - aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEOBJ, aVisibleLayers.IsSet(aBackgroundObject))); - - // Forward the call with the new arguments. - ProcessModifyPageSlot ( - aRequest, - pPage, - pPage->GetPageKind()); + if( pPage ) + { + AutoLayout eLayout = pPage->GetAutoLayout(); + + if( pWhatLayout ) + eLayout = static_cast< AutoLayout >( pWhatLayout->GetValue() ); + + // Transform the given request into the four argument form that is + // understood by ProcessModifyPageSlot(). + SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin()); + BYTE aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE)); + BYTE aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE)); + SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers()); + SfxRequest aRequest (mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE); + aRequest.AppendItem(SfxStringItem (ID_VAL_PAGENAME, pPage->GetName())); + aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, eLayout)); + aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground))); + aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEOBJ, aVisibleLayers.IsSet(aBackgroundObject))); + + // Forward the call with the new arguments. + ProcessModifyPageSlot( aRequest, pPage, pPage->GetPageKind()); + } } |