diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-18 20:59:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-19 10:08:14 +0100 |
commit | f73289763452f2f32993d5defb79ce69ba8f5188 (patch) | |
tree | a15d5a4b4ccfda23f61b577d74343d13f160a567 /sw | |
parent | 7b649f835cc00ed76927c6821a135605609bed4e (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.hxx | 6 |
2 files changed, 12 insertions, 4 deletions
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); |