summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2016-10-11 23:50:47 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2016-10-13 13:09:59 +0000
commit042a7fc229c44fcb7a0c009a1b7f5d34913f8c12 (patch)
tree30678cf8dab4925c344d057fa2c09ccb5cf33107
parent1ffc0ddfef403bd7cae3e43a4af368a4db7cc9f7 (diff)
tdf#101390 Add "Dimesion Line" command to the calc arrowsbox.
Change-Id: I00a324dd0a27dbcf598e83d2a6cc857ab7b7d6aa Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/29716 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--sc/sdi/tabvwsh.sdi1
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx19
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx2
-rw-r--r--sc/uiconfig/scalc/toolbar/arrowsbar.xml2
4 files changed, 24 insertions, 0 deletions
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 91e92c9a4fd1..f7da47fb5156 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 310b114f5961..ebc261135d44 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 f1a0f48b967a..13c32a87b5c1 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 5ec4d8a8ec35..cfe177a1c792 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>