summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main/ChartController_Tools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/main/ChartController_Tools.cxx')
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index ff567636ba0e..11fa5e74054e 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -50,6 +50,7 @@
#include "RegressionCurveHelper.hxx"
#include "ShapeController.hxx"
#include "DiagramHelper.hxx"
+#include "ObjectNameProvider.hxx"
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
@@ -242,6 +243,7 @@ void ChartController::executeDispatch_NewArrangement()
Reference< beans::XPropertyState > xState( xDiagram, uno::UNO_QUERY_THROW );
xState->setPropertyToDefault( C2U("RelativeSize"));
xState->setPropertyToDefault( C2U("RelativePosition"));
+ xState->setPropertyToDefault( C2U("PosSizeExcludeAxes"));
// 3d rotation
ThreeDHelper::set3DSettingsToDefault( uno::Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY ) );
@@ -468,6 +470,8 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
m_aSelection.applySelection( m_pDrawViewWrapper );
m_pDrawViewWrapper->EndUndo();
+
+ impl_switchDiagramPositioningToExcludingPositioning();
}
}
}
@@ -514,6 +518,8 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons
m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) );
m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pObj ) );
m_pDrawViewWrapper->EndUndo();
+
+ impl_switchDiagramPositioningToExcludingPositioning();
}
}
catch ( const uno::Exception& ex )
@@ -902,4 +908,14 @@ void ChartController::impl_ShapeControllerDispatch( const util::URL& rURL, const
}
}
+void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
+{
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::POS_SIZE,
+ ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
+ m_xUndoManager, m_aModel->getModel() );
+ if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( m_aModel->getModel(), true, true ) )
+ aUndoGuard.commitAction();
+}
+
} // namespace chart