summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main/DrawCommandDispatch.cxx
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2009-10-06 15:33:18 +0000
committerThomas Benisch <tbe@openoffice.org>2009-10-06 15:33:18 +0000
commit5a4bff35861e2ecad52a6fbb056028a5e1224f5a (patch)
tree6904aa2209745cca982bd6a5d2535f63163e7b99 /chart2/source/controller/main/DrawCommandDispatch.cxx
parent2ae7f63bebe17dbcfb02d2219971aecc91a78820 (diff)
#i12587# Inserting/editing arbitrary text objects in chart
Diffstat (limited to 'chart2/source/controller/main/DrawCommandDispatch.cxx')
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx42
1 files changed, 35 insertions, 7 deletions
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index e10a8b4125d4..8118c6c4c137 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -190,6 +190,7 @@ FeatureState DrawCommandDispatch::getState( const ::rtl::OUString& rCommand )
case COMMAND_ID_LINE_ARROW_END:
case SID_DRAW_RECT:
case SID_DRAW_ELLIPSE:
+ case SID_DRAW_FREELINE_NOFILL:
case SID_DRAW_TEXT:
case SID_DRAW_CAPTION:
{
@@ -245,6 +246,12 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
eKind = OBJ_CIRC;
}
break;
+ case SID_DRAW_FREELINE_NOFILL:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_FREELINE;
+ }
+ break;
case SID_DRAW_TEXT:
{
eDrawMode = CHARTDRAW_INSERT;
@@ -313,13 +320,14 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
void DrawCommandDispatch::describeSupportedFeatures()
{
- implDescribeSupportedFeature( ".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Line", SID_DRAW_LINE, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:LineArrowEnd", COMMAND_ID_LINE_ARROW_END, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Rect", SID_DRAW_RECT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:Ellipse", SID_DRAW_ELLIPSE, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:DrawText", SID_DRAW_TEXT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:DrawCaption", SID_DRAW_CAPTION, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Line", SID_DRAW_LINE, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:LineArrowEnd", COMMAND_ID_LINE_ARROW_END, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Rect", SID_DRAW_RECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Ellipse", SID_DRAW_ELLIPSE, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Freeline_Unfilled", SID_DRAW_FREELINE_NOFILL, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:DrawText", SID_DRAW_TEXT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:DrawCaption", SID_DRAW_CAPTION, CommandGroup::INSERT );
}
void DrawCommandDispatch::setInsertObj( USHORT eObj, const ::rtl::OUString& rShapeType )
@@ -379,6 +387,26 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
}
}
break;
+ case SID_DRAW_FREELINE_NOFILL:
+ {
+ if ( pObj->ISA( SdrPathObj ) )
+ {
+ basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom() ) );
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint( aRect.Left(), aRect.Top() ),
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Top() ),
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Center().Y() ) );
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Bottom() ),
+ basegfx::B2DPoint( aRect.Right(), aRect.Bottom() ),
+ basegfx::B2DPoint( aRect.Right(), aRect.Top() ) );
+ basegfx::B2DPolyPolygon aPoly;
+ aPoly.append( aInnerPoly );
+ ( dynamic_cast< SdrPathObj* >( pObj ) )->SetPathPoly( aPoly );
+ }
+ }
+ break;
case SID_DRAW_TEXT:
case SID_DRAW_TEXT_VERTICAL:
{