summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 14:21:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 14:58:13 +0200
commit3fd4c40a8706de03a56b152385551a3a9159f563 (patch)
treedf1068803bf973981c8b759f96dbfe5f777ce23b /svx
parentc7e48d8bf23e0fce7af5fa90ac173f0d477d7aac (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> (cherry picked from commit c152008943160fa901ef8a356515a6a074370ff0)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx5
-rw-r--r--svx/source/svdraw/svdmrkv.cxx15
2 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5c719e1076bd..8960aeed10ca 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -213,11 +213,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 df1abb7f3632..b5c62272f549 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -231,7 +231,7 @@ void SdrMarkView::ModelHasChanged()
sSelection = aSelection.toString();
}
- if(SfxViewShell* pViewShell = SfxViewShell::Current())
+ if(SfxViewShell* pViewShell = GetSfxViewShell())
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sSelection.getStr());
}
}
@@ -714,7 +714,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");
@@ -738,7 +738,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");
@@ -771,10 +771,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);
@@ -1263,6 +1263,11 @@ void SdrMarkView::SetRef2(const Point& rPt)
}
}
+SfxViewShell* SdrMarkView::GetSfxViewShell() const
+{
+ return SfxViewShell::Current();
+}
+
bool SdrPageView::IsObjSelectable(SdrObject *pObj) const
{
SdrLayerID nLay=pObj->GetLayer();