From 7822e88a9487258d2a398ac202cbeb045863aa16 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Tue, 9 Mar 2010 16:06:24 +0100 Subject: [PATCH] chart43: #i109977# make axes and grids deletable via delete key --- .../controller/main/ChartController_Tools.cxx | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 9edd2963aca4..94a6a24a9a1e 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -502,8 +502,7 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection ) if( (rSelection >>= aSelObjCID) && aSelObjCID.getLength() > 0 ) { ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID )); - if( (OBJECTTYPE_TITLE == aObjectType) || (OBJECTTYPE_LEGEND == aObjectType) - || (OBJECTTYPE_DATA_SERIES == aObjectType) ) + if( (OBJECTTYPE_TITLE == aObjectType) || (OBJECTTYPE_LEGEND == aObjectType) ) return true; if( (OBJECTTYPE_DATA_SERIES == aObjectType) || (OBJECTTYPE_LEGEND_ENTRY == aObjectType) ) return true; @@ -512,6 +511,8 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection ) return true; if( (OBJECTTYPE_DATA_LABELS == aObjectType) || (OBJECTTYPE_DATA_LABEL == aObjectType) ) return true; + if( (OBJECTTYPE_AXIS == aObjectType) || (OBJECTTYPE_GRID == aObjectType) || (OBJECTTYPE_SUBGRID == aObjectType) ) + return true; } return false; @@ -539,8 +540,6 @@ bool ChartController::executeDispatch_Delete() return false; //remove chart object - impl_ClearSelection(); - uno::Reference< chart2::XChartDocument > xChartDoc( m_aModel->getModel(), uno::UNO_QUERY ); if( !xChartDoc.is() ) return false; @@ -697,6 +696,24 @@ bool ChartController::executeDispatch_Delete() } break; } + case OBJECTTYPE_AXIS: + { + executeDispatch_DeleteAxis(); + bReturn = true; + break; + } + case OBJECTTYPE_GRID: + { + executeDispatch_DeleteMajorGrid(); + bReturn = true; + break; + } + case OBJECTTYPE_SUBGRID: + { + executeDispatch_DeleteMinorGrid(); + bReturn = true; + break; + } default: {