sw/source/uibase/docvw/AnnotationWin2.cxx    |   10 ++++++----
 sw/source/uibase/docvw/SidebarTxtControl.hxx |    6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 836af6409608ce8843c0e0972789d453ddeaa06d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Feb 18 20:59:30 2021 +0000
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Jun 23 21:00:58 2021 +0200

    tdf#140409 Comment text ignoring zoom size
    
    Change-Id: If48d5c1085cbc86f81ba0c92c8875ef534900c15
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111165
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117462
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 81a222959ee3..12126e35829a 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -318,7 +318,6 @@ void SwAnnotationWin::InitControls()
     mpOutliner.reset(new 
Outliner(&aShell->GetPool(),OutlinerMode::TextObject));
     aShell->GetDoc()->SetCalcFieldValueHdl( mpOutliner.get() );
     mpOutliner->SetUpdateMode( true );
-    Rescale();
 
     mpOutlinerView.reset(new OutlinerView(mpOutliner.get(), nullptr));
     mpOutliner->InsertView(mpOutlinerView.get());
@@ -326,11 +325,16 @@ void SwAnnotationWin::InitControls()
     //create Scrollbars
     mxVScrollbar = m_xBuilder->weld_scrolled_window("scrolledwindow", true);
 
+    mxMenuButton = m_xBuilder->weld_menu_button("menubutton");
+    mxMenuButton->set_size_request(METABUTTON_WIDTH, METABUTTON_HEIGHT);
+
     // actual window which holds the user text
     mxSidebarTextControl.reset(new SidebarTextControl(*this, mrView, mrMgr));
     mxSidebarTextControlWin.reset(new weld::CustomWeld(*m_xBuilder, 
"editview", *mxSidebarTextControl));
     mxSidebarTextControl->SetPointer(PointerStyle::Text);
 
+    Rescale();
+
     mpOutlinerView->SetBackgroundColor(COL_TRANSPARENT);
     mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) ) );
 
@@ -340,9 +344,6 @@ void SwAnnotationWin::InitControls()
     mxVScrollbar->connect_vadjustment_changed(LINK(this, SwAnnotationWin, 
ScrollHdl));
     mxVScrollbar->connect_mouse_move(LINK(this, SwAnnotationWin, 
MouseMoveHdl));
 
-    mxMenuButton = m_xBuilder->weld_menu_button("menubutton");
-    mxMenuButton->set_size_request(METABUTTON_WIDTH, METABUTTON_HEIGHT);
-
     const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions();
     EEControlBits nCntrl = mpOutliner->GetControlWord();
     // TODO: crash when AUTOCOMPLETE enabled
@@ -448,6 +449,7 @@ void SwAnnotationWin::Rescale()
     aMode.SetOrigin( Point() );
     mpOutliner->SetRefMapMode( aMode );
     SetMapMode( aMode );
+    mxSidebarTextControl->SetMapMode( aMode );
     const Fraction& rFraction = 
mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY();
 
     vcl::Font aFont = maLabelFont;
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.hxx 
b/sw/source/uibase/docvw/SidebarTxtControl.hxx
index 596be78244a2..bd6f31f88424 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -69,6 +69,12 @@ class SidebarTextControl : public WeldEditView
 
         OutlinerView* GetTextView() const;
 
+        void SetMapMode(const MapMode& rNewMapMode)
+        {
+            OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
+            rDevice.SetMapMode(rNewMapMode);
+        }
+
         DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
 
         void DrawForPage(OutputDevice* pDev, const Point& rPos);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to