summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-18 20:59:30 +0000
committerAndras Timar <andras.timar@collabora.com>2021-06-23 11:48:33 +0200
commit94cf0f0368cf2c479f079d15bb6dc47dc7d205a2 (patch)
tree6c9f0334c4b56e8ce10ef81ed021db2399a3943b
parentcfc46a1a5703785eda258a4cfec02941df2ec9c6 (diff)
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 <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx10
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.hxx6
2 files changed, 12 insertions, 4 deletions
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);