diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-27 10:03:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-28 09:04:43 +0200 |
commit | 0f83ff712a6253066b758d39d92ac528bdb2f5d3 (patch) | |
tree | c321f61340f60212e0cda6cd32234b3279f81158 /sd | |
parent | 1a90cfa9cb478a4a4cca9b2fbee4ba5c20b35d52 (diff) |
svx lok: avoid SfxViewShell::Current() during constructing a new view shell
Currently when a text edit is started, then in the LOK case if there is
an other view that shows the same page, then both draw views will have
an outliner view showing the text edit. This means that in case a view
shell is created after starting the text edit, that won't have an
outliner view for the text edit.
Before fixing this, calls to SfxViewShell::Current() has to be avoided
when we're in the process of setting up a new LOK view. In case of
Impress, this is a double initialization, and by the time
SdrObjEditView::ImpMakeOutlinerView() is called, we're already in the
process of setting up the second SfxViewShell (as part of
SdXImpressDocument::initializeForTiledRendering()), but
SfxViewShell::Current() still points to the old view shell. Which means
that the outliner view would refer to a view shell that's deleted soon,
and we crash as soon as it tries to invoke a LOK callback.
Fix this by adding a virtual member function to SdrObjEditView, and
override it in sd, so in case applications want to provide a more
precise way of giving the view shell owning a draw view, then they can.
Change-Id: Ie0005f73237d4ff9cf576bf16fa5b46280f13759
Reviewed-on: https://gerrit.libreoffice.org/27561
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit c0f1c0da77cf9f148b3f29aaf0965dfb43b8a32c)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/View.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index fc16663f79e1..887c84c42a6e 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -122,6 +122,7 @@ public: inline DrawDocShell* GetDocSh() const { return mpDocSh; } inline SdDrawDocument& GetDoc() const; inline ViewShell* GetViewShell() const { return mpViewSh; } + SfxViewShell* GetSfxViewShell() const override; virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = nullptr, vcl::Window* pWin = nullptr, bool bIsNewObj = false, SdrOutliner* pGivenOutliner = nullptr, OutlinerView* pGivenOutlinerView = nullptr, diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 01a23f08f515..d5caa2e1762b 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -651,6 +651,16 @@ void OutlinerMasterViewFilter::End() } } +SfxViewShell* View::GetSfxViewShell() const +{ + SfxViewShell* pRet = nullptr; + + if (mpViewSh) + pRet = &mpViewSh->GetViewShellBase(); + + return pRet; +} + bool View::SdrBeginTextEdit( SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, bool bIsNewObj, |