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>
This commit is contained in:
Gulsah Kose
2016-10-11 23:50:47 +03:00
committed by Maxim Monastirsky
parent 1ffc0ddfef
commit 042a7fc229
4 changed files with 24 additions and 0 deletions

View File

@@ -95,6 +95,7 @@ interface BaseSelection
SID_LINE_CIRCLE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_LINE_CIRCLE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_LINE_SQUARE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_LINE_SQUARE_ARROW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_LINE_ARROWS [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_LINE_ARROWS [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_DRAW_MEASURELINE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_DRAWTBX_ARROWS [ StateMethod = GetDrawState; ] SID_DRAWTBX_ARROWS [ StateMethod = GetDrawState; ]
SID_DRAW_RECT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_DRAW_RECT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]
SID_DRAW_ELLIPSE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_DRAW_ELLIPSE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ]

View File

@@ -33,6 +33,7 @@
#include <svx/xlnedit.hxx> #include <svx/xlnedit.hxx>
#include <svx/xlnstit.hxx> #include <svx/xlnstit.hxx>
#include <svx/dialmgr.hxx> #include <svx/dialmgr.hxx>
#include <svx/svdomeas.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
@@ -206,6 +207,11 @@ void FuConstRectangle::Activate()
aObjKind = OBJ_LINE; aObjKind = OBJ_LINE;
break; break;
case SID_DRAW_MEASURELINE:
aNewPointer = Pointer( PointerStyle::DrawLine );
aObjKind = OBJ_MEASURE;
break;
case SID_DRAW_RECT: case SID_DRAW_RECT:
aNewPointer = Pointer( PointerStyle::DrawRect ); aNewPointer = Pointer( PointerStyle::DrawRect );
aObjKind = OBJ_RECT; aObjKind = OBJ_RECT;
@@ -420,6 +426,19 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
break; 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:
case SID_DRAW_CAPTION_VERTICAL: case SID_DRAW_CAPTION_VERTICAL:
{ {

View File

@@ -227,6 +227,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_LINE_ARROWS: case SID_LINE_ARROWS:
case SID_DRAW_RECT: case SID_DRAW_RECT:
case SID_DRAW_ELLIPSE: case SID_DRAW_ELLIPSE:
case SID_DRAW_MEASURELINE:
pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, rReq)); pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, rReq));
break; break;
@@ -375,6 +376,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet)
case SID_LINE_CIRCLE_ARROW: case SID_LINE_CIRCLE_ARROW:
case SID_LINE_SQUARE_ARROW: case SID_LINE_SQUARE_ARROW:
case SID_LINE_ARROWS: case SID_LINE_ARROWS:
case SID_DRAW_MEASURELINE:
case SID_DRAW_RECT: case SID_DRAW_RECT:
case SID_DRAW_ELLIPSE: case SID_DRAW_ELLIPSE:
case SID_DRAW_POLYGON: case SID_DRAW_POLYGON:

View File

@@ -27,4 +27,6 @@
<toolbar:toolbaritem xlink:href=".uno:LineArrowCircle"/> <toolbar:toolbaritem xlink:href=".uno:LineArrowCircle"/>
<toolbar:toolbaritem xlink:href=".uno:LineArrowSquare"/> <toolbar:toolbaritem xlink:href=".uno:LineArrowSquare"/>
<toolbar:toolbaritem xlink:href=".uno:Line"/> <toolbar:toolbaritem xlink:href=".uno:Line"/>
<toolbar:toolbarbreak/>
<toolbar:toolbaritem xlink:href=".uno:MeasureLine"/>
</toolbar:toolbar> </toolbar:toolbar>