diff options
Diffstat (limited to 'chart2/source/model/main')
22 files changed, 14 insertions, 1866 deletions
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index 5595606a8557..08e30b1ef561 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: Axis.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.15.44.1 $ * * This file is part of OpenOffice.org. * @@ -160,7 +160,7 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( - Property( C2U( "ReferenceDiagramSize" ), + Property( C2U( "ReferencePageSize" ), PROP_AXIS_REFERENCE_DIAGRAM_SIZE, ::getCppuType( reinterpret_cast< const awt::Size * >(0)), beans::PropertyAttribute::BOUND diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 7d3c7396874e..49551bf78c7c 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ChartModel.cxx,v $ - * $Revision: 1.17 $ + * $Revision: 1.17.8.2 $ * * This file is part of OpenOffice.org. * @@ -81,46 +81,6 @@ const OUString lcl_aGDIMetaFileMIMEType( const OUString lcl_aGDIMetaFileMIMETypeHighContrast( RTL_CONSTASCII_USTRINGPARAM("application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"")); -Reference< chart2::data::XDataProvider > lcl_getDataProviderFromParent( - const Reference< frame::XModel > & xParent ) -{ - Reference< chart2::data::XDataProvider > xResult; - const OUString aDataProviderServiceName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider")); - Reference< lang::XMultiServiceFactory > xFact( xParent, uno::UNO_QUERY ); - if( xFact.is()) - { - uno::Sequence< OUString > aServiceNames( xFact->getAvailableServiceNames()); - const OUString * pBegin = aServiceNames.getConstArray(); - const OUString * pEnd = pBegin + aServiceNames.getLength(); - if( ::std::find( pBegin, pEnd, aDataProviderServiceName ) != pEnd ) - { - xResult.set( - xFact->createInstance( aDataProviderServiceName ), uno::UNO_QUERY ); - } - } - return xResult; -} - -bool lcl_ParentIsTempDocument( - const Reference< uno::XInterface > & xParent ) -{ - bool bResult = false; - try - { - Reference< beans::XPropertySet > xDocProp( xParent, uno::UNO_QUERY ); - if( xDocProp.is()) - xDocProp->getPropertyValue( C2U("InternalDocument")) >>= bResult; - } - catch( const beans::UnknownPropertyException & ) - {} - catch( const uno::Exception & ex ) - { - ASSERT_EXCEPTION( ex ); - } - - return bResult; -} - } // anonymous namespace //----------------------------------------------------------------- @@ -664,108 +624,6 @@ uno::Reference< document::XDocumentProperties > SAL_CALL return m_xDocumentProperties; } -/* -//----------------------------------------------------------------- -// view::XPrintable (optional interface) -//----------------------------------------------------------------- - uno::Sequence< beans::PropertyValue > SAL_CALL ChartModel -::getPrinter() throw(uno::RuntimeException) -{ - //@todo guard - return m_aPrinterOptions; -} - - void SAL_CALL ChartModel -::setPrinter( const uno::Sequence< beans::PropertyValue >& rPrinter ) - throw(lang::IllegalArgumentException, uno::RuntimeException) -{ - //@todo guard - m_aPrinterOptions = rPrinter; -} - - void SAL_CALL ChartModel -::print( const uno::Sequence< beans::PropertyValue >& rOptions ) - throw(lang::IllegalArgumentException, uno::RuntimeException) -{ - //@todo -} - -//----------------------------------------------------------------- -// document::XEventBroadcaster (optional interface) -//----------------------------------------------------------------- - - void SAL_CALL ChartModel -::addEventListener( const uno::Reference< document::XEventListener >& xListener ) - throw(uno::RuntimeException) -{ - //@todo -} - - void SAL_CALL ChartModel -::removeEventListener( const uno::Reference< document::XEventListener >& xListener ) - throw(uno::RuntimeException) -{ - //@todo -} - -//----------------------------------------------------------------- -// document::XEventsSupplier (optional interface) -//----------------------------------------------------------------- - - uno::Reference< container::XNameReplace > SAL_CALL ChartModel -::getEvents() throw(uno::RuntimeException) -{ - //@todo -} - -//----------------------------------------------------------------- -// document::XViewDataSupplier (optional interface) -//----------------------------------------------------------------- - - uno::Reference< container::XIndexAccess > SAL_CALL ChartModel -::getViewData() throw(uno::RuntimeException) -{ - //@todo -} - - void SAL_CALL ChartModel -::setViewData( const uno::Reference< container::XIndexAccess >& xData ) - throw(uno::RuntimeException) -{ - //m_bModified = sal_True;//@todo? is this really correct - //@todo -} -*/ - -//----------------------------------------------------------------- -// ::com::sun::star::style::XStyleFamiliesSupplier -//----------------------------------------------------------------- -// ::com::sun::star::uno::Reference< -// ::com::sun::star::container::XNameAccess > SAL_CALL ChartModel -// ::getStyleFamilies() -// throw (uno::RuntimeException) -// { -// OSL_ASSERT( m_pImplChartModel.get() != 0 ); -// // /-- -// MutexGuard aGuard( m_aModelMutex ); -// return m_pImplChartModel->GetStyleFamilies(); -// // \-- -// } - -//----------------------------------------------------------------- -// chart2::XModelDataProvider -//----------------------------------------------------------------- -// Sequence< Reference< chart2::XDataSeries > > SAL_CALL ChartModel -// ::getDataSeries() -// throw (uno::RuntimeException) -// { -// OSL_ASSERT( m_pImplChartModel.get() != 0 ); -// // /-- -// MutexGuard aGuard( m_aModelMutex ); -// return m_pImplChartModel->GetDataSeries(); -// // \-- -// } - //----------------------------------------------------------------- // chart2::XChartDocument //----------------------------------------------------------------- diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx index 339f754ec04b..bee4332a857c 100644 --- a/chart2/source/model/main/ChartModel.hxx +++ b/chart2/source/model/main/ChartModel.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ChartModel.hxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.8.2 $ * * This file is part of OpenOffice.org. * @@ -37,11 +37,7 @@ #include <com/sun/star/frame/XStorable2.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/util/XCloseable.hpp> -#include <com/sun/star/view/XPrintable.hpp> -#include <com/sun/star/document/XEventBroadcaster.hpp> -#include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> -#include <com/sun/star/document/XViewDataSupplier.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -97,18 +93,12 @@ typedef ::comphelper::WeakImplHelper20< ,::com::sun::star::frame::XStorable2 //(extension of XStorable) // ,::com::sun::star::frame::XStorable //(required interface) base of XStorable2 ,::com::sun::star::util::XModifiable //comprehends XModifyBroadcaster (required interface) -// ,::com::sun::star::view::XPrintable //(optional interface) -// ,::com::sun::star::document::XEventBroadcaster //(optional interface) -// ,::com::sun::star::document::XEventsSupplier //(optional interface) -// ,::com::sun::star::document::XViewDataSupplier //(optional interface) // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface) // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper ,::com::sun::star::lang::XServiceInfo -// ,::com::sun::star::chart2::XModelDataProvider ,::com::sun::star::chart2::XChartDocument // derived from XModel ,::com::sun::star::chart2::data::XDataReceiver // public API -// ,::com::sun::star::style::XStyleFamiliesSupplier ,::com::sun::star::chart2::XTitled ,::com::sun::star::frame::XLoadable ,::com::sun::star::util::XCloneable @@ -402,74 +392,6 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > SAL_CALL getDocumentProperties( ) throw (::com::sun::star::uno::RuntimeException); -/* - //----------------------------------------------------------------- - // ::com::sun::star::view::XPrintable (optional interface) - //----------------------------------------------------------------- - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL - getPrinter() throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL - setPrinter( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rPrinter ) - throw (::com::sun::star::lang::IllegalArgumentException - , ::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL - print( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rOptions ) - throw (::com::sun::star::lang::IllegalArgumentException - , ::com::sun::star::uno::RuntimeException); - - //----------------------------------------------------------------- - // ::com::sun::star::document::XEventBroadcaster (optional interface) - //----------------------------------------------------------------- - - virtual void SAL_CALL - addEventListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::document::XEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL - removeEventListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::document::XEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException); - - //----------------------------------------------------------------- - // ::com::sun::star::document::XEventsSupplier (optional interface) - //----------------------------------------------------------------- - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL - getEvents() throw (::com::sun::star::uno::RuntimeException); - - //----------------------------------------------------------------- - // ::com::sun::star::document::XViewDataSupplier (optional interface) - //----------------------------------------------------------------- - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL - getViewData() throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL - setViewData( const ::com::sun::star::uno::Reference< - ::com::sun::star::container::XIndexAccess >& xData ) - throw (::com::sun::star::uno::RuntimeException); - */ - - //----------------------------------------------------------------- - // ::com::sun::star::style::XStyleFamiliesSupplier - //----------------------------------------------------------------- -// virtual ::com::sun::star::uno::Reference< -// ::com::sun::star::container::XNameAccess > SAL_CALL -// getStyleFamilies() throw (::com::sun::star::uno::RuntimeException); - - //----------------------------------------------------------------- - // ::com::sun::star::chart2::XModelDataProvider - //----------------------------------------------------------------- -// virtual ::com::sun::star::uno::Sequence< -// ::com::sun::star::uno::Reference< -// ::com::sun::star::chart2::XDataSeries > > SAL_CALL -// getDataSeries() throw (::com::sun::star::uno::RuntimeException); - //----------------------------------------------------------------- // ::com::sun::star::chart2::XChartDocument //----------------------------------------------------------------- diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx index 4f270e221725..57680c4c15e7 100644 --- a/chart2/source/model/main/DataPoint.cxx +++ b/chart2/source/model/main/DataPoint.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DataPoint.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.44.1 $ * * This file is part of OpenOffice.org. * @@ -87,12 +87,6 @@ const Sequence< Property > & lcl_GetPropertySequence() namespace chart { -DataPoint::DataPoint() : - ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), - m_bNoParentPropAllowed( false ) -{} - DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentProperties ) : ::property::OPropertySet( m_aMutex ), m_xParentProperties( rParentProperties ), diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx index b2ba60c0e900..7117276800df 100644 --- a/chart2/source/model/main/DataPoint.hxx +++ b/chart2/source/model/main/DataPoint.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DataPoint.hxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.44.1 $ * * This file is part of OpenOffice.org. * @@ -65,7 +65,6 @@ class DataPoint : public ::property::OPropertySet { public: - DataPoint(); DataPoint( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rParentProperties ); virtual ~DataPoint(); diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index 9b46136d2980..8e80bc1e8a47 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DataPointProperties.cxx,v $ - * $Revision: 1.18 $ + * $Revision: 1.18.8.1 $ * * This file is part of OpenOffice.org. * @@ -326,7 +326,7 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( - Property( C2U( "ReferenceDiagramSize" ), + Property( C2U( "ReferencePageSize" ), PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE, ::getCppuType( reinterpret_cast< const awt::Size * >(0)), beans::PropertyAttribute::BOUND diff --git a/chart2/source/model/main/DataPointStyle.cxx b/chart2/source/model/main/DataPointStyle.cxx index 3e4155e1646d..e69de29bb2d1 100644 --- a/chart2/source/model/main/DataPointStyle.cxx +++ b/chart2/source/model/main/DataPointStyle.cxx @@ -1,174 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataPointStyle.cxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "DataPointStyle.hxx" -#include "DataPointProperties.hxx" -#include "PropertyHelper.hxx" -#include "macros.hxx" -#include "ContainerHelper.hxx" -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/style/XStyle.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/uno/Sequence.hxx> - -#include <algorithm> - -using namespace ::com::sun::star; - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::beans::Property; -using ::osl::MutexGuard; - -// ____________________________________________________________ - -namespace -{ -const uno::Sequence< Property > & lcl_GetPropertySequence() -{ - static uno::Sequence< Property > aPropSeq; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) - { - // get properties - ::std::vector< ::com::sun::star::beans::Property > aProperties; - ::chart::DataPointProperties::AddPropertiesToVector( aProperties ); - - // and sort them for access via bsearch - ::std::sort( aProperties.begin(), aProperties.end(), - ::chart::PropertyNameLess() ); - - // transfer result to static Sequence - aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); - } - - return aPropSeq; -} -} // anonymous namespace - -// ____________________________________________________________ - -namespace chart -{ - -DataPointStyle::DataPointStyle( - const uno::Reference< container::XNameAccess > & xStyleFamily, - ::osl::Mutex & par_rMutex ) : - ::property::OStyle( xStyleFamily, par_rMutex ), - m_rMutex( par_rMutex ) -{} - -DataPointStyle::~DataPointStyle() -{} - -// ____ XInterface ____ -uno::Any SAL_CALL DataPointStyle::queryInterface( - const uno::Type & rType ) - throw (uno::RuntimeException) -{ - return ::cppu::OWeakObject::queryInterface( rType ); -} - -void SAL_CALL DataPointStyle::acquire() throw () -{ - ::cppu::OWeakObject::acquire(); -} - -void SAL_CALL DataPointStyle::release() throw () -{ - ::cppu::OWeakObject::release(); -} - -// ____ OPropertySet ____ -uno::Any DataPointStyle::GetDefaultValue( sal_Int32 nHandle ) const - throw(beans::UnknownPropertyException) -{ - static tPropertyValueMap aStaticDefaults; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aStaticDefaults.size() ) - { - // initialize defaults - DataPointProperties::AddDefaultsToMap( aStaticDefaults ); - } - - tPropertyValueMap::const_iterator aFound( - aStaticDefaults.find( nHandle )); - - if( aFound == aStaticDefaults.end()) - throw beans::UnknownPropertyException(); - - return (*aFound).second; - // \-- -} - -::cppu::IPropertyArrayHelper & SAL_CALL DataPointStyle::getInfoHelper() -{ - return getInfoHelperConst(); -} - -::cppu::IPropertyArrayHelper & SAL_CALL DataPointStyle::getInfoHelperConst() const -{ - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); - - return aArrayHelper; -} - -// ____ XPropertySet ____ -Reference< beans::XPropertySetInfo > SAL_CALL - DataPointStyle::getPropertySetInfo() - throw (uno::RuntimeException) -{ - static Reference< beans::XPropertySetInfo > xInfo; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- -} - -::osl::Mutex & DataPointStyle::GetMutex() -{ - return m_rMutex; -} - -} // namespace chart diff --git a/chart2/source/model/main/DataPointStyle.hxx b/chart2/source/model/main/DataPointStyle.hxx index 6cf3638bbe86..e69de29bb2d1 100644 --- a/chart2/source/model/main/DataPointStyle.hxx +++ b/chart2/source/model/main/DataPointStyle.hxx @@ -1,83 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataPointStyle.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef CHART_DATAPOINTSTYLE_HXX -#define CHART_DATAPOINTSTYLE_HXX - -#include <cppuhelper/weak.hxx> -#include <osl/mutex.hxx> - -#include "OStyle.hxx" - -namespace chart -{ - -class DataPointStyle : - public ::cppu::OWeakObject, - public ::property::OStyle -{ -public: - DataPointStyle( const ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameAccess > & xStyleFamily, - ::osl::Mutex & rMutex ); - virtual ~DataPointStyle(); - - // ____ XInterface ____ - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( - const ::com::sun::star::uno::Type & rType ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); - -protected: - // ____ OPropertySet ____ - virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const - throw(::com::sun::star::beans::UnknownPropertyException); - - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); - - // ____ XPropertySet ____ - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() - throw (::com::sun::star::uno::RuntimeException); - - ::osl::Mutex & GetMutex(); - - /** const variant of getInfoHelper() - */ - ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; - -private: - ::osl::Mutex & m_rMutex; -}; - -} // namespace chart - -// CHART_DATAPOINTSTYLE_HXX -#endif diff --git a/chart2/source/model/main/DataSeriesStyle.cxx b/chart2/source/model/main/DataSeriesStyle.cxx index 24799da9749e..e69de29bb2d1 100644 --- a/chart2/source/model/main/DataSeriesStyle.cxx +++ b/chart2/source/model/main/DataSeriesStyle.cxx @@ -1,177 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataSeriesStyle.cxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "DataSeriesStyle.hxx" -#include "DataSeriesProperties.hxx" -#include "CharacterProperties.hxx" -#include "PropertyHelper.hxx" -#include "macros.hxx" -#include "ContainerHelper.hxx" -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/style/XStyle.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/uno/Sequence.hxx> - -#include <algorithm> - -using namespace ::com::sun::star; - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::beans::Property; -using ::osl::MutexGuard; - -// ____________________________________________________________ - -namespace -{ -const uno::Sequence< Property > & lcl_GetPropertySequence() -{ - static uno::Sequence< Property > aPropSeq; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) - { - // get properties - ::std::vector< ::com::sun::star::beans::Property > aProperties; - ::chart::DataSeriesProperties::AddPropertiesToVector( aProperties ); - ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); - - // and sort them for access via bsearch - ::std::sort( aProperties.begin(), aProperties.end(), - ::chart::PropertyNameLess() ); - - // transfer result to static Sequence - aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); - } - - return aPropSeq; -} -} // anonymous namespace - -// ____________________________________________________________ - -namespace chart -{ - -DataSeriesStyle::DataSeriesStyle( - const uno::Reference< container::XNameAccess > & xStyleFamily, - ::osl::Mutex & par_rMutex ) : - ::property::OStyle( xStyleFamily, par_rMutex ), - m_rMutex( par_rMutex ) -{} - -DataSeriesStyle::~DataSeriesStyle() -{} - -// ____ XInterface ____ -uno::Any SAL_CALL DataSeriesStyle::queryInterface( - const uno::Type & rType ) - throw (uno::RuntimeException) -{ - return ::cppu::OWeakObject::queryInterface( rType ); -} - -void SAL_CALL DataSeriesStyle::acquire() throw () -{ - ::cppu::OWeakObject::acquire(); -} - -void SAL_CALL DataSeriesStyle::release() throw () -{ - ::cppu::OWeakObject::release(); -} - -// ____ OPropertySet ____ -uno::Any DataSeriesStyle::GetDefaultValue( sal_Int32 nHandle ) const - throw(beans::UnknownPropertyException) -{ - static tPropertyValueMap aStaticDefaults; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aStaticDefaults.size() ) - { - // initialize defaults - DataSeriesProperties::AddDefaultsToMap( aStaticDefaults ); - CharacterProperties::AddDefaultsToMap( aStaticDefaults ); - } - - tPropertyValueMap::const_iterator aFound( - aStaticDefaults.find( nHandle )); - - if( aFound == aStaticDefaults.end()) - throw beans::UnknownPropertyException(); - - return (*aFound).second; - // \-- -} - -::cppu::IPropertyArrayHelper & SAL_CALL DataSeriesStyle::getInfoHelper() -{ - return getInfoHelperConst(); -} - -::cppu::IPropertyArrayHelper & SAL_CALL DataSeriesStyle::getInfoHelperConst() const -{ - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); - - return aArrayHelper; -} - -// ____ XPropertySet ____ -Reference< beans::XPropertySetInfo > SAL_CALL - DataSeriesStyle::getPropertySetInfo() - throw (uno::RuntimeException) -{ - static Reference< beans::XPropertySetInfo > xInfo; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- -} - -::osl::Mutex & DataSeriesStyle::GetMutex() -{ - return m_rMutex; -} - -} // namespace chart diff --git a/chart2/source/model/main/DataSeriesStyle.hxx b/chart2/source/model/main/DataSeriesStyle.hxx index cd781016471f..e69de29bb2d1 100644 --- a/chart2/source/model/main/DataSeriesStyle.hxx +++ b/chart2/source/model/main/DataSeriesStyle.hxx @@ -1,83 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataSeriesStyle.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef CHART_DATASERIESSTYLE_HXX -#define CHART_DATASERIESSTYLE_HXX - -#include <cppuhelper/weak.hxx> -#include <osl/mutex.hxx> - -#include "OStyle.hxx" - -namespace chart -{ - -class DataSeriesStyle : - public ::cppu::OWeakObject, - public ::property::OStyle -{ -public: - DataSeriesStyle( const ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameAccess > & xStyleFamily, - ::osl::Mutex & rMutex ); - virtual ~DataSeriesStyle(); - - // ____ XInterface ____ - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( - const ::com::sun::star::uno::Type & rType ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); - -protected: - // ____ OPropertySet ____ - virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const - throw(::com::sun::star::beans::UnknownPropertyException); - - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); - - // ____ XPropertySet ____ - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() - throw (::com::sun::star::uno::RuntimeException); - - ::osl::Mutex & GetMutex(); - - /** const variant of getInfoHelper() - */ - ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; - -private: - ::osl::Mutex & m_rMutex; -}; - -} // namespace chart - -// CHART_DATASERIESSTYLE_HXX -#endif diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 3d2ae5875ed9..1718ddb1646d 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -8,7 +8,7 @@ * * $RCSfile: Diagram.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.24.32.2 $ * * This file is part of OpenOffice.org. * @@ -35,7 +35,6 @@ #include "macros.hxx" #include "PropertyHelper.hxx" #include "Wall.hxx" -#include "ContextHelper.hxx" #include "UserDefinedProperties.hxx" #include "ConfigColorScheme.hxx" #include "ContainerHelper.hxx" diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx index 56d0602e901b..a2175b68a1da 100644 --- a/chart2/source/model/main/FormattedString.cxx +++ b/chart2/source/model/main/FormattedString.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormattedString.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.44.1 $ * * This file is part of OpenOffice.org. * @@ -87,12 +87,6 @@ const Sequence< Property > & lcl_GetPropertySequence() namespace chart { -FormattedString::FormattedString( const ::rtl::OUString & rString ) : - ::property::OPropertySet( m_aMutex ), - m_aString( rString ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) -{} - FormattedString::FormattedString( uno::Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), diff --git a/chart2/source/model/main/FormattedString.hxx b/chart2/source/model/main/FormattedString.hxx index 66251ddebc58..de2c8adc40b5 100644 --- a/chart2/source/model/main/FormattedString.hxx +++ b/chart2/source/model/main/FormattedString.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormattedString.hxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.44.1 $ * * This file is part of OpenOffice.org. * @@ -61,7 +61,6 @@ class FormattedString : public ::property::OPropertySet { public: - FormattedString( const ::rtl::OUString & rString ); FormattedString( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext ); virtual ~FormattedString(); diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx index 73f267739f79..6360ccc7ee9c 100644 --- a/chart2/source/model/main/ImplChartModel.cxx +++ b/chart2/source/model/main/ImplChartModel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ImplChartModel.cxx,v $ - * $Revision: 1.17 $ + * $Revision: 1.17.44.2 $ * * This file is part of OpenOffice.org. * @@ -32,10 +32,7 @@ #include "precompiled_chart2.hxx" #include "ImplChartModel.hxx" #include "DataSeries.hxx" -#include "StyleFamilies.hxx" -#include "StyleFamily.hxx" #include "macros.hxx" -#include "ContextHelper.hxx" #include "PageBackground.hxx" #include "DiagramHelper.hxx" #include "NameContainer.hxx" @@ -164,93 +161,8 @@ ImplChartModel::ImplChartModel( const ImplChartModel & rOther, const Reference< ImplChartModel::~ImplChartModel() {} -// ImplChartModel::CreateStyles() -// { -// // set style -// Reference< container::XNameAccess > xGraphicsFamily( -// GetStyleFamilies()->getByName( C2U( "graphics" )), uno::UNO_QUERY ); - -// if( xGraphicsFamily.is()) -// const sal_Int32 nModul = Reference< container::XIndexAccess >( -// xGraphicsFamily, uno::UNO_QUERY )->getCount(); -// for( size_t nI = 0; nI < nMaxSeries; ++nI ) -// { -// try -// { -// Reference< ::com::sun::star::style::XStyle > xStyle( -// xGraphicsFamily->getByName( -// aStyleNameStub + OUString::valueOf( -// static_cast< sal_Int32 >( (nI % nModul)+1 ))), uno::UNO_QUERY ); - -// Reference< beans::XPropertySet > xSeriesProp( -// aResult[ nI ], uno::UNO_QUERY ); - -// if( xSeriesProp.is()) -// { -// xSeriesProp->setPropertyValue( -// C2U( "Color" ), -// uno::makeAny( nDefaultColors[ sal_Int32( nI % nMaxDefaultColors ) ])); - -// // set style -// Reference< ::com::sun::star::style::XStyleSupplier > -// xStyleSupp( xSeriesProp->getPropertyValue( C2U( "FirstGraphicsFormat" )), -// uno::UNO_QUERY ); - -// if( xStyleSupp.is()) -// { -// xStyleSupp->setStyle( xStyle ); -// } -// } -// } -// catch( uno::Exception ex ) -// { -// OSL_ENSURE( false, "Couldn't set style" ); -// } -// } -// } - - Reference< container::XNameAccess > ImplChartModel::GetStyleFamilies() { - if( ! m_xFamilies.is()) - { -// StyleFamilies * pStyleFamilies = new StyleFamilies(); -// StyleFamily * pGraphicsFamily = new StyleFamily(); -// Reference< container::XNameAccess > xGraphicsFamily( pGraphicsFamily ); - - // add some default styles for graphics - - // randomly generated default colors - -// sal_Int32 i = 0; -// const sal_Int32 nMax = sizeof( nDefaults ) / sizeof( sal_Int32 ); -// for( ; i < nMax; ++i ) -// { -// try -// { -// Reference< ::com::sun::star::style::XStyle > xStyle( -// new GraphicsPropertiesStyle( xGraphicsFamily ) ); -// xStyle->setName( C2U( "Series " ) + OUString::valueOf( static_cast< sal_Int32 >(i + 1) ) ); -// Reference< beans::XPropertySet > xProp( xStyle, uno::UNO_QUERY ); -// if( xProp.is()) -// { -// xProp->setPropertyValue( C2U( "Color" ), uno::makeAny( nDefaults[ i ] )); -// } -// pGraphicsFamily->AddStyle( xStyle ); -// } -// catch( uno::Exception ex ) -// { -// OSL_ENSURE( false, "Error on creating styles" ); -// } -// } - -// bool bResult = pStyleFamilies->AddStyleFamily( -// C2U( "graphics" ), xGraphicsFamily ); - -// OSL_ASSERT( bResult ); -// m_xFamilies.set( pStyleFamilies ); - } - return m_xFamilies; } @@ -262,19 +174,6 @@ void ImplChartModel::RemoveAllDiagrams() m_aDiagrams.clear(); } -bool ImplChartModel::RemoveDiagram( const Reference< chart2::XDiagram > & xDiagram ) -{ - tDiagramContainer::iterator aIt( ::std::find( - m_aDiagrams.begin(), m_aDiagrams.end(), - xDiagram )); - if( aIt == m_aDiagrams.end() ) - return false; - - ModifyListenerHelper::removeListener( *aIt, m_xModifyListener ); - m_aDiagrams.erase( aIt ); - return true; -} - void ImplChartModel::AppendDiagram( const Reference< chart2::XDiagram > & xDiagram ) { Reference< util::XModifyBroadcaster > xBroadcaster( xDiagram, uno::UNO_QUERY ); @@ -414,12 +313,6 @@ Reference< chart2::XChartTypeManager > ImplChartModel::GetChartTypeManager() return m_xChartTypeManager; } -void ImplChartModel::SetChartTypeTemplate( - const Reference< chart2::XChartTypeTemplate > & xTemplate ) -{ - m_xChartTypeTemplate = xTemplate; -} - Reference< chart2::XChartTypeTemplate > ImplChartModel::GetChartTypeTemplate() { return m_xChartTypeTemplate; @@ -562,45 +455,6 @@ Reference< chart2::XUndoManager > ImplChartModel::GetUndoManager() return m_xUndoManager; } -// OUString -::std::vector< Reference< chart2::data::XLabeledDataSequence > > ImplChartModel::GetData() -{ - ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aResult; - - Reference< chart2::XDiagram > xDia; - if( m_aDiagrams.size() > 0 ) - xDia.set( GetDiagram(0) ); - - if( xDia.is()) - { - try - { - // categories - Reference< chart2::data::XLabeledDataSequence > xCategories( - DiagramHelper::getCategoriesFromDiagram( xDia )); - aResult.push_back( xCategories ); - - // data series - ::std::vector< Reference< chart2::XDataSeries > > aSeriesVec( - DiagramHelper::getDataSeriesFromDiagram( xDia )); - for( ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt = - aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt ) - { - Reference< chart2::data::XDataSource > xSource( *aIt, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::data::XLabeledDataSequence > > aDataSeq( xSource->getDataSequences()); - ::std::copy( aDataSeq.getConstArray(), aDataSeq.getConstArray() + aDataSeq.getLength(), - back_inserter( aResult )); - } - } - catch( uno::Exception & ex ) - { - ASSERT_EXCEPTION( ex ); - } - } - - return aResult; -} - void ImplChartModel::SetNewData( const Reference< chart2::data::XDataSource > & xDataSource, const Sequence< beans::PropertyValue > & rArgs ) { diff --git a/chart2/source/model/main/ImplChartModel.hxx b/chart2/source/model/main/ImplChartModel.hxx index edfa7be60727..9a912feee246 100644 --- a/chart2/source/model/main/ImplChartModel.hxx +++ b/chart2/source/model/main/ImplChartModel.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ImplChartModel.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.44.1 $ * * This file is part of OpenOffice.org. * @@ -106,8 +106,6 @@ public: void RemoveAllDiagrams(); /** @return true, if the chart was found and removed, false otherwise. */ - bool RemoveDiagram( const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XDiagram > & xDiagram ); void AppendDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > & xDiagram ); ::com::sun::star::uno::Reference< @@ -141,10 +139,6 @@ public: ::com::sun::star::chart2::XChartTypeManager > GetChartTypeManager(); - void SetChartTypeTemplate( - const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XChartTypeTemplate > & xTemplate ); - ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartTypeTemplate > GetChartTypeTemplate(); @@ -166,9 +160,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > GetUndoManager(); - ::std::vector< ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::data::XLabeledDataSequence > > GetData(); - void CreateDefaultChart(); ::com::sun::star::uno::Reference< diff --git a/chart2/source/model/main/Style.cxx b/chart2/source/model/main/Style.cxx index b9cfee4ecce7..e69de29bb2d1 100644 --- a/chart2/source/model/main/Style.cxx +++ b/chart2/source/model/main/Style.cxx @@ -1,161 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Style.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "Style.hxx" -#include "macros.hxx" -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/container/XNameContainer.hpp> - -using namespace ::com::sun::star; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::RuntimeException; -using ::rtl::OUString; -using ::osl::MutexGuard; - -// necessary for MS compiler -using ::comphelper::OPropertyContainer; -using ::chart::impl::Style_Base; - -namespace -{ -static const ::rtl::OUString lcl_aImplName( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Style" )); -} // anonymous namespace - -namespace chart -{ - -Style::Style( const Reference< container::XNameContainer > & xStyleFamiliyToAddTo ) : - OPropertyContainer( GetBroadcastHelper()), - Style_Base( GetMutex()), - m_xStyleFamily( xStyleFamiliyToAddTo ), - m_aName( C2U( "Default" ) ), - m_bUserDefined( sal_False ) -{ - OSL_ENSURE( m_xStyleFamily.is(), "No StyleFamily to add style to" ); -} - -Style::~Style() -{} - -sal_Bool SAL_CALL Style::isUserDefined() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return m_bUserDefined; - // \-- -} - -sal_Bool SAL_CALL Style::isInUse() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - - // aBoundLC is a member of cppuhelper::OPropertySetHelper - // it is assumed that a style is in use whenever some component is - // registered here as listener - return ( aBoundLC.getContainedTypes().getLength() > 0 ); - // \-- -} - -OUString SAL_CALL Style::getParentStyle() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return m_aParentStyleName; - // \-- -} - -void SAL_CALL Style::setParentStyle( const OUString& aParentStyle ) - throw (container::NoSuchElementException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - m_aParentStyleName = aParentStyle; - // \-- -} - - -OUString SAL_CALL Style::getName() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return m_aName; - // \-- -} - -void SAL_CALL Style::setName( const OUString& aName ) - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - OSL_ASSERT( m_xStyleFamily.is()); - - if( m_xStyleFamily.is() ) - { - // remove old name - if( m_aName.getLength() > 0 ) - { - Reference< container::XNameAccess > xAccess( m_xStyleFamily, uno::UNO_QUERY ); - OSL_ASSERT( xAccess.is()); - if( xAccess->hasByName( m_aName )) - m_xStyleFamily->removeByName( m_aName ); - } - - // change name - m_aName = aName; - - // add new name - m_xStyleFamily->insertByName( m_aName, uno::makeAny( this )); - } - // \-- -} - -IMPLEMENT_FORWARD_XINTERFACE2( Style, Style_Base, OPropertyContainer ) -IMPLEMENT_FORWARD_XTYPEPROVIDER2( Style, Style_Base, OPropertyContainer ) - -// implement XServiceInfo methods basing upon getSupportedServiceNames_Static -APPHELPER_XSERVICEINFO_IMPL( Style, lcl_aImplName ) - -uno::Sequence< OUString > Style::getSupportedServiceNames_Static() -{ - uno::Sequence< OUString > aServices( 1 ); - aServices[ 0 ] = C2U( "com.sun.star.style.Style" ); - return aServices; -} - -} // namespace chart diff --git a/chart2/source/model/main/Style.hxx b/chart2/source/model/main/Style.hxx index feee550f089f..e69de29bb2d1 100644 --- a/chart2/source/model/main/Style.hxx +++ b/chart2/source/model/main/Style.hxx @@ -1,116 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Style.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef CHART_STYLE_HXX -#define CHART_STYLE_HXX - -// helper classes -#include <cppuhelper/compbase2.hxx> -#include <comphelper/uno3.hxx> -#include <comphelper/broadcasthelper.hxx> -#include <comphelper/propertycontainer.hxx> -#include <comphelper/proparrhlp.hxx> - -#include "ServiceMacros.hxx" - -// interfaces and types -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/style/XStyle.hpp> - -namespace com { namespace sun { namespace star { namespace container { - class XNameContainer; -}}}} - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakComponentImplHelper2< - ::com::sun::star::style::XStyle, - ::com::sun::star::lang::XServiceInfo > Style_Base; -} - -class Style : - public ::comphelper::OMutexAndBroadcastHelper, - public ::comphelper::OPropertyContainer, - public ::comphelper::OPropertyArrayUsageHelper< Style >, - public impl::Style_Base -{ -public: - Style( const ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameContainer > & xStyleFamiliyToAddTo ); - virtual ~Style(); - - void RegisterProperties( - const ::std::vector< ::com::sun::star::beans::Property > & rProperties, - ::std::vector< ::com::sun::star::uno::Any > & rOutProperties ); - - /// declare XServiceInfo methods - APPHELPER_XSERVICEINFO_DECL() - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// merge XTypeProvider implementations - DECLARE_XTYPEPROVIDER() - -protected: - // ____ style::XStyle ____ - virtual sal_Bool SAL_CALL isUserDefined() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isInUse() throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getParentStyle() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - - // ____ container::XNamed (base of XStyle) ____ - virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); - - // ____ beans::XPropertySet ____ - /// @see ::com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() - throw (::com::sun::star::uno::RuntimeException); - /// @see ::comphelper::OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - /// @see ::comphelper::OPropertyArrayUsageHelper - virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; - -private: - ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameContainer > m_xStyleFamily; - - ::rtl::OUString m_aName; - ::rtl::OUString m_aParentStyleName; - sal_Bool m_bUserDefined; -}; - -} // namespace chart - -// CHART_STYLE_HXX -#endif diff --git a/chart2/source/model/main/StyleFamilies.cxx b/chart2/source/model/main/StyleFamilies.cxx index 32c9d978de0d..e69de29bb2d1 100644 --- a/chart2/source/model/main/StyleFamilies.cxx +++ b/chart2/source/model/main/StyleFamilies.cxx @@ -1,179 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleFamilies.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "StyleFamilies.hxx" -#include "macros.hxx" - -#include <algorithm> -#include <functional> - -using namespace ::com::sun::star; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::rtl::OUString; -using ::osl::MutexGuard; - -namespace chart -{ - -StyleFamilies::StyleFamilies() -{ -} - -StyleFamilies::~StyleFamilies() -{} - -bool StyleFamilies::AddStyleFamily( - const OUString & rName, - const Reference< container::XNameAccess > & rFamily ) -{ - if( m_aStyleFamilies.find( rName ) == m_aStyleFamilies.end() ) - { - m_aStyleFamilies[ rName ] = rFamily; - return true; - } - - return false; -} - -// container::XNameAccess -Any SAL_CALL StyleFamilies::getByName( const OUString& aName ) - throw (container::NoSuchElementException, - lang::WrappedTargetException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - - tStyleFamilyContainer::const_iterator aIt( m_aStyleFamilies.find( aName )); - if( aIt == m_aStyleFamilies.end()) - { - throw container::NoSuchElementException( - aName, - static_cast< ::cppu::OWeakObject* >( this )); - } - - OSL_ASSERT( (*aIt).first.equals( aName )); - return uno::makeAny( (*aIt).second ); - // \-- -} - -uno::Sequence< OUString > SAL_CALL StyleFamilies::getElementNames() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - Sequence< OUString > aResult( m_aStyleFamilies.size()); - - ::std::transform( m_aStyleFamilies.begin(), m_aStyleFamilies.end(), - aResult.getArray(), - ::std::select1st< tStyleFamilyContainer::value_type >() ); - - return aResult; - // \-- -} - -sal_Bool SAL_CALL StyleFamilies::hasByName( const OUString& aName ) - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - - return ( m_aStyleFamilies.find( aName ) != m_aStyleFamilies.end() ); - // \-- -} - - -// container::XIndexAccess (optional) -sal_Int32 SAL_CALL StyleFamilies::getCount() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - return m_aStyleFamilies.size(); - // \-- -} - -Any SAL_CALL StyleFamilies::getByIndex( sal_Int32 Index ) - throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - tStyleFamilyContainer::const_iterator aIt( m_aStyleFamilies.begin()); - sal_Int32 nCounter = 0; - for( ; - ( nCounter < Index ) && ( aIt != m_aStyleFamilies.end()); - ++nCounter, ++aIt ); - - if( aIt == m_aStyleFamilies.end()) - { - throw container::NoSuchElementException( - OUString::valueOf( Index ), - static_cast< ::cppu::OWeakObject* >( this )); - } - - return uno::makeAny( (*aIt).second ); - // \-- -} - - -// container::XElementAccess (base of XNameAccess and XIndexAccess) -uno::Type SAL_CALL StyleFamilies::getElementType() - throw (RuntimeException) -{ - return ::getCppuType( reinterpret_cast< Reference< container::XNameAccess > * >(0)); -} - -sal_Bool SAL_CALL StyleFamilies::hasElements() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - return ! m_aStyleFamilies.empty(); - // \-- -} - -// lang::XServiceInfo - -APPHELPER_XSERVICEINFO_IMPL( StyleFamilies, C2U( "com.sun.star.comp.chart2.StyleFamilies" )) - -Sequence< OUString > StyleFamilies::getSupportedServiceNames_Static() -{ - uno::Sequence< OUString > aServices( 1 ); - aServices[ 0 ] = C2U( "com.sun.star.style.StyleFamilies" ); - - return aServices; -} - -} // namespace chart diff --git a/chart2/source/model/main/StyleFamilies.hxx b/chart2/source/model/main/StyleFamilies.hxx index 5598dbf0eacc..e69de29bb2d1 100644 --- a/chart2/source/model/main/StyleFamilies.hxx +++ b/chart2/source/model/main/StyleFamilies.hxx @@ -1,103 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleFamilies.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef CHART_STYLEFAMILIES_HXX -#define CHART_STYLEFAMILIES_HXX - -#include <cppuhelper/implbase2.hxx> -#include <osl/mutex.hxx> - -#include "ServiceMacros.hxx" -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> - -#include <map> - -namespace chart -{ - -class StyleFamilies : public ::cppu::WeakImplHelper2 < - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XServiceInfo > -{ -public: - StyleFamilies(); - virtual ~StyleFamilies(); - - /** adds a style family. - - @param rName the name under which the family can later be accessed - through the XNameAccess. - - @param rFamily the style family object supporting the service - ::com::sun::star::style::StyleFamily. - - @return true, if the family was added. In case there already exists a - family with the name given in rName, nothing is done and false - is returned. - */ - bool AddStyleFamily( - const ::rtl::OUString & rName, - const ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameAccess > & rFamily ); - -protected: - // container::XNameAccess - // - // Note: The elements within this collection are StyleFamily instances. - // (only mandatory interface: XNameAccess) - virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); - - // container::XIndexAccess (optional) - virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // container::XElementAccess (base of XNameAccess and XIndexAccess) - virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException); - - APPHELPER_XSERVICEINFO_DECL() - - typedef ::std::map< ::rtl::OUString, - ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameAccess > > - tStyleFamilyContainer; - -private: - tStyleFamilyContainer m_aStyleFamilies; - ::osl::Mutex m_aMutex; -}; - -} // namespace chart - -// CHART_STYLEFAMILIES_HXX -#endif diff --git a/chart2/source/model/main/StyleFamily.cxx b/chart2/source/model/main/StyleFamily.cxx index f5cfe8bbccbe..e69de29bb2d1 100644 --- a/chart2/source/model/main/StyleFamily.cxx +++ b/chart2/source/model/main/StyleFamily.cxx @@ -1,267 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleFamily.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "StyleFamily.hxx" -#include "macros.hxx" -#include <com/sun/star/style/XStyle.hpp> - -#include <algorithm> -#include <functional> - -using namespace ::com::sun::star; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Sequence; -using ::rtl::OUString; -using ::osl::MutexGuard; - -namespace chart -{ - -StyleFamily::StyleFamily() -{} - -StyleFamily::~StyleFamily() -{} - -bool StyleFamily::AddStyle( - const Reference< style::XStyle > & rStyle ) -{ - bool bRet = false; - - if( rStyle.is()) - { - OUString aName( rStyle->getName() ); - m_aStyles[ aName ] = rStyle; - bRet = true; - } - - return bRet; -} - -// container::XNameAccess (also base of XNameReplace) -uno::Any SAL_CALL StyleFamily::getByName( const OUString& aName ) - throw (container::NoSuchElementException, - lang::WrappedTargetException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - - tStyleContainer::const_iterator aIt( m_aStyles.find( aName )); - if( aIt == m_aStyles.end()) - { - throw container::NoSuchElementException( - aName, - static_cast< ::cppu::OWeakObject* >( this )); - } - - OSL_ASSERT( (*aIt).first.equals( aName )); - return uno::makeAny( (*aIt).second ); - // \-- -} - -Sequence< OUString > SAL_CALL StyleFamily::getElementNames() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - Sequence< OUString > aResult( m_aStyles.size()); - - ::std::transform( m_aStyles.begin(), m_aStyles.end(), - aResult.getArray(), - ::std::select1st< tStyleContainer::value_type >() ); - - return aResult; - // \-- -} - -sal_Bool SAL_CALL StyleFamily::hasByName( const OUString& aName ) - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - - return ( m_aStyles.find( aName ) != m_aStyles.end() ); - // \-- -} - - -// container::XNameContainer (optional) -void SAL_CALL StyleFamily::insertByName( const OUString& aName, const uno::Any& aElement ) - throw (lang::IllegalArgumentException, - container::ElementExistException, - lang::WrappedTargetException, - RuntimeException) -{ - uno::Reference< style::XStyle > xStyle; - if( aElement >>= xStyle ) - { - // /-- - MutexGuard aGuard( m_aMutex ); - if( m_aStyles.find( aName ) != m_aStyles.end() ) - { - throw container::ElementExistException( - aName, - static_cast< ::cppu::OWeakObject* >( this ) ); - } - - m_aStyles[ aName ] = xStyle; - // \-- - } - else - { - throw lang::IllegalArgumentException( - aName, - static_cast< ::cppu::OWeakObject* >( this ), - 1 /* index */ ); - } -} - -void SAL_CALL StyleFamily::removeByName( const OUString& Name ) - throw (container::NoSuchElementException, - lang::WrappedTargetException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - tStyleContainer::iterator aIt( m_aStyles.find( Name )); - if( aIt == m_aStyles.end()) - { - throw container::NoSuchElementException( - Name, - static_cast< ::cppu::OWeakObject* >( this ) ); - } - - m_aStyles.erase( aIt ); - // \-- -} - - -// container::XIndexAccess (optional) -sal_Int32 SAL_CALL StyleFamily::getCount() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - return m_aStyles.size(); - // \-- -} - -uno::Any SAL_CALL StyleFamily::getByIndex( sal_Int32 Index ) - throw (lang::IndexOutOfBoundsException, - lang::WrappedTargetException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - tStyleContainer::const_iterator aIt( m_aStyles.begin()); - sal_Int32 nCounter = 0; - for( ; - ( nCounter < Index ) && ( aIt != m_aStyles.end()); - ++nCounter, ++aIt ); - - if( aIt == m_aStyles.end()) - { - throw container::NoSuchElementException( - OUString::valueOf( Index ), - static_cast< ::cppu::OWeakObject* >( this )); - } - - return uno::makeAny( (*aIt).second ); - // \-- -} - - -// container::XElementAccess (base of XNameAccess and XIndexAccess) -uno::Type SAL_CALL StyleFamily::getElementType() - throw (RuntimeException) -{ - return ::getCppuType( reinterpret_cast< Reference< style::XStyle > * >(0)); -} - -sal_Bool SAL_CALL StyleFamily::hasElements() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( m_aMutex ); - return ! m_aStyles.empty(); - // \-- -} - - -// container::XNameReplace -void SAL_CALL StyleFamily::replaceByName( const OUString& aName, const uno::Any& aElement ) - throw (lang::IllegalArgumentException, - container::NoSuchElementException, - lang::WrappedTargetException, - RuntimeException) -{ - uno::Reference< style::XStyle > xStyle; - if( aElement >>= xStyle ) - { - // /-- - MutexGuard aGuard( m_aMutex ); - tStyleContainer::const_iterator aIt( m_aStyles.begin()); - if( aIt == m_aStyles.end()) - { - throw container::NoSuchElementException( - aName, - static_cast< ::cppu::OWeakObject* >( this ) ); - } - - m_aStyles[ aName ] = xStyle; - // \-- - } - else - { - throw lang::IllegalArgumentException( - aName, - static_cast< ::cppu::OWeakObject* >( this ), - 1 /* index */ ); - } -} - -// lang::XServiceInfo - -APPHELPER_XSERVICEINFO_IMPL( StyleFamily, C2U( "com.sun.star.comp.chart2.StyleFamily" )) - -Sequence< OUString > StyleFamily::getSupportedServiceNames_Static() -{ - uno::Sequence< OUString > aServices( 1 ); - aServices[ 0 ] = C2U( "com.sun.star.style.StyleFamily" ); - - return aServices; -} - -} // namespace chart diff --git a/chart2/source/model/main/StyleFamily.hxx b/chart2/source/model/main/StyleFamily.hxx index 200c5dc5549e..e69de29bb2d1 100644 --- a/chart2/source/model/main/StyleFamily.hxx +++ b/chart2/source/model/main/StyleFamily.hxx @@ -1,115 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleFamily.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef CHART_STYLEFAMILY_HXX -#define CHART_STYLEFAMILY_HXX - -#include <cppuhelper/implbase3.hxx> -#include <osl/mutex.hxx> - -#include "ServiceMacros.hxx" -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> - -#include <map> - -namespace com { namespace sun { namespace star { - namespace style { - class XStyle; - } -}}} - -namespace chart -{ - -class StyleFamily : public - ::cppu::WeakImplHelper3< - ::com::sun::star::container::XNameContainer, - ::com::sun::star::container::XIndexAccess, - ::com::sun::star::lang::XServiceInfo - > -{ -public: - StyleFamily(); - virtual ~StyleFamily(); - - /** adds a style. - - @param rStyle the style object supporting the service - ::com::sun::star::style::Style. The name under which this object - can be accessed through XNameAccess is the one you get from - XNamed::getName() (XNamed is a base interface for XStyle.) - - @return true, if the style was added. In case there already exists a - style with the name given in getName(), nothing is done and - false is returned. - */ - bool AddStyle( const ::com::sun::star::uno::Reference< - ::com::sun::star::style::XStyle > & rStyle ); - -protected: - - // container::XNameAccess (also base of XNameReplace) - virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); - - // container::XNameContainer (optional, base of XNameReplace) - virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // container::XIndexAccess (optional) - virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // container::XElementAccess (base of XNameAccess and XIndexAccess) - virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException); - - // container::XNameReplace (base of XNameAccess) - virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - APPHELPER_XSERVICEINFO_DECL() - - typedef ::std::map< ::rtl::OUString, - ::com::sun::star::uno::Reference< - ::com::sun::star::style::XStyle > > - tStyleContainer; - -private: - tStyleContainer m_aStyles; - ::osl::Mutex m_aMutex; -}; - -} // namespace chart - -// CHART_STYLEFAMILY_HXX -#endif diff --git a/chart2/source/model/main/makefile.mk b/chart2/source/model/main/makefile.mk index e9188385aef2..775e7b60e9b9 100644 --- a/chart2/source/model/main/makefile.mk +++ b/chart2/source/model/main/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.8 $ +# $Revision: 1.8.44.1 $ # # This file is part of OpenOffice.org. # @@ -54,9 +54,7 @@ SLOFILES= \ $(SLO)$/ChartModel_Persistence.obj \ $(SLO)$/DataPoint.obj \ $(SLO)$/DataPointProperties.obj \ - $(SLO)$/DataPointStyle.obj \ $(SLO)$/DataSeries.obj \ - $(SLO)$/DataSeriesStyle.obj \ $(SLO)$/Diagram.obj \ $(SLO)$/DataSeriesProperties.obj \ $(SLO)$/FormattedString.obj \ @@ -65,8 +63,6 @@ SLOFILES= \ $(SLO)$/PageBackground.obj \ $(SLO)$/PolarCoordinateSystem.obj \ $(SLO)$/StockBar.obj \ - $(SLO)$/StyleFamilies.obj \ - $(SLO)$/StyleFamily.obj \ $(SLO)$/Title.obj \ $(SLO)$/Wall.obj \ $(SLO)$/_serviceregistration_model.obj |