diff options
Diffstat (limited to 'chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx')
-rwxr-xr-x[-rw-r--r--] | chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index e61821a117f5..baca5d41cf27 100644..100755 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -57,11 +57,9 @@ #include "WrappedAddInProperty.hxx" #include "WrappedIgnoreProperty.hxx" #include "ChartRenderer.hxx" -#include "UndoManager.hxx" #include <com/sun/star/chart2/XTitled.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> -#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <comphelper/InlineContainer.hxx> // header for function SvxShapeCollection_NewInstance #include <svx/unoshcol.hxx> @@ -83,8 +81,8 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart; -using ::com::sun::star::chart::XComplexDescriptionAccess; using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::beans::Property; @@ -251,27 +249,30 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::MAYBEDEFAULT ) ); } -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticChartDocumentWrapperPropertyArray_Initializer { - static uno::Sequence< Property > aPropSeq; + Sequence< Property >* operator()() + { + static Sequence< Property > aPropSeq( lcl_GetPropertySequence() ); + return &aPropSeq; + } - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) +private: + uno::Sequence< Property > lcl_GetPropertySequence() { - // get properties ::std::vector< ::com::sun::star::beans::Property > aProperties; lcl_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 ::chart::ContainerHelper::ContainerToSequence( aProperties ); } +}; - return aPropSeq; -} +struct StaticChartDocumentWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticChartDocumentWrapperPropertyArray_Initializer > +{ +}; } // anonymous namespace @@ -1401,12 +1402,6 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( xResult.set( m_xChartView ); bServiceFound = true; } - else if ( aServiceSpecifier.equals( CHART_UNDOMANAGER_SERVICE_NAME ) ) - { - Reference< chart2::XUndoManager > xUndoManager( new UndoManager() ); - xResult.set( xUndoManager ); - bServiceFound = true; - } else { // try to create a shape @@ -1559,7 +1554,7 @@ Reference< beans::XPropertySet > ChartDocumentWrapper::getInnerPropertySet() } const Sequence< beans::Property >& ChartDocumentWrapper::getPropertySequence() { - return lcl_GetPropertySequence(); + return *StaticChartDocumentWrapperPropertyArray::get(); } const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedProperties() |