diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/conrect.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 1 |
4 files changed, 16 insertions, 0 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 5adc6cd9dc8a..0a84b479083f 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -36,6 +36,7 @@ #include <svx/xlnedwit.hxx> #include <svx/xlnedit.hxx> #include <svx/xlnstit.hxx> +#include <svx/svdomeas.hxx> #include <sfx2/app.hxx> #include <editeng/boxitem.hxx> #include <editeng/opaqitem.hxx> @@ -2918,6 +2919,9 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const } pObj->SetLogicRect(aRect); + Point aStart = aRect.TopLeft(); + Point aEnd = aRect.BottomRight(); + if(dynamic_cast<const SdrCircObj*>( pObj) != nullptr) { SfxItemSet aAttr(pDrawModel->GetItemPool()); @@ -3021,6 +3025,12 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly); } + else if(dynamic_cast<const SdrMeasureObj*>( pObj) != nullptr) + { + sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); + static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0); + static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1); + } else if(dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr) { bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId || diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index cc12af761798..2e0542f45c15 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -170,6 +170,10 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId) m_pWin->SetSdrDrawMode(OBJ_LINE); break; + case SID_DRAW_MEASURELINE: + m_pWin->SetSdrDrawMode(OBJ_MEASURE); + break; + case SID_DRAW_RECT: m_pWin->SetSdrDrawMode(OBJ_RECT); break; diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 5325d2fd15e3..750caf8c845d 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -253,6 +253,7 @@ void SwView::ExecDraw(SfxRequest& rReq) case SID_LINE_SQUARE_ARROW: case SID_LINE_ARROWS: case SID_DRAW_LINE: + case SID_DRAW_MEASURELINE: case SID_DRAW_RECT: case SID_DRAW_ELLIPSE: case SID_DRAW_TEXT: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 07edb05c8ed4..1de3fc75951a 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -502,6 +502,7 @@ void SwView::GetDrawState(SfxItemSet &rSet) case SID_LINE_CIRCLE_ARROW: case SID_LINE_SQUARE_ARROW: case SID_LINE_ARROWS: + case SID_DRAW_MEASURELINE: case SID_DRAW_RECT: case SID_DRAW_ELLIPSE: case SID_DRAW_XPOLYGON_NOFILL: |