diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-02 14:21:18 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-02 12:54:33 +0000 |
commit | c152008943160fa901ef8a356515a6a074370ff0 (patch) | |
tree | 8fe53e484776cd2dbe2972d56f8b01fc46953751 /svx | |
parent | 9a01af253060123b86b702bb9d8ae8fe623edde4 (diff) |
svx: move GetSfxViewShell() to SdrMarkView
... from SdrObjEditView. This way SdrMarkView can avoid
SfxViewShell::Current() calls, and it can avoid clearing the LOK graphic
selection of the old view when constructing a new view.
With this, an existing graphic selection in an Impress LOK view is no
longer cleared when creating a new view, thanks to the
sd::View::GetSfxViewShell() override.
Change-Id: I70a287aa9c2265bf59a9fb18e0c3839b8f119bbc
Reviewed-on: https://gerrit.libreoffice.org/28618
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 15 |
2 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 735cbc1cc1ed..323b4a869183 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -212,11 +212,6 @@ void SdrObjEditView::TakeActionRect(Rectangle& rRect) const } } -SfxViewShell* SdrObjEditView::GetSfxViewShell() const -{ - return nullptr; -} - void SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { SdrGlueEditView::Notify(rBC,rHint); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 9e4bdd29dd7b..a4a791644677 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -228,7 +228,7 @@ void SdrMarkView::ModelHasChanged() sSelection = aSelection.toString(); } - if(SfxViewShell* pViewShell = SfxViewShell::Current()) + if(SfxViewShell* pViewShell = GetSfxViewShell()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sSelection.getStr()); } } @@ -705,7 +705,7 @@ void SdrMarkView::SetMarkHandles() if (bTiledRendering) { // Suppress handles -> empty graphic selection. - if(SfxViewShell* pViewShell = SfxViewShell::Current()) + if(SfxViewShell* pViewShell = GetSfxViewShell()) { pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY"); @@ -729,7 +729,7 @@ void SdrMarkView::SetMarkHandles() if (xController.is() && xController->hasSelectedCells()) { // The table shape has selected cells, which provide text selection already -> no graphic selection. - if(SfxViewShell* pViewShell = SfxViewShell::Current()) + if(SfxViewShell* pViewShell = GetSfxViewShell()) { pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY"); @@ -762,10 +762,10 @@ void SdrMarkView::SetMarkHandles() sSelection = aSelection.toString(); // hide the text selection too - if(SfxViewShell* pViewShell = SfxViewShell::Current()) + if(SfxViewShell* pViewShell = GetSfxViewShell()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""); } - if(SfxViewShell* pViewShell = SfxViewShell::Current()) + if(SfxViewShell* pViewShell = GetSfxViewShell()) { pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection); @@ -1254,6 +1254,11 @@ void SdrMarkView::SetRef2(const Point& rPt) } } +SfxViewShell* SdrMarkView::GetSfxViewShell() const +{ + return SfxViewShell::Current(); +} + bool SdrPageView::IsObjSelectable(SdrObject *pObj) const { SdrLayerID nLay=pObj->GetLayer(); |