diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-16 10:28:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-16 11:52:03 +0100 |
commit | 60f001962122a77863231e9cf5dc445c136aac43 (patch) | |
tree | 91ba8651ab68f278ecb34c4a2bbad36fc91dca31 /sw/source | |
parent | b0c68499ab36d2a1bdf6f1bc7d4cd259b99700e7 (diff) |
tdf#157789 Comment size wrong behavior when zooming document
Revert
commit 8d18b5af883bb6b56e758801ee730a08bb88a8f5
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Tue Jun 13 10:11:08 2023 +0200
speed up rendering annotatins, cache meta height
Change-Id: Ib0bae3fd9020200d09c5b37baf5ae882c8532e58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 4864cba499c4..a1780f9132c8 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -1215,25 +1215,14 @@ int SwAnnotationWin::GetPrefScrollbarWidth() const sal_Int32 SwAnnotationWin::GetMetaHeight() const { - if (!moMetaHeight) - { - const int fields = GetNumFields(); + const int fields = GetNumFields(); - sal_Int32 nRequiredHeight = 0; - weld::Label* aLabels[3] = { mxMetadataAuthor.get(), mxMetadataDate.get(), mxMetadataResolved.get() }; - for (int i = 0; i < fields; ++i) - nRequiredHeight += aLabels[i]->get_preferred_size().Height(); - moMetaHeight = nRequiredHeight; - } - return *moMetaHeight; -} + sal_Int32 nRequiredHeight = 0; + weld::Label* aLabels[3] = { mxMetadataAuthor.get(), mxMetadataDate.get(), mxMetadataResolved.get() }; + for (int i = 0; i < fields; ++i) + nRequiredHeight += aLabels[i]->get_preferred_size().Height(); -void SwAnnotationWin::DataChanged(const DataChangedEvent& rDCEvt) -{ - if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) - { - moMetaHeight.reset(); - } + return nRequiredHeight; } sal_Int32 SwAnnotationWin::GetNumFields() const |