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 | |
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>
-rw-r--r-- | sw/inc/AnnotationWin.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 23 |
2 files changed, 6 insertions, 20 deletions
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 07f3ed8e83f9..cbeaf7ceca44 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -29,7 +29,6 @@ #include "postithelper.hxx" #include "swrect.hxx" #include "SidebarWindowsTypes.hxx" -#include <optional> #include <annotationmark.hxx> class EditView; @@ -211,7 +210,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public InterimItemWindow virtual void LoseFocus() override; virtual void GetFocus() override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; void SetSizePixel( const Size& rNewSize ) override; @@ -277,7 +275,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public InterimItemWindow SwPostItField* mpField; rtl::Reference<sw::sidebarwindows::SidebarWinAccessible> mxSidebarWinAccessible; - mutable std::optional<sal_Int32> moMetaHeight; }; } // end of namespace sw::annotation 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 |