[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jun 29 08:32:11 UTC 2018


 vcl/source/window/status.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit bcfa971adb62bfdde14e8c328fb25e1d10acad9b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jun 22 17:03:30 2018 +0200

    tdf#116208 vcl opengl: fix lack of updates in status bar
    
    Commit f0821f9a347c7752a3c741c3451a2f1630173720 (Cache text layout of
    statusbar items, 2017-06-08) was a performance improvement of not laying
    out the text of status bar text during each & every paint. One of these
    places didn't work correctly with Chinese text, so commit
    a4ed3d9a1ffa1b51ba4352a955c950235f099fdc (tdf#115353 Status bar: no
    cache in settext, 2018-03-01) attempted to disable the caching at that
    particular place by removing the update of the cache.
    
    This resulted in lack of updates, e.g. during typing into Writer and
    checking the word count part of the status bar.
    
    Fix this (and at the same time keep the original problem fixed) by still
    not using the layout cache and that problematic place, but instead of
    just not updating the cache actually invalidate it -- probably that was
    the intention in the force place already.
    
    (cherry picked from commit 0ad7226aee21cc6dbb30d061d76491b01e39de66)
    
    Change-Id: Ib7b91e5f24bc68d2f8cae2efea64340585ad9bd5
    Reviewed-on: https://gerrit.libreoffice.org/56437
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index aebec55ec630..f83a8665dea1 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -1169,6 +1169,9 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText )
             std::unique_ptr<SalLayout> pSalLayout = ImplLayout(pItem->maText,0,-1);
             long nWidth = GetTextWidth( pItem->maText,0,-1,nullptr,pSalLayout.get() ) + nFudge;
 
+            // Invalidate cache.
+            pItem->mxLayoutCache.reset();
+
             if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
                 ((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth  ))
             {


More information about the Libreoffice-commits mailing list