diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-06-22 17:03:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-06-22 21:21:19 +0200 |
commit | 0ad7226aee21cc6dbb30d061d76491b01e39de66 (patch) | |
tree | 8156b636b704e039637a947ecc27963dd3321de6 /vcl | |
parent | c1738429b08f9d0a614ff5ee7090fd8ea41fc67a (diff) |
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 <vmiklos@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/status.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
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 )) { |