summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-09 14:32:53 -0400
committerAndras Timar <andras.timar@collabora.com>2014-07-15 23:44:08 +0200
commit0e3826d08d7a7d54dd532319fb584008eb0e24c8 (patch)
treeb24ee7faea7ab5ca895742ea21b98910f2ab41ba /chart2
parent388f2fa9fcabe1b2adaff282fa9509216f3af6de (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. (cherry picked from commit c5539bb585370f095cb6c09e38a7dd005d237295) Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: chart2/source/model/main/ChartModel_Persistence.cxx sc/source/ui/drawfunc/fuins2.cxx sw/source/uibase/table/tablemgr.cxx Change-Id: Id29659c3885ec1e06bed26d2c851123fb63072cc (cherry picked from commit 1eccdc5c39587d4019cb4c88f8483b1fe14d5dda) Signed-off-by: Andras Timar <andras.timar@collabora.com>
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 c8f992a4267a..028ce0e272bf 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -221,6 +221,8 @@ private:
void impl_adjustAdditionalShapesPositionAndSize(
const ::com::sun::star::awt::Size& aVisualAreaSize );
+ void insertDefaultChart();
+
public:
//no default constructor
ChartModel(::com::sun::star::uno::Reference<
@@ -432,6 +434,8 @@ public:
getPageBackground()
throw (::com::sun::star::uno::RuntimeException);
+ 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 c29a10e7da6c..170019ff524d 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -947,6 +947,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)
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index d964ced0d9ff..5284ad24e8ed 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -380,12 +380,7 @@ void ChartModel::impl_store(
}
}
-// frame::XLoadable
-void SAL_CALL ChartModel::initNew()
- throw (frame::DoubleInitializationException,
- io::IOException,
- uno::Exception,
- uno::RuntimeException)
+void ChartModel::insertDefaultChart()
{
lockControllers();
createInternalDataProvider( sal_False );
@@ -486,6 +481,15 @@ void SAL_CALL ChartModel::initNew()
#endif
}
+// frame::XLoadable
+void SAL_CALL ChartModel::initNew()
+ throw (frame::DoubleInitializationException,
+ io::IOException,
+ uno::Exception,
+ uno::RuntimeException)
+{
+}
+
void SAL_CALL ChartModel::load(
const Sequence< beans::PropertyValue >& rMediaDescriptor )
throw (frame::DoubleInitializationException,