summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/main')
-rw-r--r--chart2/source/controller/main/ChartController.cxx6
-rw-r--r--chart2/source/controller/main/ChartController.hxx4
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx3
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx56
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx34
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx12
6 files changed, 14 insertions, 101 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 2303782263d9..8368e76baa82 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController.cxx,v $
- * $Revision: 1.30 $
+ * $Revision: 1.30.16.1 $
*
* This file is part of OpenOffice.org.
*
@@ -1050,11 +1050,7 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
else if(aCommand.equals("Cut"))
this->executeDispatch_Cut();
else if(aCommand.equals("DataRanges"))
- {
- //only test:
-// this->executeDispatch_ObjectToDefault();
this->executeDispatch_SourceData();
- }
//----------------------------------
else if(aCommand.equals("Update")) //Update Chart
{
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index d36325675fae..0b81df0a2367 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController.hxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.12.44.3 $
*
* This file is part of OpenOffice.org.
*
@@ -584,7 +584,6 @@ private:
//private methods
sal_Bool impl_isDisposedOrSuspended() const;
- ::com::sun::star::awt::Size impl_getDiagramSize( sal_Int32 nDiaIndex = 0 ) const;
::std::auto_ptr< ReferenceSizeProvider > impl_createReferenceSizeProvider() const;
void impl_adaptDataSeriesAutoResize();
@@ -597,7 +596,6 @@ private:
void SAL_CALL executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID );
void SAL_CALL executeDispatch_ChartType();
- void SAL_CALL executeDispatch_ObjectToDefault();
void SAL_CALL executeDispatch_InsertTitle();
void SAL_CALL executeDispatch_InsertLegend();
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 7afa5fb32543..d847965b6022 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController_Insert.cxx,v $
- * $Revision: 1.16 $
+ * $Revision: 1.16.44.1 $
*
* This file is part of OpenOffice.org.
*
@@ -45,7 +45,6 @@
#include "AxisHelper.hxx"
#include "TitleHelper.hxx"
#include "DiagramHelper.hxx"
-#include "ContextHelper.hxx"
#include "macros.hxx"
#include "chartview/DrawModelWrapper.hxx"
#include "chartview/NumberFormatterWrapper.hxx"
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index aa1a3bdc8e51..3b5b3d6fa7ba 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController_Properties.cxx,v $
- * $Revision: 1.33 $
+ * $Revision: 1.33.44.2 $
*
* This file is part of OpenOffice.org.
*
@@ -67,10 +67,6 @@
//for auto_ptr
#include <memory>
-// for test in executeDispatch_ObjectToDefault
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
// header for define RET_OK
#include <vcl/msgbox.hxx>
// for SolarMutex
@@ -167,7 +163,7 @@ namespace
{
::std::auto_ptr< awt::Size > pRefSize;
if( pRefSizeProvider.get() )
- pRefSize.reset( new awt::Size( pRefSizeProvider->getDiagramSize()));
+ pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
uno::Reference< beans::XPropertySet > xDiaProp;
xDiaProp.set( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
@@ -200,7 +196,7 @@ namespace
{
::std::auto_ptr< awt::Size > pRefSize;
if( pRefSizeProvider.get() )
- pRefSize.reset( new awt::Size( pRefSizeProvider->getDiagramSize()));
+ pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
wrapper::GraphicPropertyItemConverter::eGraphicObjectType eMapTo =
wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT;
@@ -323,7 +319,7 @@ namespace
{
::std::auto_ptr< awt::Size > pRefSize;
if( pRefSizeProvider.get() )
- pRefSize.reset( new awt::Size( pRefSizeProvider->getDiagramSize()));
+ pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
pItemConverter = new wrapper::AllAxisItemConverter( xChartModel, rDrawModel.GetItemPool(),
rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), pRefSize );
@@ -663,50 +659,6 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
}
}
-void SAL_CALL ChartController::executeDispatch_ObjectToDefault()
-{
- ::rtl::OUString aObjectCID(m_aSelection.getSelectedCID());
- if( !aObjectCID.getLength() )
- {
- DBG_ERROR("nothing is selected");
- return;
- }
-
- try
- {
- //-------------------------------------------------------------
- //get type of selected object
- ObjectType eObjectType = ObjectIdentifier::getObjectType( aObjectCID );
- if( OBJECTTYPE_UNKNOWN==eObjectType )
- {
- DBG_ERROR("unknown ObjectType");
- return;
- }
- //-------------------------------------------------------------
- //get properties of selected object
- uno::Reference< beans::XPropertySet > xObjectProperties = NULL;
- xObjectProperties = ObjectIdentifier::getObjectPropertySet( aObjectCID, getModel() );
- if(!xObjectProperties.is())
- return;
-
- uno::Sequence< beans::Property > aProps( xObjectProperties->getPropertySetInfo()->getProperties() );
- uno::Reference< beans::XPropertyState > xState( xObjectProperties, uno::UNO_QUERY );
-
- if( xState.is() )
- {
- for( sal_Int32 i = 0; i < aProps.getLength(); ++i )
- {
- if( aProps[i].Attributes & beans::PropertyAttribute::MAYBEDEFAULT )
- xState->setPropertyToDefault( aProps[i].Name );
- }
- }
- }
- catch( uno::Exception& e )
- {
- ASSERT_EXCEPTION( e );
- }
-}
-
void SAL_CALL ChartController::executeDispatch_View3D()
{
try
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 501f9c7cd92f..5db316196e1d 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController_Tools.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.36.1 $
*
* This file is part of OpenOffice.org.
*
@@ -233,42 +233,12 @@ void lcl_InsertStringAsTextShapeIntoDrawPage(
namespace chart
{
-awt::Size ChartController::impl_getDiagramSize( sal_Int32 nDiaIndex ) const
-{
- awt::Size aResult;
-
- try
- {
- ExplicitValueProvider * pValueProvider(
- ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
- if( pValueProvider )
- {
- awt::Rectangle aRect( pValueProvider->getRectangleOfObject( ObjectIdentifier::createClassifiedIdentifier(
- OBJECTTYPE_DIAGRAM, OUString::valueOf( sal_Int32( nDiaIndex )))));
- aResult.Width = aRect.Width;
- aResult.Height = aRect.Height;
- }
- else
- {
- // fallback: page size
- aResult = ChartModelHelper::getPageSize( m_aModel->getModel() );
- }
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-
- return aResult;
-}
-
::std::auto_ptr< ReferenceSizeProvider > ChartController::impl_createReferenceSizeProvider() const
{
awt::Size aPageSize( ChartModelHelper::getPageSize( m_aModel->getModel()) );
return ::std::auto_ptr< ReferenceSizeProvider >(
- new ReferenceSizeProvider(
- aPageSize, impl_getDiagramSize(),
+ new ReferenceSizeProvider( aPageSize,
Reference< chart2::XChartDocument >( m_aModel->getModel(), uno::UNO_QUERY )));
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index ef3c5678c795..ce6db7db7bef 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ChartController_Window.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.31.24.2 $
*
* This file is part of OpenOffice.org.
*
@@ -1328,16 +1328,14 @@ bool ChartController::impl_moveOrResizeObject(
if( bNeedResize )
eActionType = ActionDescriptionProvider::RESIZE;
- UndoGuard aUndoGuard(
- ActionDescriptionProvider::createDescription(
- eActionType,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( rCID ))),
- m_xUndoManager, xChartModel );
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( rCID );
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
+ eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager, xChartModel );
{
ControllerLockGuard aCLGuard( xChartModel );
if( bNeedShift )
xObjProp->setPropertyValue( C2U("RelativePosition"), uno::makeAny( aRelPos ));
- if( bNeedResize )
+ if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicat size at the diagram when an explicit position is set
xObjProp->setPropertyValue( C2U("RelativeSize"), uno::makeAny( aRelSize ));
}
aUndoGuard.commitAction();