sw/source/uibase/docvw/AnnotationWin2.cxx    |    1 -
 sw/source/uibase/docvw/SidebarTxtControl.cxx |    3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit aec60c6d1b4bdd24bfbd55d1b6890e9c7042b489
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Nov 11 20:27:55 2022 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Mon Nov 14 06:30:12 2022 +0100

    Resolves: tdf#145648 use the same reference device for comments as document
    
    so we get the same text measurements and so positioning matches.
    
    Change-Id: I7b3211cbd8eba41269688316d74a8f72ac734f13
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142620
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 7872d02b38e7..fb414a4f1ebe 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -501,7 +501,6 @@ void SwAnnotationWin::Rescale()
 
     MapMode aMode = GetParent()->GetMapMode();
     aMode.SetOrigin( Point() );
-    mpOutliner->SetRefMapMode( aMode );
     SetMapMode( aMode );
     mxSidebarTextControl->SetMapMode( aMode );
     const Fraction& rFraction = 
mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY();
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx 
b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 789e6289b49d..7b7002b7fbfe 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -54,6 +54,7 @@
 #include <view.hxx>
 #include <wrtsh.hxx>
 #include <AnnotationWin.hxx>
+#include <IDocumentDeviceAccess.hxx>
 #include <redline.hxx>
 #include <memory>
 
@@ -116,7 +117,7 @@ void SidebarTextControl::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
     // for layout in the sidebar.
     Size aPaperSize(mrPostItMgr.GetSidebarWidth(), 
pEditEngine->GetPaperSize().Height());
     pEditEngine->SetPaperSize(aPaperSize);
-    pEditEngine->SetRefDevice(&rDevice);
+    
pEditEngine->SetRefDevice(mrDocView.GetWrtShell().getIDocumentDeviceAccess().getReferenceDevice(false));
 
     pEditView->SetOutputArea(tools::Rectangle(Point(0, 0), aOutputSize));
     pEditView->SetBackgroundColor(aBgColor);

Reply via email to