sd/qa/unit/tiledrendering/tiledrendering.cxx |    8 ++++----
 svx/source/annotation/AnnotationObject.cxx   |    5 +++++
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit d8a36f40462eb3eba81d50b5df142a8ca5ca8aaf
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jan 3 10:34:20 2025 +0900
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Fri Jan 3 20:15:12 2025 +0100

    tdf#162695 decrease the text margins to smaller
    
    This decreases the text margins so the comment is overall smaller,
    which should make the situation better, but the main issue might
    be that the comments previously did not change size with zoom, but
    now do. This is probably nto so simple to change.
    
    Change-Id: I5c83b787f58324431e110ee095f61135b67588e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179662
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit e70afe758eae3acdc5ac6ee2b3d173985899db1a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179704
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 45a16089cfe4..04ab4f79ef7b 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1469,7 +1469,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testCommentChangeImpress)
 
     
CPPUNIT_ASSERT(!aView1.m_aCommentCallbackResult.get<std::string>("parthash").empty());
     CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get<std::string>("text"));
-    CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 705, 365"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
+    CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 478, 280"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
 
     // Edit this annotation now
     aArgs = comphelper::InitPropertySequence(
@@ -1482,7 +1482,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testCommentChangeImpress)
 
     CPPUNIT_ASSERT_EQUAL(std::string("Modify"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
     CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get<std::string>("text"));
-    CPPUNIT_ASSERT_EQUAL(std::string("10, 20, 705, 365"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
+    CPPUNIT_ASSERT_EQUAL(std::string("10, 20, 478, 280"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
 }
@@ -1515,7 +1515,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testCommentChangeDraw)
 
     
CPPUNIT_ASSERT(!aView1.m_aCommentCallbackResult.get<std::string>("parthash").empty());
     CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get<std::string>("text"));
-    CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 705, 365"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
+    CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 478, 280"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
 
     // Edit this annotation now
     aArgs = comphelper::InitPropertySequence(
@@ -1528,7 +1528,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testCommentChangeDraw)
 
     CPPUNIT_ASSERT_EQUAL(std::string("Modify"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
     CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get<std::string>("text"));
-    CPPUNIT_ASSERT_EQUAL(std::string("10, 20, 705, 365"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
+    CPPUNIT_ASSERT_EQUAL(std::string("10, 20, 478, 280"), 
aView1.m_aCommentCallbackResult.get<std::string>("rectangle"));
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
 }
diff --git a/svx/source/annotation/AnnotationObject.cxx 
b/svx/source/annotation/AnnotationObject.cxx
index f108e0d5113d..55175ba90998 100644
--- a/svx/source/annotation/AnnotationObject.cxx
+++ b/svx/source/annotation/AnnotationObject.cxx
@@ -27,6 +27,7 @@
 #include <svx/sdooitm.hxx>
 #include <svx/sdtagitm.hxx>
 #include <svx/sdasitm.hxx>
+#include <svx/sdtditm.hxx>
 #include <svtools/colorcfg.hxx>
 
 #include <vcl/settings.hxx>
@@ -184,6 +185,10 @@ void AnnotationObject::ApplyAnnotationName()
     aItemSet.Put(makeSdrTextWordWrapItem(false));
     aItemSet.Put(makeSdrTextAutoGrowWidthItem(true));
     aItemSet.Put(makeSdrTextAutoGrowHeightItem(true));
+    aItemSet.Put(makeSdrTextLeftDistItem(50));
+    aItemSet.Put(makeSdrTextRightDistItem(50));
+    aItemSet.Put(makeSdrTextUpperDistItem(50));
+    aItemSet.Put(makeSdrTextLowerDistItem(50));
 
     SetMergedItemSet(aItemSet);
 

Reply via email to