[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Feb 19 09:08:53 UTC 2021
sw/source/uibase/docvw/AnnotationWin2.cxx | 10 ++++++----
sw/source/uibase/docvw/SidebarTxtControl.hxx | 6 ++++++
2 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit f73289763452f2f32993d5defb79ce69ba8f5188
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Feb 18 20:59:30 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Feb 19 10:08:14 2021 +0100
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 at redhat.com>
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index e65ef1254933..133f6aa440e0 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -316,7 +316,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());
@@ -324,11 +323,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) ) );
@@ -338,9 +342,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
@@ -446,6 +447,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);
More information about the Libreoffice-commits
mailing list