editeng/source/editeng/impedit.cxx | 18 +++++++++++++----- include/svx/sdr/overlay/overlaymanager.hxx | 3 --- sc/source/ui/inc/gridwin.hxx | 2 -- sc/source/ui/view/gridwin.cxx | 9 --------- sc/source/ui/view/gridwin4.cxx | 3 --- sc/source/ui/view/tabview.cxx | 3 --- sc/source/ui/view/tabview3.cxx | 6 ------ sd/source/ui/func/futext.cxx | 14 -------------- svx/inc/sdr/overlay/overlaymanagerbuffered.hxx | 3 --- svx/source/sdr/overlay/overlaymanager.cxx | 5 ----- svx/source/sdr/overlay/overlaymanagerbuffered.cxx | 6 ------ svx/source/svdraw/svdcrtv.cxx | 12 ------------ svx/source/svdraw/svddrgv.cxx | 3 --- 13 files changed, 13 insertions(+), 74 deletions(-)
New commits: commit 9ac1f9aca84e578477983957e3b2117e34c4e281 Author: Armin Le Grand (allotropia) <[email protected]> AuthorDate: Wed Feb 19 15:52:03 2025 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Sun Mar 2 23:04:39 2025 +0100 Remove OverlayManager::flush() mechanism This is a follow-up to 'Avoid short blinking of text when activating TextEdit' commit. The update using the timer works nowadays flawless, so no longer needed. I separated the two places in two commits because this one handles some places I do not know good enough to be completely sure, so it would be simpler to turn back in case of (unexpected) problems. Change-Id: I336515838949585b98101ff566e9137b898da82f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181906 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: Jenkins diff --git a/include/svx/sdr/overlay/overlaymanager.hxx b/include/svx/sdr/overlay/overlaymanager.hxx index 696cf5c992c9..f7f227943eaa 100644 --- a/include/svx/sdr/overlay/overlaymanager.hxx +++ b/include/svx/sdr/overlay/overlaymanager.hxx @@ -95,9 +95,6 @@ namespace sdr::overlay // complete redraw virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const; - // flush. Do buffered updates. - virtual void flush(); - // get the OutputDevice OutputDevice& getOutputDevice() const { return mrOutputDevice; } diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index ac5c81700f20..48c47dd57714 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -361,9 +361,7 @@ public: virtual void dispose() override; virtual void KeyInput(const KeyEvent& rKEvt) override; - // #i70788# flush and get overlay rtl::Reference<sdr::overlay::OverlayManager> getOverlayManager() const; - void flushOverlayManager(); virtual OUString GetSurroundingText() const override; virtual Selection GetSurroundingTextSelection() const override; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 7862d9b68d3d..6041bd929db9 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -7413,15 +7413,6 @@ rtl::Reference<sdr::overlay::OverlayManager> ScGridWindow::getOverlayManager() c return rtl::Reference<sdr::overlay::OverlayManager>(); } -void ScGridWindow::flushOverlayManager() -{ - // #i70788# get the OverlayManager safely - rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager(); - - if (xOverlayManager.is()) - xOverlayManager->flush(); -} - ScViewData& ScGridWindow::getViewData() { return mrViewData; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 166056d914d8..12abf75e276e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1345,9 +1345,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if (mrViewData.HasEditView(eWhich)) { - // flush OverlayManager before changing the MapMode - flushOverlayManager(); - // set MapMode for text edit rDevice.SetMapMode(mrViewData.GetLogicMode()); } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index e5a1a0d99297..2bec26ba0685 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2359,7 +2359,6 @@ void ScTabView::SetNewVisArea() for (i=0; i<4; i++) if (pGridWin[i] && aDrawMode[i] != aOldMode[i]) { - pGridWin[i]->flushOverlayManager(); // #i79909# flush overlays before switching to edit MapMode pGridWin[i]->SetMapMode(aOldMode[i]); } @@ -2384,8 +2383,6 @@ void ScTabView::SetNewVisArea() ScGridWindow *pGridWindow = GetViewData().GetActiveWin(); pGridWindow->DrawEditView(*pGridWindow->GetOutDev(), pEditView); - - pGridWindow->flushOverlayManager(); pGridWindow->GetOutDev()->SetMapMode(GetViewData().GetLogicMode()); if (bInPlaceVisCursor) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 9febf7236518..969012421d3a 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2206,9 +2206,6 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW pGridWin[i]->DeleteAutoFillOverlay(); pGridWin[i]->DeleteCopySourceOverlay(); - // flush OverlayManager before changing MapMode to text edit - pGridWin[i]->flushOverlayManager(); - // MapMode must be set after HideCursor pGridWin[i]->SetMapMode(aViewData.GetLogicMode()); @@ -3204,9 +3201,6 @@ void ScTabView::ZoomChanged() if ( pWin && aViewData.HasEditView( aViewData.GetActivePart() ) ) { - // flush OverlayManager before changing the MapMode - pWin->flushOverlayManager(); - // make sure the EditView's position and size are updated // with the right (logic, not drawing) MapMode pWin->SetMapMode( aViewData.GetLogicMode() ); diff --git a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx index a5acd6abc3ee..cc2a1fe5c217 100644 --- a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx +++ b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx @@ -62,9 +62,6 @@ namespace sdr::overlay // complete redraw virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const override; - // flush. Do buffered updates. - virtual void flush() override; - // invalidate the given range at local OutputDevice virtual void invalidateRange(const basegfx::B2DRange& rRange) override; }; diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 7edd853cf03b..8fb04c2534ad 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -255,11 +255,6 @@ namespace sdr::overlay ImpDrawMembers(aRegionRange, rTarget); } - void OverlayManager::flush() - { - // default has nothing to do - } - void OverlayManager::add(OverlayObject& rOverlayObject) { OSL_ENSURE(nullptr == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)"); diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index a58ec8192004..754f9ea5deb2 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -388,12 +388,6 @@ namespace sdr::overlay OverlayManager::completeRedraw(rRegion, pPreRenderDevice); } - void OverlayManagerBuffered::flush() - { - // call timer handler direct - ImpBufferTimerHandler(nullptr); - } - void OverlayManagerBuffered::invalidateRange(const basegfx::B2DRange& rRange) { if(rRange.isEmpty()) diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 04e6f15df2aa..c9e8326d12ae 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -820,18 +820,6 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/) mpCreateViewExtraData->CreateAndShowOverlay(*this, nullptr, aPoly); } - - // #i101679# Force changed overlay to be shown - for(sal_uInt32 a(0); a < PaintWindowCount(); a++) - { - SdrPaintWindow* pCandidate = GetPaintWindow(a); - const rtl::Reference<sdr::overlay::OverlayManager>& xOverlayManager = pCandidate->GetOverlayManager(); - - if (xOverlayManager.is()) - { - xOverlayManager->flush(); - } - } } maDragStat.SetShown(true); diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index d123e900e9c7..e910c793d8e1 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -824,9 +824,6 @@ void SdrDragView::ShowDragObj() mpCurrentSdrDragMethod->CreateOverlayGeometry( *xOverlayManager, rPageWindow.GetObjectContact()); - - // #i101679# Force changed overlay to be shown - xOverlayManager->flush(); } } } commit bb5577747836f71af7e53772902cba10aa707bb9 Author: Armin Le Grand (allotropia) <[email protected]> AuthorDate: Wed Feb 19 15:38:14 2025 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Sun Mar 2 23:02:55 2025 +0100 Avoid short blinking of text when activating TextEdit In Presentation with title/Body with text directly activating one by clicking makes the other 'blink' briefly when it gets deactivated. All that has to do with OverlayManager, repaints and the text being 'hidden' (to not be shown twice during edit). That needs to be synchronized since OM refreshes using a timer and direct paint to the target, while repaint uses system's invalidate-and-paint-callback functionality. It has shown that the immediate flush of the OM that was used before is not needed anymore, so I removed that. Note that there is task tdf#102293 mentioned as reason for the flush, so I checked that the there mentioned triple/ double-click on text does the right thing. Change-Id: Id9539129c5d6989959974befd15300abdfef3186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181904 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <[email protected]> diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index cbb011b5b2fa..2c1eb74c9aca 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -40,7 +40,6 @@ #include <editeng/editeng.hxx> #include <svx/svdoutl.hxx> #include <svx/svxids.hrc> -#include <svx/sdr/overlay/overlaymanager.hxx> #include <sfx2/docfile.hxx> #include <editeng/outlobj.hxx> #include <osl/diagnose.h> @@ -1053,19 +1052,6 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) if (mpView->SdrBeginTextEdit(pTextObj.get(), pPV, mpWindow, true, pOutl.release()) && mxTextObj.get()->GetObjInventor() == SdrInventor::Default) { - //tdf#102293 flush overlay before going on to pass clicks down to - //the outline view which will want to paint selections - for (sal_uInt32 b = 0; b < pPV->PageWindowCount(); ++b) - { - const SdrPageWindow& rPageWindow = *pPV->GetPageWindow(b); - if (!rPageWindow.GetPaintWindow().OutputToWindow()) - continue; - const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); - if (!xManager.is()) - continue; - xManager->flush(); - } - bFirstObjCreated = true; DeleteDefaultText(); commit b0c1a7be0a04c323da94abb6211217fabc060b69 Author: Armin Le Grand (allotropia) <[email protected]> AuthorDate: Mon Feb 24 15:33:16 2025 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Sun Mar 2 23:02:43 2025 +0100 Avoid slight jumping of TextEdit on activation A PixelSnap was used before using GetOutputDevice() and LogicToPixel/PixelToLogic (what was incorrect, would need to take care of 1/2 pixel in logic for rounding). We do not need that anymore, in fact it leads to the text slightly 'jumping' around by up to 1 pixel (of course). We paint text nowadays using decomposed TextPrimitives with sub-pixel precision and similar (using a shortcut) for text in TextEdit on the Overlay, also using sub-pixel precision. Just remove this to avoid Text being displayed different in TextEdit and EditView paint visualizations and assign given value to OutputArea unchanged. If this should cause problems somewhere (I do not think so, we try to paint text with Sub-Pixel quality now anyways) this can also be done in alternative ways and only for TextEdit on Overlay. Change-Id: If177ceec880a29a6d102ad4f0dddf891d95b69c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182094 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <[email protected]> diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 7f20a639f9c7..9bbde4cff4b4 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -858,11 +858,19 @@ weld::Widget* ImpEditView::GetPopupParent(tools::Rectangle& rRect) const void ImpEditView::SetOutputArea( const tools::Rectangle& rRect ) { - const OutputDevice& rOutDev = GetOutputDevice(); - // should be better be aligned on pixels! - tools::Rectangle aNewRect(rOutDev.LogicToPixel(rRect)); - aNewRect = rOutDev.PixelToLogic(aNewRect); - maOutputArea = aNewRect; + // Here a PixelSnap was used before using GetOutputDevice() and + // LogicToPixel/PixelToLogic (what was incorrect, would need + // to take care of 1/2 pixel in logic for rounding). We do not + // need that anymore, in fact it leads to text slightly + // 'jumping' around by up to 1 pixel (of course). + // We paint text nowadays using decomposed TextPrimitives + // with sub-pixel precision and similar (using a shortcut) + // for text in TextEdit on the Overlay, also using sub-pixel + // precision. Just remove this to avoid Text being displayed + // different in TextEdit and EditView paint visualizations + // and assign given value to OutputArea unchanged. + maOutputArea = rRect; + if (!maOutputArea.IsWidthEmpty() && maOutputArea.Right() < maOutputArea.Left()) maOutputArea.SetRight(maOutputArea.Left()); if (!maOutputArea.IsHeightEmpty() && maOutputArea.Bottom() < maOutputArea.Top())
