[Libreoffice-commits] core.git: sc/sdi sc/source sc/uiconfig
Gulsah Kose
gulsah.1004 at gmail.com
Thu Oct 13 13:13:05 UTC 2016
sc/sdi/tabvwsh.sdi | 1 +
sc/source/ui/drawfunc/fuconrec.cxx | 19 +++++++++++++++++++
sc/source/ui/view/tabvwsh2.cxx | 2 ++
sc/uiconfig/scalc/toolbar/arrowsbar.xml | 2 ++
4 files changed, 24 insertions(+)
New commits:
commit 042a7fc229c44fcb7a0c009a1b7f5d34913f8c12
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date: Tue Oct 11 23:50:47 2016 +0300
tdf#101390 Add "Dimesion Line" command to the calc arrowsbox.
Change-Id: I00a324dd0a27dbcf598e83d2a6cc857ab7b7d6aa
Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/29716
Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
Tested-by: Maxim Monastirsky <momonasmon at gmail.com>
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 91e92c9..f7da47f 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -95,6 +95,7 @@ interface BaseSelection
SID_LINE_CIRCLE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_LINE_SQUARE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_LINE_ARROWS [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
+ SID_DRAW_MEASURELINE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_DRAWTBX_ARROWS [ StateMethod = GetDrawState; ]
SID_DRAW_RECT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_DRAW_ELLIPSE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 310b114..ebc2611 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -33,6 +33,7 @@
#include <svx/xlnedit.hxx>
#include <svx/xlnstit.hxx>
#include <svx/dialmgr.hxx>
+#include <svx/svdomeas.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -206,6 +207,11 @@ void FuConstRectangle::Activate()
aObjKind = OBJ_LINE;
break;
+ case SID_DRAW_MEASURELINE:
+ aNewPointer = Pointer( PointerStyle::DrawLine );
+ aObjKind = OBJ_MEASURE;
+ break;
+
case SID_DRAW_RECT:
aNewPointer = Pointer( PointerStyle::DrawRect );
aObjKind = OBJ_RECT;
@@ -420,6 +426,19 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
break;
}
+
+ case SID_DRAW_MEASURELINE:
+ {
+ 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);
+ }
+
+ break;
+ }
+
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
{
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index f1a0f48..13c32a8 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -227,6 +227,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_LINE_ARROWS:
case SID_DRAW_RECT:
case SID_DRAW_ELLIPSE:
+ case SID_DRAW_MEASURELINE:
pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, rReq));
break;
@@ -375,6 +376,7 @@ void ScTabViewShell::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_POLYGON:
diff --git a/sc/uiconfig/scalc/toolbar/arrowsbar.xml b/sc/uiconfig/scalc/toolbar/arrowsbar.xml
index 5ec4d8a..cfe177a 100644
--- a/sc/uiconfig/scalc/toolbar/arrowsbar.xml
+++ b/sc/uiconfig/scalc/toolbar/arrowsbar.xml
@@ -27,4 +27,6 @@
<toolbar:toolbaritem xlink:href=".uno:LineArrowCircle"/>
<toolbar:toolbaritem xlink:href=".uno:LineArrowSquare"/>
<toolbar:toolbaritem xlink:href=".uno:Line"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:MeasureLine"/>
</toolbar:toolbar>
More information about the Libreoffice-commits
mailing list