summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-07-10 14:22:53 +0900
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-23 10:19:03 +0200
commitab5774a2f1fc5fceb1600a83d8ae472cfcea8477 (patch)
tree76ff8b945b1fb92a3b330f54f13c0018548fe4f4 /svx
parent6e05c4ae0daa175f098760dd317e18452cd310ea (diff)
tdf#161911 annot: fix for annotation with 0 size
We need to set the size to something non-zero or it will stay zero even if we try to adapt the frame to the text content. Additionally when we adapt the frame to text, we need to update the annotation with the new size. Change-Id: I4125f95fe6d0e55ab3b00a6a457cd2c9e04ec7c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170260 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins (cherry picked from commit b547e9f19de339531709c14931998125b9a41649) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170334 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/annotation/AnnotationObject.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/svx/source/annotation/AnnotationObject.cxx b/svx/source/annotation/AnnotationObject.cxx
index d69f9be6e9fa..193a3438c277 100644
--- a/svx/source/annotation/AnnotationObject.cxx
+++ b/svx/source/annotation/AnnotationObject.cxx
@@ -168,6 +168,12 @@ void AnnotationObject::ApplyAnnotationName()
aItemSet.Put(makeSdrTextAutoGrowHeightItem(true));
SetMergedItemSet(aItemSet);
+
+ // Update the annotation size after the auto-sizing the frame to content does its magic
+ auto& xAnnotationData = getAnnotationData();
+ css::geometry::RealSize2D aRealSize2D{ GetLogicRect().GetWidth() / 100.0,
+ GetLogicRect().GetHeight() / 100.0 };
+ xAnnotationData->mxAnnotation->SetSize(aRealSize2D);
}
AnnotationObject::~AnnotationObject() {}