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

New commits:
commit 0ad7226aee21cc6dbb30d061d76491b01e39de66
Author: Miklos Vajna <vmik...@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.
    
    Change-Id: Ib7b91e5f24bc68d2f8cae2efea64340585ad9bd5
    Reviewed-on: https://gerrit.libreoffice.org/56304
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 357dc6166be4..57f881cfbd48 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -1155,6 +1155,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  ))
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to