diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-08-25 10:44:51 +0200 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2022-10-21 15:01:30 +0200 |
commit | e496b55a592caf0ca07f5477285a72d50cee6501 (patch) | |
tree | ca3364265d2e6b9b896d19a49a8aa354ca2355e2 /svx | |
parent | ad8ad792f6d52714b3b2dba621b3522dc4b7e50d (diff) |
lok: masterpage: don't render text edits from different mode
In Impress we can have 2 different EditMode : Page and MasterPage.
Don't render text edits from other views in Page mode on Master Page.
Change-Id: I62341941215165281d2663af3d3b7cca034762a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138803
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdpntv.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 68345e345bdc..310c024c1972 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -639,28 +639,31 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFo // look for active TextEdit. As long as this cannot be painted to a VDev, // it cannot get part of buffering. In that case, output evtl. prerender // early and paint text edit to window. - if(IsTextEdit() && GetSdrPageView()) + SdrPageView* pPageView = GetSdrPageView(); + if(IsTextEdit() && pPageView) { if (!comphelper::LibreOfficeKit::isActive() || mbPaintTextEdit) static_cast< SdrView* >(this)->TextEditDrawing(rPaintWindow); } - if (comphelper::LibreOfficeKit::isActive()) + if (comphelper::LibreOfficeKit::isActive() && mbPaintTextEdit && pPageView) { // Look for active text edits in other views showing the same page, - // and show them as well. - if (SdrPageView* pPageView = GetSdrPageView()) + // and show them as well. Show only if Page/MasterPage mode is matching. + SdrViewIter aIter(pPageView->GetPage()); + bool bRequireMasterPage = pPageView->GetPage() ? pPageView->GetPage()->IsMasterPage() : false; + for (SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView()) { - SdrViewIter aIter(pPageView->GetPage()); - for (SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView()) - { - if (pView == this) - continue; + SdrPageView* pCurrentPageView = pView->GetSdrPageView(); + bool bIsCurrentMasterPage = (pCurrentPageView && pCurrentPageView->GetPage()) ? + pCurrentPageView->GetPage()->IsMasterPage() : false; - if (pView->IsTextEdit() && pView->GetSdrPageView()) - { - pView->TextEditDrawing(rPaintWindow); - } + if (pView == this || bRequireMasterPage != bIsCurrentMasterPage) + continue; + + if (pView->IsTextEdit() && pView->GetSdrPageView()) + { + pView->TextEditDrawing(rPaintWindow); } } } |