diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-12 11:56:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-12 10:31:02 +0000 |
commit | 65828fa693507d699369f0dbc3c0bfc31638d945 (patch) | |
tree | 349b21c55e68dd1ffc2335a42aa30331b07ffe7e /sw/source | |
parent | 3943147ab341f1e4d1c6db34405010085488b0b1 (diff) |
sw: implement SdrMarkView::GetSfxViewShell() API
With this, the graphic selection is no longer lost when creating a new
view. That happened as the SwView ctor calls
SdrMarkView::SetMarkHandles() while the new view is not yet current,
which resulted clearing the graphic selection in the old view, not in
the new one.
A side-effect of introducing SwDrawView::GetSfxViewShell() is that now
SwView::getPart() is called from the SwView dtor, guard against doing
any real work there in that situation to avoid potentially reading
already deleted data.
Change-Id: I4fab39a907d2cbe228c0fc8d44bedc64893387d1
Reviewed-on: https://gerrit.libreoffice.org/28832
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/draw/dview.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/inc/dview.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 763652fbee27..ae40150357ac 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -920,6 +920,11 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView ) } } +SfxViewShell* SwDrawView::GetSfxViewShell() const +{ + return rImp.GetShell()->GetSfxViewShell(); +} + void SwDrawView::DeleteMarked() { SwDoc* pDoc = Imp().GetShell()->GetDoc(); diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx index 0242d9db3e3e..1b66f6f0d696 100644 --- a/sw/source/core/inc/dview.hxx +++ b/sw/source/core/inc/dview.hxx @@ -112,6 +112,9 @@ public: // method to replace marked/selected <SwDrawVirtObj> // by its reference object for delete of selection and group selection static void ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView ); + + /// See SdrMarkView::GetSfxViewShell(). + SfxViewShell* GetSfxViewShell() const override; }; #endif diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 2f401a0c67c0..213e0f928a58 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -250,7 +250,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) int SwView::getPart() const { - if (!m_pWrtShell) + if (m_bInDtor || !m_pWrtShell) return 0; sal_uInt16 nPage, nLogPage; |