diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-03-25 22:53:28 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-03-26 15:09:45 +0000 |
commit | 12c6caa84a61f23df996a0396432fa4b8d5c4785 (patch) | |
tree | 9cf31b38751281d60cd79635c2cc128a7d6053c2 /sw | |
parent | 3bae306bcf23c4baae65b2b8a3617f0b697dfc6a (diff) |
Kill remaining PseudoSlots usage
Change-Id: I14a820b7c0baba8d8b17d07715bf17c42c73c8fb
TODO: Remove support code from idl and sfx2 modules
Reviewed-on: https://gerrit.libreoffice.org/35718
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/sdi/drwbassh.sdi | 37 | ||||
-rw-r--r-- | sw/sdi/wdrwbase.sdi | 37 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/shells/slotadd.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 21 |
6 files changed, 82 insertions, 39 deletions
diff --git a/sw/sdi/drwbassh.sdi b/sw/sdi/drwbassh.sdi index 4dd539504f8c..3653e0408856 100644 --- a/sw/sdi/drwbassh.sdi +++ b/sw/sdi/drwbassh.sdi @@ -28,9 +28,44 @@ shell SwDrawBaseShell: SwBaseShell SID_OBJECT_ALIGN [ - ExecMethod = Execute ; StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + SID_OBJECT_ALIGN_LEFT + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_CENTER + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_RIGHT + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_UP + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_MIDDLE + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_DOWN + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] } diff --git a/sw/sdi/wdrwbase.sdi b/sw/sdi/wdrwbase.sdi index 60bb334ce5f8..afa74203db79 100644 --- a/sw/sdi/wdrwbase.sdi +++ b/sw/sdi/wdrwbase.sdi @@ -28,9 +28,44 @@ shell SwWebDrawBaseShell: SwBaseShell SID_OBJECT_ALIGN [ - ExecMethod = Execute ; StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + SID_OBJECT_ALIGN_LEFT + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_CENTER + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_RIGHT + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_UP + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_MIDDLE + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_OBJECT_ALIGN_DOWN + [ + ExecMethod = Execute; + StateMethod = GetState; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] } diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index fa8f4c5383c3..361d69bf81fa 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -107,14 +107,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if(pArgs) pArgs->GetItemState(nSlotId, false, &pItem); - //Special case align by menu - if(pItem && nSlotId == SID_OBJECT_ALIGN) - { - OSL_ENSURE(dynamic_cast<const SfxEnumItemInterface*>( pItem),"SfxEnumItem expected" ); - nSlotId = nSlotId + static_cast<const SfxEnumItemInterface*>(pItem)->GetEnumValue(); - nSlotId++; - } - bool bAlignPossible = pSh->IsAlignPossible(); bool bTopParam = true, bBottomParam = true; @@ -671,17 +663,15 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) rSet.DisableItem( nWhich ); else { - SfxAllEnumItem aEnumItem(nWhich, USHRT_MAX); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); //if only one object is selected it can only be vertically // aligned because it is character bound if( rMarkList.GetMarkCount() == 1 ) { - aEnumItem.DisableValue(SID_OBJECT_ALIGN_LEFT); - aEnumItem.DisableValue(SID_OBJECT_ALIGN_CENTER); - aEnumItem.DisableValue(SID_OBJECT_ALIGN_RIGHT); + rSet.DisableItem(SID_OBJECT_ALIGN_LEFT); + rSet.DisableItem(SID_OBJECT_ALIGN_CENTER); + rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT); } - rSet.Put(aEnumItem); } break; diff --git a/sw/source/uibase/shells/slotadd.cxx b/sw/source/uibase/shells/slotadd.cxx index c0658a329e51..4ea84aa6969e 100644 --- a/sw/source/uibase/shells/slotadd.cxx +++ b/sw/source/uibase/shells/slotadd.cxx @@ -122,7 +122,6 @@ #include <svx/drawitem.hxx> #include <avmedia/mediaitem.hxx> -#define SvxDrawAlignItem SfxAllEnumItem #define avmedia_MediaItem ::avmedia::MediaItem #include <svx/xflftrit.hxx> diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 558350d63e10..1e885c75eb74 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1230,15 +1230,8 @@ void SwView::Execute(SfxRequest &rReq) case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break; } } - //special handling for the draw shell - if(nAlias && (m_nSelectionType & (nsSelectionType::SEL_DRW))) - { - SfxAllEnumItem aEnumItem(SID_OBJECT_ALIGN, nAlias - SID_OBJECT_ALIGN_LEFT); - GetViewFrame()->GetDispatcher()->ExecuteList(SID_OBJECT_ALIGN, - SfxCallMode::ASYNCHRON, { &aEnumItem }); - } - else if(nAlias) //these slots are either re-mapped to text or object alignment + if (nAlias) GetViewFrame()->GetDispatcher()->Execute( nAlias, SfxCallMode::ASYNCHRON); } diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 519e6c396e76..70468382d387 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -428,7 +428,6 @@ void SwView::GetState(SfxItemSet &rSet) if( !m_pShell ) SelectShell(); sal_uInt16 nAlias = 0; - bool bDraw = false; if( m_nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) ) { switch( nWhich ) @@ -442,17 +441,6 @@ void SwView::GetState(SfxItemSet &rSet) case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM; break; } } - else if(m_nSelectionType & (nsSelectionType::SEL_DRW)) - { - //the draw shell cannot provide a status per item - only one for SID_OBJECT_ALIGN - if(nWhich != SID_ALIGN_ANY_JUSTIFIED) - { - const SfxPoolItem* pItem = nullptr; - GetViewFrame()->GetDispatcher()->QueryState( SID_OBJECT_ALIGN, pItem ); - if(pItem) - bDraw = true; - } - } else { switch( nWhich ) @@ -471,10 +459,13 @@ void SwView::GetState(SfxItemSet &rSet) GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState ); if(pState) { - std::unique_ptr<SfxPoolItem> pNewItem(pState->CloneSetWhich(nWhich)); - rSet.Put(*pNewItem); + if (!(m_nSelectionType & nsSelectionType::SEL_DRW)) + { + std::unique_ptr<SfxPoolItem> pNewItem(pState->CloneSetWhich(nWhich)); + rSet.Put(*pNewItem); + } } - else if(!bDraw) + else rSet.DisableItem(nWhich); } break; |