diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-16 22:58:53 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-17 02:59:19 +0200 |
commit | 026e2623f7f498432e6dc970fb06145dfc77dc45 (patch) | |
tree | 22229b7aab2fff3c4f4f12f856e55494dc7fb565 /chart2/source/model | |
parent | 13660d4b311501d80b3e1a9541fb7db80cc42f87 (diff) |
remove the GL based 3D charts
Change-Id: Ia578c71ae70aa0a85b49fa50138edf90f961b1e9
Reviewed-on: https://gerrit.libreoffice.org/57533
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2/source/model')
-rw-r--r-- | chart2/source/model/main/ChartModel.cxx | 26 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeManager.cxx | 16 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartType.cxx | 166 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartType.hxx | 58 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartTypeTemplate.cxx | 195 | ||||
-rw-r--r-- | chart2/source/model/template/GL3DBarChartTypeTemplate.hxx | 62 |
6 files changed, 0 insertions, 523 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 4eabcba9560c..2560796e6c61 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -35,8 +35,6 @@ #include <ModifyListenerHelper.hxx> #include <svx/charthelper.hxx> -#include <vcl/openglwin.hxx> - #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp> @@ -114,9 +112,6 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext) "com.sun.star.xml.NamespaceMap", "com.sun.star.comp.chart.XMLNameSpaceMap" ), uno::UNO_QUERY) , mnStart(0) , mnEnd(0) -#if HAVE_FEATURE_OPENGL - , mpOpenGLWindow(nullptr) -#endif { osl_atomic_increment(&m_refCount); { @@ -158,9 +153,6 @@ ChartModel::ChartModel( const ChartModel & rOther ) , m_xInternalDataProvider( rOther.m_xInternalDataProvider ) , mnStart(rOther.mnStart) , mnEnd(rOther.mnEnd) -#if HAVE_FEATURE_OPENGL - , mpOpenGLWindow(nullptr) -#endif { osl_atomic_increment(&m_refCount); { @@ -946,11 +938,6 @@ void SAL_CALL ChartModel::createDefaultChart() insertDefaultChart(); } -sal_Bool SAL_CALL ChartModel::isOpenGLChart() -{ - return ChartHelper::isGL3DDiagram(m_xDiagram); -} - // ____ XTitled ____ uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject() { @@ -1309,16 +1296,6 @@ void ChartModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd) mbTimeBased = true; } -void ChartModel::setWindow( const sal_uInt64 nWindowPtr ) -{ -#if HAVE_FEATURE_OPENGL - OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(nWindowPtr); - mpOpenGLWindow = pWindow; -#else - (void)nWindowPtr; -#endif -} - void ChartModel::update() { if(!mxChartView.is()) @@ -1327,9 +1304,6 @@ void ChartModel::update() } mxChartView->setViewDirty(); mxChartView->update(); -#if HAVE_FEATURE_OPENGL - mxChartView->updateOpenGLWindow(); -#endif } bool ChartModel::isDataFromSpreadsheet() diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index 6028279d8b35..44684adb2c6c 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -32,9 +32,6 @@ #include "NetChartTypeTemplate.hxx" #include "BubbleChartTypeTemplate.hxx" #include <config_features.h> -#if HAVE_FEATURE_OPENGL -#include "GL3DBarChartTypeTemplate.hxx" -#endif #include <cppuhelper/component_context.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> @@ -123,8 +120,6 @@ enum TemplateId TEMPLATE_STOCKVOLUMELOWHIGHCLOSE, TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE, TEMPLATE_BUBBLE, - TEMPLATE_GL3DBAR, - TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE, // TEMPLATE_SURFACE, // TEMPLATE_ADDIN, TEMPLATE_NOT_FOUND = 0xffff @@ -199,8 +194,6 @@ const tTemplateMapType & lcl_DefaultChartTypeMap() {"com.sun.star.chart2.template.StockVolumeLowHighClose", TEMPLATE_STOCKVOLUMELOWHIGHCLOSE}, {"com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE}, {"com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE}, - {"com.sun.star.chart2.template.GL3DBar", TEMPLATE_GL3DBAR}, - {"com.sun.star.chart2.template.GL3DBarRoundedRectangle", TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE}, // {"com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE}, // {"com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN}, }; @@ -530,16 +523,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance( case TEMPLATE_BUBBLE: xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier )); break; -#if HAVE_FEATURE_OPENGL - case TEMPLATE_GL3DBAR: - xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier)); - break; - case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE: - xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier)); - break; -#else default: break; -#endif // case TEMPLATE_SURFACE: // case TEMPLATE_ADDIN: // break; diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx deleted file mode 100644 index 34f7a516307c..000000000000 --- a/chart2/source/model/template/GL3DBarChartType.cxx +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "GL3DBarChartType.hxx" -#include <servicenames_charttypes.hxx> -#include <PropertyHelper.hxx> -#include <unonames.hxx> -#include <cppuhelper/supportsservice.hxx> - -#include <com/sun/star/beans/Property.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> - -using namespace com::sun::star; - -namespace chart { - -namespace { - -enum -{ - PROP_GL3DCHARTTYPE_ROUNDED_EDGE -}; - -struct DefaultsInitializer -{ - tPropertyValueMap* operator()() - { - static tPropertyValueMap aStaticDefaults; - - if (aStaticDefaults.empty()) - addDefaults(aStaticDefaults); - - return &aStaticDefaults; - } -private: - - static void addDefaults( tPropertyValueMap & rOutMap ) - { - PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false); - } -}; - -struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {}; - -struct InfoHelperInitializer -{ - cppu::OPropertyArrayHelper* operator()() - { - static cppu::OPropertyArrayHelper aHelper(getProperties()); - return &aHelper; - } - - static uno::Sequence<beans::Property> getProperties() - { - uno::Sequence<beans::Property> aRet(1); - - aRet[0] = beans::Property( - CHART_UNONAME_ROUNDED_EDGE, - PROP_GL3DCHARTTYPE_ROUNDED_EDGE, - cppu::UnoType<bool>::get(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); - - return aRet; - } -}; - -struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {}; - -struct ChartTypeInfoInitializer -{ - uno::Reference<beans::XPropertySetInfo>* operator()() - { - static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo; - - if (!xPropertySetInfo.is()) - xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get()); - - return &xPropertySetInfo; - } -}; - -struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {}; - -} - -GL3DBarChartType::GL3DBarChartType() -{ -} - -GL3DBarChartType::GL3DBarChartType( const GL3DBarChartType& rOther ) : - ChartType(rOther) -{ -} - -GL3DBarChartType::~GL3DBarChartType() {} - -OUString SAL_CALL GL3DBarChartType::getImplementationName() -{ - return OUString("com.sun.star.comp.chart.GL3DBarChartType"); -} - -sal_Bool SAL_CALL GL3DBarChartType::supportsService( const OUString& rServiceName ) -{ - return cppu::supportsService(this, rServiceName); -} - -css::uno::Sequence< OUString > SAL_CALL GL3DBarChartType::getSupportedServiceNames() -{ - return { - CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR, - "com.sun.star.chart2.ChartType", - "com.sun.star.beans.PropertySet" }; -} - -OUString SAL_CALL GL3DBarChartType::getChartType() -{ - return OUString(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR); -} - -uno::Sequence<OUString> GL3DBarChartType::getSupportedPropertyRoles() -{ - uno::Sequence< OUString > aPropRoles { "FillColor" }; - - return aPropRoles; -} - -css::uno::Reference<css::util::XCloneable> -GL3DBarChartType::createClone() -{ - return uno::Reference<util::XCloneable>(new GL3DBarChartType(*this)); -} - -css::uno::Any GL3DBarChartType::GetDefaultValue( sal_Int32 nHandle ) const -{ - const tPropertyValueMap& rDefaults = *Defaults::get(); - tPropertyValueMap::const_iterator it = rDefaults.find(nHandle); - return it == rDefaults.end() ? uno::Any() : it->second; -} - -cppu::IPropertyArrayHelper& GL3DBarChartType::getInfoHelper() -{ - return *InfoHelper::get(); -} - -css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartType::getPropertySetInfo() -{ - return *ChartTypeInfo::get(); -} - -} - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * -com_sun_star_comp_chart_GL3DBarChartType_get_implementation(css::uno::XComponentContext * /*context*/, - css::uno::Sequence<css::uno::Any> const &) -{ - return cppu::acquire(new ::chart::GL3DBarChartType); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/GL3DBarChartType.hxx b/chart2/source/model/template/GL3DBarChartType.hxx deleted file mode 100644 index 09bacd33c803..000000000000 --- a/chart2/source/model/template/GL3DBarChartType.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPE_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPE_HXX - -#include "ChartType.hxx" - -namespace chart { - -/** - * Chart type that represents 3 dimensional data content in 3D space using - * OpenGL. - */ -class GL3DBarChartType final : public ChartType -{ -public: - explicit GL3DBarChartType(); - virtual ~GL3DBarChartType() override; - - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedPropertyRoles() override; - virtual OUString SAL_CALL - getImplementationName() override; - virtual sal_Bool SAL_CALL - supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() override; - -private: - GL3DBarChartType( const GL3DBarChartType& rOther ); - - virtual OUString SAL_CALL getChartType() override; - - virtual css::uno::Reference<css::util::XCloneable> SAL_CALL - createClone() override; - - // OPropertySet - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - - virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; - - // XPropertySet - virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL - getPropertySetInfo() override; -}; - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx deleted file mode 100644 index ba7022da71b5..000000000000 --- a/chart2/source/model/template/GL3DBarChartTypeTemplate.cxx +++ /dev/null @@ -1,195 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "GL3DBarChartTypeTemplate.hxx" -#include "GL3DBarChartType.hxx" - -#include <servicenames_charttypes.hxx> -#include <PropertyHelper.hxx> -#include <DiagramHelper.hxx> -#include <unonames.hxx> - -#include <com/sun/star/beans/Property.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <tools/diagnose_ex.h> - -using namespace com::sun::star; - -namespace chart { - -namespace { - -enum -{ - PROP_GL3DCHARTTYPE_ROUNDED_EDGE -}; - -struct DefaultsInitializer -{ - tPropertyValueMap* operator()() - { - static tPropertyValueMap aStaticDefaults; - - if (aStaticDefaults.empty()) - addDefaults(aStaticDefaults); - - return &aStaticDefaults; - } -private: - - static void addDefaults( tPropertyValueMap & rOutMap ) - { - PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false); - } -}; - -struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {}; - -struct InfoHelperInitializer -{ - cppu::OPropertyArrayHelper* operator()() - { - static cppu::OPropertyArrayHelper aHelper(getProperties()); - return &aHelper; - } - - static uno::Sequence<beans::Property> getProperties() - { - uno::Sequence<beans::Property> aRet(1); - - aRet[0] = beans::Property( - CHART_UNONAME_ROUNDED_EDGE, - PROP_GL3DCHARTTYPE_ROUNDED_EDGE, - cppu::UnoType<bool>::get(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); - - return aRet; - } -}; - -struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {}; - -struct ChartTypeInfoInitializer -{ - uno::Reference<beans::XPropertySetInfo>* operator()() - { - static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo; - - if (!xPropertySetInfo.is()) - xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get()); - - return &xPropertySetInfo; - } -}; - -struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {}; - -} - -GL3DBarChartTypeTemplate::GL3DBarChartTypeTemplate( - const uno::Reference<uno::XComponentContext>& xContext, const OUString& rServiceName ) : - property::OPropertySet(m_aMutex), - ChartTypeTemplate(xContext, rServiceName) {} - -GL3DBarChartTypeTemplate::~GL3DBarChartTypeTemplate() {} - -uno::Reference<chart2::XChartType> GL3DBarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ ) -{ - uno::Reference<chart2::XChartType> xResult; - - try - { - uno::Reference<lang::XMultiServiceFactory> xFact( - GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); - - xResult.set(xFact->createInstance(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR), uno::UNO_QUERY_THROW); - - uno::Reference<beans::XPropertySet> xCTProp(xResult, uno::UNO_QUERY); - if (xCTProp.is()) - { - xCTProp->setPropertyValue( - CHART_UNONAME_ROUNDED_EDGE, getFastPropertyValue(PROP_GL3DCHARTTYPE_ROUNDED_EDGE)); - } - } - catch (const uno::Exception &) - { - DBG_UNHANDLED_EXCEPTION("chart2"); - } - - return xResult; -} - -sal_Bool SAL_CALL GL3DBarChartTypeTemplate::matchesTemplate( - const css::uno::Reference<css::chart2::XDiagram>& xDiagram, - sal_Bool bAdaptProperties ) -{ - bool bResult = ChartTypeTemplate::matchesTemplate(xDiagram, bAdaptProperties); - - if (bResult && bAdaptProperties) - { - uno::Reference<chart2::XChartType> xChartType = DiagramHelper::getChartTypeByIndex(xDiagram, 0); - uno::Reference<beans::XPropertySet> xPS(xChartType, uno::UNO_QUERY); - if (xPS.is()) - { - setFastPropertyValue_NoBroadcast( - PROP_GL3DCHARTTYPE_ROUNDED_EDGE, xPS->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE)); - } - } - - return bResult; -} - -uno::Reference<chart2::XChartType> -GL3DBarChartTypeTemplate::getChartTypeForNewSeries( const uno::Sequence<uno::Reference<chart2::XChartType> >& /*xOldChartTypes*/ ) -{ - uno::Reference<chart2::XChartType> xResult; - - try - { - rtl::Reference<GL3DBarChartType> chart(new GL3DBarChartType()); - bool bVal = false; - getFastPropertyValue(PROP_GL3DCHARTTYPE_ROUNDED_EDGE) >>= bVal; - chart->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, uno::Any(bVal)); - xResult = chart.get(); - } - catch (const uno::Exception &) - { - DBG_UNHANDLED_EXCEPTION("chart2"); - } - - return xResult; -} - -sal_Bool GL3DBarChartTypeTemplate::supportsCategories() -{ - return false; -} - -css::uno::Any GL3DBarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const -{ - const tPropertyValueMap& rDefaults = *Defaults::get(); - tPropertyValueMap::const_iterator it = rDefaults.find(nHandle); - return it == rDefaults.end() ? uno::Any() : it->second; -} - -cppu::IPropertyArrayHelper& GL3DBarChartTypeTemplate::getInfoHelper() -{ - return *InfoHelper::get(); -} - -css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartTypeTemplate::getPropertySetInfo() -{ - return *ChartTypeInfo::get(); -} - -IMPLEMENT_FORWARD_XINTERFACE2(GL3DBarChartTypeTemplate, ChartTypeTemplate, OPropertySet) - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx b/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx deleted file mode 100644 index 3b24ecebf2f9..000000000000 --- a/chart2/source/model/template/GL3DBarChartTypeTemplate.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPETEMPLATE_HXX -#define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPETEMPLATE_HXX - -#include <MutexContainer.hxx> -#include "ChartTypeTemplate.hxx" -#include <OPropertySet.hxx> - -#include <comphelper/uno3.hxx> - -namespace chart { - -class GL3DBarChartTypeTemplate : - public MutexContainer, public property::OPropertySet, public ChartTypeTemplate -{ -public: - - DECLARE_XINTERFACE() - - GL3DBarChartTypeTemplate( - const css::uno::Reference< - css::uno::XComponentContext>& xContext, - const OUString& rServiceName ); - - virtual ~GL3DBarChartTypeTemplate() override; - - virtual css::uno::Reference<css::chart2::XChartType> getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override; - - // XChartTypeTemplate - - virtual sal_Bool SAL_CALL matchesTemplate( - const css::uno::Reference<css::chart2::XDiagram>& xDiagram, - sal_Bool bAdaptProperties ) override; - - virtual css::uno::Reference<css::chart2::XChartType> SAL_CALL - getChartTypeForNewSeries( const css::uno::Sequence<css::uno::Reference<css::chart2::XChartType> >& xOldChartTypes ) override; - - virtual sal_Bool SAL_CALL supportsCategories() override; - - // OPropertySet - virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override; - - virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; - - // XPropertySet - virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL - getPropertySetInfo() override; -}; - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |