summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-09 14:32:53 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-10 10:04:14 -0400
commit486bf19009d2c737dd7bb822f534aaa47dbe9d6e (patch)
treef3f1283d0bdd509cd9374136f0590a033caac6eb /chart2
parent713c639ce5ba6371e9c0d9ff51be7cf4c68d3d4c (diff)
fdo#79676: Initialize with a default chart only from the UI.
When creating an embedded chart object during import, we don't want to create a default chart which would only mess up the chart data. With this change, ChartModel::initNew() is a no-op. Change-Id: Id29659c3885ec1e06bed26d2c851123fb63072cc (cherry picked from commit c5539bb585370f095cb6c09e38a7dd005d237295)
Diffstat (limited to 'chart2')
-rw-r--r--chart2/inc/ChartModel.hxx4
-rw-r--r--chart2/source/model/main/ChartModel.cxx6
-rw-r--r--chart2/source/model/main/ChartModel_Persistence.cxx16
3 files changed, 20 insertions, 6 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 9fb24fef2414..d8367ff31afa 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -223,6 +223,8 @@ private:
void impl_adjustAdditionalShapesPositionAndSize(
const ::com::sun::star::awt::Size& aVisualAreaSize );
+ void insertDefaultChart();
+
public:
//no default constructor
ChartModel(::com::sun::star::uno::Reference<
@@ -434,6 +436,8 @@ public:
getPageBackground()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL createDefaultChart() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
// ____ XDataReceiver (public API) ____
virtual void SAL_CALL
attachDataProvider( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index c61e83cf4f8b..504db8c6d605 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -958,6 +958,12 @@ uno::Reference< beans::XPropertySet > SAL_CALL ChartModel::getPageBackground()
return m_xPageBackground;
}
+void SAL_CALL ChartModel::createDefaultChart()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ insertDefaultChart();
+}
+
// ____ XTitled ____
uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject()
throw (uno::RuntimeException, std::exception)
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index 80ddf7ae4fd4..d3bfec237609 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -381,12 +381,7 @@ void ChartModel::impl_store(
}
}
-// frame::XLoadable
-void SAL_CALL ChartModel::initNew()
- throw (frame::DoubleInitializationException,
- io::IOException,
- uno::Exception,
- uno::RuntimeException, std::exception)
+void ChartModel::insertDefaultChart()
{
lockControllers();
createInternalDataProvider( sal_False );
@@ -487,6 +482,15 @@ void SAL_CALL ChartModel::initNew()
#endif
}
+// frame::XLoadable
+void SAL_CALL ChartModel::initNew()
+ throw (frame::DoubleInitializationException,
+ io::IOException,
+ uno::Exception,
+ uno::RuntimeException, std::exception)
+{
+}
+
void SAL_CALL ChartModel::load(
const Sequence< beans::PropertyValue >& rMediaDescriptor )
throw (frame::DoubleInitializationException,