Kaydet (Commit) f61e453f authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

the DUMMY_CHART_FACTORY variable is not the only indicator for OpenGl charts

Change-Id: Idab33c8611526dc4749b4dbe4fe84e68138b4f73
üst 5d622c55
......@@ -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<
......
......@@ -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)
......
......@@ -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
......
......@@ -804,7 +804,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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment