summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2009-08-19 15:56:41 +0000
committerThomas Benisch <tbe@openoffice.org>2009-08-19 15:56:41 +0000
commit9f2b6e201b5b7dbd783ea16bd746f5e90ce1a5b8 (patch)
tree8d723166d778108417eeb00817fd3bee7252a93f /chart2
parent7f85e315411933893caf6506b21375c7b9183975 (diff)
#i12587# Inserting/editing arbitrary text objects in chart
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx17
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx16
2 files changed, 27 insertions, 6 deletions
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index ac405192a5a5..77a1bcfff790 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -701,8 +701,16 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
}
else
{
- m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper, rMEvt.IsRight(), m_bWaitingForDoubleClick );
- m_aSelection.applySelection( pDrawViewWrapper );
+ SdrObject* pObj = pDrawViewWrapper->getSelectedObject();
+ if ( pObj )
+ {
+ uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
+ if ( xShape.is() )
+ {
+ m_aSelection.setSelection( xShape );
+ m_aSelection.applySelection( pDrawViewWrapper );
+ }
+ }
}
}
else
@@ -1617,6 +1625,11 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
ePointerStyle = POINTER_DRAW_RECT;
}
break;
+ case OBJ_CIRC:
+ {
+ ePointerStyle = POINTER_DRAW_ELLIPSE;
+ }
+ break;
case OBJ_TEXT:
{
ePointerStyle = POINTER_DRAW_TEXT;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 7d3c4cce9fae..851b9986e550 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -121,6 +121,7 @@ FeatureState DrawCommandDispatch::getState( const ::rtl::OUString& rCommand ) co
case SID_OBJECT_SELECT:
case SID_DRAW_LINE:
case SID_DRAW_RECT:
+ case SID_DRAW_ELLIPSE:
case SID_DRAW_TEXT:
{
aReturn.bEnabled = true;
@@ -167,6 +168,12 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
eKind = OBJ_RECT;
}
break;
+ case SID_DRAW_ELLIPSE:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_CIRC;
+ }
+ break;
case SID_DRAW_TEXT:
{
eDrawMode = CHARTDRAW_INSERT;
@@ -229,10 +236,11 @@ 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:Rect", SID_DRAW_RECT, CommandGroup::INSERT );
- implDescribeSupportedFeature( ".uno:DrawText", SID_DRAW_TEXT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Line", SID_DRAW_LINE, 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 );
}
void DrawCommandDispatch::setInsertObj( USHORT eObj, const ::rtl::OUString& rShapeType )