[Libreoffice-commits] core.git: Branch 'feature/chart_opengl_window' - 2 commits - chart2/inc chart2/source offapi/com svtools/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Aug 25 12:52:49 PDT 2014
chart2/inc/ChartModel.hxx | 2 ++
chart2/source/model/main/ChartModel.cxx | 7 +++++++
offapi/com/sun/star/chart2/XChartDocument.idl | 4 ++++
svtools/source/misc/embedhlp.cxx | 14 +++++++++++++-
4 files changed, 26 insertions(+), 1 deletion(-)
New commits:
commit 14a0b9acb7f58b4ab8c94afa5e56c5e49a7b019e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 21:47:34 2014 +0200
the DUMMY_CHART_FACTORY variable is not the only indicator for OpenGl charts
Change-Id: Idab33c8611526dc4749b4dbe4fe84e68138b4f73
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 9b3eba3..cedfc1f 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -438,6 +438,8 @@ public:
virtual void SAL_CALL createDefaultChart() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL isOpenGLChart() 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 ed0d24e..a3d97c2 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -32,6 +32,7 @@
#include "NameContainer.hxx"
#include "UndoManager.hxx"
#include "ChartView.hxx"
+#include "GL3DHelper.hxx"
#include <vcl/openglwin.hxx>
@@ -964,6 +965,12 @@ void SAL_CALL ChartModel::createDefaultChart()
insertDefaultChart();
}
+sal_Bool SAL_CALL ChartModel::isOpenGLChart()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return GL3DHelper::isGL3DDiagram(m_xDiagram);
+}
+
// ____ XTitled ____
uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject()
throw (uno::RuntimeException, std::exception)
diff --git a/offapi/com/sun/star/chart2/XChartDocument.idl b/offapi/com/sun/star/chart2/XChartDocument.idl
index 0055cbb..57bcfc9 100644
--- a/offapi/com/sun/star/chart2/XChartDocument.idl
+++ b/offapi/com/sun/star/chart2/XChartDocument.idl
@@ -127,6 +127,10 @@ interface XChartDocument : ::com::sun::star::frame::XModel
/** Creates a default chart type for a brand-new chart object.
*/
void createDefaultChart();
+
+ /** Returns true if the chart is based on OpenGL
+ */
+ boolean isOpenGLChart();
};
} ; // chart2
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index ed6b00a..cae50a2 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -793,7 +793,18 @@ bool EmbeddedObjectRef::IsChart(const ::com::sun::star::uno::Reference < ::com::
bool EmbeddedObjectRef::IsGLChart(const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj)
{
static const char* env = getenv("CHART_DUMMY_FACTORY");
- return IsChart(xObj) && env;
+ if (IsChart(xObj))
+ {
+ if (env)
+ return true;
+
+ uno::Reference< chart2::XChartDocument > xChartDoc(xObj->getComponent(), uno::UNO_QUERY);
+ if (!xChartDoc.is())
+ return false;
+
+ return xChartDoc->isOpenGLChart();
+ }
+ return false;
}
void EmbeddedObjectRef::UpdateReplacement()
commit a804600a101d97f58d76027427e8bb212a5bc206
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Aug 25 19:09:39 2014 +0200
cache the call to getenv
Change-Id: I13095b13694aa092e3d5f542b5be12e703eb4590
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 4e96ff3..ed6b00a 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -792,7 +792,8 @@ bool EmbeddedObjectRef::IsChart(const ::com::sun::star::uno::Reference < ::com::
bool EmbeddedObjectRef::IsGLChart(const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj)
{
- return IsChart(xObj) && getenv("CHART_DUMMY_FACTORY");
+ static const char* env = getenv("CHART_DUMMY_FACTORY");
+ return IsChart(xObj) && env;
}
void EmbeddedObjectRef::UpdateReplacement()
More information about the Libreoffice-commits
mailing list