diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 15:11:37 +0100 |
commit | 9fba7e804f5b72b58b7bb2799238eb72c531ce08 (patch) | |
tree | 6c1a597349965683af983a422dd54c6e3afffd0a /chart2/source/tools | |
parent | ace88acbc3ac297b64bf0b5dbe46ceebd9718c26 (diff) | |
parent | b903a1de34f5fc3694c696110c1f00b97d60299f (diff) |
CWS-TOOLING: integrate CWS chart49
Diffstat (limited to 'chart2/source/tools')
28 files changed, 215 insertions, 388 deletions
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 8cdd24e4dc05..b5f7abfb8206 100644..100755 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -64,19 +64,16 @@ using namespace ::com::sun::star::chart2; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -//static Reference< chart2::XScaling > AxisHelper::createLinearScaling() { return new LinearScaling( 1.0, 0.0 ); } -//static Reference< chart2::XScaling > AxisHelper::createLogarithmicScaling( double fBase ) { return new LogarithmicScaling( fBase ); } -//static ScaleData AxisHelper::createDefaultScale() { ScaleData aScaleData; @@ -87,7 +84,6 @@ ScaleData AxisHelper::createDefaultScale() return aScaleData; } -//static void AxisHelper::removeExplicitScaling( ScaleData& rScaleData ) { uno::Any aEmpty; @@ -95,7 +91,6 @@ void AxisHelper::removeExplicitScaling( ScaleData& rScaleData ) rScaleData.Scaling = 0; } -//static bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling ) { bool bReturn = false; @@ -105,7 +100,6 @@ bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling ) return bReturn; } -//static Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex , sal_Int32 nAxisIndex // 0==main or 1==secondary axis @@ -173,7 +167,6 @@ Reference< XAxis > AxisHelper::createAxis( return xAxis; } -//static Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMainAxis , const Reference< chart2::XDiagram >& xDiagram , const Reference< uno::XComponentContext >& xContext @@ -192,7 +185,6 @@ Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMain nDimensionIndex, nAxisIndex, xCooSys, xContext, pRefSizeProvider ); } -//static void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis , const Reference< chart2::XDiagram >& xDiagram , const Reference< uno::XComponentContext >& xContext @@ -215,7 +207,6 @@ void AxisHelper::showAxis( sal_Int32 nDimensionIndex, bool bMainAxis AxisHelper::makeAxisVisible( xAxis ); } -//static void AxisHelper::showGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid , const Reference< XDiagram >& xDiagram , const Reference< uno::XComponentContext >& /*xContext*/ ) @@ -245,7 +236,6 @@ void AxisHelper::showGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bo } } -//static void AxisHelper::makeAxisVisible( const Reference< XAxis >& xAxis ) { Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY ); @@ -257,7 +247,6 @@ void AxisHelper::makeAxisVisible( const Reference< XAxis >& xAxis ) } } -//static void AxisHelper::makeGridVisible( const Reference< beans::XPropertySet >& xGridProperties ) { if( xGridProperties.is() ) @@ -267,14 +256,12 @@ void AxisHelper::makeGridVisible( const Reference< beans::XPropertySet >& xGridP } } -//static void AxisHelper::hideAxis( sal_Int32 nDimensionIndex, bool bMainAxis , const Reference< XDiagram >& xDiagram ) { AxisHelper::makeAxisInvisible( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) ); } -//static void AxisHelper::makeAxisInvisible( const Reference< XAxis >& xAxis ) { Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY ); @@ -284,7 +271,6 @@ void AxisHelper::makeAxisInvisible( const Reference< XAxis >& xAxis ) } } -//static void AxisHelper::hideAxisIfNoDataIsAttached( const Reference< XAxis >& xAxis, const Reference< XDiagram >& xDiagram ) { //axis is hidden if no data is attached anymore but data is available @@ -328,7 +314,6 @@ void AxisHelper::hideGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bo } } -//static void AxisHelper::makeGridInvisible( const Reference< beans::XPropertySet >& xGridProperties ) { if( xGridProperties.is() ) @@ -362,7 +347,6 @@ sal_Bool AxisHelper::isGridShown( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIn return bRet; } -//static Reference< XCoordinateSystem > AxisHelper::getCoordinateSystemByIndex( const Reference< XDiagram >& xDiagram, sal_Int32 nIndex ) { @@ -375,7 +359,6 @@ Reference< XCoordinateSystem > AxisHelper::getCoordinateSystemByIndex( return NULL; } -//static Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, bool bMainAxis , const Reference< XDiagram >& xDiagram ) { @@ -391,7 +374,6 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, bool bMainAxi return xRet; } -//static Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex , const Reference< XCoordinateSystem >& xCooSys ) { @@ -407,7 +389,6 @@ Reference< XAxis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 nAx return xRet; } -//static Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xAxis , const Reference< XCoordinateSystem >& xCooSys ) { @@ -429,7 +410,6 @@ Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xA return AxisHelper::getAxis( nDimensionIndex, 0, xCooSys ); } -//static Reference< XAxis > AxisHelper::getParallelAxis( const Reference< XAxis >& xAxis , const Reference< XDiagram >& xDiagram ) { @@ -456,7 +436,6 @@ sal_Bool AxisHelper::isAxisShown( sal_Int32 nDimensionIndex, bool bMainAxis return AxisHelper::isAxisVisible( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) ); } -//static sal_Bool AxisHelper::isAxisVisible( const Reference< XAxis >& xAxis ) { sal_Bool bRet = false; @@ -482,7 +461,6 @@ sal_Bool AxisHelper::areAxisLabelsVisible( const Reference< beans::XPropertySet return bRet; } -//static sal_Bool AxisHelper::isGridVisible( const Reference< beans::XPropertySet >& xGridProperies ) { sal_Bool bRet = false; @@ -496,7 +474,6 @@ sal_Bool AxisHelper::isGridVisible( const Reference< beans::XPropertySet >& xGri return bRet; } -//static Reference< beans::XPropertySet > AxisHelper::getGridProperties( const Reference< XCoordinateSystem >& xCooSys , sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex, sal_Int32 nSubGridIndex ) @@ -519,7 +496,6 @@ Reference< beans::XPropertySet > AxisHelper::getGridProperties( return xRet; } -//static sal_Int32 AxisHelper::getDimensionIndexOfAxis( const Reference< XAxis >& xAxis , const Reference< XDiagram >& xDiagram ) @@ -531,7 +507,6 @@ sal_Int32 AxisHelper::getDimensionIndexOfAxis( return nDimensionIndex; } -//static bool AxisHelper::getIndicesForAxis( const Reference< XAxis >& xAxis , const Reference< XCoordinateSystem >& xCooSys @@ -564,7 +539,6 @@ bool AxisHelper::getIndicesForAxis( return false; } -//static bool AxisHelper::getIndicesForAxis( const Reference< XAxis >& xAxis, const Reference< XDiagram >& xDiagram , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ) { @@ -591,7 +565,6 @@ bool AxisHelper::getIndicesForAxis( const Reference< XAxis >& xAxis, const Refer return false; } -//static std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem( const Reference< XCoordinateSystem >& xCooSys , bool bOnlyVisible /* = false */ ) @@ -638,7 +611,6 @@ std::vector< Reference< XAxis > > AxisHelper::getAllAxesOfCoordinateSystem( return aAxisVector; } -//static Sequence< Reference< XAxis > > AxisHelper::getAllAxesOfDiagram( const Reference< XDiagram >& xDiagram , bool bOnlyVisible ) @@ -660,7 +632,6 @@ Sequence< Reference< XAxis > > AxisHelper::getAllAxesOfDiagram( return ContainerHelper::ContainerToSequence( aAxisVector ); } -//static Sequence< Reference< beans::XPropertySet > > AxisHelper::getAllGrids( const Reference< XDiagram >& xDiagram ) { Sequence< Reference< XAxis > > aAllAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) ); @@ -689,7 +660,6 @@ Sequence< Reference< beans::XPropertySet > > AxisHelper::getAllGrids( const Refe return ContainerHelper::ContainerToSequence( aGridVector ); } -//static void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityList , const Reference< XDiagram>& xDiagram, sal_Bool bAxis ) { @@ -709,7 +679,6 @@ void AxisHelper::getAxisOrGridPossibilities( Sequence< sal_Bool >& rPossibilityL rPossibilityList[nIndex] = rPossibilityList[nIndex-3]; } -//static bool AxisHelper::isSecondaryYAxisNeeded( const Reference< XCoordinateSystem >& xCooSys ) { Reference< chart2::XChartTypeContainer > xCTCnt( xCooSys, uno::UNO_QUERY ); @@ -738,7 +707,6 @@ bool AxisHelper::isSecondaryYAxisNeeded( const Reference< XCoordinateSystem >& x return false; } -//static bool AxisHelper::shouldAxisBeDisplayed( const Reference< XAxis >& xAxis , const Reference< XCoordinateSystem >& xCooSys ) { @@ -764,7 +732,6 @@ bool AxisHelper::shouldAxisBeDisplayed( const Reference< XAxis >& xAxis return bRet; } -//static void AxisHelper::getAxisOrGridExcistence( Sequence< sal_Bool >& rExistenceList , const Reference< XDiagram>& xDiagram, sal_Bool bAxis ) { @@ -790,7 +757,6 @@ void AxisHelper::getAxisOrGridExcistence( Sequence< sal_Bool >& rExistenceList } } -//static bool AxisHelper::changeVisibilityOfAxes( const Reference< XDiagram >& xDiagram , const Sequence< sal_Bool >& rOldExistenceList , const Sequence< sal_Bool >& rNewExistenceList @@ -814,7 +780,6 @@ bool AxisHelper::changeVisibilityOfAxes( const Reference< XDiagram >& xDiagram return bChanged; } -//static bool AxisHelper::changeVisibilityOfGrids( const Reference< XDiagram >& xDiagram , const Sequence< sal_Bool >& rOldExistenceList , const Sequence< sal_Bool >& rNewExistenceList @@ -835,7 +800,6 @@ bool AxisHelper::changeVisibilityOfGrids( const Reference< XDiagram >& xDiagram return bChanged; } -//static Reference< XCoordinateSystem > AxisHelper::getCoordinateSystemOfAxis( const Reference< XAxis >& xAxis , const Reference< XDiagram >& xDiagram ) diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index cca655780a79..c403ca046b9e 100644..100755 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -561,7 +561,6 @@ bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle ) nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP ); } -// static awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet( const uno::Reference< beans::XMultiPropertySet > & xMultiPropSet ) { diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx index a49b2abeac98..e5e21eac8a7f 100644..100755 --- a/chart2/source/tools/ChartModelHelper.cxx +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -54,21 +54,18 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -//static uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter( const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier ) { return new RangeHighlighter( xSelectionSupplier ); } -//static uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider( const uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, bool bConnectToModel ) { return new InternalDataProvider( xChartDoc, bConnectToModel ); } -//static uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel ) { uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY ); @@ -77,7 +74,6 @@ uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< return NULL; } -// static uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< chart2::XChartDocument >& xChartDoc ) { try @@ -92,7 +88,6 @@ uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< return NULL; } -//static uno::Reference< XCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( const uno::Reference< frame::XModel >& xModel ) { uno::Reference< XCoordinateSystem > XCooSys; @@ -106,7 +101,6 @@ uno::Reference< XCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( return XCooSys; } -// static ::std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries( const uno::Reference< XChartDocument > & xChartDoc ) { @@ -119,7 +113,6 @@ uno::Reference< XCoordinateSystem > ChartModelHelper::getFirstCoordinateSystem( return aResult; } -// static ::std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries( const uno::Reference< frame::XModel > & xModel ) { diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index b851a3864b97..debb241e9604 100644..100755 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -438,7 +438,6 @@ bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference< chart2::XC return sal_False; } -//static sal_Int32 ChartTypeHelper::getDefaultDirectLightColor( bool bSimple, const uno::Reference< chart2::XChartType >& xChartType ) { sal_Int32 nRet = static_cast< sal_Int32 >( 0x808080 ); // grey @@ -459,7 +458,6 @@ sal_Int32 ChartTypeHelper::getDefaultDirectLightColor( bool bSimple, const uno:: return nRet; } -//static sal_Int32 ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple, const uno::Reference< chart2::XChartType >& xChartType ) { sal_Int32 nRet = static_cast< sal_Int32 >( 0x999999 ); // grey40 diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx index 55fbd368426a..c6f712787559 100644..100755 --- a/chart2/source/tools/ChartViewHelper.cxx +++ b/chart2/source/tools/ChartViewHelper.cxx @@ -45,7 +45,6 @@ namespace chart using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; -//static void ChartViewHelper::setViewToDirtyState( const uno::Reference< frame::XModel >& xChartModel ) { try diff --git a/chart2/source/tools/ColorPerPointHelper.cxx b/chart2/source/tools/ColorPerPointHelper.cxx index 762cb436a9a7..b0b1e3f03130 100644..100755 --- a/chart2/source/tools/ColorPerPointHelper.cxx +++ b/chart2/source/tools/ColorPerPointHelper.cxx @@ -42,7 +42,6 @@ namespace chart using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; -//static bool ColorPerPointHelper::hasPointOwnColor( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xDataSeriesProperties @@ -72,7 +71,6 @@ bool ColorPerPointHelper::hasPointOwnColor( return false; } -// static bool ColorPerPointHelper::hasPointOwnProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesProperties diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx index e9d90248ce84..6b70ac4c1500 100644..100755 --- a/chart2/source/tools/CommonConverters.cxx +++ b/chart2/source/tools/CommonConverters.cxx @@ -474,7 +474,6 @@ uno::Sequence< rtl::OUString > DataSequenceToStringSequence( const uno::Reference< data::XDataSequence >& xDataSequence ) { uno::Sequence< rtl::OUString > aResult; - OSL_ASSERT( xDataSequence.is()); if(!xDataSequence.is()) return aResult; diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 36afef60a6d4..b3ae733c4067 100644..100755 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -73,7 +73,6 @@ using ::rtl::OUString; namespace chart { -// static DiagramHelper::tTemplateWithServiceName DiagramHelper::getTemplateForDiagram( const Reference< XDiagram > & xDiagram, @@ -132,7 +131,6 @@ DiagramHelper::tTemplateWithServiceName return aResult; } -// static void DiagramHelper::setVertical( const Reference< XDiagram > & xDiagram, bool bVertical /* = true */ ) @@ -210,7 +208,6 @@ void DiagramHelper::setVertical( } } -//static bool DiagramHelper::getVertical( const uno::Reference< chart2::XDiagram > & xDiagram, bool& rbFound, bool& rbAmbiguous ) { @@ -248,7 +245,6 @@ bool DiagramHelper::getVertical( const uno::Reference< chart2::XDiagram > & xDia return bValue; } -//static void DiagramHelper::setStackMode( const Reference< XDiagram > & xDiagram, StackMode eStackMode, @@ -340,8 +336,6 @@ void DiagramHelper::setStackMode( } } -//static - StackMode DiagramHelper::getStackMode( const Reference< XDiagram > & xDiagram, bool& rbFound, bool& rbAmbiguous ) { rbFound=false; @@ -383,7 +377,6 @@ StackMode DiagramHelper::getStackMode( const Reference< XDiagram > & xDiagram, b return eGlobalStackMode; } -// static StackMode DiagramHelper::getStackModeFromChartType( const Reference< XChartType > & xChartType, bool& rbFound, bool& rbAmbiguous, @@ -467,7 +460,6 @@ StackMode DiagramHelper::getStackModeFromChartType( return eStackMode; } -// static sal_Int32 DiagramHelper::getDimension( const Reference< XDiagram > & xDiagram ) { // -1: not yet set @@ -500,7 +492,6 @@ sal_Int32 DiagramHelper::getDimension( const Reference< XDiagram > & xDiagram ) return nResult; } -// static void DiagramHelper::setDimension( const Reference< XDiagram > & xDiagram, sal_Int32 nNewDimensionCount ) @@ -561,7 +552,6 @@ void DiagramHelper::setDimension( } } -// static void DiagramHelper::replaceCoordinateSystem( const Reference< XDiagram > & xDiagram, const Reference< XCoordinateSystem > & xCooSysToReplace, @@ -597,7 +587,6 @@ void DiagramHelper::replaceCoordinateSystem( } } -//static bool DiagramHelper::isSeriesAttachedToMainAxis( const uno::Reference< chart2::XDataSeries >& xDataSeries ) { @@ -605,7 +594,6 @@ bool DiagramHelper::isSeriesAttachedToMainAxis( return (nAxisIndex==0); } -//static bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis , const uno::Reference< chart2::XDataSeries >& xDataSeries , const uno::Reference< chart2::XDiagram >& xDiagram @@ -651,7 +639,6 @@ bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis return bChanged; } -//static uno::Reference< XAxis > DiagramHelper::getAttachedAxis( const uno::Reference< XDataSeries >& xSeries, const uno::Reference< XDiagram >& xDiagram ) @@ -659,7 +646,6 @@ uno::Reference< XAxis > DiagramHelper::getAttachedAxis( return AxisHelper::getAxis( 1, DiagramHelper::isSeriesAttachedToMainAxis( xSeries ), xDiagram ); } -//static uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries( const uno::Reference< chart2::XDiagram >& xDiagram , const uno::Reference< XDataSeries >& xGivenDataSeries ) @@ -709,7 +695,6 @@ uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries( return 0; } -// static ::std::vector< Reference< XDataSeries > > DiagramHelper::getDataSeriesFromDiagram( const Reference< XDiagram > & xDiagram ) @@ -856,7 +841,6 @@ std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram( } // anonymous namespace -//static bool DiagramHelper::isCategoryDiagram( const Reference< XDiagram >& xDiagram ) { @@ -895,7 +879,6 @@ bool DiagramHelper::isCategoryDiagram( return false; } -// static void DiagramHelper::setCategoriesToDiagram( const Reference< chart2::data::XLabeledDataSequence >& xCategories, const Reference< XDiagram >& xDiagram, @@ -927,7 +910,6 @@ void DiagramHelper::setCategoriesToDiagram( } } -// static Reference< data::XLabeledDataSequence > DiagramHelper::getCategoriesFromDiagram( const Reference< XDiagram > & xDiagram ) @@ -1022,7 +1004,6 @@ Sequence< rtl::OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( return aRet; } -//static Sequence< rtl::OUString > DiagramHelper::getExplicitSimpleCategories( const Reference< XChartDocument >& xChartDoc ) { @@ -1037,7 +1018,6 @@ Sequence< rtl::OUString > DiagramHelper::getExplicitSimpleCategories( return aRet; } -// static Sequence< Reference< XChartType > > DiagramHelper::getChartTypesFromDiagram( const Reference< XDiagram > & xDiagram ) @@ -1067,7 +1047,6 @@ Sequence< Reference< XChartType > > return ContainerHelper::ContainerToSequence( aResult ); } -//static bool DiagramHelper::areChartTypesCompatible( const Reference< ::chart2::XChartType >& xFirstType, const Reference< ::chart2::XChartType >& xSecondType ) { @@ -1327,7 +1306,6 @@ bool DiagramHelper::isPieOrDonutChart( const ::com::sun::star::uno::Reference< return false; } -// static sal_Int32 DiagramHelper::getGeometry3D( const uno::Reference< chart2::XDiagram > & xDiagram, bool& rbFound, bool& rbAmbiguous ) @@ -1374,7 +1352,6 @@ sal_Int32 DiagramHelper::getGeometry3D( return nCommonGeom; } -// static void DiagramHelper::setGeometry3D( const Reference< chart2::XDiagram > & xDiagram, sal_Int32 nNewGeometry ) @@ -1390,7 +1367,6 @@ void DiagramHelper::setGeometry3D( } } -//static sal_Int32 DiagramHelper::getCorrectedMissingValueTreatment( const Reference< chart2::XDiagram > & xDiagram, const Reference< chart2::XChartType >& xChartType ) @@ -1418,7 +1394,6 @@ sal_Int32 DiagramHelper::getCorrectedMissingValueTreatment( return nResult; } -//static DiagramPositioningMode DiagramHelper::getDiagramPositioningMode( const uno::Reference< chart2::XDiagram > & xDiagram ) { @@ -1450,7 +1425,6 @@ void lcl_ensureRange0to1( double& rValue ) rValue=1.0; } -//static bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >& xChartModel, const awt::Rectangle& rPosRect /*100th mm*/ ) { @@ -1496,7 +1470,6 @@ bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel > return bChanged; } -//static awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference< frame::XModel >& xChartModel ) { awt::Rectangle aRet(-1,-1,-1,-1); @@ -1513,8 +1486,8 @@ awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference xDiaProps->getPropertyValue(C2U("RelativeSize") ) >>= aRelSize; awt::Size aAbsSize( - aRelSize.Primary * aPageSize.Width, - aRelSize.Secondary * aPageSize.Height ); + static_cast< sal_Int32 >( aRelSize.Primary * aPageSize.Width ), + static_cast< sal_Int32 >( aRelSize.Secondary * aPageSize.Height )); awt::Point aAbsPos( static_cast< sal_Int32 >( aRelPos.Primary * aPageSize.Width ), @@ -1527,7 +1500,6 @@ awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference return aRet; } -//static bool DiagramHelper::switchDiagramPositioningToExcludingPositioning( const uno::Reference< frame::XModel >& xChartModel , bool bResetModifiedState, bool bConvertAlsoFromAutoPositioning ) diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 7468d8bb7896..c8aa400d1be5 100644..100755 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -107,49 +107,72 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); } -void lcl_AddDefaultsToMap( - ::chart::tPropertyValueMap & rOutMap ) +struct StaticErrorBarDefaults_Initializer { - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_STYLE, ::com::sun::star::chart::ErrorBarStyle::NONE ); - ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_POS_ERROR, 0.0 ); - ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_NEG_ERROR, 0.0 ); - ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_WEIGHT, 1.0 ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_POS_ERROR, true ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_NEG_ERROR, true ); -} + ::chart::tPropertyValueMap* operator()() + { + static ::chart::tPropertyValueMap aStaticDefaults; + lcl_AddDefaultsToMap( aStaticDefaults ); + return &aStaticDefaults; + } +private: + void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) + { + ::chart::LineProperties::AddDefaultsToMap( rOutMap ); + + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_STYLE, ::com::sun::star::chart::ErrorBarStyle::NONE ); + ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_POS_ERROR, 0.0 ); + ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_NEG_ERROR, 0.0 ); + ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_WEIGHT, 1.0 ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_POS_ERROR, true ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_NEG_ERROR, true ); + } +}; + +struct StaticErrorBarDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticErrorBarDefaults_Initializer > +{ +}; -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticErrorBarInfoHelper_Initializer { - static uno::Sequence< Property > aPropSeq; + ::cppu::OPropertyArrayHelper* operator()() + { + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; + } - // /-- - 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 ); ::chart::LineProperties::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; -} +}; -::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +struct StaticErrorBarInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticErrorBarInfoHelper_Initializer > { - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); +}; - return aArrayHelper; -} +struct StaticErrorBarInfo_Initializer +{ + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticErrorBarInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; + +struct StaticErrorBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticErrorBarInfo_Initializer > +{ +}; bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq ) { @@ -208,50 +231,23 @@ uno::Reference< util::XCloneable > SAL_CALL ErrorBar::createClone() uno::Any ErrorBar::GetDefaultValue( sal_Int32 nHandle ) const throw(beans::UnknownPropertyException) { - static tPropertyValueMap aStaticDefaults; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aStaticDefaults.size() ) - { - // initialize defaults - lcl_AddDefaultsToMap( aStaticDefaults ); - LineProperties::AddDefaultsToMap( aStaticDefaults ); - } - - tPropertyValueMap::const_iterator aFound( - aStaticDefaults.find( nHandle )); - - if( aFound == aStaticDefaults.end()) + const tPropertyValueMap& rStaticDefaults = *StaticErrorBarDefaults::get(); + tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) ); + if( aFound == rStaticDefaults.end() ) return uno::Any(); - return (*aFound).second; - // \-- } ::cppu::IPropertyArrayHelper & SAL_CALL ErrorBar::getInfoHelper() { - return lcl_getInfoHelper(); + return *StaticErrorBarInfoHelper::get(); } - // ____ XPropertySet ____ -uno::Reference< beans::XPropertySetInfo > SAL_CALL - ErrorBar::getPropertySetInfo() +uno::Reference< beans::XPropertySetInfo > SAL_CALL ErrorBar::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo; - - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- + return *StaticErrorBarInfo::get(); } // ____ XModifyBroadcaster ____ diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index bd1c1bb79813..a59610b1fc3a 100644..100755 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -71,9 +71,9 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2: { uno::Reference< data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() ); - if( xDataProvider.is() ) + OUString aCatgoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) ); + if( xDataProvider.is() && aCatgoriesRange.getLength() ) { - OUString aCatgoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) ); const bool bFirstCellAsLabel = false; const bool bHasCategories = false; const uno::Sequence< sal_Int32 > aSequenceMapping; @@ -355,7 +355,6 @@ Sequence< OUString > lcl_getExplicitSimpleCategories( return aRet; } -//static Sequence< OUString > ExplicitCategoriesProvider::getExplicitSimpleCategories( const SplitCategoriesProvider& rSplitCategoriesProvider ) { @@ -401,7 +400,6 @@ std::vector< ComplexCategory > ExplicitCategoriesProvider::getCategoriesByLevel return aRet; } -// static OUString ExplicitCategoriesProvider::getCategoryByIndex( const Reference< XCoordinateSystem >& xCooSysModel , const uno::Reference< frame::XModel >& xChartModel diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx index ee23727c321b..f95bbfd166e0 100644..100755 --- a/chart2/source/tools/FillProperties.cxx +++ b/chart2/source/tools/FillProperties.cxx @@ -136,7 +136,6 @@ void lcl_AddPropertiesToVector_without_BitmapProperties( ::std::vector< ::com::s | beans::PropertyAttribute::MAYBEDEFAULT )); } -//static void lcl_AddPropertiesToVector_only_BitmapProperties( ::std::vector< ::com::sun::star::beans::Property > & rOutProperties ) { rOutProperties.push_back( diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 4abc51be31af..26b2db4fc253 100644..100755 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -356,9 +356,11 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum if( xSeq.is() ) aStringSeq = xSeq->getTextualData(); // @todo: be able to deal with XDataSequence, too sal_Int32 nLength = aStringSeq.getLength(); - if( static_cast< sal_Int32 >(aNewCategories.size()) < nLength ) + sal_Int32 nCatLength = static_cast< sal_Int32 >(aNewCategories.size()); + if( nCatLength < nLength ) aNewCategories.resize( nLength ); - + else if( nLength < nCatLength ) + aStringSeq.realloc( nCatLength ); transform( aNewCategories.begin(), aNewCategories.end(), aStringSeq.getConstArray(), aNewCategories.begin(), lcl_setStringAtLevel(nL) ); } diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx index 4e778db1a68c..af170e971a5b 100644..100755 --- a/chart2/source/tools/LegendHelper.cxx +++ b/chart2/source/tools/LegendHelper.cxx @@ -46,7 +46,6 @@ namespace chart //............................................................................. -//static Reference< chart2::XLegend > LegendHelper::showLegend( const Reference< frame::XModel >& xModel , const uno::Reference< uno::XComponentContext >& xContext ) { @@ -78,7 +77,6 @@ Reference< chart2::XLegend > LegendHelper::showLegend( const Reference< frame::X return xLegend; } -//static void LegendHelper::hideLegend( const Reference< frame::XModel >& xModel ) { uno::Reference< chart2::XLegend > xLegend = LegendHelper::getLegend( xModel, 0, false ); @@ -89,7 +87,6 @@ void LegendHelper::hideLegend( const Reference< frame::XModel >& xModel ) } } -// static uno::Reference< chart2::XLegend > LegendHelper::getLegend( const uno::Reference< frame::XModel >& xModel , const uno::Reference< uno::XComponentContext >& xContext @@ -127,7 +124,6 @@ uno::Reference< chart2::XLegend > LegendHelper::getLegend( return xResult; } -// static bool LegendHelper::hasLegend( const uno::Reference< chart2::XDiagram > & xDiagram ) { bool bReturn = false; diff --git a/chart2/source/tools/LineProperties.cxx b/chart2/source/tools/LineProperties.cxx index 95cf95e21a86..889efb029103 100644..100755 --- a/chart2/source/tools/LineProperties.cxx +++ b/chart2/source/tools/LineProperties.cxx @@ -108,7 +108,6 @@ void LineProperties::AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_JOINT, drawing::LineJoint_ROUND ); } -//static bool LineProperties::IsLineVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xLineProperties ) { @@ -137,7 +136,6 @@ bool LineProperties::IsLineVisible( const ::com::sun::star::uno::Reference< return bRet; } -//static void LineProperties::SetLineVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xLineProperties ) { @@ -162,7 +160,6 @@ void LineProperties::SetLineVisible( const ::com::sun::star::uno::Reference< } } -//static void LineProperties::SetLineInvisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xLineProperties ) { diff --git a/chart2/source/tools/NamedFillProperties.cxx b/chart2/source/tools/NamedFillProperties.cxx index f904c34c1df1..de9cffde7897 100644..100755 --- a/chart2/source/tools/NamedFillProperties.cxx +++ b/chart2/source/tools/NamedFillProperties.cxx @@ -93,7 +93,6 @@ void NamedFillProperties::AddDefaultsToMap( { } -// static OUString NamedFillProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) { //will return e.g. "FillGradientName" for PROP_FILL_GRADIENT_NAME diff --git a/chart2/source/tools/NamedLineProperties.cxx b/chart2/source/tools/NamedLineProperties.cxx index 02680abf690e..3379b3804e52 100644..100755 --- a/chart2/source/tools/NamedLineProperties.cxx +++ b/chart2/source/tools/NamedLineProperties.cxx @@ -81,7 +81,6 @@ void NamedLineProperties::AddDefaultsToMap( { } -// static OUString NamedLineProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) { //will return e.g. "LineDashName" for PROP_LINE_DASH_NAME diff --git a/chart2/source/tools/NamedProperties.cxx b/chart2/source/tools/NamedProperties.cxx index 4fcb536b3279..5a4e0b2d16da 100644..100755 --- a/chart2/source/tools/NamedProperties.cxx +++ b/chart2/source/tools/NamedProperties.cxx @@ -47,7 +47,6 @@ void NamedProperties::AddPropertiesToVector( NamedLineProperties::AddPropertiesToVector( rOutProperties ); } -// static OUString NamedProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) { OUString aName = NamedFillProperties::GetPropertyNameForHandle( nHandle ); diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 0599f9317aed..accbdd27bfa8 100644..100755 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -340,7 +340,6 @@ bool ObjectIdentifier::operator<( const ObjectIdentifier& rOID ) const return bReturn; } -//static OUString ObjectIdentifier::createClassifiedIdentifierForObject( const Reference< uno::XInterface >& xObject , const Reference< frame::XModel >& xChartModel ) @@ -424,14 +423,12 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject( return aRet; } -//static OUString ObjectIdentifier::createClassifiedIdentifierForParticle( const OUString& rParticle ) { return ObjectIdentifier::createClassifiedIdentifierForParticles( rParticle, OUString() ); } -//static OUString ObjectIdentifier::createClassifiedIdentifierForParticles( const OUString& rParentParticle , const OUString& rChildParticle @@ -458,7 +455,6 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createParticleForDiagram( const Reference< XDiagram >& /*xDiagram*/ , const Reference< frame::XModel >& /*xChartModel*/ ) @@ -468,7 +464,6 @@ OUString ObjectIdentifier::createParticleForDiagram( return aRet; } -//static OUString ObjectIdentifier::createParticleForCoordinateSystem( const Reference< XCoordinateSystem >& xCooSys , const Reference< frame::XModel >& xChartModel ) @@ -497,7 +492,6 @@ OUString ObjectIdentifier::createParticleForCoordinateSystem( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createParticleForAxis( sal_Int32 nDimensionIndex , sal_Int32 nAxisIndex ) @@ -511,7 +505,6 @@ OUString ObjectIdentifier::createParticleForAxis( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createParticleForGrid( sal_Int32 nDimensionIndex , sal_Int32 nAxisIndex ) @@ -525,7 +518,6 @@ OUString ObjectIdentifier::createParticleForGrid( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createClassifiedIdentifierForGrid( const Reference< XAxis >& xAxis , const Reference< frame::XModel >& xChartModel @@ -544,7 +536,6 @@ OUString ObjectIdentifier::createClassifiedIdentifierForGrid( return aGridCID; } -//static OUString ObjectIdentifier::createParticleForSeries( sal_Int32 nDiagramIndex, sal_Int32 nCooSysIndex , sal_Int32 nChartTypeIndex, sal_Int32 nSeriesIndex ) @@ -565,7 +556,6 @@ OUString ObjectIdentifier::createParticleForSeries( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createParticleForLegend( const Reference< XLegend >& /*xLegend*/ , const Reference< frame::XModel >& xChartModel ) @@ -583,7 +573,6 @@ OUString ObjectIdentifier::createParticleForLegend( return aRet.makeStringAndClear(); } -//static OUString ObjectIdentifier::createClassifiedIdentifier( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES , const OUString& rParticleID )//e.g. SeriesID @@ -592,7 +581,6 @@ OUString ObjectIdentifier::createClassifiedIdentifier( eObjectType, rParticleID, m_aEmptyString ); } -//static OUString ObjectIdentifier::createClassifiedIdentifierWithParent( enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_POINT or OBJECTTYPE_GRID , const OUString& rParticleID //e.g. Point Index or SubGrid Index @@ -619,13 +607,11 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent( return aRet.makeStringAndClear(); } -//static const OUString& ObjectIdentifier::getPieSegmentDragMethodServiceName() { return m_aPieSegmentDragMethodServiceName; } -//static OUString ObjectIdentifier::createPieSegmentDragParameterString( sal_Int32 nOffsetPercent , const awt::Point& rMinimumPosition @@ -643,7 +629,6 @@ OUString ObjectIdentifier::createPieSegmentDragParameterString( return aRet.makeStringAndClear(); } -//static bool ObjectIdentifier::parsePieSegmentDragParameterString( const OUString& rDragParameterString , sal_Int32& rOffsetPercent @@ -681,7 +666,6 @@ bool ObjectIdentifier::parsePieSegmentDragParameterString( return true; } -//static OUString ObjectIdentifier::getDragMethodServiceName( const OUString& rCID ) { OUString aRet; @@ -707,7 +691,6 @@ OUString ObjectIdentifier::getDragMethodServiceName( const OUString& rCID ) return aRet; } -//static OUString ObjectIdentifier::getDragParameterString( const OUString& rCID ) { OUString aRet; @@ -733,7 +716,6 @@ OUString ObjectIdentifier::getDragParameterString( const OUString& rCID ) return aRet; } -//static bool ObjectIdentifier::isDragableObject( const OUString& rClassifiedIdentifier ) { ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier ); @@ -768,7 +750,6 @@ bool ObjectIdentifier::isDragableObject() return bReturn; } -//static bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier ) { ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier ); @@ -783,7 +764,6 @@ bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier return false; } -//static bool ObjectIdentifier::isMultiClickObject( const OUString& rClassifiedIdentifier ) { //the name of a shape is it's ClassifiedIdentifier @@ -846,7 +826,6 @@ bool ObjectIdentifier::areIdenticalObjects( const OUString& rCID1, const OUStrin return false; } -//static OUString ObjectIdentifier::getStringForType( ObjectType eObjectType ) { OUString aRet; @@ -933,7 +912,6 @@ OUString ObjectIdentifier::getStringForType( ObjectType eObjectType ) return aRet; } -//static ObjectType ObjectIdentifier::getObjectType( const OUString& rCID ) { ObjectType eRet; @@ -1020,7 +998,6 @@ ObjectType ObjectIdentifier::getObjectType() return eObjectType; } -//static OUString ObjectIdentifier::createDataCurveCID( const OUString& rSeriesParticle , sal_Int32 nCurveIndex @@ -1031,7 +1008,6 @@ OUString ObjectIdentifier::createDataCurveCID( return createClassifiedIdentifierWithParent( eType, aParticleID, rSeriesParticle ); } -//static OUString ObjectIdentifier::createDataCurveEquationCID( const OUString& rSeriesParticle , sal_Int32 nCurveIndex ) @@ -1040,7 +1016,6 @@ OUString ObjectIdentifier::createDataCurveEquationCID( return createClassifiedIdentifierWithParent( OBJECTTYPE_DATA_CURVE_EQUATION, aParticleID, rSeriesParticle ); } -//static OUString ObjectIdentifier::addChildParticle( const rtl::OUString& rParticle, const rtl::OUString& rChildParticle ) { OUStringBuffer aRet(rParticle); @@ -1053,7 +1028,6 @@ OUString ObjectIdentifier::addChildParticle( const rtl::OUString& rParticle, con return aRet.makeStringAndClear(); } -//static rtl::OUString ObjectIdentifier::createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex ) { OUStringBuffer aRet( getStringForType( eObjectType ) ); @@ -1065,7 +1039,6 @@ rtl::OUString ObjectIdentifier::createChildParticleWithIndex( ObjectType eObject return aRet.makeStringAndClear(); } -//static sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const rtl::OUString& rParticleOrCID ) { sal_Int32 nRet = -1; @@ -1077,7 +1050,6 @@ sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const rtl::OUString& rPar return nRet; } -//static OUString ObjectIdentifier::createSeriesSubObjectStub( ObjectType eSubObjectType , const rtl::OUString& rSeriesParticle , const rtl::OUString& rDragMethodServiceName @@ -1091,14 +1063,12 @@ OUString ObjectIdentifier::createSeriesSubObjectStub( ObjectType eSubObjectType , rDragMethodServiceName, rDragParameterString ); } -//static OUString ObjectIdentifier::createPointCID( const OUString& rPointCID_Stub, sal_Int32 nIndex ) { OUString aRet(rPointCID_Stub); return aRet+=OUString::valueOf( nIndex ); } -//static OUString ObjectIdentifier::getParticleID( const OUString& rCID ) { OUString aRet; @@ -1108,7 +1078,6 @@ OUString ObjectIdentifier::getParticleID( const OUString& rCID ) return aRet; } -//static OUString ObjectIdentifier::getFullParentParticle( const OUString& rCID ) { OUString aRet; @@ -1127,7 +1096,6 @@ OUString ObjectIdentifier::getFullParentParticle( const OUString& rCID ) return aRet; } -//static OUString ObjectIdentifier::getObjectID( const rtl::OUString& rCID ) { OUString aRet; @@ -1143,7 +1111,6 @@ OUString ObjectIdentifier::getObjectID( const rtl::OUString& rCID ) return aRet; } -//static bool ObjectIdentifier::isCID( const OUString& rName ) { return rName.getLength() && rName.match( m_aProtocol ); @@ -1157,7 +1124,6 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet( rObjectCID, Reference< frame::XModel >( xChartDocument, uno::UNO_QUERY )); } -//static Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet( const OUString& rObjectCID , const Reference< frame::XModel >& xChartModel ) @@ -1340,7 +1306,6 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet( return xObjectProperties; } -//static Reference< XAxis > ObjectIdentifier::getAxisForCID( const OUString& rObjectCID , const Reference< frame::XModel >& xChartModel ) @@ -1356,7 +1321,6 @@ Reference< XAxis > ObjectIdentifier::getAxisForCID( return AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys ); } -//static Reference< XDataSeries > ObjectIdentifier::getDataSeriesForCID( const OUString& rObjectCID , const Reference< frame::XModel >& xChartModel ) @@ -1383,7 +1347,6 @@ Reference< XDataSeries > ObjectIdentifier::getDataSeriesForCID( return xSeries; } -//static Reference< XDiagram > ObjectIdentifier::getDiagramForCID( const rtl::OUString& rObjectCID , const uno::Reference< frame::XModel >& xChartModel ) @@ -1415,7 +1378,6 @@ TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( const OUString& rC return eRet; } -// static OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID ) { sal_Int32 nDiagramIndex = -1; @@ -1430,7 +1392,6 @@ OUString ObjectIdentifier::getSeriesParticleFromCID( const OUString& rCID ) return ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex ); } -//static OUString ObjectIdentifier::getMovedSeriesCID( const ::rtl::OUString& rObjectCID, sal_Bool bForward ) { sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, C2U("CID/D=") ) ); diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx index 68e041e668ca..a3d43d2a3d03 100644..100755 --- a/chart2/source/tools/RegressionCurveCalculator.cxx +++ b/chart2/source/tools/RegressionCurveCalculator.cxx @@ -55,7 +55,6 @@ RegressionCurveCalculator::RegressionCurveCalculator() : RegressionCurveCalculator::~RegressionCurveCalculator() {} -// static bool RegressionCurveCalculator::isLinearScaling( const Reference< chart2::XScaling > & xScaling ) { @@ -67,7 +66,6 @@ bool RegressionCurveCalculator::isLinearScaling( return (xServiceName.is() && xServiceName->getServiceName().equals( aLinScalingServiceName )); } -// static bool RegressionCurveCalculator::isLogarithmicScaling( const Reference< chart2::XScaling > & xScaling ) { diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index b553dbc2d217..df9c4bdadd65 100644..100755 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -88,7 +88,6 @@ namespace chart { //............................................................................. -// static Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine( const Reference< XComponentContext > & xContext ) { @@ -96,7 +95,6 @@ Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine( new MeanValueRegressionCurve( xContext )); } -// static Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServiceName( const Reference< XComponentContext > & xContext, ::rtl::OUString aServiceName ) @@ -134,7 +132,6 @@ Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServ // ------------------------------------------------------------ -// static Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( ::rtl::OUString aServiceName ) { @@ -170,7 +167,6 @@ Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionC return xResult; } -// static void RegressionCurveHelper::initializeCurveCalculator( const Reference< XRegressionCurveCalculator > & xOutCurveCalculator, const Reference< data::XDataSource > & xSource, @@ -235,7 +231,6 @@ void RegressionCurveHelper::initializeCurveCalculator( xOutCurveCalculator->recalculateRegression( aXValues, aYValues ); } -// static void RegressionCurveHelper::initializeCurveCalculator( const Reference< XRegressionCurveCalculator > & xOutCurveCalculator, const Reference< XDataSeries > & xSeries, @@ -251,7 +246,6 @@ void RegressionCurveHelper::initializeCurveCalculator( // ---------------------------------------- -// static bool RegressionCurveHelper::hasMeanValueLine( const uno::Reference< XRegressionCurveContainer > & xRegCnt ) { @@ -276,7 +270,6 @@ bool RegressionCurveHelper::hasMeanValueLine( return false; } -// static bool RegressionCurveHelper::isMeanValueLine( const uno::Reference< chart2::XRegressionCurve > & xRegCurve ) { @@ -288,7 +281,6 @@ bool RegressionCurveHelper::isMeanValueLine( return false; } -// static uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getMeanValueLine( const uno::Reference< chart2::XRegressionCurveContainer > & xRegCnt ) @@ -314,7 +306,6 @@ uno::Reference< chart2::XRegressionCurve > return uno::Reference< chart2::XRegressionCurve >(); } -// static void RegressionCurveHelper::addMeanValueLine( uno::Reference< XRegressionCurveContainer > & xRegCnt, const uno::Reference< XComponentContext > & xContext, @@ -339,7 +330,6 @@ void RegressionCurveHelper::addMeanValueLine( } } -// static void RegressionCurveHelper::removeMeanValueLine( Reference< XRegressionCurveContainer > & xRegCnt ) { @@ -487,7 +477,6 @@ void RegressionCurveHelper::removeEquations( } } -// static void RegressionCurveHelper::replaceOrAddCurveAndReduceToOne( tRegressionType eType, uno::Reference< XRegressionCurveContainer > & xRegCnt, @@ -510,7 +499,6 @@ void RegressionCurveHelper::replaceOrAddCurveAndReduceToOne( } } -// static uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getFirstCurveNotMeanValueLine( const Reference< XRegressionCurveContainer > & xRegCnt ) { @@ -538,7 +526,6 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getFirstCurveN return NULL; } -// static RegressionCurveHelper::tRegressionType RegressionCurveHelper::getRegressionType( const Reference< XRegressionCurve > & xCurve ) { @@ -586,7 +573,6 @@ RegressionCurveHelper::tRegressionType RegressionCurveHelper::getRegressionType( return eResult; } -// static RegressionCurveHelper::tRegressionType RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( const Reference< XRegressionCurveContainer > & xRegCnt ) { @@ -650,7 +636,6 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR return aResult; } -// static ::std::vector< Reference< chart2::XRegressionCurve > > RegressionCurveHelper::getAllRegressionCurvesNotMeanValueLine( const Reference< chart2::XDiagram > & xDiagram ) @@ -676,7 +661,6 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR return aResult; } -// static void RegressionCurveHelper::resetEquationPosition( const Reference< chart2::XRegressionCurve > & xCurve ) { diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx index cf5be998308e..06e38dbd0f16 100644..100755 --- a/chart2/source/tools/RegressionCurveModel.cxx +++ b/chart2/source/tools/RegressionCurveModel.cxx @@ -63,37 +63,63 @@ static const OUString lcl_aImplementationName_Potential( static const OUString lcl_aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.RegressionCurve" )); -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticXXXDefaults_Initializer { - static uno::Sequence< Property > aPropSeq; + ::chart::tPropertyValueMap* operator()() + { + static ::chart::tPropertyValueMap aStaticDefaults; + lcl_AddDefaultsToMap( aStaticDefaults ); + return &aStaticDefaults; + } +private: + void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) + { + ::chart::LineProperties::AddDefaultsToMap( rOutMap ); + } +}; + +struct StaticXXXDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticXXXDefaults_Initializer > +{ +}; + +struct StaticRegressionCurveInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()() + { + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; + } - // /-- - 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; ::chart::LineProperties::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 StaticRegressionCurveInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionCurveInfoHelper_Initializer > +{ +}; -::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +struct StaticRegressionCurveInfo_Initializer { - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionCurveInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; - return aArrayHelper; -} +struct StaticRegressionCurveInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionCurveInfo_Initializer > +{ +}; } // anonymous namespace @@ -240,49 +266,23 @@ void RegressionCurveModel::fireModifyEvent() uno::Any RegressionCurveModel::GetDefaultValue( sal_Int32 nHandle ) const throw(beans::UnknownPropertyException) { - static tPropertyValueMap aStaticDefaults; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aStaticDefaults.size() ) - { - // initialize defaults - LineProperties::AddDefaultsToMap( aStaticDefaults ); - } - - tPropertyValueMap::const_iterator aFound( - aStaticDefaults.find( nHandle )); - - if( aFound == aStaticDefaults.end()) + const tPropertyValueMap& rStaticDefaults = *StaticXXXDefaults::get(); + tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) ); + if( aFound == rStaticDefaults.end() ) return uno::Any(); - return (*aFound).second; - // \-- } ::cppu::IPropertyArrayHelper & SAL_CALL RegressionCurveModel::getInfoHelper() { - return lcl_getInfoHelper(); + return *StaticRegressionCurveInfoHelper::get(); } - // ____ XPropertySet ____ -uno::Reference< beans::XPropertySetInfo > SAL_CALL - RegressionCurveModel::getPropertySetInfo() +uno::Reference< beans::XPropertySetInfo > SAL_CALL RegressionCurveModel::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo; - - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - getInfoHelper()); - } - - return xInfo; - // \-- + return *StaticRegressionCurveInfo::get(); } // ================================================================================ diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx index ea16e5b7702a..cc9156569a8f 100644..100755 --- a/chart2/source/tools/RegressionEquation.cxx +++ b/chart2/source/tools/RegressionEquation.cxx @@ -118,32 +118,51 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID )); } -void lcl_AddDefaultsToMap( - ::chart::tPropertyValueMap & rOutMap ) +struct StaticRegressionEquationDefaults_Initializer { - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW, false ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW_CORRELATION_COEFF, false ); -// ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SEPARATOR, ::rtl::OUString( sal_Unicode( '\n' ))); - - // override other defaults - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE ); - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE ); - - float fDefaultCharHeight = 10.0; - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); - ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); -} + ::chart::tPropertyValueMap* operator()() + { + static ::chart::tPropertyValueMap aStaticDefaults; + lcl_AddDefaultsToMap( aStaticDefaults ); + return &aStaticDefaults; + } +private: + void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) + { + ::chart::LineProperties::AddDefaultsToMap( rOutMap ); + ::chart::FillProperties::AddDefaultsToMap( rOutMap ); + ::chart::CharacterProperties::AddDefaultsToMap( rOutMap ); + + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW_CORRELATION_COEFF, false ); + //::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SEPARATOR, ::rtl::OUString( sal_Unicode( '\n' ))); + + // override other defaults + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE ); + + float fDefaultCharHeight = 10.0; + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight ); + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight ); + } +}; -const uno::Sequence< Property > & lcl_GetPropertySequence() +struct StaticRegressionEquationDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticRegressionEquationDefaults_Initializer > { - static uno::Sequence< Property > aPropSeq; +}; - // /-- - MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aPropSeq.getLength() ) +struct StaticRegressionEquationInfoHelper_Initializer +{ + ::cppu::OPropertyArrayHelper* operator()() + { + static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() ); + return &aPropHelper; + } + +private: + uno::Sequence< Property > lcl_GetPropertySequence() { - // get properties ::std::vector< ::com::sun::star::beans::Property > aProperties; lcl_AddPropertiesToVector( aProperties ); ::chart::LineProperties::AddPropertiesToVector( aProperties ); @@ -151,25 +170,31 @@ const uno::Sequence< Property > & lcl_GetPropertySequence() ::chart::CharacterProperties::AddPropertiesToVector( aProperties ); ::chart::UserDefinedProperties::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; -} +}; -::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +struct StaticRegressionEquationInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionEquationInfoHelper_Initializer > { - static ::cppu::OPropertyArrayHelper aArrayHelper( - lcl_GetPropertySequence(), - /* bSorted = */ sal_True ); +}; - return aArrayHelper; -} +struct StaticRegressionEquationInfo_Initializer +{ + uno::Reference< beans::XPropertySetInfo >* operator()() + { + static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionEquationInfoHelper::get() ) ); + return &xPropertySetInfo; + } +}; + +struct StaticRegressionEquationInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionEquationInfo_Initializer > +{ +}; } // anonymous namespace @@ -206,56 +231,25 @@ uno::Reference< util::XCloneable > SAL_CALL RegressionEquation::createClone() uno::Any RegressionEquation::GetDefaultValue( sal_Int32 nHandle ) const throw(beans::UnknownPropertyException) { - static tPropertyValueMap aStaticDefaults; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( 0 == aStaticDefaults.size() ) - { - // initialize defaults - LineProperties::AddDefaultsToMap( aStaticDefaults ); - FillProperties::AddDefaultsToMap( aStaticDefaults ); - CharacterProperties::AddDefaultsToMap( aStaticDefaults ); - - // overrides a line property - lcl_AddDefaultsToMap( aStaticDefaults ); - } - - tPropertyValueMap::const_iterator aFound( - aStaticDefaults.find( nHandle )); - - if( aFound == aStaticDefaults.end()) + const tPropertyValueMap& rStaticDefaults = *StaticRegressionEquationDefaults::get(); + tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) ); + if( aFound == rStaticDefaults.end() ) return uno::Any(); - return (*aFound).second; - // \-- } ::cppu::IPropertyArrayHelper & SAL_CALL RegressionEquation::getInfoHelper() { - return lcl_getInfoHelper(); + return *StaticRegressionEquationInfoHelper::get(); } // ____ XPropertySet ____ -Reference< beans::XPropertySetInfo > SAL_CALL - RegressionEquation::getPropertySetInfo() +Reference< beans::XPropertySetInfo > SAL_CALL RegressionEquation::getPropertySetInfo() throw (uno::RuntimeException) { - static Reference< beans::XPropertySetInfo > xInfo; - - // /-- - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !xInfo.is()) - { - xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( - lcl_getInfoHelper()); - } - - return xInfo; - // \-- + return *StaticRegressionEquationInfo::get(); } - // ____ XModifyBroadcaster ____ void SAL_CALL RegressionEquation::addModifyListener( const uno::Reference< util::XModifyListener >& aListener ) throw (uno::RuntimeException) diff --git a/chart2/source/tools/RelativePositionHelper.cxx b/chart2/source/tools/RelativePositionHelper.cxx index 4d566b1f7f48..45018b755f3b 100644..100755 --- a/chart2/source/tools/RelativePositionHelper.cxx +++ b/chart2/source/tools/RelativePositionHelper.cxx @@ -36,7 +36,6 @@ using namespace ::com::sun::star; namespace chart { -// static chart2::RelativePosition RelativePositionHelper::getReanchoredPosition( const chart2::RelativePosition & rPosition, const chart2::RelativeSize & rObjectSize, @@ -132,7 +131,6 @@ chart2::RelativePosition RelativePositionHelper::getReanchoredPosition( } -// static awt::Point RelativePositionHelper::getUpperLeftCornerOfAnchoredObject( awt::Point aPoint , awt::Size aObjectSize @@ -191,7 +189,6 @@ awt::Point RelativePositionHelper::getUpperLeftCornerOfAnchoredObject( return aResult; } -// static awt::Point RelativePositionHelper::getCenterOfAnchoredObject( awt::Point aPoint , awt::Size aUnrotatedObjectSize diff --git a/chart2/source/tools/RelativeSizeHelper.cxx b/chart2/source/tools/RelativeSizeHelper.cxx index d3da090ca397..3d1949da1732 100644..100755 --- a/chart2/source/tools/RelativeSizeHelper.cxx +++ b/chart2/source/tools/RelativeSizeHelper.cxx @@ -45,7 +45,6 @@ using ::rtl::OUString; namespace chart { -// static double RelativeSizeHelper::calculate( double fValue, const Size & rOldReferenceSize, @@ -61,7 +60,6 @@ double RelativeSizeHelper::calculate( * fValue; } -// static void RelativeSizeHelper::adaptFontSizes( const Reference< XPropertySet > & xTargetProperties, const Size & rOldReferenceSize, diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 721451c276da..8cec1321c579 100644..100755 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -181,7 +181,6 @@ void lcl_setXMLRangePropertyAtDataSequence( namespace chart { -// static double StatisticsHelper::getVariance( const Sequence< double > & rData, bool bUnbiasedEstimator /* = false */ ) @@ -190,7 +189,6 @@ double StatisticsHelper::getVariance( return lcl_getVariance( rData, nValCount, bUnbiasedEstimator ); } -// static double StatisticsHelper::getStandardDeviation( const Sequence< double > & rData ) { double fResult = getVariance( rData ); @@ -200,7 +198,6 @@ double StatisticsHelper::getStandardDeviation( const Sequence< double > & rData return fResult; } -// static double StatisticsHelper::getStandardError( const Sequence< double > & rData ) { sal_Int32 nValCount; @@ -221,7 +218,6 @@ double StatisticsHelper::getStandardError( const Sequence< double > & rData ) return fResult; } -// static Reference< chart2::data::XLabeledDataSequence > StatisticsHelper::getErrorLabeledDataSequenceFromDataSource( const Reference< chart2::data::XDataSource > & xDataSource, bool bPositiveValue, @@ -240,7 +236,6 @@ Reference< chart2::data::XLabeledDataSequence > StatisticsHelper::getErrorLabele return xResult; } -// static Reference< chart2::data::XDataSequence > StatisticsHelper::getErrorDataSequenceFromDataSource( const Reference< chart2::data::XDataSource > & xDataSource, bool bPositiveValue, @@ -256,7 +251,6 @@ Reference< chart2::data::XDataSequence > StatisticsHelper::getErrorDataSequenceF return xLSeq->getValues(); } -// static double StatisticsHelper::getErrorFromDataSource( const Reference< chart2::data::XDataSource > & xDataSource, sal_Int32 nIndex, @@ -286,7 +280,6 @@ double StatisticsHelper::getErrorFromDataSource( return fResult; } -// static void StatisticsHelper::setErrorDataSequence( const Reference< chart2::data::XDataSource > & xDataSource, const Reference< chart2::data::XDataProvider > & xDataProvider, @@ -318,7 +311,6 @@ void StatisticsHelper::setErrorDataSequence( } } -// static Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( const Reference< chart2::XDataSeries > & xDataSeries, const Reference< uno::XComponentContext > & xContext, @@ -348,7 +340,6 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( return xErrorBar; } -// static Reference< beans::XPropertySet > StatisticsHelper::getErrorBars( const Reference< chart2::XDataSeries > & xDataSeries, bool bYError /* = true */ ) @@ -363,7 +354,6 @@ Reference< beans::XPropertySet > StatisticsHelper::getErrorBars( return xErrorBar; } -// static bool StatisticsHelper::hasErrorBars( const Reference< chart2::XDataSeries > & xDataSeries, bool bYError /* = true */ ) @@ -376,7 +366,6 @@ bool StatisticsHelper::hasErrorBars( nStyle != ::com::sun::star::chart::ErrorBarStyle::NONE ); } -// static void StatisticsHelper::removeErrorBars( const Reference< chart2::XDataSeries > & xDataSeries, bool bYError /* = true */ ) @@ -387,7 +376,6 @@ void StatisticsHelper::removeErrorBars( ::com::sun::star::chart::ErrorBarStyle::NONE )); } -// static bool StatisticsHelper::usesErrorBarRanges( const Reference< chart2::XDataSeries > & xDataSeries, bool bYError /* = true */ ) diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx index 44ed73eade43..e6be4a7ce4e0 100644..100755 --- a/chart2/source/tools/ThreeDHelper.cxx +++ b/chart2/source/tools/ThreeDHelper.cxx @@ -1172,7 +1172,6 @@ void ThreeDHelper::setCameraDistance( } } -//static double ThreeDHelper::CameraDistanceToPerspective( double fCameraDistance ) { double fRet = fCameraDistance; @@ -1188,7 +1187,6 @@ double ThreeDHelper::CameraDistanceToPerspective( double fCameraDistance ) return fRet; } -//static double ThreeDHelper::PerspectiveToCameraDistance( double fPerspective ) { double fRet = fPerspective; @@ -1204,7 +1202,6 @@ double ThreeDHelper::PerspectiveToCameraDistance( double fPerspective ) return fRet; } -//static ThreeDLookScheme ThreeDHelper::detectScheme( const uno::Reference< XDiagram >& xDiagram ) { ThreeDLookScheme aScheme = ThreeDLookScheme_Unknown; @@ -1278,7 +1275,6 @@ void ThreeDHelper::setScheme( const uno::Reference< XDiagram >& xDiagram, ThreeD } -//static void ThreeDHelper::set3DSettingsToDefault( const uno::Reference< beans::XPropertySet >& xSceneProperties ) { Reference< beans::XPropertyState > xState( xSceneProperties, uno::UNO_QUERY ); @@ -1291,7 +1287,6 @@ void ThreeDHelper::set3DSettingsToDefault( const uno::Reference< beans::XPropert ThreeDHelper::setDefaultIllumination( xSceneProperties ); } -//static void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet >& xSceneProperties, bool bPieOrDonut ) { if( !xSceneProperties.is() ) @@ -1307,14 +1302,12 @@ void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet uno::makeAny( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation ))); } -//static void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet >& xSceneProperties ) { bool bPieOrDonut( DiagramHelper::isPieOrDonutChart( uno::Reference< XDiagram >(xSceneProperties, uno::UNO_QUERY) ) ); ThreeDHelper::setDefaultRotation( xSceneProperties, bPieOrDonut ); } -//static void ThreeDHelper::setDefaultIllumination( const uno::Reference< beans::XPropertySet >& xSceneProperties ) { if( !xSceneProperties.is() ) @@ -1341,7 +1334,6 @@ void ThreeDHelper::setDefaultIllumination( const uno::Reference< beans::XPropert lcl_setLightsForScheme( xSceneProperties, aScheme ); } -//static void ThreeDHelper::getRoundedEdgesAndObjectLines( const uno::Reference< XDiagram > & xDiagram , sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines ) @@ -1441,7 +1433,6 @@ void ThreeDHelper::getRoundedEdgesAndObjectLines( ASSERT_EXCEPTION( e ); } } -//static void ThreeDHelper::setRoundedEdgesAndObjectLines( const uno::Reference< XDiagram > & xDiagram , sal_Int32 nRoundedEdges, sal_Int32 nObjectLines ) @@ -1471,7 +1462,6 @@ void ThreeDHelper::setRoundedEdgesAndObjectLines( } } -//static CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( const Reference< beans::XPropertySet >& xSceneProperties ) { CuboidPlanePosition eRet(CuboidPlanePosition_Left); @@ -1488,7 +1478,6 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeft return eRet; } -//static CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( const Reference< beans::XPropertySet >& xSceneProperties ) { CuboidPlanePosition eRet(CuboidPlanePosition_Back); @@ -1505,7 +1494,6 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBack return eRet; } -//static CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( const Reference< beans::XPropertySet >& xSceneProperties ) { CuboidPlanePosition eRet(CuboidPlanePosition_Bottom); diff --git a/chart2/source/tools/WrappedIgnoreProperty.cxx b/chart2/source/tools/WrappedIgnoreProperty.cxx index aaa6c545a799..c98b80582616 100644..100755 --- a/chart2/source/tools/WrappedIgnoreProperty.cxx +++ b/chart2/source/tools/WrappedIgnoreProperty.cxx @@ -92,7 +92,6 @@ beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< b : beans::PropertyState_DIRECT_VALUE ); } -//static void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList ) { rList.push_back( new WrappedIgnoreProperty( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ) ) ); @@ -104,14 +103,12 @@ void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedPrope rList.push_back( new WrappedIgnoreProperty( C2U( "LineJoint" ), uno::makeAny( drawing::LineJoint_ROUND ) ) ); } -//static void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList ) { addIgnoreFillProperties_without_BitmapProperties( rList ); addIgnoreFillProperties_only_BitmapProperties( rList ); } -//static void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList ) { rList.push_back( new WrappedIgnoreProperty( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_SOLID ) ) ); @@ -126,7 +123,6 @@ void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( rList.push_back( new WrappedIgnoreProperty( C2U( "FillBackground" ), uno::makeAny( sal_Bool(sal_False) ) ) ); } -//static void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::std::vector< WrappedProperty* >& rList ) { // rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapName" ), uno::makeAny( ::rtl::OUString() ) ) ); diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx index 843aeb261a5f..9b752634a264 100644..100755 --- a/chart2/source/tools/WrappedPropertySet.cxx +++ b/chart2/source/tools/WrappedPropertySet.cxx @@ -66,8 +66,7 @@ Reference< beans::XPropertyState > WrappedPropertySet::getInnerPropertyState() void WrappedPropertySet::clearWrappedPropertySet() { - // /-- - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence //delete all wrapped properties if(m_pWrappedPropertyMap) @@ -84,22 +83,27 @@ void WrappedPropertySet::clearWrappedPropertySet() DELETEZ(m_pWrappedPropertyMap); m_xInfo = NULL; - // \-- } //XPropertySet Reference< beans::XPropertySetInfo > SAL_CALL WrappedPropertySet::getPropertySetInfo( ) throw (uno::RuntimeException) { - if( !m_xInfo.is() ) + Reference< beans::XPropertySetInfo > xInfo = m_xInfo; + if( !xInfo.is() ) { - // /-- - ::osl::MutexGuard aGuard( m_aMutex ); - if( !m_xInfo.is() ) + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence + xInfo = m_xInfo; + if( !xInfo.is() ) { - m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() ); + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() ); + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + m_xInfo = xInfo; } - // \-- + } + else + { + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); } return m_xInfo; } @@ -435,16 +439,21 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence ::cppu::IPropertyArrayHelper& WrappedPropertySet::getInfoHelper() { - if(!m_pPropertyArrayHelper) + ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper; + if(!p) { - // /-- - ::osl::MutexGuard aGuard( m_aMutex ); - if(!m_pPropertyArrayHelper) + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence + p = m_pPropertyArrayHelper; + if(!p) { - sal_Bool bSorted = sal_True; - m_pPropertyArrayHelper = new ::cppu::OPropertyArrayHelper( getPropertySequence(), bSorted ); + p = new ::cppu::OPropertyArrayHelper( getPropertySequence(), sal_True ); + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + m_pPropertyArrayHelper = p; } - // \-- + } + else + { + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); } return *m_pPropertyArrayHelper; } @@ -453,14 +462,15 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap() { - if(!m_pWrappedPropertyMap) + tWrappedPropertyMap* p = m_pWrappedPropertyMap; + if(!p) { - // /-- - ::osl::MutexGuard aGuard( m_aMutex ); - if(!m_pWrappedPropertyMap) + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence + p = m_pWrappedPropertyMap; + if(!p) { std::vector< WrappedProperty* > aPropList( createWrappedProperties() ); - m_pWrappedPropertyMap = new tWrappedPropertyMap(); + p = new tWrappedPropertyMap(); for( std::vector< WrappedProperty* >::const_iterator aIt = aPropList.begin(); aIt!=aPropList.end(); ++aIt ) { @@ -474,18 +484,24 @@ tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap() OSL_ENSURE( false, "missing property in property list" ); delete pProperty;//we are owner or the created WrappedProperties } - else if( m_pWrappedPropertyMap->find( nHandle ) != m_pWrappedPropertyMap->end() ) + else if( p->find( nHandle ) != p->end() ) { //duplicate Wrapped property OSL_ENSURE( false, "duplicate Wrapped property" ); delete pProperty;//we are owner or the created WrappedProperties } else - (*m_pWrappedPropertyMap)[ nHandle ] = pProperty; + (*p)[ nHandle ] = pProperty; } } + + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + m_pWrappedPropertyMap = p; } - // \-- + } + else + { + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); } return *m_pWrappedPropertyMap; } |