svx/source/svdraw/svdpntv.cxx | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
New commits: commit 2c700bfaa646fea37f55d7873bce9e35940b1abc Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Aug 25 10:44:51 2022 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Nov 9 14:23:27 2022 +0100 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Henry Castro <hcas...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142470 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 4047d4974fb4..4145229b0027 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -641,28 +641,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); } } }