summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-01-06 11:11:47 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-01-06 11:11:47 +0100
commitfa663ff3fef9992ea327a571cdc123d23cf4b9da (patch)
tree94cb9e00b25076142efc24ecaa4842cc04b1c273
parente3c9000303f73558849a3e9b493b53ac67678f1f (diff)
parente0cef95bab1bd41fce1f08be9d6a2fed71f16944 (diff)
rebase to DEV300_m96
-rw-r--r--chart2/prj/build.lst3
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AreaWrapper.cxx30
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AxisWrapper.cxx29
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx26
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx74
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx27
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/GridWrapper.cxx30
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/LegendWrapper.cxx29
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx124
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx6
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/TitleWrapper.cxx28
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx126
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx5
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx28
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx18
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx1
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx19
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx4
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx10
-rw-r--r--chart2/source/controller/dialogs/dlg_DataSource.cxx1
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx1
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.cxx1
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx1
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.src4
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx1
-rw-r--r--chart2/source/controller/itemsetwrapper/ItemConverter.cxx1
-rw-r--r--chart2/source/controller/main/ChartController.cxx33
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx1
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx151
-rw-r--r--chart2/source/controller/main/ImplUndoManager.cxx2
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx2
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx7
-rw-r--r--chart2/source/controller/main/ShapeController.cxx21
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.cxx3
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.cxx9
-rw-r--r--chart2/source/controller/main/UndoManager.cxx2
-rw-r--r--chart2/source/controller/makefile.mk3
-rw-r--r--chart2/source/inc/OPropertySet.hxx33
-rw-r--r--chart2/source/model/inc/DataSeries.hxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Axis.cxx142
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/BaseCoordinateSystem.cxx99
-rwxr-xr-xchart2/source/model/main/ChartModel.cxx13
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/ChartModel.hxx19
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataPoint.cxx73
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataPoint.hxx7
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataSeries.cxx115
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Diagram.cxx114
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/FormattedString.cxx100
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/GridProperties.cxx105
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Legend.cxx123
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/PageBackground.cxx112
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/StockBar.cxx110
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Title.cxx144
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Wall.cxx112
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/AreaChartTypeTemplate.cxx101
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BarChartTypeTemplate.cxx103
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleChartType.cxx98
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleChartTypeTemplate.cxx99
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/CandleStickChartType.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ChartType.cxx57
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ChartTypeTemplate.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ColumnChartType.cxx108
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ColumnLineChartTypeTemplate.cxx101
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/DataInterpreter.cxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/LineChartType.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/LineChartTypeTemplate.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/NetChartType.cxx54
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/PieChartType.cxx101
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/PieChartTypeTemplate.cxx108
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ScatterChartType.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ScatterChartTypeTemplate.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/StockChartTypeTemplate.cxx106
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/_serviceregistration_charttypes.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/AxisHelper.cxx36
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/CharacterProperties.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartModelHelper.cxx7
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartTypeHelper.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartViewHelper.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ColorPerPointHelper.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/CommonConverters.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/DiagramHelper.cxx32
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ErrorBar.cxx114
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ExplicitCategoriesProvider.cxx6
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/FillProperties.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/InternalDataProvider.cxx6
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/LegendHelper.cxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/LineProperties.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedFillProperties.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedLineProperties.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedProperties.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ObjectIdentifier.cxx39
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveCalculator.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveHelper.cxx16
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveModel.cxx98
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionEquation.cxx132
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RelativePositionHelper.cxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RelativeSizeHelper.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/StatisticsHelper.cxx12
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ThreeDHelper.cxx12
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/WrappedIgnoreProperty.cxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/WrappedPropertySet.cxx64
-rw-r--r--chart2/source/view/axes/TickmarkHelper.cxx3
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx1
-rw-r--r--chart2/source/view/axes/VCartesianGrid.cxx1
-rw-r--r--chart2/source/view/axes/VCoordinateSystem.cxx1
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx1
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx1
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx3
-rw-r--r--chart2/source/view/main/ChartView.cxx6
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx2
-rw-r--r--chart2/source/view/main/LabelPositionHelper.cxx3
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx1
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx10
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx10
-rw-r--r--chart2/source/view/main/VLegend.cxx1
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx1
-rw-r--r--sc/inc/cellsuno.hxx7
-rw-r--r--sc/inc/document.hxx7
-rw-r--r--sc/inc/docuno.hxx1
-rw-r--r--sc/inc/viewuno.hxx3
-rw-r--r--sc/prj/build.lst2
-rw-r--r--sc/source/core/data/documen3.cxx8
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/tool/progress.cxx13
-rw-r--r--sc/source/filter/excel/excdoc.cxx2
-rw-r--r--sc/source/filter/excel/excel.cxx17
-rw-r--r--sc/source/filter/excel/excimp8.cxx5
-rw-r--r--sc/source/filter/excel/xeroot.cxx64
-rw-r--r--sc/source/filter/excel/xestream.cxx64
-rw-r--r--sc/source/filter/excel/xicontent.cxx2
-rw-r--r--sc/source/filter/excel/xiroot.cxx4
-rw-r--r--sc/source/filter/excel/xistream.cxx110
-rw-r--r--sc/source/filter/excel/xlroot.cxx6
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx34
-rw-r--r--sc/source/filter/inc/fapihelper.hxx7
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx6
-rw-r--r--sc/source/filter/inc/xeroot.hxx6
-rw-r--r--sc/source/filter/inc/xestream.hxx18
-rw-r--r--sc/source/filter/inc/xistream.hxx24
-rw-r--r--sc/source/filter/inc/xlroot.hxx5
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx33
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx16
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx26
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx20
-rw-r--r--sc/source/ui/app/transobj.cxx8
-rw-r--r--sc/source/ui/docshell/docfunc.cxx14
-rw-r--r--sc/source/ui/docshell/docsh.cxx27
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx2
-rw-r--r--sc/source/ui/inc/crdlg.hxx2
-rw-r--r--sc/source/ui/inc/delcldlg.hxx2
-rw-r--r--sc/source/ui/inc/delcodlg.hxx2
-rw-r--r--sc/source/ui/inc/docfunc.hxx3
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx2
-rw-r--r--sc/source/ui/inc/groupdlg.hxx2
-rw-r--r--sc/source/ui/inc/imoptdlg.hxx2
-rw-r--r--sc/source/ui/inc/inputhdl.hxx2
-rw-r--r--sc/source/ui/inc/inscldlg.hxx2
-rw-r--r--sc/source/ui/inc/inscodlg.hxx2
-rw-r--r--sc/source/ui/inc/mtrindlg.hxx2
-rw-r--r--sc/source/ui/inc/mvtabdlg.hxx2
-rw-r--r--sc/source/ui/inc/namecrea.hxx2
-rw-r--r--sc/source/ui/inc/namepast.hxx2
-rw-r--r--sc/source/ui/inc/scendlg.hxx2
-rw-r--r--sc/source/ui/inc/strindlg.hxx2
-rw-r--r--sc/source/ui/inc/tabbgcolordlg.hxx3
-rw-r--r--sc/source/ui/inc/tabview.hxx9
-rw-r--r--sc/source/ui/inc/tphf.hxx2
-rw-r--r--sc/source/ui/inc/transobj.hxx3
-rw-r--r--sc/source/ui/inc/ui_pch.hxx2
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx4
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx50
-rw-r--r--sc/source/ui/unoobj/docuno.cxx19
-rw-r--r--[-rwxr-xr-x]sc/source/ui/unoobj/scdetect.cxx14
-rw-r--r--sc/source/ui/unoobj/servuno.cxx8
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx7
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx79
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx73
-rw-r--r--sc/source/ui/vba/makefile.mk12
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx49
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx10
-rwxr-xr-xsc/source/ui/vba/vbaeventshelper.cxx237
-rwxr-xr-xsc/source/ui/vba/vbaeventshelper.hxx9
-rw-r--r--sc/source/ui/vba/vbanames.cxx5
-rwxr-xr-xsc/source/ui/vba/vbarange.cxx245
-rw-r--r--sc/source/ui/vba/vbarange.hxx24
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbasheetobject.cxx35
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx14
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx76
-rw-r--r--sc/source/ui/vba/vbaworkbooks.hxx5
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx66
-rw-r--r--sc/source/ui/vba/vbaworksheet.hxx5
-rw-r--r--sc/source/ui/view/prevwsh.cxx1
-rw-r--r--sc/source/ui/view/tabview3.cxx4
-rw-r--r--sc/source/ui/view/tabview5.cxx4
-rw-r--r--sc/source/ui/view/tabvwsh.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx9
-rw-r--r--sc/util/makefile.mk2
-rw-r--r--sc/workben/test.cxx2
-rw-r--r--scaddins/prj/build.lst2
-rw-r--r--sccomp/prj/build.lst2
211 files changed, 3248 insertions, 2987 deletions
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst
index 3cdc9a26e3f5..5526e2964680 100644
--- a/chart2/prj/build.lst
+++ b/chart2/prj/build.lst
@@ -1,4 +1,4 @@
-ch chart2 : l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 NULL
+ch chart2 : l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
ch chart2 usr1 - all ch_mkout NULL
ch chart2\inc nmake - all ch_inc NULL
ch chart2\source\inc get - all ch_source_inc NULL
@@ -24,3 +24,4 @@ ch chart2\source\controller\chartapiwrapper nmake - all ch_source_controlle
ch chart2\source\controller\main nmake - all ch_source_controller_main ch_inc NULL
ch chart2\source\controller\menus nmake - all ch_source_controller_menus ch_inc NULL
ch chart2\prj get - all ch_prj NULL
+ch chart2\qa\unoapi nmake - all ch_qa_unoapi NULL
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
index 2e1636b4406b..b4422c5442ec 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
@@ -57,31 +57,35 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Area" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAreaWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::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 );
}
+};
+
+struct StaticAreaWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAreaWrapperPropertyArray_Initializer >
+{
+};
+
- return aPropSeq;
-}
} // anonymous namespace
// --------------------------------------------------------------------------------
@@ -175,7 +179,7 @@ Reference< beans::XPropertySet > AreaWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AreaWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticAreaWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > AreaWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 6d53fb8b01f6..ebb9459e7d54 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -323,33 +323,35 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAxisWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( 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 StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -428,7 +430,6 @@ uno::Reference< util::XNumberFormats > SAL_CALL AxisWrapper::getNumberFormats()
return uno::Reference< util::XNumberFormats >();
}
-// static
void AxisWrapper::getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, sal_Bool& rbMainAxis )
{
switch( eType )
@@ -532,7 +533,7 @@ Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticAxisWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index d6487d425657..e8d91cd6c124 100644..100755
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -249,28 +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
@@ -1582,7 +1584,7 @@ Reference< beans::XPropertySet > ChartDocumentWrapper::getInnerPropertySet()
}
const Sequence< beans::Property >& ChartDocumentWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticChartDocumentWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index d69212512ebe..b79cab0930c6 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -173,44 +173,55 @@ void lcl_AddPropertiesToVector_SeriesOnly(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const uno::Sequence< Property > & lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
+uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
{
- static uno::Sequence< Property > aSeriesPropSeq;
- static uno::Sequence< Property > aPointPropSeq;
+ ::std::vector< ::com::sun::star::beans::Property > aProperties;
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- uno::Sequence< Property >& rPropSeq =
- (_eType == DataSeriesPointWrapper::DATA_SERIES) ? aSeriesPropSeq : aPointPropSeq;
- if( 0 == rPropSeq.getLength() )
+ lcl_AddPropertiesToVector_PointProperties( aProperties );
+ if( _eType == DataSeriesPointWrapper::DATA_SERIES )
{
- // get properties
- ::std::vector< ::com::sun::star::beans::Property > aProperties;
+ lcl_AddPropertiesToVector_SeriesOnly( aProperties );
+ WrappedStatisticProperties::addProperties( aProperties );
+ }
+ WrappedSymbolProperties::addProperties( aProperties ); //for series and points
+ WrappedDataCaptionProperties::addProperties( aProperties ); //for series and points
- lcl_AddPropertiesToVector_PointProperties( aProperties );
- if( _eType == DataSeriesPointWrapper::DATA_SERIES )
- {
- lcl_AddPropertiesToVector_SeriesOnly( aProperties );
- WrappedStatisticProperties::addProperties( aProperties );
- }
- WrappedSymbolProperties::addProperties( aProperties ); //for series and points
- WrappedDataCaptionProperties::addProperties( aProperties ); //for series and points
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
+ ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() );
- // and sort them for access via bsearch
- ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
+}
- // transfer result to static Sequence
- rPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+struct StaticSeriesWrapperPropertyArray_Initializer
+{
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_SERIES ) );
+ return &aPropSeq;
}
+};
- return rPropSeq;
-}
+struct StaticSeriesWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticSeriesWrapperPropertyArray_Initializer >
+{
+};
+
+struct StaticPointWrapperPropertyArray_Initializer
+{
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_POINT ) );
+ return &aPropSeq;
+ }
+};
+
+struct StaticPointWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticPointWrapperPropertyArray_Initializer >
+{
+};
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
@@ -706,7 +717,10 @@ Reference< beans::XPropertySet > DataSeriesPointWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DataSeriesPointWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence( m_eType );
+ if( m_eType == DATA_SERIES )
+ return *StaticSeriesWrapperPropertyArray::get();
+ else
+ return *StaticPointWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index c0be0ddcbf0d..c174614a0bf3 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -434,15 +434,17 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticDiagramWrapperPropertyArray_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 );
::chart::LineProperties::AddPropertiesToVector( aProperties );
@@ -456,16 +458,16 @@ const uno::Sequence< Property > & lcl_GetPropertySequence()
WrappedStockProperties::addProperties( aProperties );
WrappedAutomaticPositionProperties::addProperties( 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 StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer >
+{
+};
bool lcl_isXYChart( const Reference< chart2::XDiagram > xDiagram )
{
@@ -570,7 +572,6 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
}
typedef ::comphelper::MakeMap< ::rtl::OUString, ::rtl::OUString > tMakeStringStringMap;
-//static
const tMakeStringStringMap& lcl_getChartTypeNameMap()
{
static tMakeStringStringMap g_aChartTypeNameMap =
@@ -2085,7 +2086,7 @@ Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticDiagramWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index ff36c4cebcc7..6586511424db 100644..100755
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -59,30 +59,31 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Grid" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticGridWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
-
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedLineProperties::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;
-}
+struct StaticGridWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticGridWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -104,7 +105,6 @@ GridWrapper::GridWrapper(
GridWrapper::~GridWrapper()
{}
-// static
void GridWrapper::getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDimensionIndex, bool& rbSubGrid )
{
rnDimensionIndex = 1;
@@ -179,7 +179,7 @@ Reference< beans::XPropertySet > GridWrapper::getInnerPropertySet()
const Sequence< beans::Property >& GridWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticGridWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > GridWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index 02ffcb942c99..5b71c7d3e768 100644..100755
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -246,35 +246,38 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLegendWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( 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 );
}
+};
+
+struct StaticLegendWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticLegendWrapperPropertyArray_Initializer >
+{
+};
- return aPropSeq;
-}
} // anonymous namespace
// --------------------------------------------------------------------------------
@@ -418,7 +421,7 @@ Reference< beans::XPropertySet > LegendWrapper::getInnerPropertySet()
const Sequence< beans::Property >& LegendWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticLegendWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > LegendWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
index fdfc7c094aaf..2885a79afe6d 100644..100755
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
@@ -56,31 +56,79 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.ChartLine" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticMinMaxLineWrapperDefaults_Initializer
{
- static 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 StaticMinMaxLineWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticMinMaxLineWrapperDefaults_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperPropertyArray_Initializer
+{
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedLineProperties::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;
-}
+struct StaticMinMaxLineWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticMinMaxLineWrapperPropertyArray_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( *StaticMinMaxLineWrapperPropertyArray::get() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticMinMaxLineWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticMinMaxLineWrapperInfoHelper_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticMinMaxLineWrapperInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticMinMaxLineWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticMinMaxLineWrapperInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -94,7 +142,6 @@ namespace wrapper
MinMaxLineWrapper::MinMaxLineWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
: m_spChart2ModelContact( spChart2ModelContact )
, m_aEventListenerContainer( m_aMutex )
- , m_pPropertyArrayHelper()
, m_aWrappedLineJointProperty( C2U("LineJoint"), uno::makeAny( drawing::LineJoint_NONE ))
{
}
@@ -109,11 +156,6 @@ void SAL_CALL MinMaxLineWrapper::dispose()
{
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
-
- // /--
- MutexGuard aGuard( GetMutex());
- m_xInfo.clear();
- // \--
}
void SAL_CALL MinMaxLineWrapper::addEventListener(
@@ -132,34 +174,16 @@ void SAL_CALL MinMaxLineWrapper::removeEventListener(
::cppu::IPropertyArrayHelper& MinMaxLineWrapper::getInfoHelper()
{
- if(!m_pPropertyArrayHelper.get())
- {
- // /--
- ::osl::MutexGuard aGuard( GetMutex() );
- if(!m_pPropertyArrayHelper.get())
- {
- sal_Bool bSorted = sal_True;
- m_pPropertyArrayHelper = ::boost::shared_ptr< ::cppu::OPropertyArrayHelper >( new ::cppu::OPropertyArrayHelper( lcl_GetPropertySequence(), bSorted ) );
- }
- // \--
- }
- return *m_pPropertyArrayHelper.get();
+ return *StaticMinMaxLineWrapperInfoHelper::get();
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL MinMaxLineWrapper::getPropertySetInfo()
throw (uno::RuntimeException)
{
- if( !m_xInfo.is() )
- {
- // /--
- ::osl::MutexGuard aGuard( GetMutex() );
- if( !m_xInfo.is() )
- m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
- // \--
- }
- return m_xInfo;
+ return *StaticMinMaxLineWrapperInfo::get();
}
+
void SAL_CALL MinMaxLineWrapper::setPropertyValue( const ::rtl::OUString& rPropertyName, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -355,26 +379,14 @@ void SAL_CALL MinMaxLineWrapper::setPropertyToDefault( const ::rtl::OUString& rP
{
this->setPropertyValue( rPropertyName, this->getPropertyDefault(rPropertyName) );
}
+
uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const ::rtl::OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticMinMaxLineWrapperDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( getInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
@@ -383,7 +395,7 @@ uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const ::rtl::OUString&
void SAL_CALL MinMaxLineWrapper::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- const Sequence< beans::Property >& rPropSeq = lcl_GetPropertySequence();
+ const Sequence< beans::Property >& rPropSeq = *StaticMinMaxLineWrapperPropertyArray::get();
for(sal_Int32 nN=0; nN<rPropSeq.getLength(); nN++)
{
::rtl::OUString aPropertyName( rPropSeq[nN].Name );
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
index 449a1f550860..31a67b600536 100644..100755
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
@@ -123,12 +123,6 @@ private: //member
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySetInfo >
- m_xInfo;//outer PropertySetInfo
-
- ::boost::shared_ptr< ::cppu::OPropertyArrayHelper > m_pPropertyArrayHelper;
-
WrappedIgnoreProperty m_aWrappedLineJointProperty;
};
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 20785faa8b66..9a2183f089fe 100644..100755
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -182,35 +182,37 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticTitleWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( 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 StaticTitleWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticTitleWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -526,7 +528,7 @@ Reference< beans::XPropertySet > TitleWrapper::getInnerPropertySet()
const Sequence< beans::Property >& TitleWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticTitleWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index 338131c4f973..16f576453869 100644..100755
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -57,32 +57,81 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.ChartArea" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticUpDownBarWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::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;
-}
+struct StaticUpDownBarWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticUpDownBarWrapperPropertyArray_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( *StaticUpDownBarWrapperPropertyArray::get() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticUpDownBarWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticUpDownBarWrapperInfoHelper_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticUpDownBarWrapperInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticUpDownBarWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticUpDownBarWrapperInfo_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperDefaults_Initializer
+{
+ ::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 );
+ }
+};
+
+struct StaticUpDownBarWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticUpDownBarWrapperDefaults_Initializer >
+{
+};
} // anonymous namespace
@@ -98,8 +147,6 @@ UpDownBarWrapper::UpDownBarWrapper(
: m_spChart2ModelContact( spChart2ModelContact )
, m_aEventListenerContainer( m_aMutex )
, m_aPropertySetName( bUp ? C2U("WhiteDay") : C2U("BlackDay") )
- , m_xInfo(0)
- , m_pPropertyArrayHelper()
{
}
@@ -113,11 +160,6 @@ void SAL_CALL UpDownBarWrapper::dispose()
{
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
-
- // /--
- MutexGuard aGuard( GetMutex());
- m_xInfo.clear();
- // \--
}
void SAL_CALL UpDownBarWrapper::addEventListener(
@@ -136,33 +178,14 @@ void SAL_CALL UpDownBarWrapper::removeEventListener(
::cppu::IPropertyArrayHelper& UpDownBarWrapper::getInfoHelper()
{
- if(!m_pPropertyArrayHelper.get())
- {
- // /--
- ::osl::MutexGuard aGuard( GetMutex() );
- if(!m_pPropertyArrayHelper.get())
- {
- sal_Bool bSorted = sal_True;
- m_pPropertyArrayHelper = ::boost::shared_ptr< ::cppu::OPropertyArrayHelper >( new ::cppu::OPropertyArrayHelper( lcl_GetPropertySequence(), bSorted ) );
- }
- // \--
- }
- return *m_pPropertyArrayHelper.get();
+ return *StaticUpDownBarWrapperInfoHelper::get();
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL UpDownBarWrapper::getPropertySetInfo()
throw (uno::RuntimeException)
{
- if( !m_xInfo.is() )
- {
- // /--
- ::osl::MutexGuard aGuard( GetMutex() );
- if( !m_xInfo.is() )
- m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
- // \--
- }
- return m_xInfo;
+ return *StaticUpDownBarWrapperInfo::get();
}
void SAL_CALL UpDownBarWrapper::setPropertyValue( const ::rtl::OUString& rPropertyName, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
@@ -320,27 +343,14 @@ void SAL_CALL UpDownBarWrapper::setPropertyToDefault( const ::rtl::OUString& rPr
{
this->setPropertyValue( rPropertyName, this->getPropertyDefault(rPropertyName) );
}
+
uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const ::rtl::OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticUpDownBarWrapperDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( getInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
@@ -349,7 +359,7 @@ uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const ::rtl::OUString& r
void SAL_CALL UpDownBarWrapper::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- const Sequence< beans::Property >& rPropSeq = lcl_GetPropertySequence();
+ const Sequence< beans::Property >& rPropSeq = *StaticUpDownBarWrapperPropertyArray::get();
for(sal_Int32 nN=0; nN<rPropSeq.getLength(); nN++)
{
::rtl::OUString aPropertyName( rPropSeq[nN].Name );
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index 5b028a6acc66..f271bcbf2bb5 100644..100755
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -123,11 +123,6 @@ private: //member
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
rtl::OUString m_aPropertySetName;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySetInfo >
- m_xInfo;//outer PropertySetInfo
- ::boost::shared_ptr< ::cppu::OPropertyArrayHelper > m_pPropertyArrayHelper;
-
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index a43bc610fc0c..be485f86aac4 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -59,31 +59,33 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.WallOrFloor" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticWallFloorWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
+ //::chart::NamedProperties::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;
-}
+struct StaticWallFloorWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticWallFloorWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -155,7 +157,7 @@ Reference< beans::XPropertySet > WallFloorWrapper::getInnerPropertySet()
const Sequence< beans::Property >& WallFloorWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticWallFloorWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > WallFloorWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
index 15ae48bc22dd..925b9694ba5f 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
@@ -131,7 +131,6 @@ void lcl_addWrappedProperties( std::vector< WrappedProperty* >& rList )
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedAutomaticPositionProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -145,7 +144,6 @@ void WrappedAutomaticPositionProperties::addProperties( ::std::vector< Property
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedAutomaticPositionProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList )
{
lcl_addWrappedProperties( rList );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
index 0c4a98263a04..11e49850b694 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
@@ -69,7 +69,6 @@ private: //member
sal_Int32 m_nDimensionIndex;
};
-//static
void WrappedAxisAndGridExistenceProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -239,7 +238,6 @@ private: //member
TitleHelper::eTitleType m_eTitleType;
};
-//static
void WrappedAxisTitleExistenceProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -359,7 +357,6 @@ private: //member
sal_Int32 m_nDimensionIndex;
};
-//static
void WrappedAxisLabelExistenceProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
index 5fca42c2b3ad..bd7c49052804 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
@@ -62,7 +62,6 @@ WrappedCharacterHeightProperty_Base::~WrappedCharacterHeightProperty_Base()
{
}
-//static
void WrappedCharacterHeightProperty::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ReferenceSizePropertyProvider* pRefSizePropProvider )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
index bc91136590cb..902938f04a78 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
@@ -119,7 +119,6 @@ void lcl_addWrappedProperties( std::vector< WrappedProperty* >& rList
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedDataCaptionProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -133,7 +132,6 @@ void WrappedDataCaptionProperties::addProperties( ::std::vector< Property > & rO
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedDataCaptionProperties::addWrappedPropertiesForSeries( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -143,7 +141,6 @@ void WrappedDataCaptionProperties::addWrappedPropertiesForSeries( std::vector< W
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedDataCaptionProperties::addWrappedPropertiesForDiagram( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index b0fc030d0fbf..a89ca372d9ee 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -107,7 +107,6 @@ WrappedScaleProperty::~WrappedScaleProperty()
{
}
-//static
void WrappedScaleProperty::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
index 5e11a3012cf3..2249ac1c41c3 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
@@ -141,7 +141,6 @@ enum
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedScaleTextProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -155,7 +154,6 @@ void WrappedScaleTextProperties::addProperties( ::std::vector< Property > & rOut
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedScaleTextProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
index 68d408ea7147..79c09b8b41b0 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
@@ -46,7 +46,6 @@ namespace chart
namespace wrapper
{
-//static
void WrappedSceneProperty::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index 16ddb1137d4a..6890e06a1641 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -197,7 +197,6 @@ enum
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedSplineProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -226,12 +225,11 @@ void WrappedSplineProperties::addProperties( ::std::vector< Property > & rOutPro
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedSplineProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
rList.push_back( new WrappedSplineTypeProperty( spChart2ModelContact ) );
- rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineOrder"), C2U("SplineOrder"), uno::makeAny(sal_Int32(2)), spChart2ModelContact ) );
+ rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineOrder"), C2U("SplineOrder"), uno::makeAny(sal_Int32(3)), spChart2ModelContact ) );
rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineResolution"), C2U("CurveResolution"), uno::makeAny(sal_Int32(20)), spChart2ModelContact ) );
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index 1c7b495bd566..145e3423ccd8 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -1032,7 +1032,6 @@ void lcl_addWrappedProperties( std::vector< WrappedProperty* >& rList
}//anonymous namespace
-//static
void WrappedStatisticProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -1128,7 +1127,6 @@ void WrappedStatisticProperties::addProperties( ::std::vector< Property > & rOut
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedStatisticProperties::addWrappedPropertiesForSeries( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -1138,7 +1136,6 @@ void WrappedStatisticProperties::addWrappedPropertiesForSeries( std::vector< Wra
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedStatisticProperties::addWrappedPropertiesForDiagram( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
index 3ecb23ce84d2..37db09b977b6 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
@@ -291,7 +291,6 @@ enum
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedStockProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -313,7 +312,6 @@ void WrappedStockProperties::addProperties( ::std::vector< Property > & rOutProp
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedStockProperties::addWrappedProperties( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index 4ca8f7161f6e..068f65f415be 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -201,7 +201,6 @@ void lcl_addWrappedProperties( std::vector< WrappedProperty* >& rList
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedSymbolProperties::addProperties( ::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
@@ -236,7 +235,6 @@ void WrappedSymbolProperties::addProperties( ::std::vector< Property > & rOutPro
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedSymbolProperties::addWrappedPropertiesForSeries( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -246,7 +244,6 @@ void WrappedSymbolProperties::addWrappedPropertiesForSeries( std::vector< Wrappe
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void WrappedSymbolProperties::addWrappedPropertiesForDiagram( std::vector< WrappedProperty* >& rList
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
@@ -573,8 +570,19 @@ void WrappedSymbolAndLinesProperty::setValueToSeries(
if(!xSeriesPropertySet.is())
return;
- drawing::LineStyle eLineStyle( bDrawLines ? drawing::LineStyle_SOLID : drawing::LineStyle_NONE );
- xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( eLineStyle ) );
+ drawing::LineStyle eOldLineStyle( drawing::LineStyle_SOLID );
+ xSeriesPropertySet->getPropertyValue( C2U("LineStyle") ) >>= eOldLineStyle;
+ if( bDrawLines )
+ {
+ //#i114298# don't overwrite dashed lines with solid lines here
+ if( eOldLineStyle == drawing::LineStyle_NONE )
+ xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( drawing::LineStyle_SOLID ) );
+ }
+ else
+ {
+ if( eOldLineStyle != drawing::LineStyle_NONE )
+ xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( drawing::LineStyle_NONE ) );
+ }
}
beans::PropertyState WrappedSymbolAndLinesProperty::getPropertyState( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 513d49b6aad8..fedcfaffebc4 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -387,7 +387,6 @@ bool SeriesHeader::HasFocus() const
return m_spSeriesName->HasFocus();
}
-// static
Image SeriesHeader::GetChartTypeImage(
const Reference< chart2::XChartType > & xChartType,
bool bSwapXAndYAxis,
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index f32a882aa1e9..eedd2e3c6ba9 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -381,7 +381,6 @@ DialogModel::DialogModel(
m_xContext( xContext ),
m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) )
{
- createBackup();
}
DialogModel::~DialogModel()
@@ -724,20 +723,16 @@ bool DialogModel::setData(
return true;
}
-// static
OUString DialogModel::ConvertRoleFromInternalToUI( const OUString & rRoleString )
{
return lcl_ConvertRole( rRoleString, true );
}
-// static
OUString DialogModel::GetRoleDataLabel()
{
return OUString( String( ::chart::SchResId( STR_OBJECT_DATALABELS )));
}
-// static
-
sal_Int32 DialogModel::GetRoleIndexForSorting( const ::rtl::OUString & rInternalRoleString )
{
static lcl_tRoleIndexMap aRoleIndexMap;
@@ -754,20 +749,6 @@ sal_Int32 DialogModel::GetRoleIndexForSorting( const ::rtl::OUString & rInternal
// private methods
-void DialogModel::createBackup()
-{
- OSL_ENSURE( ! m_xBackupChartDocument.is(), "Cloning already cloned model" );
- try
- {
- Reference< util::XCloneable > xCloneable( m_xChartDocument, uno::UNO_QUERY_THROW );
- m_xBackupChartDocument.set( xCloneable->createClone(), uno::UNO_QUERY_THROW );
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-}
-
void DialogModel::applyInterpretedData(
const InterpretedData & rNewData,
const ::std::vector< Reference< XDataSeries > > & rSeriesToReUse,
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index dcca6c716b8d..b7f882611e47 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -163,10 +163,6 @@ private:
m_xChartDocument;
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument >
- m_xBackupChartDocument;
-
- ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartTypeTemplate >
m_xTemplate;
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 0836ab9ca93a..9057b850332f 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -332,7 +332,7 @@ rtl::OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural
}
return aRet;
}
-//static
+
rtl::OUString ObjectNameProvider::getAxisName( const rtl::OUString& rObjectCID
, const uno::Reference< frame::XModel >& xChartModel )
{
@@ -373,7 +373,6 @@ rtl::OUString ObjectNameProvider::getAxisName( const rtl::OUString& rObjectCID
return aRet;
}
-//static
OUString ObjectNameProvider::getTitleNameByType( TitleHelper::eTitleType eType )
{
OUString aRet;
@@ -412,7 +411,6 @@ OUString ObjectNameProvider::getTitleNameByType( TitleHelper::eTitleType eType )
return aRet;
}
-//static
OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
, const Reference< frame::XModel >& xChartModel )
{
@@ -432,7 +430,6 @@ OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
return aRet;
}
-//static
rtl::OUString ObjectNameProvider::getGridName( const rtl::OUString& rObjectCID
, const uno::Reference< frame::XModel >& xChartModel )
{
@@ -709,7 +706,6 @@ rtl::OUString ObjectNameProvider::getHelpText( const rtl::OUString& rObjectCID,
return aRet;
}
-// static
rtl::OUString ObjectNameProvider::getSelectedObjectText( const rtl::OUString & rObjectCID, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDocument )
{
rtl::OUString aRet;
@@ -762,8 +758,6 @@ rtl::OUString ObjectNameProvider::getSelectedObjectText( const rtl::OUString & r
return aRet;
}
-
-// static
rtl::OUString ObjectNameProvider::getNameForCID(
const rtl::OUString& rObjectCID,
const uno::Reference< chart2::XChartDocument >& xChartDocument )
@@ -820,7 +814,6 @@ rtl::OUString ObjectNameProvider::getNameForCID(
return getName( eType );
}
-//static
rtl::OUString ObjectNameProvider::getName_ObjectForSeries(
ObjectType eObjectType,
const rtl::OUString& rSeriesCID,
@@ -839,7 +832,6 @@ rtl::OUString ObjectNameProvider::getName_ObjectForSeries(
return ObjectNameProvider::getName_ObjectForAllSeries( eObjectType );
}
-//static
rtl::OUString ObjectNameProvider::getName_ObjectForAllSeries( ObjectType eObjectType )
{
OUString aRet = String(SchResId(STR_OBJECT_FOR_ALL_SERIES));
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index 9469293ae1c5..3e4cba6b23ad 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -146,7 +146,6 @@ void DataSourceTabControl::EnableTabToggling()
// ----------------------------------------
-// static
USHORT DataSourceDialog::m_nLastPageId = 0;
DataSourceDialog::DataSourceDialog(
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index 9c4438b6f1ca..50aa10ec6e6b 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -95,7 +95,6 @@ void InsertErrorBarsDialog::SetAxisMinorStepWidthForErrorBarDecimals( double fMi
m_apErrorBarResources->SetAxisMinorStepWidthForErrorBarDecimals( fMinorStepWidth );
}
-//static
double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals(
const Reference< frame::XModel >& xChartModel,
const Reference< uno::XInterface >& xChartView,
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index bf0dedfbc6e8..d7491156358e 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -67,7 +67,6 @@ NumberFormatDialog::~NumberFormatDialog()
{
}
-//static
SfxItemSet NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( SfxItemPool& rItemPool )
{
static const USHORT nWhichPairs[] =
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 26a726ac5156..3c868f6aeaff 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -57,7 +57,6 @@ using namespace ::com::sun::star::chart2;
//-------------------------------------------------------------------
//-------------------------------------------------------------------
-// static
USHORT View3DDialog::m_nLastPageId = 0;
View3DDialog::View3DDialog(Window* pParent, const uno::Reference< frame::XModel > & xChartModel, XColorTable* pColorTable )
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src
index 615e81c2c550..0f8f12c3e48b 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.src
+++ b/chart2/source/controller/dialogs/tp_DataLabel.src
@@ -28,10 +28,6 @@
#include "TabPages.hrc"
#include "res_DataLabel.hrc"
-#ifndef _GLOBLMN_HRC
-#include <svx/globlmn.hrc>
-#endif
-
TabPage TP_DATA_DESCR
{
Hide = TRUE ;
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 48c96a715c5f..9da7f7536d28 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -424,7 +424,6 @@ void DrawViewWrapper::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
}
}
-//static
SdrObject* DrawViewWrapper::getSdrObject( const uno::Reference<
drawing::XShape >& xShape )
{
diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
index 5ee167260974..5754559ce8ae 100644
--- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
@@ -239,7 +239,6 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
// --------------------------------------------------------------------------------
-//static
void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItemSet &rSourceSet )
{
SfxWhichIter aIter (rSourceSet);
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index bf8afc65e78f..675bcf40e7a2 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -475,6 +475,7 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
if( rEvent.NewMode.equals(C2U("dirty")) )
{
//the view has become dirty, we should repaint it if we have a window
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
m_pChartWindow->ForceInvalidate();
}
@@ -518,8 +519,11 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
impl_initializeAccessible();
- if( m_pChartWindow )
- m_pChartWindow->Invalidate();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ m_pChartWindow->Invalidate();
+ }
}
m_bConnectingToView = false;
@@ -537,10 +541,10 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
//is called to attach the controller to a new model.
//return true if attach was successfully, false otherwise (e.g. if you do not work with a model)
- ::vos::OClearableGuard aGuard( Application::GetSolarMutex());
+ ::vos::OClearableGuard aClearableGuard( Application::GetSolarMutex());
if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
return sal_False; //behave passive if already disposed or suspended
- aGuard.clear();
+ aClearableGuard.clear();
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);
@@ -612,8 +616,11 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
}
//the frameloader is responsible to call xModel->connectController
- if( m_pChartWindow )
- m_pChartWindow->Invalidate();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ m_pChartWindow->Invalidate();
+ }
uno::Reference< chart2::XUndoSupplier > xUndoSupplier( getModel(), uno::UNO_QUERY );
if( xUndoSupplier.is())
@@ -1106,6 +1113,7 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
else if(aCommand.equals("Update")) //Update Chart
{
ChartViewHelper::setViewToDirtyState( getModel() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
m_pChartWindow->Invalidate();
}
@@ -1491,6 +1499,7 @@ uno::Reference< XAccessible > ChartController::CreateAccessible()
void ChartController::impl_invalidateAccessible()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Reference< lang::XInitialization > xInit( m_pChartWindow->GetAccessible(false), uno::UNO_QUERY );
@@ -1503,6 +1512,7 @@ void ChartController::impl_invalidateAccessible()
}
void ChartController::impl_initializeAccessible()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
this->impl_initializeAccessible( Reference< lang::XInitialization >( m_pChartWindow->GetAccessible(false), uno::UNO_QUERY ) );
}
@@ -1517,11 +1527,14 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
aArguments[1]=uno::makeAny(xModel);
aArguments[2]=uno::makeAny(m_xChartView);
uno::Reference< XAccessible > xParent;
- if( m_pChartWindow )
{
- Window* pParentWin( m_pChartWindow->GetAccessibleParentWindow());
- if( pParentWin )
- xParent.set( pParentWin->GetAccessible());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ {
+ Window* pParentWin( m_pChartWindow->GetAccessibleParentWindow());
+ if( pParentWin )
+ xParent.set( pParentWin->GetAccessible());
+ }
}
aArguments[3]=uno::makeAny(xParent);
aArguments[4]=uno::makeAny(m_xViewWindow);
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index a6e82430d8f6..6091fd8ef3f8 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -76,6 +76,7 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
{
//the first marked object will be edited
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
SdrObject* pTextObj = m_pDrawViewWrapper->getTextEditObject();
if(!pTextObj)
return;
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 779e3c32f1e7..735cb9634671 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -297,6 +297,7 @@ void ChartController::executeDispatch_ScaleText()
void ChartController::executeDispatch_Paste()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Graphic aGraphic;
@@ -581,7 +582,6 @@ void ChartController::executeDispatch_Cut()
executeDispatch_Delete();
}
-//static
bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
{
ObjectIdentifier aSelOID( rSelection );
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 56908ac4ef79..885e37126dc2 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -243,12 +243,12 @@ const short HITPIX=2; //hit-tolerance in pixel
, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
throw (uno::RuntimeException)
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
- Window* pWindow = m_pChartWindow;
- if(xWindow.is() && pWindow)
+ if(xWindow.is() && m_pChartWindow)
{
- Size aLogicSize = pWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) );
+ Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) );
bool bIsEmbedded = true;
//todo: for standalone chart: detect wether we are standalone
@@ -263,8 +263,8 @@ const short HITPIX=2; //hit-tolerance in pixel
MapMode aNewMapMode( MAP_100TH_MM, Point(0,0)
, Fraction(nScaleXNumerator,nScaleXDenominator)
, Fraction(nScaleYNumerator,nScaleYDenominator) );
- pWindow->SetMapMode(aNewMapMode);
- pWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
+ m_pChartWindow->SetMapMode(aNewMapMode);
+ m_pChartWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
//#i75867# poor quality of ole's alternative view with 3D scenes and zoomfactors besides 100%
uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
@@ -285,7 +285,7 @@ const short HITPIX=2; //hit-tolerance in pixel
//a correct work area is at least necessary for correct values in the position and size dialog and for dragging area
if(m_pDrawViewWrapper)
{
- Rectangle aRect(Point(0,0), pWindow->GetOutputSize());
+ Rectangle aRect(Point(0,0), m_pChartWindow->GetOutputSize());
m_pDrawViewWrapper->SetWorkArea( aRect );
}
}
@@ -293,9 +293,9 @@ const short HITPIX=2; //hit-tolerance in pixel
{
//change visarea
ChartModelHelper::setPageSize( awt::Size( aLogicSize.Width(), aLogicSize.Height() ), getModel() );
- pWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
+ m_pChartWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
}
- pWindow->Invalidate();
+ m_pChartWindow->Invalidate();
}
}
@@ -533,12 +533,11 @@ void ChartController::execute_Paint( const Rectangle& rRect )
if( xUpdatable.is() )
xUpdatable->update();
- Window* pWindow = m_pChartWindow;
{
::vos::OGuard aGuard( Application::GetSolarMutex());
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
if(pDrawViewWrapper)
- pDrawViewWrapper->CompleteRedraw(pWindow, Region(rRect) );
+ pDrawViewWrapper->CompleteRedraw(m_pChartWindow, Region(rRect) );
}
}
catch( uno::Exception & ex )
@@ -562,6 +561,8 @@ bool isDoubleClick( const MouseEvent& rMEvt )
void ChartController::startDoubleClickWaiting()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
m_bWaitingForDoubleClick = true;
ULONG nDblClkTime = 500;
@@ -587,6 +588,7 @@ IMPL_LINK( ChartController, DoubleClickWaitingHdl, void*, EMPTYARG )
if( !m_bWaitingForMouseUp && m_aSelection.maybeSwitchSelectionAfterSingleClickWasEnsured() )
{
this->impl_selectObjectAndNotiy();
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Window::PointerState aPointerState( m_pChartWindow->GetPointerState() );
@@ -615,17 +617,16 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
m_aSelection.remindSelectionBeforeMouseDown();
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper )
+ if(!m_pChartWindow || !pDrawViewWrapper )
return;
- Point aMPos = pWindow->PixelToLogic(rMEvt.GetPosPixel());
+ Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
if ( MOUSE_LEFT == rMEvt.GetButtons() )
{
- pWindow->GrabFocus();
- pWindow->CaptureMouse();
+ m_pChartWindow->GrabFocus();
+ m_pChartWindow->CaptureMouse();
}
if( pDrawViewWrapper->IsTextEdit() )
@@ -710,7 +711,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
&& !rMEvt.IsRight() )
{
//start drag
- USHORT nDrgLog = (USHORT)pWindow->PixelToLogic(Size(DRGPIX,0)).Width();
+ USHORT nDrgLog = (USHORT)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width();
SdrDragMethod* pDragMethod = NULL;
//change selection to 3D scene if rotate mode
@@ -750,9 +751,8 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
{
::vos::OGuard aGuard( Application::GetSolarMutex());
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
if( m_pDrawViewWrapper->IsTextEdit() )
@@ -763,7 +763,7 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
if(pDrawViewWrapper->IsAction())
{
- pDrawViewWrapper->MovAction( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ pDrawViewWrapper->MovAction( m_pChartWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
}
//?? pDrawViewWrapper->GetPageView()->DragPoly();
@@ -785,12 +785,11 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{
::vos::OGuard aGuard( Application::GetSolarMutex());
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
- Point aMPos = pWindow->PixelToLogic(rMEvt.GetPosPixel());
+ Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
if(pDrawViewWrapper->IsTextEdit())
{
@@ -920,7 +919,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
}
//@todo ForcePointer(&rMEvt);
- pWindow->ReleaseMouse();
+ m_pChartWindow->ReleaseMouse();
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
bNotifySelectionChange = true;
@@ -969,7 +968,9 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel )
void ChartController::execute_Resize()
{
- m_pChartWindow->Invalidate();
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ m_pChartWindow->Invalidate();
}
void ChartController::execute_Activate()
{
@@ -992,13 +993,11 @@ void ChartController::execute_LoseFocus()
void ChartController::execute_Command( const CommandEvent& rCEvt )
{
- Window* pWindow = m_pChartWindow;
-
bool bIsAction = false;
{
::vos::OGuard aGuard( Application::GetSolarMutex());
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
bIsAction = m_pDrawViewWrapper->IsAction();
}
@@ -1006,7 +1005,11 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
// pop-up menu
if(rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !bIsAction)
{
- m_pChartWindow->ReleaseMouse();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ m_pChartWindow->ReleaseMouse();
+ }
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
impl_notifySelectionChangeListeners();
@@ -1020,7 +1023,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
Point aPos( rCEvt.GetMousePosPixel() );
if( !rCEvt.IsMouseEvent() )
{
- aPos = m_pChartWindow->GetPointerState().maPos;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ aPos = m_pChartWindow->GetPointerState().maPos;
}
aContextMenuHelper.completeAndExecute( aPos, aContextMenu );
}
@@ -1290,7 +1295,11 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
Point aPos( rCEvt.GetMousePosPixel() );
if( !rCEvt.IsMouseEvent() )
- aPos = m_pChartWindow->GetPointerState().maPos;
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ aPos = m_pChartWindow->GetPointerState().maPos;
+ }
aContextMenuHelper.completeAndExecute( aPos, xPopupMenu );
}
}
@@ -1301,6 +1310,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
( rCEvt.GetCommand() == COMMAND_INPUTCONTEXTCHANGE ) )
{
//#i84417# enable editing with IME
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pDrawViewWrapper )
m_pDrawViewWrapper->Command( rCEvt, m_pChartWindow );
}
@@ -1310,9 +1320,8 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
{
bool bReturn=false;
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return bReturn;
// handle accelerators
@@ -1335,14 +1344,17 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if( bReturn )
return bReturn;
- if( pDrawViewWrapper->IsTextEdit() )
{
- if( pDrawViewWrapper->KeyInput(rKEvt,pWindow) )
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( pDrawViewWrapper->IsTextEdit() )
{
- bReturn = true;
- if( nCode == KEY_ESCAPE )
+ if( pDrawViewWrapper->KeyInput(rKEvt,m_pChartWindow) )
{
- this->EndTextEdit();
+ bReturn = true;
+ if( nCode == KEY_ESCAPE )
+ {
+ this->EndTextEdit();
+ }
}
}
}
@@ -1434,12 +1446,16 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm in each direction
double fGrowAmountX = 200.0;
double fGrowAmountY = 200.0;
- if( bAlternate && pWindow )
+ if( bAlternate && m_pChartWindow )
{
// together with Alt-key: 1 px in each direction
- Size aPixelSize = pWindow->PixelToLogic( Size( 2, 2 ));
- fGrowAmountX = static_cast< double >( aPixelSize.Width());
- fGrowAmountY = static_cast< double >( aPixelSize.Height());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ {
+ Size aPixelSize = m_pChartWindow->PixelToLogic( Size( 2, 2 ));
+ fGrowAmountX = static_cast< double >( aPixelSize.Width());
+ fGrowAmountY = static_cast< double >( aPixelSize.Height());
+ }
}
if( nCode == KEY_SUBTRACT )
{
@@ -1461,12 +1477,16 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm
double fShiftAmountX = 100.0;
double fShiftAmountY = 100.0;
- if( bAlternate && pWindow )
+ if( bAlternate && m_pChartWindow )
{
// together with Alt-key: 1 px
- Size aPixelSize = pWindow->PixelToLogic( Size( 1, 1 ));
- fShiftAmountX = static_cast< double >( aPixelSize.Width());
- fShiftAmountY = static_cast< double >( aPixelSize.Height());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ {
+ Size aPixelSize = m_pChartWindow->PixelToLogic( Size( 1, 1 ));
+ fShiftAmountX = static_cast< double >( aPixelSize.Width());
+ fShiftAmountY = static_cast< double >( aPixelSize.Height());
+ }
}
switch( nCode )
{
@@ -1557,6 +1577,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
bReturn = executeDispatch_Delete();
if( ! bReturn )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
InfoBox( m_pChartWindow, String(SchResId( STR_ACTION_NOTPOSSIBLE ))).Execute();
}
}
@@ -1729,11 +1750,14 @@ bool ChartController::requestQuickHelp(
void ChartController::impl_selectObjectAndNotiy()
{
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if( pDrawViewWrapper )
{
- pDrawViewWrapper->SetDragMode( m_eDragMode );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ if( pDrawViewWrapper )
+ {
+ pDrawViewWrapper->SetDragMode( m_eDragMode );
+ m_aSelection.applySelection( m_pDrawViewWrapper );
+ }
}
impl_notifySelectionChangeListeners();
}
@@ -1862,10 +1886,9 @@ bool ChartController::impl_DragDataPoint( const ::rtl::OUString & rCID, double f
void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
::vos::OGuard aGuard( Application::GetSolarMutex());
- Window* pWindow = m_pChartWindow;
- if( m_pDrawViewWrapper && pWindow )
+ if( m_pDrawViewWrapper && m_pChartWindow )
{
- Point aMousePos( pWindow->PixelToLogic( rEvent.GetPosPixel()));
+ Point aMousePos( m_pChartWindow->PixelToLogic( rEvent.GetPosPixel()));
sal_uInt16 nModifier = rEvent.GetModifier();
BOOL bLeftDown = rEvent.IsLeft();
@@ -1873,8 +1896,8 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
if( m_pDrawViewWrapper->IsTextEditHit( aMousePos, HITPIX) )
{
- pWindow->SetPointer( m_pDrawViewWrapper->GetPreferedPointer(
- aMousePos, pWindow, nModifier, bLeftDown ) );
+ m_pChartWindow->SetPointer( m_pDrawViewWrapper->GetPreferedPointer(
+ aMousePos, m_pChartWindow, nModifier, bLeftDown ) );
return;
}
}
@@ -1891,7 +1914,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
Pointer aPointer = m_pDrawViewWrapper->GetPreferedPointer(
- aMousePos, pWindow, nModifier, bLeftDown );
+ aMousePos, m_pChartWindow, nModifier, bLeftDown );
bool bForceArrowPointer = false;
ObjectIdentifier aOID( m_aSelection.getSelectedOID() );
@@ -1924,9 +1947,9 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
}
if( bForceArrowPointer )
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
else
- pWindow->SetPointer( aPointer );
+ m_pChartWindow->SetPointer( aPointer );
}
else
{
@@ -1975,7 +1998,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
}
break;
}
- pWindow->SetPointer( Pointer( ePointerStyle ) );
+ m_pChartWindow->SetPointer( Pointer( ePointerStyle ) );
return;
}
@@ -1987,7 +2010,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
if( aHitObjectCID.equals(m_aSelection.getSelectedCID()) )
{
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
return;
}
}
@@ -1995,14 +2018,14 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( !aHitObjectCID.getLength() )
{
//additional shape was hit
- pWindow->SetPointer( POINTER_MOVE );
+ m_pChartWindow->SetPointer( POINTER_MOVE );
}
else if( ObjectIdentifier::isDragableObject( aHitObjectCID ) )
{
if( (m_eDragMode == SDRDRAG_ROTATE)
&& SelectionHelper::isRotateableObject( aHitObjectCID
, getModel() ) )
- pWindow->SetPointer( Pointer( POINTER_ROTATE ) );
+ m_pChartWindow->SetPointer( Pointer( POINTER_ROTATE ) );
else
{
ObjectType eHitObjectType = ObjectIdentifier::getObjectType( aHitObjectCID );
@@ -2011,15 +2034,15 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( !ObjectIdentifier::areSiblings(aHitObjectCID,m_aSelection.getSelectedCID())
&& !ObjectIdentifier::areIdenticalObjects(aHitObjectCID,m_aSelection.getSelectedCID()) )
{
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
return;
}
}
- pWindow->SetPointer( POINTER_MOVE );
+ m_pChartWindow->SetPointer( POINTER_MOVE );
}
}
else
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
}
}
}
diff --git a/chart2/source/controller/main/ImplUndoManager.cxx b/chart2/source/controller/main/ImplUndoManager.cxx
index 57e8e7315334..0976b7db286e 100644
--- a/chart2/source/controller/main/ImplUndoManager.cxx
+++ b/chart2/source/controller/main/ImplUndoManager.cxx
@@ -143,7 +143,6 @@ OUString UndoElement::getActionString() const
return m_aActionString;
}
-// static
Reference< frame::XModel > UndoElement::cloneModel( const Reference< frame::XModel > & xModel )
{
Reference< frame::XModel > xResult;
@@ -155,7 +154,6 @@ Reference< frame::XModel > UndoElement::cloneModel( const Reference< frame::XMod
return xResult;
}
-// static
void UndoElement::applyModelContentToModel(
Reference< frame::XModel > & xInOutModelToChange,
const Reference< frame::XModel > & xModelToCopyFrom,
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index fe73d15500f5..19577eb4900e 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -630,13 +630,11 @@ ObjectHierarchy::ObjectHierarchy(
ObjectHierarchy::~ObjectHierarchy()
{}
-// static
ObjectHierarchy::tOID ObjectHierarchy::getRootNodeOID()
{
return ObjectIdentifier( C2U( "ROOT" ) );
}
-// static
bool ObjectHierarchy::isRootNode( const ObjectHierarchy::tOID& rOID )
{
return ( rOID == ObjectHierarchy::getRootNodeOID() );
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index 567a36473a5b..cd51adc7842e 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -335,7 +335,6 @@ bool Selection::isAdditionalShapeSelected() const
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
, rtl::OUString& rOutName
, bool bGivenObjectMayBeResult )
@@ -369,7 +368,6 @@ bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
return true;
}
-//static
bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
, ObjectIdentifier& rOutObject
, bool bGivenObjectMayBeResult )
@@ -383,7 +381,6 @@ bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
return false;
}
-//static
bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
, const rtl::OUString& rNameOfSelectedObject
, const DrawViewWrapper& rDrawViewWrapper )
@@ -399,7 +396,6 @@ bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
return true;
}
-// static
::rtl::OUString SelectionHelper::getHitObjectCID(
const Point& rMPos,
DrawViewWrapper& rDrawViewWrapper,
@@ -465,7 +461,6 @@ bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
// \\- solar mutex
}
-//static
bool SelectionHelper::isRotateableObject( const ::rtl::OUString& rCID
, const uno::Reference< frame::XModel >& xChartModel )
{
@@ -497,7 +492,6 @@ bool SelectionHelper::getFrameDragSingles()
return bFrameDragSingles;
}
-//static
SdrObject* SelectionHelper::getMarkHandlesObject( SdrObject* pObj )
{
if(!pObj)
@@ -553,7 +547,6 @@ SdrObject* SelectionHelper::getObjectToMark()
return m_pMarkObj;
}
-//static
E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj )
{
//search wether the object or one of its children is a 3D object
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index b6adf9bf7477..b2eccae6c98d 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -262,6 +262,7 @@ IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
void ShapeController::executeDispatch_FormatLine()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -276,7 +277,6 @@ void ShapeController::executeDispatch_FormatLine()
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
}
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -302,6 +302,7 @@ void ShapeController::executeDispatch_FormatLine()
void ShapeController::executeDispatch_FormatArea()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -315,7 +316,6 @@ void ShapeController::executeDispatch_FormatArea()
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
}
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -351,6 +351,7 @@ void ShapeController::executeDispatch_FormatArea()
void ShapeController::executeDispatch_TextAttributes()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -363,7 +364,6 @@ void ShapeController::executeDispatch_TextAttributes()
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
}
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -388,6 +388,7 @@ void ShapeController::executeDispatch_TextAttributes()
void ShapeController::executeDispatch_TransformDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -402,7 +403,6 @@ void ShapeController::executeDispatch_TransformDialog()
pDrawViewWrapper->GetAttributes( aAttr );
// item set for position and size
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -427,7 +427,6 @@ void ShapeController::executeDispatch_TransformDialog()
else
{
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -446,6 +445,7 @@ void ShapeController::executeDispatch_TransformDialog()
void ShapeController::executeDispatch_ObjectTitleDescription()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
@@ -456,7 +456,6 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
{
String aTitle( pSelectedObj->GetTitle() );
String aDescription( pSelectedObj->GetDescription() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -477,6 +476,7 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
void ShapeController::executeDispatch_RenameObject()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
@@ -486,7 +486,6 @@ void ShapeController::executeDispatch_RenameObject()
if ( pSelectedObj )
{
String aName( pSelectedObj->GetName() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -509,10 +508,10 @@ void ShapeController::executeDispatch_RenameObject()
void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
if ( pDrawViewWrapper )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
switch ( nId )
{
case COMMAND_ID_BRING_TO_FRONT:
@@ -558,6 +557,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
void ShapeController::executeDispatch_FontDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -568,7 +568,6 @@ void ShapeController::executeDispatch_FontDialog()
SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
pDrawViewWrapper->GetAttributes( aAttr );
ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
@@ -581,6 +580,7 @@ void ShapeController::executeDispatch_FontDialog()
void ShapeController::executeDispatch_ParagraphDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -606,7 +606,6 @@ void ShapeController::executeDispatch_ParagraphDialog()
aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
::boost::scoped_ptr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
@@ -701,6 +700,7 @@ bool ShapeController::isBackwardPossible()
{
if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
@@ -719,6 +719,7 @@ bool ShapeController::isForwardPossible()
{
if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
index d80d37eff7da..68c56f2d988b 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
@@ -40,9 +40,6 @@
// #include <vcl/svapp.hxx>
// #endif
-// for ressource strings STR_UNDO and STR_REDO
-#include <sfx2/sfx.hrc>
-
#include "ResId.hxx"
using namespace ::com::sun::star;
diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx
index eb3d00a2723a..128a4b4091d0 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.cxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.cxx
@@ -38,9 +38,8 @@
#include <vcl/svapp.hxx>
// for ressource strings STR_UNDO and STR_REDO
-#include <sfx2/sfx.hrc>
-
-#include "ResId.hxx"
+#include <svtools/svtools.hrc>
+#include <svtools/svtdata.hxx>
using namespace ::com::sun::star;
@@ -86,13 +85,13 @@ void UndoCommandDispatch::fireStatusEvent(
if( m_xUndoManager->undoPossible())
{
// using assignment for broken gcc 3.3
- OUString aUndo = OUString( String( SchResId( STR_UNDO )));
+ OUString aUndo = OUString( String( SvtResId( STR_UNDO )));
aUndoState <<= ( aUndo + m_xUndoManager->getCurrentUndoString());
}
if( m_xUndoManager->redoPossible())
{
// using assignment for broken gcc 3.3
- OUString aRedo = OUString( String( SchResId( STR_REDO )));
+ OUString aRedo = OUString( String( SvtResId( STR_REDO )));
aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoString());
}
diff --git a/chart2/source/controller/main/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx
index 21e27922b1c8..21b3bbc1f725 100644
--- a/chart2/source/controller/main/UndoManager.cxx
+++ b/chart2/source/controller/main/UndoManager.cxx
@@ -408,7 +408,6 @@ sal_Int64 UndoManager::getSomething( const Sequence< sal_Int8 >& rId )
return 0;
}
-// static
const Sequence< sal_Int8 >& UndoManager::getUnoTunnelId()
{
static Sequence< sal_Int8 >* pSeq = 0;
@@ -425,7 +424,6 @@ const Sequence< sal_Int8 >& UndoManager::getUnoTunnelId()
return *pSeq;
}
-// static
UndoManager* UndoManager::getImplementation( const Reference< uno::XInterface > xObj )
{
UndoManager* pRet = NULL;
diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk
index fbc888f38c3f..41d7df24acaa 100644
--- a/chart2/source/controller/makefile.mk
+++ b/chart2/source/controller/makefile.mk
@@ -109,11 +109,10 @@ DEF1NAME= $(SHL1TARGET)
# --- Resources ---------------------------------------------------------------
-# sfx.srs is needed for the strings for UNDO and REDO in the UndoCommandDispatch
RESLIB1LIST=\
$(SRS)$/chcdialogs.srs \
$(SRS)$/chcmenus.srs \
- $(SOLARCOMMONRESDIR)$/sfx.srs
+
RESLIB1NAME= $(TARGET)
RESLIB1IMAGES=$(PRJ)$/res
diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx
index fa773a6dab00..93dce272bf6e 100644
--- a/chart2/source/inc/OPropertySet.hxx
+++ b/chart2/source/inc/OPropertySet.hxx
@@ -96,39 +96,6 @@ protected:
*/
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() = 0;
- // ____ XPropertySet ____
- /** sample implementation using the InfoHelper:
-
- <pre>
- uno::Reference&lt; beans::XPropertySetInfo &gt; SAL_CALL
- OPropertySet::getPropertySetInfo()
- throw (uno::RuntimeException)
- {
- static uno::Reference&lt; beans::XPropertySetInfo &gt; xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
- }
- </pre>
-
- <p>(The reason why this isn't implemented here is, that the static
- object is only valid per concrete PropertySet. Otherwise all
- PropertySets derived from this base calss would have the same
- properties.)</p>
-
- @see ::cppu::OPropertySetHelper
- */
-// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
-// getPropertySetInfo()
-// throw (::com::sun::star::uno::RuntimeException) = 0;
/** Try to convert the value <code>rValue</code> to the type required by the
property associated with <code>nHandle</code>.
diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/model/inc/DataSeries.hxx
index e05bac782b86..c557e537da70 100644
--- a/chart2/source/model/inc/DataSeries.hxx
+++ b/chart2/source/model/inc/DataSeries.hxx
@@ -198,10 +198,6 @@ protected:
void fireModifyEvent();
- /** const variant of getInfoHelper()
- */
- ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
-
private:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index fd1d78ebe071..165ebe0f0717 100644..100755
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -194,63 +194,86 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
-{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_OVERLAP, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_STACKED, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_ARRANGE_ORDER, ::com::sun::star::chart::ChartAxisArrangeOrderType_AUTO );
-
- 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::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
-}
+struct StaticAxisDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_OVERLAP, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_STACKED, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_ARRANGE_ORDER, ::com::sun::star::chart::ChartAxisArrangeOrderType_AUTO );
+
+ 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::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAxisDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAxisDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticAxisInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::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;
-}
+struct StaticAxisInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAxisInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticAxisInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAxisInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticAxisInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAxisInfo_Initializer >
+{
+};
typedef uno::Reference< beans::XPropertySet > lcl_tSubGridType;
typedef uno::Sequence< lcl_tSubGridType > lcl_tSubGridSeq;
@@ -577,52 +600,23 @@ void Axis::fireModifyEvent()
uno::Any Axis::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- LineProperties::AddDefaultsToMap( aStaticDefaults );
-
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticAxisDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL Axis::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticAxisInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- Axis::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL Axis::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticAxisInfo::get();
}
// ================================================================================
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx
index 4fa58cff5039..80fa0b51575f 100644..100755
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -69,35 +69,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticCooSysDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
+ }
+};
+
+struct StaticCooSysDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCooSysDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticCooSysInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_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;
-}
+struct StaticCooSysInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCooSysInfoHelper_Initializer >
+{
+};
+
+struct StaticCooSysInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCooSysInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticCooSysInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCooSysInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -352,53 +381,25 @@ void BaseCoordinateSystem::fireModifyEvent()
uno::Any BaseCoordinateSystem::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticCooSysDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BaseCoordinateSystem::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticCooSysInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- BaseCoordinateSystem::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL BaseCoordinateSystem::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;
- // \--
+ return *StaticCooSysInfo::get();
}
using impl::BaseCoordinateSystem_Base;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 5a30d97118c5..95bc1315ad51 100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -182,6 +182,16 @@ ChartModel::~ChartModel()
m_xOldModelAgg->setDelegator( 0 );
}
+void SAL_CALL ChartModel::initialize( const Sequence< Any >& /*rArguments*/ )
+ throw (uno::Exception, uno::RuntimeException)
+{
+ //#i113722# avoid duplicate creation
+
+ //maybe additional todo?:
+ //support argument "EmbeddedObject"?
+ //support argument "EmbeddedScriptSupport"?
+ //support argument "DocumentRecoverySupport"?
+}
//-----------------------------------------------------------------
// private methods
@@ -1301,7 +1311,8 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
if( !m_xOwnNumberFormatsSupplier.is() )
{
Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY );
- m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_apSvNumberFormatter.reset( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( m_apSvNumberFormatter.get() );
//pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo?
}
m_xNumberFormatsSupplier = m_xOwnNumberFormatsSupplier;
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 23da02f3f83a..190d4f597c94 100644..100755
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -38,6 +38,7 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
@@ -62,9 +63,9 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_20)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_20
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 20
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 21
#include "comphelper/implbase_var.hxx"
#endif
#include <osl/mutex.hxx>
@@ -74,6 +75,8 @@
// for auto_ptr
#include <memory>
+class SvNumberFormatter;
+
//=============================================================================
/** this is an example implementation for the service ::com::sun::star::document::OfficeDocument
*/
@@ -85,7 +88,7 @@ namespace impl
{
// Note: needed for queryInterface (if it calls the base-class implementation)
-typedef ::comphelper::WeakImplHelper20<
+typedef ::comphelper::WeakImplHelper21<
// ::com::sun::star::frame::XModel //comprehends XComponent (required interface), base of XChartDocument
::com::sun::star::util::XCloseable //comprehends XCloseBroadcaster
,::com::sun::star::frame::XStorable2 //(extension of XStorable)
@@ -95,6 +98,7 @@ typedef ::comphelper::WeakImplHelper20<
// ,::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::lang::XInitialization
,::com::sun::star::chart2::XChartDocument // derived from XModel
,::com::sun::star::chart2::data::XDataReceiver // public API
,::com::sun::star::chart2::XTitled
@@ -157,6 +161,7 @@ private:
m_xOwnNumberFormatsSupplier;
::com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >
m_xNumberFormatsSupplier;
+ std::auto_ptr< SvNumberFormatter > m_apSvNumberFormatter; // #i113784# avoid memory leak
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartTypeManager >
m_xChartTypeManager;
@@ -246,6 +251,12 @@ public:
APPHELPER_SERVICE_FACTORY_HELPER(ChartModel)
//-----------------------------------------------------------------
+ // ::com::sun::star::lang::XInitialization
+ //-----------------------------------------------------------------
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ //-----------------------------------------------------------------
// ::com::sun::star::frame::XModel (required interface)
//-----------------------------------------------------------------
diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx
index 1f3d92e4d94b..e658000cc9dd 100644..100755
--- a/chart2/source/model/main/DataPoint.cxx
+++ b/chart2/source/model/main/DataPoint.cxx
@@ -53,30 +53,48 @@ using ::rtl::OUString;
namespace
{
-const Sequence< Property > & lcl_GetPropertySequence()
+
+struct StaticDataPointInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::DataPointProperties::AddPropertiesToVector( aProperties );
::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 );
}
+};
+
+struct StaticDataPointInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataPointInfoHelper_Initializer >
+{
+};
+
+struct StaticDataPointInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataPointInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDataPointInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataPointInfo_Initializer >
+{
+};
- return aPropSeq;
-}
} // anonymous namespace
// ____________________________________________________________
@@ -157,7 +175,7 @@ uno::Reference< util::XCloneable > SAL_CALL DataPoint::createClone()
Reference< uno::XInterface > SAL_CALL DataPoint::getParent()
throw (uno::RuntimeException)
{
- return Reference< uno::XInterface >( m_xParentProperties, uno::UNO_QUERY );
+ return Reference< uno::XInterface >( m_xParentProperties.get(), uno::UNO_QUERY );
}
void SAL_CALL DataPoint::setParent(
@@ -165,7 +183,7 @@ void SAL_CALL DataPoint::setParent(
throw (lang::NoSupportException,
uno::RuntimeException)
{
- m_xParentProperties.set( Parent, uno::UNO_QUERY );
+ m_xParentProperties = Reference< beans::XPropertySet >( Parent, uno::UNO_QUERY );
}
// ____ OPropertySet ____
@@ -173,7 +191,7 @@ uno::Any DataPoint::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
// the value set at the data series is the default
- uno::Reference< beans::XFastPropertySet > xFast( m_xParentProperties, uno::UNO_QUERY );
+ uno::Reference< beans::XFastPropertySet > xFast( m_xParentProperties.get(), uno::UNO_QUERY );
if( !xFast.is())
{
OSL_ENSURE( m_bNoParentPropAllowed, "data point needs a parent property set to provide values correctly" );
@@ -214,35 +232,14 @@ void SAL_CALL DataPoint::setFastPropertyValue_NoBroadcast(
::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelper()
{
- return getInfoHelperConst();
-}
-
-::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelperConst() const
-{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDataPointInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- DataPoint::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL DataPoint::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;
- // \--
+ return *StaticDataPointInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx
index 1498b8345963..974899f42e24 100644..100755
--- a/chart2/source/model/main/DataPoint.hxx
+++ b/chart2/source/model/main/DataPoint.hxx
@@ -29,6 +29,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/weakref.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/util/XCloneable.hpp>
@@ -101,10 +102,6 @@ protected:
throw (::com::sun::star::lang::NoSupportException,
::com::sun::star::uno::RuntimeException);
- /** const variant of getInfoHelper()
- */
- ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
-
// ____ XModifyBroadcaster ____
virtual void SAL_CALL addModifyListener(
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
@@ -130,7 +127,7 @@ protected:
void fireModifyEvent();
private:
- ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::WeakReference<
::com::sun::star::beans::XPropertySet > m_xParentProperties;
::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index 89197aa5ba3f..55ab9c9e5a59 100644..100755
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -55,30 +55,73 @@ using ::osl::MutexGuard;
namespace
{
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+
+struct StaticDataSeriesDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::DataSeriesProperties::AddDefaultsToMap( rOutMap );
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+
+ 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 );
+ }
+};
+
+struct StaticDataSeriesDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticDataSeriesDefaults_Initializer >
{
- static uno::Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticDataSeriesInfoHelper_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;
::chart::DataSeriesProperties::AddPropertiesToVector( aProperties );
::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;
-}
+};
+
+struct StaticDataSeriesInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataSeriesInfoHelper_Initializer >
+{
+};
+
+struct StaticDataSeriesInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataSeriesInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDataSeriesInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataSeriesInfo_Initializer >
+{
+};
void lcl_SetParent(
const uno::Reference< uno::XInterface > & xChildInterface,
@@ -245,60 +288,24 @@ Sequence< OUString > DataSeries::getSupportedServiceNames_Static()
uno::Any DataSeries::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 );
-
- float fDefaultCharHeight = 10.0;
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight );
- ::chart::PropertyHelper::setPropertyValue( aStaticDefaults, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- throw beans::UnknownPropertyException();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticDataSeriesDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL DataSeries::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDataSeriesInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- DataSeries::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL DataSeries::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticDataSeriesInfo::get();
}
void SAL_CALL DataSeries::getFastPropertyValue
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index ff8a0c4030bc..aac706ab0c91 100644..100755
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -41,6 +41,7 @@
#include "DisposeHelper.hxx"
#include "BaseGFXHelper.hxx"
#include <basegfx/numeric/ftools.hxx>
+#include <rtl/instance.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
@@ -176,42 +177,71 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticDiagramDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticDiagramDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticDiagramDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticDiagramInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::SceneProperties::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;
-}
+struct StaticDiagramInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDiagramInfoHelper_Initializer >
+{
+};
+
+struct StaticDiagramInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDiagramInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDiagramInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDiagramInfo_Initializer >
+{
+};
/// clones a UNO-sequence of UNO-References
typedef Reference< chart2::XCoordinateSystem > lcl_tCooSysRef;
@@ -591,54 +621,24 @@ Sequence< OUString > Diagram::getSupportedServiceNames_Static()
uno::Any Diagram::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 );
- ::chart::SceneProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticDiagramDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL Diagram::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDiagramInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Diagram::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Diagram::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticDiagramInfo::get();
}
// ____ XFastPropertySet ____
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx
index 9d38fafd3cf7..2d1f937d3e57 100644..100755
--- a/chart2/source/model/main/FormattedString.cxx
+++ b/chart2/source/model/main/FormattedString.cxx
@@ -47,37 +47,64 @@ using ::osl::MutexGuard;
namespace
{
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticFormattedStringDefaults_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+ }
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticFormattedStringDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticFormattedStringDefaults_Initializer >
+{
+};
+
+struct StaticFormattedStringInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > 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 ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticFormattedStringInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticFormattedStringInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticFormattedStringInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticFormattedStringInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticFormattedStringInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticFormattedStringInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -201,50 +228,25 @@ Sequence< OUString > FormattedString::getSupportedServiceNames_Static()
uno::Any FormattedString::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- throw beans::UnknownPropertyException();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticFormattedStringDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL FormattedString::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticFormattedStringInfoHelper::get();
}
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- FormattedString::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL FormattedString::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticFormattedStringInfo::get();
}
// ================================================================================
diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx
index a8d5be5d1453..4739b96bb4b7 100644..100755
--- a/chart2/source/model/main/GridProperties.cxx
+++ b/chart2/source/model/main/GridProperties.cxx
@@ -71,50 +71,73 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_addDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+struct StaticGridDefaults_Initializer
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::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_GRID_SHOW, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_GRID_SHOW, false );
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
- rOutMap, ::chart::LineProperties::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
-}
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
+ rOutMap, ::chart::LineProperties::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
+ }
+};
+
+struct StaticGridDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticGridDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_getPropertySequence()
+struct StaticGridInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::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 StaticGridInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticGridInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_getPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticGridInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticGridInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticGridInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticGridInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -149,45 +172,23 @@ GridProperties::~GridProperties()
uno::Any GridProperties::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- lcl_addDefaultsToMap( aStaticDefaults );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticGridDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL GridProperties::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticGridInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- GridProperties::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL GridProperties::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 *StaticGridInfo::get();
}
// ____ XCloneable ____
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index c1143ecdf77a..e9f5f5324365 100644..100755
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -107,28 +107,47 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLegendDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
-
- 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_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
+
+ 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 Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLegendDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLegendDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticLegendInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
@@ -136,25 +155,30 @@ const 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;
-}
+struct StaticLegendInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLegendInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticLegendInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLegendInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticLegendInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLegendInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -309,52 +333,23 @@ Sequence< OUString > Legend::getSupportedServiceNames_Static()
Any Legend::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- // call last to overwrite some character property defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- return Any();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticLegendDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL Legend::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticLegendInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- Legend::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL Legend::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;
- // \--
+ return *StaticLegendInfo::get();
}
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 0dbe1d82fcf3..5f237b21ae7a 100644..100755
--- a/chart2/source/model/main/PageBackground.cxx
+++ b/chart2/source/model/main/PageBackground.cxx
@@ -53,47 +53,71 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PageBackground" ));
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPageBackgroundDefaults_Initializer
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
-}
+ ::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 );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ }
+};
+
+struct StaticPageBackgroundDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPageBackgroundDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPageBackgroundInfoHelper_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;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::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 StaticPageBackgroundInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPageBackgroundInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticPageBackgroundInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPageBackgroundInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticPageBackgroundInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPageBackgroundInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -132,55 +156,25 @@ uno::Reference< util::XCloneable > SAL_CALL PageBackground::createClone()
uno::Any PageBackground::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 );
- // overrides defaults of FillProperties
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPageBackgroundDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL PageBackground::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticPageBackgroundInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PageBackground::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PageBackground::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 *StaticPageBackgroundInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL PageBackground::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index 9a3c7f8ab623..e812ba3c39dd 100644..100755
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -57,46 +57,70 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.StockBar" ));
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticStockBarInfoHelper_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;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::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;
-}
+};
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticStockBarInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticStockBarInfoHelper_Initializer >
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // white
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticStockBarInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockBarInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticStockBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockBarInfo_Initializer >
+{
+};
+
+struct StaticStockBarDefaults_Initializer
+{
+ ::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 );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // white
+ }
+};
+
+struct StaticStockBarDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticStockBarDefaults_Initializer >
+{
+};
} // anonymous namespace
@@ -144,55 +168,25 @@ uno::Reference< util::XCloneable > SAL_CALL StockBar::createClone()
uno::Any StockBar::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 );
-
- // overrides a line property
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticStockBarDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL StockBar::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticStockBarInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- StockBar::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL StockBar::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 *StaticStockBarInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL StockBar::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index d7c5691d160d..7483c02ffa93 100644..100755
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -156,62 +156,87 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticTitleDefaults_Initializer
{
- // ParagraphProperties
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_ADJUST,
- ::com::sun::star::style::ParagraphAdjust_CENTER );
- // PROP_TITLE_PARA_LAST_LINE_ADJUST
-
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_LEFT_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_RIGHT_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_TOP_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_BOTTOM_MARGIN, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_IS_HYPHENATION, true );
-
- // own properties
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_TITLE_TEXT_ROTATION, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_TEXT_STACKED, false );
-
- // 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 );
-}
+ ::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 );
+
+ // ParagraphProperties
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_ADJUST,
+ ::com::sun::star::style::ParagraphAdjust_CENTER );
+ // PROP_TITLE_PARA_LAST_LINE_ADJUST
+
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_LEFT_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_RIGHT_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_TOP_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_TITLE_PARA_BOTTOM_MARGIN, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_IS_HYPHENATION, true );
+
+ // own properties
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_TITLE_TEXT_ROTATION, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_TEXT_STACKED, false );
+
+ // 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 );
+ }
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticTitleDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticTitleDefaults_Initializer >
{
- static uno::Sequence< Property > aPropSeq;
+};
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticTitleInfoHelper_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 );
::chart::FillProperties::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 StaticTitleInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticTitleInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticTitleInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticTitleInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticTitleInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticTitleInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -283,54 +308,23 @@ void SAL_CALL Title::setText( const uno::Sequence< uno::Reference< chart2::XForm
uno::Any Title::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
-
- // initialize defaults
- // Note: this should be last to override defaults of the previously
- // added defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticTitleDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL Title::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticTitleInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Title::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Title::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 *StaticTitleInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index 2ad00a4c90ae..404a5e6ff97f 100644..100755
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -59,46 +59,70 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Wall" ));
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticWallDefaults_Initializer
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
-}
+ ::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 );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ }
+};
+
+struct StaticWallDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticWallDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticWallInfoHelper_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;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::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 StaticWallInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticWallInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticWallInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticWallInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticWallInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticWallInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -135,55 +159,23 @@ uno::Reference< util::XCloneable > SAL_CALL Wall::createClone()
uno::Any Wall::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 );
-
- // initialize defaults
- // Note: this should be last to override defaults of the previously
- // added defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticWallDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL Wall::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticWallInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Wall::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Wall::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 *StaticWallInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx
index 5fe21cfb25e0..ea8b7a89c778 100644..100755
--- a/chart2/source/model/template/AreaChartTypeTemplate.cxx
+++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx
@@ -70,43 +70,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticAreaChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AREA_TEMPLATE_DIMENSION, 2 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AREA_TEMPLATE_DIMENSION, 2 );
+ }
+};
+
+struct StaticAreaChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAreaChartTypeTemplateDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAreaChartTypeTemplateInfoHelper_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 );
- // 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 StaticAreaChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAreaChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticAreaChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAreaChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticAreaChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAreaChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -133,49 +154,23 @@ AreaChartTypeTemplate::~AreaChartTypeTemplate()
uno::Any AreaChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticAreaChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL AreaChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticAreaChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- AreaChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartTypeTemplate::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 *StaticAreaChartTypeTemplateInfo::get();
}
sal_Int32 AreaChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx
index 01dc4c253d2b..77cd240c3fd0 100644..100755
--- a/chart2/source/model/template/BarChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BarChartTypeTemplate.cxx
@@ -77,44 +77,65 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticBarChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_BAR_TEMPLATE_DIMENSION, 2 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_BAR_TEMPLATE_DIMENSION, 2 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
+ }
+};
+
+struct StaticBarChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBarChartTypeTemplateDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBarChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ 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;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticBarChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBarChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticBarChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBarChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticBarChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBarChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -226,49 +247,23 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe
uno::Any BarChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBarChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL BarChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticBarChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- BarChartTypeTemplate::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL BarChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticBarChartTypeTemplateInfo::get();
}
void SAL_CALL BarChartTypeTemplate::applyStyle(
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
index 9922ed4df5fb..f82936241232 100644..100755
--- a/chart2/source/model/template/BubbleChartType.cxx
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -56,33 +56,62 @@ void lcl_AddPropertiesToVector(
{
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & /*rOutMap*/ )
+struct StaticBubbleChartTypeDefaults_Initializer
{
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & /*rOutMap*/ )
+ {
+ }
+};
+
+struct StaticBubbleChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBubbleChartTypeInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ 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 StaticBubbleChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticBubbleChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticBubbleChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -177,53 +206,24 @@ OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
uno::Any BubbleChartType::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticBubbleChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- BubbleChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticBubbleChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > BubbleChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
index 59b552cc8995..e0e37e2c825a 100644..100755
--- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -65,42 +65,63 @@ void lcl_AddPropertiesToVector(
{
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & /*rOutMap*/ )
+struct StaticBubbleChartTypeTemplateDefaults_Initializer
{
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & /*rOutMap*/ )
+ {
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBubbleChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeTemplateDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticBubbleChartTypeTemplateInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticBubbleChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticBubbleChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBubbleChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticBubbleChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBubbleChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -123,49 +144,23 @@ BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
uno::Any BubbleChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticBubbleChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- BubbleChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartTypeTemplate::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 *StaticBubbleChartTypeTemplateInfo::get();
}
sal_Int32 BubbleChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx
index 22c8e058ea53..499ee238650e 100644..100755
--- a/chart2/source/model/template/CandleStickChartType.cxx
+++ b/chart2/source/model/template/CandleStickChartType.cxx
@@ -95,39 +95,67 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap,
- ::osl::Mutex & rMutex )
+struct StaticCandleStickChartTypeDefaults_Initializer
{
- ::osl::MutexGuard aGuard( rMutex );
- // must match default in CTOR!
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ // must match default in CTOR!
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_JAPANESE, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_FIRST, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CANDLESTICKCHARTTYPE_SHOW_HIGH_LOW, true );
+ }
+};
+
+struct StaticCandleStickChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCandleStickChartTypeDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticCandleStickChartTypeInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ 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 StaticCandleStickChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCandleStickChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticCandleStickChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCandleStickChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticCandleStickChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCandleStickChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -261,53 +289,24 @@ OUString SAL_CALL CandleStickChartType::getRoleOfSequenceForSeriesLabel()
uno::Any CandleStickChartType::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, GetMutex() );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticCandleStickChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL CandleStickChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticCandleStickChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- CandleStickChartType::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL CandleStickChartType::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;
- // \--
+ return *StaticCandleStickChartTypeInfo::get();
}
void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx
index 22a744769fc6..146c06934a46 100644..100755
--- a/chart2/source/model/template/ChartType.cxx
+++ b/chart2/source/model/template/ChartType.cxx
@@ -230,34 +230,51 @@ uno::Any ChartType::GetDefaultValue( sal_Int32 /* nHandle */ ) const
return uno::Any();
}
-// ____ OPropertySet ____
-::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
+namespace
{
- // using assignment for broken gcc 3.3
- static ::cppu::OPropertyArrayHelper aArrayHelper = ::cppu::OPropertyArrayHelper(
- Sequence< beans::Property >(), /* bSorted */ sal_True );
-
- return aArrayHelper;
-}
+struct StaticChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ // using assignment for broken gcc 3.3
+ static ::cppu::OPropertyArrayHelper aPropHelper = ::cppu::OPropertyArrayHelper(
+ Sequence< beans::Property >() );
+ return &aPropHelper;
+ }
+};
-// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ChartType::getPropertySetInfo()
- throw (uno::RuntimeException)
+struct StaticChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticChartTypeInfoHelper_Initializer >
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
+struct StaticChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
{
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
}
+};
+
+struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticChartTypeInfo_Initializer >
+{
+};
+
+}
- return xInfo;
- // \--
+// ____ OPropertySet ____
+::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
+{
+ return *StaticChartTypeInfoHelper::get();
+}
+
+// ____ XPropertySet ____
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ChartType::getPropertySetInfo()
+ throw (uno::RuntimeException)
+{
+ return *StaticChartTypeInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index e3943e9eb45f..c922de69a2c7 100644..100755
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -882,7 +882,6 @@ void ChartTypeTemplate::createChartTypes(
}
}
-//static
void ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem(
const Sequence< Reference< XChartType > > & rOldChartTypesSeq,
const Reference< XChartType > & xNewChartType )
diff --git a/chart2/source/model/template/ColumnChartType.cxx b/chart2/source/model/template/ColumnChartType.cxx
index aa11d77e8995..90dcf7c80ee2 100644..100755
--- a/chart2/source/model/template/ColumnChartType.cxx
+++ b/chart2/source/model/template/ColumnChartType.cxx
@@ -67,40 +67,70 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticColumnChartTypeDefaults_Initializer
{
- Sequence< sal_Int32 > aSeq(2);
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ Sequence< sal_Int32 > aSeq(2);
- aSeq[0] = aSeq[1] = 0;
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
+ aSeq[0] = aSeq[1] = 0;
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
- aSeq[0] = aSeq[1] = 100;
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
-}
+ aSeq[0] = aSeq[1] = 100;
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticColumnChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticColumnChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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 StaticColumnChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticColumnChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticColumnChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -138,51 +168,23 @@ uno::Reference< util::XCloneable > SAL_CALL ColumnChartType::createClone()
uno::Any ColumnChartType::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticColumnChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL ColumnChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
- return aArrayHelper;
+ return *StaticColumnChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ColumnChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticColumnChartTypeInfo::get();
}
//
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
index 663cad4c2fe4..35a29f78e6ee 100644..100755
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
@@ -76,43 +76,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticColumnLineChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
+ }
+};
+
+struct StaticColumnLineChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnLineChartTypeTemplateDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticColumnLineChartTypeTemplateInfoHelper_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 );
- // 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 StaticColumnLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnLineChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticColumnLineChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnLineChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticColumnLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnLineChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -139,49 +160,23 @@ ColumnLineChartTypeTemplate::~ColumnLineChartTypeTemplate()
uno::Any ColumnLineChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticColumnLineChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL ColumnLineChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticColumnLineChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ColumnLineChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnLineChartTypeTemplate::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 *StaticColumnLineChartTypeTemplateInfo::get();
}
void ColumnLineChartTypeTemplate::createChartTypes(
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index b619553ee959..b5aa13775e8e 100644..100755
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -329,7 +329,6 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
// convenience methods
-// static
OUString DataInterpreter::GetRole( const Reference< data::XDataSequence > & xSeq )
{
OUString aResult;
@@ -348,7 +347,6 @@ OUString DataInterpreter::GetRole( const Reference< data::XDataSequence > & xSeq
return aResult;
}
-// static
void DataInterpreter::SetRole( const Reference< data::XDataSequence > & xSeq, const OUString & rRole )
{
if( ! xSeq.is())
@@ -364,7 +362,6 @@ void DataInterpreter::SetRole( const Reference< data::XDataSequence > & xSeq, co
}
}
-// static
uno::Any DataInterpreter::GetProperty(
const Sequence< beans::PropertyValue > & aArguments,
const OUString & rName )
@@ -377,7 +374,6 @@ uno::Any DataInterpreter::GetProperty(
return uno::Any();
}
-// static
bool DataInterpreter::HasCategories(
const Sequence< beans::PropertyValue > & rArguments,
const Sequence< Reference< data::XLabeledDataSequence > > & rData )
diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx
index f96d7ed1297d..e249f7508908 100644..100755
--- a/chart2/source/model/template/LineChartType.cxx
+++ b/chart2/source/model/template/LineChartType.cxx
@@ -78,39 +78,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLineChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
-}
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLineChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLineChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticLineChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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 StaticLineChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLineChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticLineChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLineChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticLineChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -150,52 +180,23 @@ uno::Reference< util::XCloneable > SAL_CALL LineChartType::createClone()
uno::Any LineChartType::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL LineChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticLineChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- LineChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticLineChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > LineChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index 8d582178a128..cc9bbc804288 100644..100755
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -88,48 +88,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLineChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
-}
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
+ }
+};
+
+struct StaticLineChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLineChartTypeTemplateDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLineChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ 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;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLineChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticLineChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLineChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -161,49 +182,23 @@ LineChartTypeTemplate::~LineChartTypeTemplate()
uno::Any LineChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL LineChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticLineChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- LineChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartTypeTemplate::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 *StaticLineChartTypeTemplateInfo::get();
}
sal_Int32 LineChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx
index ddf001b2a6e4..bba666bb006c 100644..100755
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -108,31 +108,51 @@ uno::Any NetChartType_Base::GetDefaultValue( sal_Int32 /*nHandle*/ ) const
return uno::Any();
}
+namespace
+{
+
+struct StaticNetChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ // using assignment for broken gcc 3.3
+ static ::cppu::OPropertyArrayHelper aPropHelper = ::cppu::OPropertyArrayHelper(
+ Sequence< beans::Property >() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticNetChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticNetChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticNetChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticNetChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticNetChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticNetChartTypeInfo_Initializer >
+{
+};
+
+}
+
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL NetChartType_Base::getInfoHelper()
{
- uno::Sequence< beans::Property > aProps;
- static ::cppu::OPropertyArrayHelper aArrayHelper(aProps);
- return aArrayHelper;
+ return *StaticNetChartTypeInfoHelper::get();
}
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- NetChartType_Base::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL NetChartType_Base::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticNetChartTypeInfo::get();
}
//-----------------------------------------------------------------------------
diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx
index 9c199bb23d70..2c9bd4792cbf 100644..100755
--- a/chart2/source/model/template/PieChartType.cxx
+++ b/chart2/source/model/template/PieChartType.cxx
@@ -67,34 +67,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPieChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIECHARTTYPE_USE_RINGS, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIECHARTTYPE_USE_RINGS, false );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPieChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPieChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticPieChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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 StaticPieChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticPieChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPieChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticPieChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPieChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -174,53 +204,24 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
uno::Any PieChartType::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL PieChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticPieChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PieChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticPieChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > PieChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index c16682846d53..439e4946378d 100644..100755
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -100,46 +100,67 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPieChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_OFFSET_MODE, chart2::PieChartOffsetMode_NONE );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_PIE_TEMPLATE_DEFAULT_OFFSET, 0.5 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_OFFSET_MODE, chart2::PieChartOffsetMode_NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_PIE_TEMPLATE_DEFAULT_OFFSET, 0.5 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
+ }
+};
+
+struct StaticPieChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPieChartTypeTemplateDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPieChartTypeTemplateInfoHelper_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 );
- // 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 StaticPieChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticPieChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPieChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticPieChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPieChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -168,52 +189,25 @@ PieChartTypeTemplate::~PieChartTypeTemplate()
uno::Any PieChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL PieChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticPieChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PieChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartTypeTemplate::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 *StaticPieChartTypeTemplateInfo::get();
}
-
// ____ ChartTypeTemplate ____
sal_Int32 PieChartTypeTemplate::getDimension() const
{
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx
index 8c4ab0d18415..7952e69497b5 100644..100755
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -82,39 +82,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticScatterChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION, 20 );
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_SPLINE_ORDER, 3 );
-}
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_SPLINE_ORDER, 3 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticScatterChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticScatterChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticScatterChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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 StaticScatterChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticScatterChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticScatterChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticScatterChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -231,53 +261,24 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScatterChartType::getSupportedOptional
uno::Any ScatterChartType::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticScatterChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ScatterChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- // \--
+ return *StaticScatterChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > ScatterChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index a83d9a8a4ea3..eaec10fe7c21 100644..100755
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -90,48 +90,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticScatterChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
- // todo: check whether order 3 means polygons of order 3 or 2. (see
- // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
-}
+ // todo: check whether order 3 means polygons of order 3 or 2. (see
+ // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, 3 );
+ }
+};
+
+struct StaticScatterChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticScatterChartTypeTemplateDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticScatterChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ 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;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticScatterChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticScatterChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticScatterChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticScatterChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -162,49 +183,23 @@ ScatterChartTypeTemplate::~ScatterChartTypeTemplate()
uno::Any ScatterChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticScatterChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ScatterChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartTypeTemplate::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 *StaticScatterChartTypeTemplateInfo::get();
}
sal_Int32 ScatterChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index 00ace6c330ad..b265561eca90 100644..100755
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -104,46 +104,66 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticStockChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_OPEN, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_OPEN, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE, false );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticStockChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticStockChartTypeTemplateDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- // /--
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticStockChartTypeTemplateInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ 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 StaticStockChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticStockChartTypeTemplateInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticStockChartTypeTemplateInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticStockChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
// ----------------------------------------
@@ -180,49 +200,23 @@ StockChartTypeTemplate::~StockChartTypeTemplate()
uno::Any StockChartTypeTemplate::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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticStockChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
- // \--
}
::cppu::IPropertyArrayHelper & SAL_CALL StockChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticStockChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- StockChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL StockChartTypeTemplate::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 *StaticStockChartTypeTemplateInfo::get();
}
sal_Int32 StockChartTypeTemplate::getAxisCountByDimension( sal_Int32 nDimension )
diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx
index c0ffb8f4825f..9a62a97582e0 100644..100755
--- a/chart2/source/model/template/_serviceregistration_charttypes.cxx
+++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx
@@ -130,7 +130,6 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_charttypes[] =
} // anonymous namespace
-// static
struct ::cppu::ImplementationEntry *
ChartTypeEntriesForServiceRegistration::getImplementationEntries()
{
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;
}
diff --git a/chart2/source/view/axes/TickmarkHelper.cxx b/chart2/source/view/axes/TickmarkHelper.cxx
index 9e2e2707c035..f4f717722bed 100644
--- a/chart2/source/view/axes/TickmarkHelper.cxx
+++ b/chart2/source/view/axes/TickmarkHelper.cxx
@@ -339,7 +339,6 @@ TickInfo* EquidistantTickIter::nextInfo()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
double TickmarkHelper::getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement )
{
//the returned value will be <= fMin and on a Major Tick given by rIncrement
@@ -358,7 +357,6 @@ double TickmarkHelper::getMinimumAtIncrement( double fMin, const ExplicitIncreme
}
return fRet;
}
-//static
double TickmarkHelper::getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement )
{
//the returned value will be >= fMax and on a Major Tick given by rIncrement
@@ -781,7 +779,6 @@ bool TickmarkHelper_2D::isVerticalAxis() const
return ( m_aAxisStartScreenPosition2D.getX() == m_aAxisEndScreenPosition2D.getX() );
}
-//static
sal_Int32 TickmarkHelper_2D::getTickScreenDistance( TickIter& rIter )
{
//return the positive distance between the two first tickmarks in screen values
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index 1e3e62894741..63c98141991b 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -157,7 +157,6 @@ TickmarkProperties AxisProperties::makeTickmarkPropertiesForComplexCategories(
return aTickmarkProperties;
}
-//static
TickmarkProperties AxisProperties::getBiggestTickmarkProperties()
{
TickmarkProperties aTickmarkProperties;
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx
index 7fe6b9937ca6..18b8942b6787 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -192,7 +192,6 @@ VCartesianGrid::~VCartesianGrid()
m_pPosHelper = NULL;
}
-//static
void VCartesianGrid::fillLinePropertiesFromGridModel( ::std::vector<VLineProperties>& rLinePropertiesList
, const Sequence< Reference< beans::XPropertySet > > & rGridPropertiesList )
{
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index bc908acdf85a..b61a58cd2238 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -61,7 +61,6 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-//static
VCoordinateSystem* VCoordinateSystem::createCoordinateSystem(
const Reference< XCoordinateSystem >& xCooSysModel )
{
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index 0bd98b642acb..b2172244f920 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -76,7 +76,6 @@ void VPolarGrid::getAllTickInfos( sal_Int32 nDimensionIndex, ::std::vector< ::st
aTickmarkHelper.getAllTicks( rAllTickInfos );
}
-//static
void VPolarGrid::createLinePointSequence_ForAngleAxis(
drawing::PointSequenceSequence& rPoints
, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 840cbbe3e1e1..4150fade8834 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2070,7 +2070,6 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForCh
return std::vector< ViewLegendEntry >();
}
-//static
VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
const uno::Reference<XChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index d8f997d36da9..c997f9ee483d 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -108,7 +108,7 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_Z_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_ORIGIN);
ppPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_X);
- ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
+ ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
ppPoolDefaults[SCHATTR_STAT_AVERAGE - SCHATTR_START] = new SfxBoolItem (SCHATTR_STAT_AVERAGE);
@@ -249,7 +249,6 @@ SfxMapUnit ChartItemPool::GetMetric(USHORT /* nWhich */) const
return SFX_MAPUNIT_100TH_MM;
}
-// static
SfxItemPool* ChartItemPool::CreateChartItemPool()
{
return new ChartItemPool();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 2347824664c5..390c1890154e 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -117,7 +117,6 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
using rtl::OUString;
-//static
const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -134,7 +133,6 @@ const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
return *pSeq;
}
-//static
ExplicitValueProvider* ExplicitValueProvider::getExplicitValueProvider(
const Reference< uno::XInterface >& xChartView )
{
@@ -1925,7 +1923,6 @@ sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
return nNumberFormatKey;
}
-//static
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
const Reference< chart2::XAxis >& xAxis
, const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
@@ -1935,7 +1932,6 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
, true /*bSearchForParallelAxisIfNothingIsFound*/ );
}
-//static
sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
sal_Int32 nRet=-1;
@@ -2014,7 +2010,6 @@ sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabe
return nFormat;
}
-//static
awt::Rectangle ExplicitValueProvider::addAxisTitleSizes(
const Reference< frame::XModel >& xChartModel
, const Reference< uno::XInterface >& xChartView
@@ -2082,7 +2077,6 @@ awt::Rectangle ExplicitValueProvider::addAxisTitleSizes(
return aRet;
}
-//static
awt::Rectangle ExplicitValueProvider::substractAxisTitleSizes(
const Reference< frame::XModel >& xChartModel
, const Reference< uno::XInterface >& xChartView
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 577f450172b5..83544d6a8f2b 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -370,7 +370,6 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const rtl::OUString& rName )
return getNamedSdrObject( rName, GetPage(0) );
}
-//static
SdrObject* DrawModelWrapper::getNamedSdrObject( const String& rObjectCID, SdrObjList* pSearchList )
{
if(!pSearchList || rObjectCID.Len()==0)
@@ -390,7 +389,6 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const String& rObjectCID, SdrObj
return 0;
}
-//static
bool DrawModelWrapper::removeShape( const uno::Reference< drawing::XShape >& xShape )
{
uno::Reference< container::XChild > xChild( xShape, uno::UNO_QUERY );
diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx
index 24ec5a285468..cd954f53b7ba 100644
--- a/chart2/source/view/main/LabelPositionHelper.cxx
+++ b/chart2/source/view/main/LabelPositionHelper.cxx
@@ -67,7 +67,6 @@ awt::Point LabelPositionHelper::transformSceneToScreenPosition( const drawing::P
rScenePosition3D, m_xLogicTarget, m_pShapeFactory, m_nDimensionCount );
}
-//static
void LabelPositionHelper::changeTextAdjustment( tAnySequence& rPropValues, const tNameSequence& rPropNames, LabelAlignment eAlignment)
{
//HorizontalAdjustment
@@ -107,7 +106,6 @@ void lcl_doDynamicFontResize( uno::Any* pAOldAndNewFontHeightAny
}
}
-//static
void LabelPositionHelper::doDynamicFontResize( tAnySequence& rPropValues
, const tNameSequence& rPropNames
, const uno::Reference< beans::XPropertySet >& xAxisModelProps
@@ -431,7 +429,6 @@ void lcl_correctRotation_Right_Bottom( double& rfXCorrection, double& rfYCorrect
}//end anonymous namespace
-//static
void LabelPositionHelper::correctPositionForRotation( const uno::Reference< drawing::XShape >& xShape2DText
, LabelAlignment eLabelAlignment, const double fRotationAngle, bool bRotateAroundCenter )
{
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index deb390b70a79..b5d39b2f898f 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -198,7 +198,6 @@ drawing::Position3D PlottingPositionHelper::transformScaledLogicToScene(
return SequenceToPosition3D(aSeq);
}
-//static
awt::Point PlottingPositionHelper::transformSceneToScreenPosition( const drawing::Position3D& rScenePosition3D
, const uno::Reference< drawing::XShapes >& xSceneTarget
, ShapeFactory* pShapeFactory
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index 1979582763fa..99b7c0bd2ae0 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -58,7 +58,6 @@ void lcl_overwriteOrAppendValues(
} // anonymous namespace
-//static
void PropertyMapper::setMappedProperties(
const uno::Reference< beans::XPropertySet >& xTarget
, const uno::Reference< beans::XPropertySet >& xSource
@@ -193,7 +192,6 @@ uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropVal
//Schatten UNO_NAME_CHAR_SHADOWED bool
*/
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
{
//shape property -- chart model object property
@@ -260,7 +258,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProper
return m_aShapePropertyMapForCharacterProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties()
{
//shape property -- chart model object property
@@ -277,7 +274,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProper
return m_aShapePropertyMapForParagraphProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties()
{
//shape property -- chart model object property
@@ -306,7 +302,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties(
return m_aShapePropertyMapForFillProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties()
{
//shape property -- chart model object property
@@ -322,7 +317,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties(
return m_aShapePropertyMapForLineProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
{
static tMakePropertyNameMap m_aShapePropertyMapForFillAndLineProperties =
@@ -334,7 +328,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProp
return m_aShapePropertyMapForFillAndLineProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProperties()
{
static tMakePropertyNameMap m_aShapePropertyMapForTextShapeProperties =
@@ -357,7 +350,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProper
return m_aShapePropertyMapForTextShapeProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesProperties()
{
//shape property -- chart model object property
@@ -374,7 +366,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesPrope
return m_aShapePropertyMapForLineSeriesProperties;
}
-//static
const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
{
//shape property -- chart model object property
@@ -410,7 +401,6 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesPro
return m_aShapePropertyMapForFilledSeriesProperties;
}
-// static
void PropertyMapper::setMultiProperties(
const tNameSequence& rNames
, const tAnySequence& rValues
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 721cabd15d83..311b5e076e9a 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -80,7 +80,6 @@ namespace chart
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//static
void ShapeFactory::setShapeName( const uno::Reference< drawing::XShape >& xShape
, const rtl::OUString& rName )
{
@@ -104,7 +103,6 @@ void ShapeFactory::setShapeName( const uno::Reference< drawing::XShape >& xShape
//-----------------------------------------------------------------------------
-//static
rtl::OUString ShapeFactory::getShapeName( const uno::Reference< drawing::XShape >& xShape )
{
rtl::OUString aRet;
@@ -1961,7 +1959,6 @@ uno::Reference< drawing::XShape >
return xShape;
}
-//static
rtl::OUString ShapeFactory::getStackedString( const rtl::OUString& rString, bool bStacked )
{
sal_Int32 nLen = rString.getLength();
@@ -1982,7 +1979,6 @@ rtl::OUString ShapeFactory::getStackedString( const rtl::OUString& rString, bool
return aStackStr.makeStringAndClear();
}
-//static
bool ShapeFactory::hasPolygonAnyLines( drawing::PolyPolygonShape3D& rPoly)
{
// #i67757# check all contained polygons, if at least one polygon contains 2 or more points, return true
@@ -1992,7 +1988,6 @@ bool ShapeFactory::hasPolygonAnyLines( drawing::PolyPolygonShape3D& rPoly)
return false;
}
-//static
bool ShapeFactory::isPolygonEmptyOrSinglePoint( drawing::PolyPolygonShape3D& rPoly)
{
// true, if empty polypolygon or one polygon with one point
@@ -2000,7 +1995,6 @@ bool ShapeFactory::isPolygonEmptyOrSinglePoint( drawing::PolyPolygonShape3D& rPo
((rPoly.SequenceX.getLength() == 1) && (rPoly.SequenceX[0].getLength() <= 1));
}
-//static
void ShapeFactory::closePolygon( drawing::PolyPolygonShape3D& rPoly)
{
DBG_ASSERT( rPoly.SequenceX.getLength() <= 1, "ShapeFactory::closePolygon - single polygon expected" );
@@ -2011,7 +2005,6 @@ void ShapeFactory::closePolygon( drawing::PolyPolygonShape3D& rPoly)
AddPointToPoly( rPoly, aFirst );
}
-//static
awt::Size ShapeFactory::calculateNewSizeRespectingAspectRatio(
const awt::Size& rTargetSize
, const awt::Size& rSourceSizeWithCorrectAspectRatio )
@@ -2027,7 +2020,6 @@ awt::Size ShapeFactory::calculateNewSizeRespectingAspectRatio(
return aNewSize;
}
-//static
awt::Point ShapeFactory::calculateTopLeftPositionToCenterObject(
const awt::Point& rTargetAreaPosition
, const awt::Size& rTargetAreaSize
@@ -2039,7 +2031,6 @@ awt::Point ShapeFactory::calculateTopLeftPositionToCenterObject(
return aNewPosition;
}
-//static
::basegfx::B2IRectangle ShapeFactory::getRectangleOfShape(
const uno::Reference< drawing::XShape >& xShape )
{
@@ -2055,7 +2046,6 @@ awt::Point ShapeFactory::calculateTopLeftPositionToCenterObject(
}
-//static
awt::Size ShapeFactory::getSizeAfterRotation(
const uno::Reference< drawing::XShape >& xShape, double fRotationAngleDegree )
{
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 7101a984ee24..9a011498991b 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -651,7 +651,6 @@ void VLegend::setDefaultWritingMode( sal_Int16 nDefaultWritingMode )
// ----------------------------------------
-// static
bool VLegend::isVisible( const Reference< XLegend > & xLegend )
{
if( ! xLegend.is())
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index 958a8defe0b6..d29b28e8dbe9 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -104,7 +104,6 @@ void lcl_setPropetiesToShape(
namespace chart
{
-// static
Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
const Reference< drawing::XShapes > xSymbolContainer,
chart2::LegendSymbolStyle eStyle,
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index a53f167b164a..d3d02818b358 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -205,7 +205,6 @@ private:
const ScPatternAttr* GetCurrentAttrsFlat();
const ScPatternAttr* GetCurrentAttrsDeep();
SfxItemSet* GetCurrentDataSet(bool bNoDflt = false);
- const ScMarkData* GetMarkData();
void ForgetMarkData();
void ForgetCurrentAttrs();
@@ -218,6 +217,8 @@ private:
const ScAddress* pLastPos);
protected:
+ const ScMarkData* GetMarkData();
+
// GetItemPropertyMap for derived classes must contain all entries, including base class
virtual const SfxItemPropertyMap* GetItemPropertyMap();
virtual ::com::sun::star::beans::PropertyState GetOnePropertyState(
@@ -815,7 +816,7 @@ public:
//! really derive cell from range?
-class ScCellObj : public ScCellRangeObj,
+class SC_DLLPUBLIC ScCellObj : public ScCellRangeObj,
public com::sun::star::text::XText,
public com::sun::star::container::XEnumerationAccess,
public com::sun::star::table::XCell,
@@ -874,6 +875,8 @@ public:
const ::rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar );
const ScAddress& GetPosition() const { return aCellPos; }
+ void InputEnglishString( const ::rtl::OUString& rText );
+
// XText
virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference<
::com::sun::star::text::XTextRange >& xRange,
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 5c4685223281..90aac02aab7f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -556,7 +556,7 @@ public:
SC_DLLPUBLIC BOOL HasTable( SCTAB nTab ) const;
SC_DLLPUBLIC BOOL GetName( SCTAB nTab, String& rName ) const;
SC_DLLPUBLIC BOOL GetCodeName( SCTAB nTab, String& rName ) const;
- SC_DLLPUBLIC BOOL SetCodeName( SCTAB nTab, String& rName );
+ SC_DLLPUBLIC BOOL SetCodeName( SCTAB nTab, const String& rName );
SC_DLLPUBLIC BOOL GetTable( const String& rName, SCTAB& rTab ) const;
SC_DLLPUBLIC inline SCTAB GetTableCount() const { return nMaxTableNumber; }
SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; }
@@ -748,6 +748,7 @@ public:
bool HasSheetEventScript( SCTAB nTab, sal_Int32 nEvent, bool bWithVbaEvents = false ) const;
bool HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents = false ) const; // on any sheet
+ bool HasAnyCalcNotification() const;
BOOL HasCalcNotification( SCTAB nTab ) const;
void SetCalcNotification( SCTAB nTab );
void ResetCalcNotifications();
@@ -926,8 +927,8 @@ public:
/** Shrink a range to only include used data area. */
bool ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
- void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const;
+ SC_DLLPUBLIC void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
+ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const;
SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 14c9515dfacb..92424e8178f4 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -105,6 +105,7 @@ private:
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawMarkerTab;
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawDashTab;
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xChartDataProv;
+ com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xObjProvider;
::cppu::OInterfaceContainerHelper maChangesListeners;
diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index 19b5c60fd070..0f03e0e9b111 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -225,7 +225,8 @@ public:
void SelectionChanged();
void VisAreaChanged();
- void SheetChanged();
+ // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
+ void SheetChanged( bool bSameTabButMoved = false );
bool IsMouseListening() const;
sal_Bool MousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException);
sal_Bool MouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException);
diff --git a/sc/prj/build.lst b/sc/prj/build.lst
index 08d9f97b23f4..f5ab2a5f73fe 100644
--- a/sc/prj/build.lst
+++ b/sc/prj/build.lst
@@ -1,4 +1,4 @@
-sc sc : filter l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox NULL
+sc sc : filter l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox LIBXSLT:libxslt NULL
sc sc usr1 - all sc_mkout NULL
sc sc\inc nmake - all sc_inc NULL
sc sc\prj get - all sc_prj NULL
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 8fea4b8af2b9..f3b3f1ab32c6 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -544,6 +544,14 @@ bool ScDocument::HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents )
return false;
}
+bool ScDocument::HasAnyCalcNotification() const
+{
+ for (SCTAB nTab = 0; nTab <= MAXTAB; nTab++)
+ if (pTab[nTab] && pTab[nTab]->GetCalcNotification())
+ return true;
+ return false;
+}
+
BOOL ScDocument::HasCalcNotification( SCTAB nTab ) const
{
if (VALIDTAB(nTab) && pTab[nTab])
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 192e6f69bc67..3711b1b68603 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -158,7 +158,7 @@ BOOL ScDocument::GetName( SCTAB nTab, String& rName ) const
return FALSE;
}
-BOOL ScDocument::SetCodeName( SCTAB nTab, String& rName )
+BOOL ScDocument::SetCodeName( SCTAB nTab, const String& rName )
{
if (VALIDTAB(nTab))
{
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index a2fa45764bcc..d36f4d431fdf 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -46,6 +46,7 @@
#include "global.hxx"
#include "globstr.hrc"
+using namespace com::sun::star;
static ScProgress theDummyInterpretProgress;
@@ -78,6 +79,14 @@ BOOL lcl_IsHiddenDocument( SfxObjectShell* pObjSh )
return FALSE;
}
+bool lcl_HasControllersLocked( SfxObjectShell& rObjSh )
+{
+ uno::Reference<frame::XModel> xModel( rObjSh.GetBaseModel() );
+ if (xModel.is())
+ return xModel->hasControllersLocked();
+ return false;
+}
+
ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText,
ULONG nRange, BOOL bAllDocs, BOOL bWait )
{
@@ -104,10 +113,12 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText,
pProgress = NULL;
}
else if ( pObjSh && ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
- pObjSh->GetProgress() ) )
+ pObjSh->GetProgress() ||
+ lcl_HasControllersLocked(*pObjSh) ) )
{
// #62808# no own progress for embedded objects,
// #73633# no second progress if the document already has one
+ // #163566# no progress while controllers are locked (repaint disabled)
pProgress = NULL;
}
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 458629979172..f20b63efe7ba 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -222,7 +222,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
else
{
if( IsDocumentEncrypted() )
- Add( new XclExpFilePass( GetRoot() ) );
+ Add( new XclExpFileEncryption( GetRoot() ) );
Add( new XclExpInterfaceHdr( nCodePage ) );
Add( new XclExpUInt16Record( EXC_ID_MMS, 0 ) );
Add( new XclExpInterfaceEnd );
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 3a43a23cd624..90ac8011a4bf 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -31,6 +31,8 @@
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/request.hxx>
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
#include <tools/globname.hxx>
@@ -99,10 +101,17 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
SfxItemSet* pItemSet = rMedium.GetItemSet();
if( pItemSet )
{
- if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
- aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pItem->GetValue() );
- if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_PASSWORD ) ) )
- aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pItem->GetValue() );
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
+ if( pFileNameItem )
+ aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
+
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if( pPasswordItem )
+ aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
+
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if( pEncryptionDataItem )
+ aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler();
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index d75a0e669603..77afeb58d945 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -55,6 +55,7 @@
#include <editeng/flditem.hxx>
#include <svx/xflclit.hxx>
#include <filter/msfilter/svxmsbas.hxx>
+#include <oox/xls/excelvbaproject.hxx>
#include <basic/basmgr.hxx>
#include <vcl/graph.hxx>
@@ -243,6 +244,10 @@ void ImportExcel8::ReadBasic( void )
SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg );
bool bAsComment = !bLoadExecutable;
aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment );
+
+ uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY );
+ ::oox::xls::ExcelVbaProject aVbaProject( ::comphelper::getProcessServiceFactory(), xDocument );
+ aVbaProject.createMissingModules();
}
}
}
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 50e07ae1f2ed..4632a10a088e 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -28,7 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <rtl/random.h>
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
#include <unotools/saveopt.hxx>
#include <svl/itemset.hxx>
@@ -51,6 +54,8 @@
#include "document.hxx"
#include "scextopt.hxx"
+using namespace ::com::sun::star;
+
// Global data ================================================================
XclExpRootData::XclExpRootData( XclBiff eBiff, SfxMedium& rMedium,
@@ -241,23 +246,66 @@ bool XclExpRoot::IsDocumentEncrypted() const
if (pDocProt && pDocProt->isProtected() && pDocProt->isOptionEnabled(ScDocProtection::STRUCTURE))
return true;
- if (GetPassword().Len() > 0)
+ if ( GetEncryptionData().getLength() > 0 )
// Password is entered directly into the save dialog.
return true;
return false;
}
-String XclExpRoot::GetPassword() const
+uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const ::rtl::OUString& aPass ) const
{
- if( SfxItemSet* pItemSet = GetMedium().GetItemSet() )
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+
+ if ( aPass.getLength() > 0 && aPass.getLength() < 16 )
{
- const SfxPoolItem* pItem = 0;
- if( pItemSet->GetItemState( SID_PASSWORD, TRUE, &pItem ) == SFX_ITEM_SET )
- if( const SfxStringItem* pStrItem = dynamic_cast< const SfxStringItem* >( pItem ) )
- return pStrItem->GetValue();
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+
+ sal_uInt8 pnDocId[16];
+ rtl_random_getBytes( aRandomPool, pnDocId, 16 );
+
+ rtl_random_destroyPool( aRandomPool );
+
+ sal_uInt16 pnPasswd[16];
+ memset( pnPasswd, 0, sizeof( pnPasswd ) );
+ for (xub_StrLen nChar = 0; nChar < aPass.getLength(); ++nChar )
+ pnPasswd[nChar] = aPass.getStr()[nChar];
+
+ ::msfilter::MSCodec_Std97 aCodec;
+ aCodec.InitKey( pnPasswd, pnDocId );
+ aEncryptionData = aCodec.GetEncryptionData();
}
- return String::EmptyString();
+
+ return aEncryptionData;
+}
+
+uno::Sequence< beans::NamedValue > XclExpRoot::GetEncryptionData() const
+{
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ if ( pEncryptionDataItem )
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+ else
+ {
+ // try to get the encryption data from the password
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ if ( pPasswordItem && pPasswordItem->GetValue().Len() )
+ aEncryptionData = GenerateEncryptionData( pPasswordItem->GetValue() );
+ }
+
+ return aEncryptionData;
+}
+
+uno::Sequence< beans::NamedValue > XclExpRoot::GenerateDefaultEncryptionData() const
+{
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( GetDefaultPassword().Len() > 0 )
+ aEncryptionData = GenerateEncryptionData( GetDefaultPassword() );
+
+ return aEncryptionData;
}
XclExpRootData::XclExpLinkMgrRef XclExpRoot::GetLocalLinkMgrRef() const
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index f828079c8735..356b0d8bab42 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -32,6 +32,7 @@
#include <utility>
#include <rtl/ustring.hxx>
+#include <rtl/random.h>
#include <sax/fshelper.hxx>
#include <unotools/streamwrap.hxx>
@@ -65,6 +66,7 @@ using ::utl::OStreamWrapper;
using ::std::vector;
using namespace formula;
+using namespace ::com::sun::star;
// ============================================================================
@@ -484,17 +486,16 @@ void XclExpStream::WriteRawZeroBytes( sal_Size nBytes )
// ============================================================================
-XclExpBiff8Encrypter::XclExpBiff8Encrypter( const XclExpRoot& rRoot, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] ) :
+XclExpBiff8Encrypter::XclExpBiff8Encrypter( const XclExpRoot& rRoot ) :
mrRoot(rRoot),
mnOldPos(STREAM_SEEK_TO_END),
mbValid(false)
{
- String aPass = rRoot.GetPassword();
- if (aPass.Len() == 0)
+ uno::Sequence< beans::NamedValue > aEncryptionData = rRoot.GetEncryptionData();
+ if ( aEncryptionData.getLength() == 0 )
// Empty password. Get the default biff8 password.
- aPass = rRoot.GetDefaultPassword();
- Init(aPass, nDocId, nSalt);
+ aEncryptionData = rRoot.GenerateDefaultEncryptionData();
+ Init( aEncryptionData );
}
XclExpBiff8Encrypter::~XclExpBiff8Encrypter()
@@ -506,9 +507,22 @@ bool XclExpBiff8Encrypter::IsValid() const
return mbValid;
}
-void XclExpBiff8Encrypter::GetSaltDigest( sal_uInt8 nSaltDigest[16] ) const
+void XclExpBiff8Encrypter::GetSaltDigest( sal_uInt8 pnSaltDigest[16] ) const
{
- memcpy(nSaltDigest, mnSaltDigest, 16);
+ if ( sizeof( mpnSaltDigest ) == 16 )
+ memcpy( pnSaltDigest, mpnSaltDigest, 16 );
+}
+
+void XclExpBiff8Encrypter::GetSalt( sal_uInt8 pnSalt[16] ) const
+{
+ if ( sizeof( mpnSalt ) == 16 )
+ memcpy( pnSalt, mpnSalt, 16 );
+}
+
+void XclExpBiff8Encrypter::GetDocId( sal_uInt8 pnDocId[16] ) const
+{
+ if ( sizeof( mpnDocId ) == 16 )
+ memcpy( pnDocId, mpnDocId, 16 );
}
void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_uInt8 nData )
@@ -565,36 +579,32 @@ void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_Int32 nData )
Encrypt(rStrm, static_cast<sal_uInt32>(nData));
}
-void XclExpBiff8Encrypter::Init( const String& aPass, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] )
+void XclExpBiff8Encrypter::Init( const uno::Sequence< beans::NamedValue >& aEncryptionData )
{
- memset(mnSaltDigest, 0, sizeof(mnSaltDigest));
+ mbValid = false;
- xub_StrLen nLen = aPass.Len();
- bool bValid = (0 < nLen) && (nLen < 16);
- if ( bValid )
+ if ( maCodec.InitCodec( aEncryptionData ) )
{
- // transform String to sal_uInt16 array
- memset(mnPassw, 0, sizeof(mnPassw));
- for (xub_StrLen nChar = 0; nChar < nLen; ++nChar)
- mnPassw[nChar] = static_cast<sal_uInt16>(aPass.GetChar(nChar));
+ maCodec.GetDocId( mpnDocId );
- // copy document ID
- memcpy(mnDocId, nDocId, sizeof(mnDocId));
+ // generate the salt here
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes( aRandomPool, &aTime, 8 );
+ rtl_random_getBytes( aRandomPool, mpnSalt, 16 );
+ rtl_random_destroyPool( aRandomPool );
- // init codec
- maCodec.InitKey(mnPassw, mnDocId);
+ memset( mpnSaltDigest, 0, sizeof( mpnSaltDigest ) );
// generate salt hash.
::msfilter::MSCodec_Std97 aCodec;
- aCodec.InitKey(mnPassw, mnDocId);
- aCodec.CreateSaltDigest(nSalt, mnSaltDigest);
+ aCodec.InitCodec( aEncryptionData );
+ aCodec.CreateSaltDigest( mpnSalt, mpnSaltDigest );
// verify to make sure it's in good shape.
- bValid = maCodec.VerifyKey(nSalt, mnSaltDigest);
+ mbValid = maCodec.VerifyKey( mpnSalt, mpnSaltDigest );
}
-
- mbValid = bValid;
}
sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( sal_Size nStrmPos ) const
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index fb1eb9a3bf44..b210d18f479c 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -1118,7 +1118,7 @@ ErrCode XclImpDecryptHelper::ReadFilepass( XclImpStream& rStrm )
// request and verify a password (decrypter implements IDocPasswordVerifier)
if( xDecr.is() )
- rStrm.GetRoot().RequestPassword( *xDecr );
+ rStrm.GetRoot().RequestEncryptionData( *xDecr );
// return error code (success, wrong password, etc.)
return xDecr.is() ? xDecr->GetError() : EXC_ENCR_ERROR_UNSUPP_CRYPT;
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 5f8bcbd481e5..9f83dacf4ca0 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -107,7 +107,7 @@ void XclImpRoot::SetAppFontEncoding( rtl_TextEncoding eAppFontEnc )
SetTextEncoding( eAppFontEnc );
}
-void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ )
+void XclImpRoot::InitializeTable( SCTAB nScTab )
{
if( GetBiff() <= EXC_BIFF4 )
{
@@ -119,6 +119,8 @@ void XclImpRoot::InitializeTable( SCTAB /*nScTab*/ )
GetXFRangeBuffer().Initialize();
GetPageSettings().Initialize();
GetTabViewSettings().Initialize();
+ // delete the automatically generated codename
+ GetDoc().SetCodeName( nScTab, String::EmptyString() );
}
void XclImpRoot::FinalizeTable()
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 98db9dcb4471..534d40fa5cd5 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <comphelper/docpasswordhelper.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+
#include "xistream.hxx"
#include "xlstring.hxx"
#include "xiroot.hxx"
@@ -38,6 +41,8 @@ using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringToOString;
+using namespace ::com::sun::star;
+
// ============================================================================
// Decryption
// ============================================================================
@@ -69,9 +74,16 @@ XclImpDecrypterRef XclImpDecrypter::Clone() const
return xNewDecr;
}
-::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword( const ::rtl::OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
+{
+ o_rEncryptionData = OnVerifyPassword( rPassword );
+ mnError = o_rEncryptionData.getLength() ? ERRCODE_NONE : ERRCODE_ABORT;
+ return o_rEncryptionData.getLength() ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
+::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
{
- bool bValid = OnVerify( rPassword );
+ bool bValid = OnVerifyEncryptionData( rEncryptionData );
mnError = bValid ? ERRCODE_NONE : ERRCODE_ABORT;
return bValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
@@ -110,7 +122,6 @@ sal_uInt16 XclImpDecrypter::Read( SvStream& rStrm, void* pData, sal_uInt16 nByte
// ----------------------------------------------------------------------------
XclImpBiff5Decrypter::XclImpBiff5Decrypter( sal_uInt16 nKey, sal_uInt16 nHash ) :
- maPassword( 16 ),
mnKey( nKey ),
mnHash( nHash )
{
@@ -118,12 +129,12 @@ XclImpBiff5Decrypter::XclImpBiff5Decrypter( sal_uInt16 nKey, sal_uInt16 nHash )
XclImpBiff5Decrypter::XclImpBiff5Decrypter( const XclImpBiff5Decrypter& rSrc ) :
XclImpDecrypter( rSrc ),
- maPassword( rSrc.maPassword ),
+ maEncryptionData( rSrc.maEncryptionData ),
mnKey( rSrc.mnKey ),
mnHash( rSrc.mnHash )
{
if( IsValid() )
- maCodec.InitKey( &maPassword.front() );
+ maCodec.InitCodec( maEncryptionData );
}
XclImpBiff5Decrypter* XclImpBiff5Decrypter::OnClone() const
@@ -131,24 +142,59 @@ XclImpBiff5Decrypter* XclImpBiff5Decrypter::OnClone() const
return new XclImpBiff5Decrypter( *this );
}
-bool XclImpBiff5Decrypter::OnVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
/* Convert password to a byte string. TODO: this needs some finetuning
according to the spec... */
OString aBytePassword = OUStringToOString( rPassword, osl_getThreadTextEncoding() );
sal_Int32 nLen = aBytePassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
- // copy byte string to sal_uInt8 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
- memcpy( &maPassword.front(), aBytePassword.getStr(), static_cast< size_t >( nLen ) );
+ // init codec
+ maCodec.InitKey( (sal_uInt8*)aBytePassword.getStr() );
+
+ if ( maCodec.VerifyKey( mnKey, mnHash ) )
+ {
+ maEncryptionData = maCodec.GetEncryptionData();
+
+ // since the export uses Std97 encryption always we have to request it here
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
+ for( sal_Int32 nInd = 0; nInd < nLen; ++nInd, ++aIt )
+ *aIt = static_cast< sal_uInt16 >( rPassword.getStr()[nInd] );
+
+ uno::Sequence< sal_Int8 > aDocId = ::comphelper::DocPasswordHelper::GenerateRandomByteSequence( 16 );
+ OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the senquence!" );
+
+ ::msfilter::MSCodec_Std97 aCodec97;
+ aCodec97.InitKey( &aPassVect.front(), (sal_uInt8*)aDocId.getConstArray() );
+
+ // merge the EncryptionData, there should be no conflicts
+ ::comphelper::SequenceAsHashMap aEncryptionHash( maEncryptionData );
+ aEncryptionHash.update( ::comphelper::SequenceAsHashMap( aCodec97.GetEncryptionData() ) );
+ aEncryptionHash >> maEncryptionData;
+ }
+ }
+
+ return maEncryptionData;
+}
+bool XclImpBiff5Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
// init codec
- maCodec.InitKey( &maPassword.front() );
- return maCodec.VerifyKey( mnKey, mnHash );
+ maCodec.InitCodec( rEncryptionData );
+
+ if ( maCodec.VerifyKey( mnKey, mnHash ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
void XclImpBiff5Decrypter::OnUpdate( sal_Size /*nOldStrmPos*/, sal_Size nNewStrmPos, sal_uInt16 nRecSize )
@@ -168,7 +214,6 @@ sal_uInt16 XclImpBiff5Decrypter::OnRead( SvStream& rStrm, sal_uInt8* pnData, sal
XclImpBiff8Decrypter::XclImpBiff8Decrypter( sal_uInt8 pnSalt[ 16 ],
sal_uInt8 pnVerifier[ 16 ], sal_uInt8 pnVerifierHash[ 16 ] ) :
- maPassword( 16, 0 ),
maSalt( pnSalt, pnSalt + 16 ),
maVerifier( pnVerifier, pnVerifier + 16 ),
maVerifierHash( pnVerifierHash, pnVerifierHash + 16 )
@@ -177,13 +222,13 @@ XclImpBiff8Decrypter::XclImpBiff8Decrypter( sal_uInt8 pnSalt[ 16 ],
XclImpBiff8Decrypter::XclImpBiff8Decrypter( const XclImpBiff8Decrypter& rSrc ) :
XclImpDecrypter( rSrc ),
- maPassword( rSrc.maPassword ),
+ maEncryptionData( rSrc.maEncryptionData ),
maSalt( rSrc.maSalt ),
maVerifier( rSrc.maVerifier ),
maVerifierHash( rSrc.maVerifierHash )
{
if( IsValid() )
- maCodec.InitKey( &maPassword.front(), &maSalt.front() );
+ maCodec.InitCodec( maEncryptionData );
}
XclImpBiff8Decrypter* XclImpBiff8Decrypter::OnClone() const
@@ -191,25 +236,44 @@ XclImpBiff8Decrypter* XclImpBiff8Decrypter::OnClone() const
return new XclImpBiff8Decrypter( *this );
}
-bool XclImpBiff8Decrypter::OnVerify( const OUString& rPassword )
+uno::Sequence< beans::NamedValue > XclImpBiff8Decrypter::OnVerifyPassword( const ::rtl::OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
sal_Int32 nLen = rPassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
// copy string to sal_uInt16 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
const sal_Unicode* pcChar = rPassword.getStr();
const sal_Unicode* pcCharEnd = pcChar + nLen;
- ::std::vector< sal_uInt16 >::iterator aIt = maPassword.begin();
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
for( ; pcChar < pcCharEnd; ++pcChar, ++aIt )
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- maCodec.InitKey( &maPassword.front(), &maSalt.front() );
- return maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() );
+ maCodec.InitKey( &aPassVect.front(), &maSalt.front() );
+ if ( maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = maCodec.GetEncryptionData();
+ }
+
+ return maEncryptionData;
+}
+
+bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.getLength() )
+ {
+ // init codec
+ maCodec.InitCodec( rEncryptionData );
+
+ if ( maCodec.VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.getLength();
}
void XclImpBiff8Decrypter::OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 /*nRecSize*/ )
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 2b2180db5e6a..c6d6c5b9246a 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -71,6 +71,8 @@ using ::com::sun::star::frame::XFrame;
using ::com::sun::star::frame::XFramesSupplier;
using ::com::sun::star::lang::XMultiServiceFactory;
+using namespace ::com::sun::star;
+
// Global data ================================================================
#ifdef DBG_UTIL
@@ -240,11 +242,11 @@ sal_Int32 XclRoot::GetHmmFromPixelY( double fPixelY ) const
return static_cast< sal_Int32 >( fPixelY * mrData.mfScreenPixelY + 0.5 );
}
-String XclRoot::RequestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+uno::Sequence< beans::NamedValue > XclRoot::RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( mrData.maDefPassword );
- return ScfApiHelper::QueryPasswordForMedium( mrData.mrMedium, rVerifier, &aDefaultPasswords );
+ return ScfApiHelper::QueryEncryptionDataForMedium( mrData.mrMedium, rVerifier, &aDefaultPasswords );
}
bool XclRoot::HasVbaStorage() const
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index eeef52aed550..185923b28277 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -38,6 +38,8 @@
#include <tools/urlobj.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
#include <svl/stritem.hxx>
#include <svl/itemset.hxx>
@@ -59,6 +61,8 @@ using ::com::sun::star::lang::XServiceName;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER;
+using namespace ::com::sun::star;
+
// Static helper functions ====================================================
OUString ScfApiHelper::GetServiceName( Reference< XInterface > xInt )
@@ -136,25 +140,33 @@ Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
return CreateInstanceWithArgs( ::comphelper::getProcessServiceFactory(), rServiceName, rArgs );
}
-String ScfApiHelper::QueryPasswordForMedium( SfxMedium& rMedium,
+uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( SfxMedium& rMedium,
::comphelper::IDocPasswordVerifier& rVerifier, const ::std::vector< OUString >* pDefaultPasswords )
{
- OUString aMediaPassword;
- SfxItemSet* pItemSet = rMedium.GetItemSet();
- const SfxPoolItem *pPasswordItem;
- if( pItemSet && (SFX_ITEM_SET == pItemSet->GetItemState( SID_PASSWORD, TRUE, &pPasswordItem )) )
- aMediaPassword = static_cast< const SfxStringItem* >( pPasswordItem )->GetValue();
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ if ( pEncryptionDataItem )
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+
+ ::rtl::OUString aPassword;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if ( pPasswordItem )
+ aPassword = pPasswordItem->GetValue();
+
OUString aDocName = INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DECODE_WITH_CHARSET );
bool bIsDefaultPassword = false;
- OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
- rVerifier, aMediaPassword, rMedium.GetInteractionHandler(), aDocName,
+ aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ rVerifier, aEncryptionData, aPassword, rMedium.GetInteractionHandler(), aDocName,
::comphelper::DocPasswordRequestType_MS, pDefaultPasswords, &bIsDefaultPassword );
- if( !bIsDefaultPassword && (aPassword.getLength() > 0) && pItemSet )
- pItemSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) );
+ rMedium.GetItemSet()->ClearItem( SID_PASSWORD );
+ rMedium.GetItemSet()->ClearItem( SID_ENCRYPTIONDATA );
+
+ if( !bIsDefaultPassword && (aEncryptionData.getLength() > 0) )
+ rMedium.GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
- return aPassword;
+ return aEncryptionData;
}
// Property sets ==============================================================
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 8c204f1cef35..699a4e28720a 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <tools/color.hxx>
#include <comphelper/types.hxx>
#include "ftools.hxx"
@@ -106,9 +107,9 @@ public:
const ::rtl::OUString& rServiceName,
const UnoAnySequence& rArgs );
- /** Opens a password dialog and returns the entered password.
- @return The entered password or an empty string on 'Cancel' or any error. */
- static String QueryPasswordForMedium( SfxMedium& rMedium,
+ /** Opens a password dialog and returns the encryption data.
+ @return The encryption data or an empty sequence on 'Cancel' or any error. */
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > QueryEncryptionDataForMedium( SfxMedium& rMedium,
::comphelper::IDocPasswordVerifier& rVerifier,
const ::std::vector< ::rtl::OUString >* pDefaultPasswords = 0 );
};
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 201562fa752c..8afbe946d2f7 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -478,11 +478,11 @@ public:
// ============================================================================
-class XclExpFilePass : public XclExpRecord
+class XclExpFileEncryption : public XclExpRecord
{
public:
- explicit XclExpFilePass( const XclExpRoot& rRoot );
- virtual ~XclExpFilePass();
+ explicit XclExpFileEncryption( const XclExpRoot& rRoot );
+ virtual ~XclExpFileEncryption();
private:
virtual void WriteBody( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx
index 980590f9d4ff..ba51abdef1a2 100644
--- a/sc/source/filter/inc/xeroot.hxx
+++ b/sc/source/filter/inc/xeroot.hxx
@@ -28,6 +28,8 @@
#ifndef SC_XEROOT_HXX
#define SC_XEROOT_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include "xlroot.hxx"
// Forward declarations of objects in public use ==============================
@@ -158,7 +160,9 @@ public:
bool IsDocumentEncrypted() const;
- String GetPassword() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GenerateEncryptionData( const ::rtl::OUString& aPass ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GetEncryptionData() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > GenerateDefaultEncryptionData() const;
private:
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 3308827441dd..38acef2783e8 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -30,6 +30,8 @@
#ifndef SC_XESTREAM_HXX
#define SC_XESTREAM_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <map>
#include <stack>
#include <string>
@@ -216,13 +218,14 @@ private:
class XclExpBiff8Encrypter
{
public:
- explicit XclExpBiff8Encrypter( const XclExpRoot& rRoot, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] );
+ explicit XclExpBiff8Encrypter( const XclExpRoot& rRoot );
~XclExpBiff8Encrypter();
bool IsValid() const;
- void GetSaltDigest( sal_uInt8 nSaltDigest[16] ) const;
+ void GetSaltDigest( sal_uInt8 pnSaltDigest[16] ) const;
+ void GetSalt( sal_uInt8 pnSalt[16] ) const;
+ void GetDocId( sal_uInt8 pnDocId[16] ) const;
void Encrypt( SvStream& rStrm, sal_uInt8 nData );
void Encrypt( SvStream& rStrm, sal_uInt16 nData );
@@ -238,17 +241,16 @@ public:
void EncryptBytes( SvStream& rStrm, ::std::vector<sal_uInt8>& aBytes );
private:
- void Init( const String& aPass, const sal_uInt8 nDocId[16],
- const sal_uInt8 nSalt[16] );
+ void Init( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData );
sal_uInt32 GetBlockPos( sal_Size nStrmPos ) const;
sal_uInt16 GetOffsetInBlock( sal_Size nStrmPos ) const;
private:
::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation.
- sal_uInt16 mnPassw[16]; /// Cached password data for copy construction.
- sal_uInt8 mnDocId[16]; /// Cached document ID for copy construction.
- sal_uInt8 mnSaltDigest[16];
+ sal_uInt8 mpnDocId[16];
+ sal_uInt8 mpnSalt[16];
+ sal_uInt8 mpnSaltDigest[16];
const XclExpRoot& mrRoot;
sal_Size mnOldPos; /// Last known stream position
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index 9b27077d78e7..4aec7c337a32 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -64,10 +64,9 @@ public:
/** Creates a (ref-counted) copy of this decrypter object. */
XclImpDecrypterRef Clone() const;
- /** Implementation of the ::comphelper::IDocPasswordVerifier interface,
- calls the new virtual function implVerify(). */
- virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const ::rtl::OUString& rPassword );
+ /** Implementation of the ::comphelper::IDocPasswordVerifier interface */
+ virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Updates the decrypter on start of a new record or after seeking stream. */
void Update( SvStream& rStrm, sal_uInt16 nRecSize );
@@ -84,7 +83,10 @@ private:
virtual XclImpDecrypter* OnClone() const = 0;
/** Derived classes implement password verification and initialization of
the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword ) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData ) = 0;
+
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) = 0;
/** Implementation of the decryption. */
@@ -111,7 +113,9 @@ private:
/** Implementation of cloning this object. */
virtual XclImpBiff5Decrypter* OnClone() const;
/** Implements password verification and initialization of the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize );
/** Implementation of the decryption. */
@@ -119,7 +123,7 @@ private:
private:
::msfilter::MSCodec_XorXLS95 maCodec; /// Crypto algorithm implementation.
- ::std::vector< sal_uInt8 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
sal_uInt16 mnKey;
sal_uInt16 mnHash;
};
@@ -140,7 +144,9 @@ private:
/** Implementation of cloning this object. */
virtual XclImpBiff8Decrypter* OnClone() const;
/** Implements password verification and initialization of the decoder. */
- virtual bool OnVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ OnVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool OnVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of updating the decrypter. */
virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize );
/** Implementation of the decryption. */
@@ -153,7 +159,7 @@ private:
private:
::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation.
- ::std::vector< sal_uInt16 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
::std::vector< sal_uInt8 > maSalt;
::std::vector< sal_uInt8 > maVerifier;
::std::vector< sal_uInt8 > maVerifierHash;
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index 2f029c74baa9..44ded449cd76 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -28,6 +28,8 @@
#ifndef SC_XLROOT_HXX
#define SC_XLROOT_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <i18npool/lang.h>
#include <sot/storage.hxx>
#include "xlconst.hxx"
@@ -196,7 +198,8 @@ public:
/** Returns the default password used for stream encryption. */
inline const String& GetDefaultPassword() const { return mrData.maDefPassword; }
/** Requests and verifies a password from the medium or the user. */
- String RequestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
/** Returns the OLE2 root storage of the imported/exported file.
@return Pointer to root storage or 0, if the file is a simple stream. */
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index df6bdcbbe671..209bbc83f6c3 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1251,27 +1251,18 @@ void XclDelta::SaveXml( XclExpXmlStream& rStrm )
// ============================================================================
-XclExpFilePass::XclExpFilePass( const XclExpRoot& rRoot ) :
+XclExpFileEncryption::XclExpFileEncryption( const XclExpRoot& rRoot ) :
XclExpRecord(0x002F, 54),
mrRoot(rRoot)
{
}
-XclExpFilePass::~XclExpFilePass()
+XclExpFileEncryption::~XclExpFileEncryption()
{
}
-void XclExpFilePass::WriteBody( XclExpStream& rStrm )
+void XclExpFileEncryption::WriteBody( XclExpStream& rStrm )
{
- static const sal_uInt8 nDocId[] = {
- 0x17, 0xf7, 0x01, 0x08, 0xea, 0xad, 0x30, 0x5c,
- 0x1a, 0x95, 0xa5, 0x75, 0xd6, 0x79, 0xcd, 0x8d };
-
-
- static const sal_uInt8 nSalt[] = {
- 0xa4, 0x5b, 0xf7, 0xe9, 0x9f, 0x55, 0x21, 0xc5,
- 0xc5, 0x56, 0xa8, 0x0d, 0x39, 0x05, 0x3a, 0xb4 };
-
// 0x0000 - neither standard nor strong encryption
// 0x0001 - standard or strong encryption
rStrm << static_cast<sal_uInt16>(0x0001);
@@ -1281,13 +1272,17 @@ void XclExpFilePass::WriteBody( XclExpStream& rStrm )
sal_uInt16 nStdEnc = 0x0001;
rStrm << nStdEnc << nStdEnc;
- sal_uInt8 nSaltHash[16];
- XclExpEncrypterRef xEnc( new XclExpBiff8Encrypter(mrRoot, nDocId, nSalt) );
- xEnc->GetSaltDigest(nSaltHash);
-
- rStrm.Write(nDocId, 16);
- rStrm.Write(nSalt, 16);
- rStrm.Write(nSaltHash, 16);
+ sal_uInt8 pnDocId[16];
+ sal_uInt8 pnSalt[16];
+ sal_uInt8 pnSaltHash[16];
+ XclExpEncrypterRef xEnc( new XclExpBiff8Encrypter(mrRoot) );
+ xEnc->GetDocId(pnDocId);
+ xEnc->GetSalt(pnSalt);
+ xEnc->GetSaltDigest(pnSaltHash);
+
+ rStrm.Write(pnDocId, 16);
+ rStrm.Write(pnSalt, 16);
+ rStrm.Write(pnSaltHash, 16);
rStrm.SetEncrypter(xEnc);
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index bfd9b2b69dae..ddd6dbb3ce24 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4338,15 +4338,20 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&
++nPropsToAdd;
}
+ bool bVBACompat = false;
uno::Reference <container::XNameAccess> xCodeNameAccess;
DBG_ASSERT( pDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" );
if( pDoc && pDoc->IsInVBAMode() )
{
+ // VBA compatibility mode
+ bVBACompat = true;
+ ++nPropsToAdd;
+ // code names
xCodeNameAccess = new XMLCodeNameProvider( pDoc );
- if( xCodeNameAccess.is() && xCodeNameAccess->hasElements() )
+ if( xCodeNameAccess->hasElements() )
++nPropsToAdd;
else
- xCodeNameAccess = 0;
+ xCodeNameAccess.clear();
}
if( nPropsToAdd > 0 )
@@ -4359,10 +4364,17 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>&
rProps[nCount].Value <<= aTrackedChangesKey.makeStringAndClear();
++nCount;
}
+ if( bVBACompat )
+ {
+ rProps[nCount].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VBACompatibilityMode"));
+ rProps[nCount].Value <<= bVBACompat;
+ ++nCount;
+ }
if( xCodeNameAccess.is() )
{
rProps[nCount].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScriptConfiguration"));
rProps[nCount].Value <<= xCodeNameAccess;
+ ++nCount;
}
}
}
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 269e1dd9a7e4..e83f68bb2bbd 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2219,6 +2219,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
{
sal_Int32 nCount(aConfigProps.getLength());
rtl::OUString sCTName(RTL_CONSTASCII_USTRINGPARAM("TrackedChangesProtectionKey"));
+ rtl::OUString sVBName(RTL_CONSTASCII_USTRINGPARAM("VBACompatibilityMode"));
rtl::OUString sSCName(RTL_CONSTASCII_USTRINGPARAM("ScriptConfiguration"));
for (sal_Int32 i = nCount - 1; i >= 0; --i)
{
@@ -2243,26 +2244,15 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
}
}
}
- else if (aConfigProps[i].Name == sSCName)
+ // store the following items for later use (after document is loaded)
+ else if ((aConfigProps[i].Name == sVBName) || (aConfigProps[i].Name == sSCName))
{
- uno::Type aType = aConfigProps[i].Value.getValueType();
- uno::Reference<beans::XPropertySet> xImportInfo =
- getImportInfo();
-
- if (xImportInfo.is() &&
- (aType.equals(getCppuType(
- (uno::Reference<container::XNameContainer> *)0 ) ) ||
- aType.equals(getCppuType(
- (uno::Reference<container::XNameAccess> *)0 ) ) ) )
+ uno::Reference< beans::XPropertySet > xImportInfo = getImportInfo();
+ if (xImportInfo.is())
{
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo =
- xImportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is() &&
- xPropertySetInfo->hasPropertyByName(sSCName) )
- {
- xImportInfo->setPropertyValue(sSCName,
- aConfigProps[i].Value );
- }
+ uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xImportInfo->getPropertySetInfo();
+ if (xPropertySetInfo.is() && xPropertySetInfo->hasPropertyByName(aConfigProps[i].Name))
+ xImportInfo->setPropertyValue( aConfigProps[i].Name, aConfigProps[i].Value );
}
}
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index dbe647bc433f..7721260367c9 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -65,6 +65,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <svx/xmleohlp.hxx>
#include <rtl/logfile.hxx>
@@ -426,6 +427,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
{ MAP_LEN( "StreamRelPath" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "StreamName" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "BuildId" ), 0, &::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "VBACompatibilityMode" ), 0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "ScriptConfiguration" ), 0, &::getCppuType((uno::Reference<container::XNameAccess> *)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
{ NULL, 0, 0, NULL, 0, 0 }
@@ -643,6 +645,24 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
uno::Reference <container::XNameAccess> xCodeNameAccess;
if( aAny >>= xCodeNameAccess )
XMLCodeNameProvider::set( xCodeNameAccess, &rDoc );
+
+ // VBA compatibility
+ bool bVBACompat = false;
+ if ( (xInfoSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("VBACompatibilityMode"))) >>= bVBACompat) && bVBACompat )
+ {
+ /* Set library container to VBA compatibility mode, this
+ forces loading the Basic project, which in turn creates the
+ VBA Globals object and does all related initialization. */
+ if ( xModelSet.is() ) try
+ {
+ uno::Reference< script::vba::XVBACompatibility > xVBACompat( xModelSet->getPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ), uno::UNO_QUERY_THROW );
+ xVBACompat->setVBACompatibilityMode( sal_True );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
}
// Don't test bStylesRetval and bMetaRetval, because it could be an older file which not contain such streams
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 4b268b9da791..e6b8b3b5049a 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -134,7 +134,8 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc
nDragHandleY( 0 ),
nDragSourceFlags( 0 ),
bDragWasInternal( FALSE ),
- bUsedForLink( FALSE )
+ bUsedForLink( FALSE ),
+ bUseInApi( false )
{
DBG_ASSERT(pDoc->IsClipboard(), "wrong document");
@@ -540,6 +541,11 @@ void ScTransferObj::SetDragWasInternal()
bDragWasInternal = TRUE;
}
+void ScTransferObj::SetUseInApi( bool bSet )
+{
+ bUseInApi = bSet;
+}
+
ScDocument* ScTransferObj::GetSourceDocument()
{
ScDocShell* pSourceDocSh = GetSourceDocShell();
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index fc8ba28a217e..038d0a72e824 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -851,13 +851,13 @@ BOOL ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, BOOL bApi
return TRUE;
}
-void ScDocFunc::NotifyInputHandler( const ScAddress& /* rPos */ )
+void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh && pViewSh->GetViewData()->GetDocShell() == &rDocShell )
{
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
- if ( pInputHdl )
+ if ( pInputHdl && pInputHdl->GetCursorPos() == rPos )
{
sal_Bool bIsEditMode(pInputHdl->IsEditMode());
@@ -986,7 +986,7 @@ ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const Stri
ScBaseCell* ScDocFunc::InterpretEnglishString( const ScAddress& rPos,
- const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
+ const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar, short* pRetFormatType )
{
ScDocument* pDoc = rDocShell.GetDocument();
ScBaseCell* pNewCell = NULL;
@@ -1020,7 +1020,12 @@ ScBaseCell* ScDocFunc::InterpretEnglishString( const ScAddress& rPos,
sal_uInt32 nEnglish = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US);
double fVal;
if ( pFormatter->IsNumberFormat( rText, nEnglish, fVal ) )
+ {
pNewCell = new ScValueCell( fVal );
+ // return the format type from the English format, so a localized format can be created
+ if ( pRetFormatType )
+ *pRetFormatType = pFormatter->GetType( nEnglish );
+ }
else if ( rText.Len() )
pNewCell = ScBaseCell::CreateTextCell( rText, pDoc );
@@ -2650,8 +2655,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
if ( xVBAModuleInfo.is() )
{
- String sCodeName( genModuleName );
- rDoc.SetCodeName( nTab, sCodeName );
+ rDoc.SetCodeName( nTab, genModuleName );
script::ModuleInfo sModuleInfo = lcl_InitModuleInfo( rDocSh, genModuleName );
xVBAModuleInfo->insertModuleInfo( genModuleName, sModuleInfo );
xLib->insertByName( genModuleName, aSourceAny );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d5d7f6e09292..e7089349fdb7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -72,7 +72,6 @@
#include <com/sun/star/task/XJob.hpp>
#include <basic/sbstar.hxx>
#include <basic/basmgr.hxx>
-#include <vbahelper/vbaaccesshelper.hxx>
#include "scabstdlg.hxx" //CHINA001
#include <sot/formats.hxx>
@@ -554,6 +553,13 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
xVbaEvents->processVbaEvent( WORKBOOK_AFTERSAVE, aArgs );
}
break;
+ case SFX_EVENT_CLOSEDOC:
+ {
+ // #163655# prevent event processing after model is disposed
+ aDocument.SetVbaEventProcessor( uno::Reference< script::vba::XVBAEventProcessor >() );
+ uno::Reference< lang::XEventListener >( xVbaEvents, uno::UNO_QUERY_THROW )->disposing( lang::EventObject() );
+ }
+ break;
}
}
}
@@ -619,25 +625,6 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
SetReadOnlyUI( sal_True );
}
}
-
- // VBA specific initialization
- if( aDocument.IsInVBAMode() ) try
- {
- uno::Reference< frame::XModel > xModel( GetModel(), uno::UNO_SET_THROW );
-
- // create VBAGlobals object if not yet done (this also creates the "ThisExcelDoc" symbol)
- uno::Reference< lang::XMultiServiceFactory > xFactory( xModel, uno::UNO_QUERY_THROW );
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
-
- // create the VBA document event processor
- uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[ 0 ] <<= xModel;
- xVbaEvents.set( ooo::vba::createVBAUnoAPIServiceWithArgs( this, "com.sun.star.script.vba.VBASpreadsheetEventProcessor" , aArgs ), uno::UNO_QUERY );
- aDocument.SetVbaEventProcessor( xVbaEvents );
- }
- catch( uno::Exception& )
- {
- }
}
break;
case SFX_EVENT_VIEWCREATED:
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 0e7560fe0c50..62f7bfd865e7 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -29,7 +29,7 @@
#define SC_ANYREFDG_HXX
#ifndef _IMAGEBTN_HXX
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#endif
#ifndef _EDIT_HXX
#include <vcl/edit.hxx>
diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx
index 20dd79f359ad..77d844d161b3 100644
--- a/sc/source/ui/inc/crdlg.hxx
+++ b/sc/source/ui/inc/crdlg.hxx
@@ -30,7 +30,7 @@
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include "scui_def.hxx" //CHINA001
diff --git a/sc/source/ui/inc/delcldlg.hxx b/sc/source/ui/inc/delcldlg.hxx
index e1a816e78c0f..ae5cb565b4e7 100644
--- a/sc/source/ui/inc/delcldlg.hxx
+++ b/sc/source/ui/inc/delcldlg.hxx
@@ -30,7 +30,7 @@
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
diff --git a/sc/source/ui/inc/delcodlg.hxx b/sc/source/ui/inc/delcodlg.hxx
index 8773b9c78f3a..3991184d7c5e 100644
--- a/sc/source/ui/inc/delcodlg.hxx
+++ b/sc/source/ui/inc/delcodlg.hxx
@@ -30,7 +30,7 @@
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include "global.hxx"
//------------------------------------------------------------------------
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index c92cc082986d..e36e1a9af92f 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -92,7 +92,8 @@ public:
// creates a new cell for use with PutCell
ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText,
- const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar );
+ const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar,
+ short* pRetFormatType = NULL );
bool ShowNote( const ScAddress& rPos, bool bShow = true );
inline bool HideNote( const ScAddress& rPos ) { return ShowNote( rPos, false ); }
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 800696970fbd..5d23172f7d8c 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -37,7 +37,7 @@
#endif
#ifndef _IMAGEBTN_HXX //autogen
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#endif
#ifndef _COMBOBOX_HXX //autogen
diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx
index 38b96f21e90e..03f05ab0705d 100644
--- a/sc/source/ui/inc/groupdlg.hxx
+++ b/sc/source/ui/inc/groupdlg.hxx
@@ -30,7 +30,7 @@
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
//------------------------------------------------------------------------
diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx
index 01e10f9a3983..d959069c46b6 100644
--- a/sc/source/ui/inc/imoptdlg.hxx
+++ b/sc/source/ui/inc/imoptdlg.hxx
@@ -32,7 +32,7 @@
#include <vcl/fixed.hxx>
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <svx/txencbox.hxx>
#include "scdllapi.h"
#include "global.hxx"
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 61974cf7464d..f3eba8b26f6b 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -168,6 +168,8 @@ public:
const String& GetEditString();
const String& GetFormString() const { return aFormText; }
+ const ScAddress& GetCursorPos() const { return aCursorPos; }
+
BOOL GetTextAndFields( ScEditEngineDefaulter& rDestEngine );
BOOL KeyInput( const KeyEvent& rKEvt, BOOL bStartEdit = FALSE );
diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx
index fd8c090cfd33..110c914f294c 100644
--- a/sc/source/ui/inc/inscldlg.hxx
+++ b/sc/source/ui/inc/inscldlg.hxx
@@ -29,7 +29,7 @@
#define SC_INSCLDLG_HXX
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx
index ffdccaba6a10..cf8008809d52 100644
--- a/sc/source/ui/inc/inscodlg.hxx
+++ b/sc/source/ui/inc/inscodlg.hxx
@@ -29,7 +29,7 @@
#define SC_INSCODLG_HXX
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include "global.hxx"
diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx
index f88f57a74e58..c9249f9fe945 100644
--- a/sc/source/ui/inc/mtrindlg.hxx
+++ b/sc/source/ui/inc/mtrindlg.hxx
@@ -30,7 +30,7 @@
#include <vcl/dialog.hxx>
#include <vcl/field.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index d5ce7726243f..6ca196a4fbb5 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -31,7 +31,7 @@
#include "address.hxx"
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/fixed.hxx>
diff --git a/sc/source/ui/inc/namecrea.hxx b/sc/source/ui/inc/namecrea.hxx
index e4e053fe0bcf..8f2e90bcacfc 100644
--- a/sc/source/ui/inc/namecrea.hxx
+++ b/sc/source/ui/inc/namecrea.hxx
@@ -29,7 +29,7 @@
#define SC_NAMECREA_HXX
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include "scui_def.hxx" //CHINA001
diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index 3286af7b81bc..c3e408d0c373 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -29,7 +29,7 @@
#define SC_NAMEPAST_HXX
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx
index 6281bb58b02c..5be21d87a6f2 100644
--- a/sc/source/ui/inc/scendlg.hxx
+++ b/sc/source/ui/inc/scendlg.hxx
@@ -32,7 +32,7 @@
#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <svtools/svmedit.hxx>
#include <svtools/ctrlbox.hxx>
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index b5dd140a4109..a3a99684cddc 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -31,7 +31,7 @@
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/edit.hxx>
#include <layout/layout.hxx>
diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx b/sc/source/ui/inc/tabbgcolordlg.hxx
index e7ca3da290b0..64145a58a07c 100644
--- a/sc/source/ui/inc/tabbgcolordlg.hxx
+++ b/sc/source/ui/inc/tabbgcolordlg.hxx
@@ -32,7 +32,8 @@
#define SC_TABBGCOLORDLG_HXX
#include <vcl/dialog.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
#include <svtools/valueset.hxx>
//------------------------------------------------------------------------
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index a6e99613f2ea..ab21a6161752 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -287,7 +287,8 @@ public:
BOOL IsMinimized() const { return bMinimized; }
- void TabChanged();
+ // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
+ void TabChanged( bool bSameTabButMoved = false );
void SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll );
SC_DLLPUBLIC void RefreshZoom();
void SetPagebreakMode( BOOL bSet );
@@ -387,10 +388,8 @@ public:
void SetNewStartIfMarking();
- //<!--Added by PengYunQuan for Validity Cell Range Picker
- //void SetTabNo( SCTAB nTab, BOOL bNew = FALSE, BOOL bExtendSelection = FALSE );
- SC_DLLPUBLIC void SetTabNo( SCTAB nTab, BOOL bNew = FALSE, BOOL bExtendSelection = FALSE );
- //-->Added by PengYunQuan for Validity Cell Range Picker
+ // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
+ SC_DLLPUBLIC void SetTabNo( SCTAB nTab, BOOL bNew = FALSE, BOOL bExtendSelection = FALSE, bool bSameTabButMoved = false );
void SelectNextTab( short nDir, BOOL bExtendSelection = FALSE );
void ActivateView( BOOL bActivate, BOOL bFirst );
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index dcf730712a40..efd681a688a6 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -29,7 +29,7 @@
#define SC_TPHF_HXX
-#include <svx/hdft2.hxx>
+#include <svx/hdft.hxx>
class ScStyleDlg;
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index e2dbad485812..546637c726d0 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -64,6 +64,7 @@ private:
BOOL bDragWasInternal;
BOOL bUsedForLink;
bool bHasFiltered; // if has filtered rows
+ bool bUseInApi; // to recognize clipboard content copied from API
void InitDocShell();
static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY,
@@ -93,6 +94,7 @@ public:
SCTAB GetVisibleTab() const { return nVisibleTab; }
USHORT GetDragSourceFlags() const { return nDragSourceFlags; }
bool HasFilteredRows() const { return bHasFiltered; }
+ bool GetUseInApi() const { return bUseInApi; }
ScDocShell* GetSourceDocShell();
ScDocument* GetSourceDocument();
ScMarkData GetSourceMarkData();
@@ -103,6 +105,7 @@ public:
void SetDragSource( ScDocShell* pSourceShell, const ScMarkData& rMark );
void SetDragSourceFlags( USHORT nFlags );
void SetDragWasInternal();
+ SC_DLLPUBLIC void SetUseInApi( bool bSet );
static SC_DLLPUBLIC ScTransferObj* GetOwnClipboard( Window* pUIWin );
diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx
index ec8da19ba5ea..c7ec17209085 100644
--- a/sc/source/ui/inc/ui_pch.hxx
+++ b/sc/source/ui/inc/ui_pch.hxx
@@ -207,7 +207,7 @@
#include <svl/stritem.hxx>
#include <collect.hxx>
#include <svx/svdsob.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdglue.hxx>
#include <svx/svdlayer.hxx>
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 1b14b15e24c8..7594dddd914b 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -49,7 +49,7 @@
#include <svl/zforlist.hxx>
#include <vcl/msgbox.hxx>
#include <comphelper/processfactory.hxx>
-
+#include <sfx2/sfxresid.hxx>
#include "sc.hrc"
#include "scmod.hxx"
#include "attrib.hxx"
@@ -251,7 +251,7 @@ IMPL_LINK( ScAutoFormatDlg, AddHdl, void *, EMPTYARG )
{
if ( !bFmtInserted && pSelFmtData )
{
- String aStrStandard( ScResId(STR_STANDARD) );
+ String aStrStandard( SfxResId(STR_STANDARD) );
String aFormatName;
ScStringInputDlg* pDlg;
BOOL bOk = FALSE;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index dea7cc056756..53ac57ee2318 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -6272,6 +6272,53 @@ void ScCellObj::SetFormulaWithGrammar( const ::rtl::OUString& rFormula,
}
}
+void ScCellObj::InputEnglishString( const ::rtl::OUString& rText )
+{
+ // This is like a mixture of setFormula and property FormulaLocal:
+ // The cell's number format is checked for "text", a new cell format may be set,
+ // but all parsing is in English.
+
+ ScDocShell* pDocSh = GetDocShell();
+ if ( pDocSh )
+ {
+ String aString(rText);
+ ScDocument* pDoc = pDocSh->GetDocument();
+ SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ sal_uInt32 nOldFormat = pDoc->GetNumberFormat( aCellPos );
+ if ( pFormatter->GetType( nOldFormat ) == NUMBERFORMAT_TEXT )
+ {
+ SetString_Impl(aString, FALSE, FALSE); // text cell
+ }
+ else
+ {
+ ScDocFunc aFunc(*pDocSh);
+ short nFormatType = 0;
+ ScBaseCell* pNewCell = aFunc.InterpretEnglishString( aCellPos, aString,
+ EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1, &nFormatType );
+ if (pNewCell)
+ {
+ if ( ( nOldFormat % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 && nFormatType != 0 )
+ {
+ // apply a format for the recognized type and the old format's language
+ sal_uInt32 nNewFormat = ScGlobal::GetStandardFormat( *pFormatter, nOldFormat, nFormatType );
+ if ( nNewFormat != nOldFormat )
+ {
+ ScPatternAttr aPattern( pDoc->GetPool() );
+ aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
+ // ATTR_LANGUAGE_FORMAT remains unchanged
+ aFunc.ApplyAttributes( *GetMarkData(), aPattern, TRUE, TRUE );
+ }
+ }
+ // put the cell into the document
+ // (after applying the format, so possible formula recalculation already uses the new format)
+ (void)aFunc.PutCell( aCellPos, pNewCell, TRUE );
+ }
+ else
+ SetString_Impl(aString, FALSE, FALSE); // no cell from InterpretEnglishString, probably empty string
+ }
+ }
+}
+
// XText
uno::Reference<text::XTextCursor> SAL_CALL ScCellObj::createTextCursor()
@@ -8482,8 +8529,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
rtl::OUString aCodeName;
if ( pDocSh && ( aValue >>= aCodeName ) )
{
- String sNewName( aCodeName );
- pDocSh->GetDocument()->SetCodeName( GetTab_Impl(), sNewName );
+ pDocSh->GetDocument()->SetCodeName( GetTab_Impl(), aCodeName );
}
}
else
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 6057721a68b7..9f3780a9b2e3 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -577,8 +577,21 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
DELETEZ( pPrintFuncCache );
// handle "OnCalculate" sheet events (search also for VBA event handlers)
- if ( pDocShell && pDocShell->GetDocument()->HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE, true ) )
- HandleCalculateEvents();
+ if ( pDocShell )
+ {
+ ScDocument* pDoc = pDocShell->GetDocument();
+ if ( pDoc->GetVbaEventProcessor().is() )
+ {
+ // If the VBA event processor is set, HasAnyCalcNotification is much faster than HasAnySheetEventScript
+ if ( pDoc->HasAnyCalcNotification() && pDoc->HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE, true ) )
+ HandleCalculateEvents();
+ }
+ else
+ {
+ if ( pDoc->HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE ) )
+ HandleCalculateEvents();
+ }
+ }
}
}
else if ( rHint.ISA( ScPointerChangedHint ) )
@@ -1946,6 +1959,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance(
case SC_SERVICE_MARKERTAB: xRet.set(xDrawMarkerTab); break;
case SC_SERVICE_DASHTAB: xRet.set(xDrawDashTab); break;
case SC_SERVICE_CHDATAPROV: xRet.set(xChartDataProv); break;
+ case SC_SERVICE_VBAOBJECTPROVIDER: xRet.set(xObjProvider); break;
}
// #i64497# If a chart is in a temporary document during clipoard paste,
@@ -1971,6 +1985,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance(
case SC_SERVICE_MARKERTAB: xDrawMarkerTab.set(xRet); break;
case SC_SERVICE_DASHTAB: xDrawDashTab.set(xRet); break;
case SC_SERVICE_CHDATAPROV: xChartDataProv.set(xRet); break;
+ case SC_SERVICE_VBAOBJECTPROVIDER: xObjProvider.set(xRet); break;
}
}
}
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 03d6d14a3ac7..affedff83c7b 100755..100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -400,20 +400,16 @@ static BOOL lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( !bRepairPackage )
{
// ask the user whether he wants to try to repair
- RequestPackageReparation* pRequest = new RequestPackageReparation( aDocumentTitle );
- uno::Reference< task::XInteractionRequest > xRequest ( pRequest );
-
- xInteraction->handle( xRequest );
-
- bRepairAllowed = pRequest->isApproved();
+ RequestPackageReparation aRequest( aDocumentTitle );
+ xInteraction->handle( aRequest.GetRequest() );
+ bRepairAllowed = aRequest.isApproved();
}
if ( !bRepairAllowed )
{
// repair either not allowed or not successful
- NotifyBrokenPackage* pNotifyRequest = new NotifyBrokenPackage( aDocumentTitle );
- uno::Reference< task::XInteractionRequest > xRequest ( pNotifyRequest );
- xInteraction->handle( xRequest );
+ NotifyBrokenPackage aNotifyRequest( aDocumentTitle );
+ xInteraction->handle( aNotifyRequest.GetRequest() );
}
}
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index a173e6d1e051..0a1f86afd7d1 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -28,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
#include <tools/debug.hxx>
#include <svtools/unoimap.hxx>
#include <svx/unofill.hxx>
@@ -61,6 +59,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/document/XCodeNameQuery.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
@@ -573,6 +572,11 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
+
+ // create the VBA document event processor
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents(
+ ::ooo::vba::createVBAUnoAPIServiceWithArgs( pDocShell, "com.sun.star.script.vba.VBASpreadsheetEventProcessor", aArgs ), uno::UNO_QUERY );
+ pDocShell->GetDocument()->SetVbaEventProcessor( xVbaEvents );
}
}
break;
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index fd1e655b8ffb..7646e52c030f 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -572,7 +572,7 @@ void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent )
}
}
-void ScTabViewObj::SheetChanged()
+void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
{
if ( !GetViewShell() )
return;
@@ -600,9 +600,10 @@ void ScTabViewObj::SheetChanged()
}
}
- // handle sheet events
+ /* Handle sheet events, but do not trigger event handlers, if the old
+ active sheet gets re-activated after inserting/deleting/moving a sheet. */
SCTAB nNewTab = pViewData->GetTabNo();
- if ( nNewTab != nPreviousTab )
+ if ( !bSameTabButMoved && (nNewTab != nPreviousTab) )
{
lcl_CallActivate( pDocSh, nPreviousTab, SC_SHEETEVENT_UNFOCUS );
lcl_CallActivate( pDocSh, nNewTab, SC_SHEETEVENT_FOCUS );
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 2c39d7154b4b..42a415d68e32 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -24,24 +24,25 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#include <docuno.hxx>
+
#include "excelvbahelper.hxx"
+
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/sheet/XSheetCellRange.hpp>
+#include "docuno.hxx"
#include "tabvwsh.hxx"
#include "transobj.hxx"
#include "scmod.hxx"
#include "cellsuno.hxx"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/sheet/XSheetCellRange.hpp>
+
+namespace ooo {
+namespace vba {
+namespace excel {
using namespace ::com::sun::star;
using namespace ::ooo::vba;
-namespace ooo
-{
-namespace vba
-{
-namespace excel
-{
+// ============================================================================
ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
{
@@ -150,7 +151,14 @@ implnCopy( const uno::Reference< frame::XModel>& xModel )
{
ScTabViewShell* pViewShell = getBestViewShell( xModel );
if ( pViewShell )
+ {
pViewShell->CopyToClip(NULL,false,false,true);
+
+ // mark the copied transfer object so it is used in ScVbaRange::Insert
+ ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL );
+ if (pClipObj)
+ pClipObj->SetUseInApi( true );
+ }
}
void
@@ -158,7 +166,14 @@ implnCut( const uno::Reference< frame::XModel>& xModel )
{
ScTabViewShell* pViewShell = getBestViewShell( xModel );
if ( pViewShell )
+ {
pViewShell->CutToClip( NULL, TRUE );
+
+ // mark the copied transfer object so it is used in ScVbaRange::Insert
+ ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL );
+ if (pClipObj)
+ pClipObj->SetUseInApi( true );
+ }
}
void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
@@ -181,7 +196,10 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
ScDocument* pDoc = NULL;
if ( pOwnClip )
+ {
pDoc = pOwnClip->GetDocument();
+ pOwnClip->SetUseInApi( false ); // don't use in Insert after it was pasted once
+ }
pTabViewShell->PasteFromClip( nFlags, pDoc,
nFunction, bSkipEmpty, bTranspose, bAsLink,
eMoveMode, IDF_NONE, TRUE );
@@ -229,11 +247,10 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel )
return NULL;
}
-uno::Reference< XHelperInterface >
-getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
+uno::Reference< vba::XHelperInterface >
+getUnoSheetModuleObj( const uno::Reference< sheet::XSpreadsheet >& xSheet ) throw ( uno::RuntimeException )
{
- uno::Reference< sheet::XSheetCellRange > xSheetRange( xRange, uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xProps( xSheetRange->getSpreadsheet(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xSheet, uno::UNO_QUERY_THROW );
rtl::OUString sCodeName;
xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CodeName") ) ) >>= sCodeName;
// #TODO #FIXME ideally we should 'throw' here if we don't get a valid parent, but... it is possible
@@ -241,28 +258,52 @@ getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw
// are *NO* special document module objects ( of course being able to switch between vba/non vba mode at
// the document in the future could fix this, especially IF the switching of the vba mode takes care to
// create the special document module objects if they don't exist.
- uno::Reference< XHelperInterface > xParent( ov::getUnoDocModule( sCodeName, GetDocShellFromRange( xRange ) ), uno::UNO_QUERY );
-
+ uno::Reference< XHelperInterface > xParent( ov::getUnoDocModule( sCodeName, GetDocShellFromRange( xSheet ) ), uno::UNO_QUERY );
return xParent;
}
uno::Reference< XHelperInterface >
+getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
+{
+ uno::Reference< sheet::XSheetCellRange > xSheetRange( xRange, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XSpreadsheet > xSheet( xSheetRange->getSpreadsheet(), uno::UNO_SET_THROW );
+ return getUnoSheetModuleObj( xSheet );
+}
+
+uno::Reference< XHelperInterface >
getUnoSheetModuleObj( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
{
uno::Reference< container::XEnumerationAccess > xEnumAccess( xRanges, uno::UNO_QUERY_THROW );
uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration();
uno::Reference< table::XCellRange > xRange( xEnum->nextElement(), uno::UNO_QUERY_THROW );
-
return getUnoSheetModuleObj( xRange );
}
+uno::Reference< XHelperInterface >
+getUnoSheetModuleObj( const uno::Reference< table::XCell >& xCell ) throw ( uno::RuntimeException )
+{
+ uno::Reference< sheet::XSheetCellRange > xSheetRange( xCell, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XSpreadsheet > xSheet( xSheetRange->getSpreadsheet(), uno::UNO_SET_THROW );
+ return getUnoSheetModuleObj( xSheet );
+}
+
+uno::Reference< XHelperInterface >
+getUnoSheetModuleObj( const uno::Reference< frame::XModel >& xModel, SCTAB nTab ) throw ( uno::RuntimeException )
+{
+ uno::Reference< sheet::XSpreadsheetDocument > xDoc( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xSheets( xDoc->getSheets(), uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XSpreadsheet > xSheet( xSheets->getByIndex( nTab ), uno::UNO_QUERY_THROW );
+ return getUnoSheetModuleObj( xSheet );
+}
+
SfxItemSet*
ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj )
{
return pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : 0;
}
+// ============================================================================
-} //excel
-} //vba
-} //ooo
+} // namespace excel
+} // namespace vba
+} // namespace ooo
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index da0474e6ceb0..be04fefa1639 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -27,41 +27,54 @@
#ifndef SC_EXCEL_VBA_HELPER_HXX
#define SC_EXCEL_VBA_HELPER_HXX
-#include<vbahelper/vbahelper.hxx>
-#include <docsh.hxx>
+#include <vbahelper/vbahelper.hxx>
+#include "docsh.hxx"
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <ooo/vba/XHelperInterface.hpp>
class ScCellRangesBase;
-namespace ooo
+namespace ooo {
+namespace vba {
+namespace excel {
+
+// ============================================================================
+
+// nTabs empty means apply zoom to all sheets
+void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
+void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
+void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
+void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
+void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
+ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
+
+css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException );
+css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
+css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
+css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell ) throw ( css::uno::RuntimeException );
+css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab ) throw ( css::uno::RuntimeException );
+
+ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+
+// ============================================================================
+
+class ScVbaCellRangeAccess
{
- namespace vba
- {
- namespace excel
- {
- // nTabs empty means apply zoom to all sheets
- void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
- void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
- void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
- ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
- ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
- ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
- SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
- css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
- css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
- ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
- ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
- css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
- class ScVbaCellRangeAccess
- {
- public:
- static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
- };
-}
-}
-}
+public:
+ static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
+};
+
+// ============================================================================
+
+} // namespace excel
+} // namespace vba
+} // namespace ooo
+
#endif
diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk
index 92bb3fd39db0..5842b90237ff 100644
--- a/sc/source/ui/vba/makefile.mk
+++ b/sc/source/ui/vba/makefile.mk
@@ -110,15 +110,3 @@ SLOFILES= \
.INCLUDE : target.mk
-.IF "$(L10N_framework)"==""
-
-ALLTAR : \
- $(MISC)$/$(TARGET).don \
-
-$(SLOFILES) : $(MISC)$/$(TARGET).don
-
-$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
- +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
- echo $@
-
-.ENDIF
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index f3965393e919..30d4bd4d39a0 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -60,6 +60,7 @@
#include "sc.hrc"
#include <osl/file.hxx>
+#include <rtl/instance.hxx>
#include <sfx2/request.hxx>
#include <sfx2/objsh.hxx>
@@ -108,11 +109,32 @@ public:
ActiveWorkbook( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext) : ScVbaWorkbook( xParent, xContext ){}
};
+// ============================================================================
+
+/** Global application settings shared by all open workbooks. */
+struct ScVbaAppSettings
+{
+ sal_Int32 mnCalculation;
+ sal_Bool mbDisplayAlerts;
+ sal_Bool mbEnableEvents;
+
+ explicit ScVbaAppSettings();
+};
+
+ScVbaAppSettings::ScVbaAppSettings() :
+ mnCalculation( excel::XlCalculation::xlCalculationAutomatic ),
+ mbDisplayAlerts( sal_True ),
+ mbEnableEvents( sal_True )
+{
+}
+
+struct ScVbaStaticAppSettings : public ::rtl::Static< ScVbaAppSettings, ScVbaStaticAppSettings > {};
+
+// ============================================================================
+
ScVbaApplication::ScVbaApplication( const uno::Reference<uno::XComponentContext >& xContext ) :
ScVbaApplication_BASE( xContext ),
- m_xCalculation( excel::XlCalculation::xlCalculationAutomatic ),
- m_bDisplayAlerts( sal_True ),
- m_bEnableEvents( sal_True )
+ mrAppSettings( ScVbaStaticAppSettings::get() )
{
}
@@ -120,6 +142,11 @@ ScVbaApplication::~ScVbaApplication()
{
}
+/*static*/ bool ScVbaApplication::getDocumentEventsEnabled()
+{
+ return ScVbaStaticAppSettings::get().mbEnableEvents;
+}
+
SfxObjectShell* ScVbaApplication::GetDocShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
return static_cast< SfxObjectShell* >( excel::getDocShell( xModel ) );
@@ -396,8 +423,10 @@ ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::Runtime
if( _statusbar >>= sText )
{
setDisplayStatusBar( sal_True );
- xStatusIndicator->start( sText, 100 );
- //xStatusIndicator->setText( sText );
+ if ( sText.getLength() )
+ xStatusIndicator->start( sText, 100 );
+ else
+ xStatusIndicator->end(); // restore normal state for empty text
}
else if( _statusbar >>= bDefault )
{
@@ -415,6 +444,7 @@ ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::Runtime
::sal_Int32 SAL_CALL
ScVbaApplication::getCalculation() throw (uno::RuntimeException)
{
+ // TODO: in Excel, this is an application-wide setting
uno::Reference<sheet::XCalculatable> xCalc(getCurrentDocument(), uno::UNO_QUERY_THROW);
if(xCalc->isAutomaticCalculationEnabled())
return excel::XlCalculation::xlCalculationAutomatic;
@@ -425,6 +455,7 @@ ScVbaApplication::getCalculation() throw (uno::RuntimeException)
void SAL_CALL
ScVbaApplication::setCalculation( ::sal_Int32 _calculation ) throw (uno::RuntimeException)
{
+ // TODO: in Excel, this is an application-wide setting
uno::Reference< sheet::XCalculatable > xCalc(getCurrentDocument(), uno::UNO_QUERY_THROW);
switch(_calculation)
{
@@ -704,25 +735,25 @@ ScVbaApplication::getName() throw (uno::RuntimeException)
void SAL_CALL
ScVbaApplication::setDisplayAlerts(sal_Bool displayAlerts) throw (uno::RuntimeException)
{
- m_bDisplayAlerts = displayAlerts;
+ mrAppSettings.mbDisplayAlerts = displayAlerts;
}
sal_Bool SAL_CALL
ScVbaApplication::getDisplayAlerts() throw (uno::RuntimeException)
{
- return m_bDisplayAlerts;
+ return mrAppSettings.mbDisplayAlerts;
}
void SAL_CALL
ScVbaApplication::setEnableEvents(sal_Bool bEnable) throw (uno::RuntimeException)
{
- m_bEnableEvents = bEnable;
+ mrAppSettings.mbEnableEvents = bEnable;
}
sal_Bool SAL_CALL
ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
{
- return m_bEnableEvents;
+ return mrAppSettings.mbEnableEvents;
}
void SAL_CALL
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index a7be5feb1d27..bb696c967a37 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -39,12 +39,13 @@
//typedef InheritedHelperInterfaceImpl1< ov::excel::XApplication > ScVbaApplication_BASE;
typedef cppu::ImplInheritanceHelper1< VbaApplicationBase, ov::excel::XApplication > ScVbaApplication_BASE;
+struct ScVbaAppSettings;
+
class ScVbaApplication : public ScVbaApplication_BASE
{
private:
- sal_Int32 m_xCalculation;
- sal_Bool m_bDisplayAlerts;
- sal_Bool m_bEnableEvents;
+ // note: member variables moved to struct "ScVbaAppSettings", see cxx file, to be shared by all application instances
+ ScVbaAppSettings& mrAppSettings;
rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
@@ -55,6 +56,9 @@ public:
ScVbaApplication( const css::uno::Reference< css::uno::XComponentContext >& m_xContext );
virtual ~ScVbaApplication();
+ /** Returns true, if VBA document events are enabled. */
+ static bool getDocumentEventsEnabled();
+
virtual SfxObjectShell* GetDocShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException);
// XExactName
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index 45667adf2f2c..6ea807a16eae 100755
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -48,6 +48,7 @@
#include "cellsuno.hxx"
#include "convuno.hxx"
+#include "vbaapplication.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::script::vba::VBAEventId;
@@ -55,6 +56,51 @@ using namespace ::ooo::vba;
// ============================================================================
+namespace {
+
+/** Extracts a sheet index from the specified element of the passed sequence.
+ The element may be an integer, a Calc range or ranges object, or a VBA Range object. */
+SCTAB lclGetTabFromArgs( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) throw (lang::IllegalArgumentException)
+{
+ VbaEventsHelperBase::checkArgument( rArgs, nIndex );
+
+ // first try to extract a sheet index
+ SCTAB nTab = -1;
+ if( rArgs[ nIndex ] >>= nTab )
+ return nTab;
+
+ // try VBA Range object
+ uno::Reference< excel::XRange > xVbaRange = getXSomethingFromArgs< excel::XRange >( rArgs, nIndex );
+ if( xVbaRange.is() )
+ {
+ uno::Reference< XHelperInterface > xVbaHelper( xVbaRange, uno::UNO_QUERY_THROW );
+ // TODO: in the future, the parent may be an excel::XChart (chart sheet) -> will there be a common base interface?
+ uno::Reference< excel::XWorksheet > xVbaSheet( xVbaHelper->getParent(), uno::UNO_QUERY_THROW );
+ // VBA sheet index is 1-based
+ return static_cast< SCTAB >( xVbaSheet->getIndex() - 1 );
+ }
+
+ // try single UNO range object
+ uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable = getXSomethingFromArgs< sheet::XCellRangeAddressable >( rArgs, nIndex );
+ if( xCellRangeAddressable.is() )
+ return xCellRangeAddressable->getRangeAddress().Sheet;
+
+ // at last, try UNO range list
+ uno::Reference< sheet::XSheetCellRangeContainer > xRanges = getXSomethingFromArgs< sheet::XSheetCellRangeContainer >( rArgs, nIndex );
+ if( xRanges.is() )
+ {
+ uno::Sequence< table::CellRangeAddress > aRangeAddresses = xRanges->getRangeAddresses();
+ if( aRangeAddresses.getLength() > 0 )
+ return aRangeAddresses[ 0 ].Sheet;
+ }
+
+ throw lang::IllegalArgumentException();
+}
+
+} // namespace
+
+// ============================================================================
+
typedef ::cppu::WeakImplHelper4<
awt::XWindowListener, util::XCloseListener, frame::XBorderResizeListener, util::XChangesListener > ScVbaEventsListener_BASE;
@@ -90,7 +136,6 @@ private:
uno::Reference< awt::XWindow > getContainerWindow();
bool isMouseReleased();
DECL_LINK( fireResizeMacro, void* );
- void processWindowResizeMacro();
private:
::osl::Mutex maMutex;
@@ -287,7 +332,7 @@ void SAL_CALL ScVbaEventsListener::changesOccurred( const util::ChangesEvent& aE
aChange.ReplacedElement >>= xRangeObj;
if( xRangeObj.is() )
{
- uno::Sequence< uno::Any > aArgs(1);
+ uno::Sequence< uno::Any > aArgs( 1 );
aArgs[0] <<= xRangeObj;
mrVbaEvents.processVbaEvent( WORKSHEET_CHANGE, aArgs );
}
@@ -362,19 +407,18 @@ bool ScVbaEventsListener::isMouseReleased()
IMPL_LINK( ScVbaEventsListener, fireResizeMacro, void*, EMPTYARG )
{
- if( !mbDisposed && isMouseReleased() )
- processWindowResizeMacro();
+ if( !mbDisposed && isMouseReleased() ) try
+ {
+ mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
+ }
+ catch( uno::Exception& )
+ {
+ // #163419# do not throw exceptions into application core
+ }
release();
return 0;
}
-void ScVbaEventsListener::processWindowResizeMacro()
-{
- OSL_TRACE( "**** Attempt to FIRE MACRO **** " );
- if( !mbDisposed )
- mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
-}
-
// ============================================================================
ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& xContext ) :
@@ -441,43 +485,19 @@ void SAL_CALL ScVbaEventsHelper::disposing( const lang::EventObject& rSource ) t
// protected ------------------------------------------------------------------
-bool ScVbaEventsHelper::implEventsEnabled() throw (uno::RuntimeException)
+bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue,
+ const EventHandlerInfo& rInfo, const uno::Sequence< uno::Any >& rArgs ) throw (uno::RuntimeException)
{
// document and document shell are needed during event processing
- if( !mpDocShell || !mpDoc )
+ if( !mpShell || !mpDoc )
throw uno::RuntimeException();
- // get Application object and check if events are enabled (this is an Excel-only attribute)
- uno::Reference< excel::XApplication > xApplication( mxApplication.get(), uno::UNO_QUERY );
- if( !xApplication.is() && mpShell )
- {
- uno::Any aVBAGlobals;
- mpShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aVBAGlobals );
- uno::Reference< XHelperInterface > xHelperInterface( aVBAGlobals, uno::UNO_QUERY );
- if( xHelperInterface.is() )
- {
- xApplication.set( xHelperInterface->Application(), uno::UNO_QUERY );
- mxApplication = xApplication;
- }
- }
- if( !xApplication.is() )
- throw uno::RuntimeException();
+ // framework and Calc fire a few events before 'opened', ignore them
+ bool bExecuteEvent = mbOpened;
- // return whether event processing is enabled
- return xApplication->getEnableEvents();
-}
-
-bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue,
- const EventHandlerInfo& rInfo, const uno::Sequence< uno::Any >& rArgs ) throw (uno::RuntimeException)
-{
- // check preconditions for some events, add more events if needed
- bool bExecuteEvent = true;
+ // special handling for some events
switch( rInfo.mnEventId )
{
- case WORKBOOK_ACTIVATE:
- // while loading, framework fires this before 'opened' event, delay it
- bExecuteEvent = mbOpened;
- break;
case WORKBOOK_OPEN:
bExecuteEvent = !mbOpened;
if( bExecuteEvent )
@@ -490,15 +510,25 @@ bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue,
break;
case WORKSHEET_SELECTIONCHANGE:
// if selection is not changed, then do not fire the event
- bExecuteEvent = mbOpened && isSelectionChanged( rArgs, 0 );
+ bExecuteEvent = bExecuteEvent && isSelectionChanged( rArgs, 0 );
break;
}
- // add workbook event associated to a sheet event
- bool bSheetEvent = false;
- rInfo.maUserData >>= bSheetEvent;
- if( bSheetEvent && bExecuteEvent )
- rEventQueue.push_back( EventQueueEntry( rInfo.mnEventId + USERDEFINED_START, rArgs ) );
+ if( bExecuteEvent )
+ {
+ // add workbook event associated to a sheet event
+ bool bSheetEvent = false;
+ if( (rInfo.maUserData >>= bSheetEvent) && bSheetEvent )
+ rEventQueue.push_back( EventQueueEntry( rInfo.mnEventId + USERDEFINED_START, rArgs ) );
+
+ /* For document events: check if events are enabled via the
+ Application.EnableEvents symbol (this is an Excel-only attribute).
+ Check this again for every event, as the event handler may change
+ the state of the EnableEvents symbol. Global events such as
+ AUTO_OPEN and AUTO_CLOSE are always enabled. */
+ if( rInfo.meType == EVENTHANDLER_DOCUMENT )
+ bExecuteEvent = ScVbaApplication::getDocumentEventsEnabled();
+ }
return bExecuteEvent;
}
@@ -622,7 +652,7 @@ void ScVbaEventsHelper::implPostProcessEvent( EventQueue& rEventQueue,
{
bool bSheetEvent = false;
rInfo.maUserData >>= bSheetEvent;
- SCTAB nTab = bSheetEvent ? getTabFromArgs( rArgs, 0 ) : -1;
+ SCTAB nTab = bSheetEvent ? lclGetTabFromArgs( rArgs, 0 ) : -1;
if( bSheetEvent && (nTab < 0) )
throw lang::IllegalArgumentException();
@@ -636,95 +666,82 @@ void ScVbaEventsHelper::implPostProcessEvent( EventQueue& rEventQueue,
// private --------------------------------------------------------------------
-SCTAB ScVbaEventsHelper::getTabFromArgs( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) throw (lang::IllegalArgumentException)
-{
- checkArgument( rArgs, nIndex );
+namespace {
- // first try to extract a sheet index
- SCTAB nTab = -1;
- if( rArgs[ nIndex ] >>= nTab )
- return nTab;
+/** Compares the passed range lists representing sheet selections. Ignores
+ selections that refer to different sheets (returns false in this case). */
+bool lclSelectionChanged( const ScRangeList& rLeft, const ScRangeList& rRight )
+{
+ // one of the range lists empty? -> return false, if both lists empty
+ bool bLeftEmpty = rLeft.Count() == 0;
+ bool bRightEmpty = rRight.Count() == 0;
+ if( bLeftEmpty || bRightEmpty )
+ return !(bLeftEmpty && bRightEmpty);
- // next, try single range object
- uno::Reference< sheet::XCellRangeAddressable > xCellRangeAddressable = getXSomethingFromArgs< sheet::XCellRangeAddressable >( rArgs, nIndex );
- if( xCellRangeAddressable.is() )
- return xCellRangeAddressable->getRangeAddress().Sheet;
+ // check sheet indexes of the range lists (assuming that all ranges in a list are on the same sheet)
+ if( rLeft.GetObject( 0 )->aStart.Tab() != rRight.GetObject( 0 )->aStart.Tab() )
+ return false;
- // at last, try range list
- uno::Reference< sheet::XSheetCellRangeContainer > xRanges = getXSomethingFromArgs< sheet::XSheetCellRangeContainer >( rArgs, nIndex );
- if( xRanges.is() )
- {
- uno::Sequence< table::CellRangeAddress > aRangeAddresses = xRanges->getRangeAddresses();
- if( aRangeAddresses.getLength() > 0 )
- return aRangeAddresses[ 0 ].Sheet;
- }
-
- throw lang::IllegalArgumentException();
+ // compare all ranges
+ return rLeft != rRight;
}
+} // namespace
+
bool ScVbaEventsHelper::isSelectionChanged( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
+ uno::Reference< uno::XInterface > xOldSelection( maOldSelection, uno::UNO_QUERY );
uno::Reference< uno::XInterface > xNewSelection = getXSomethingFromArgs< uno::XInterface >( rArgs, nIndex, false );
- if( ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( xNewSelection ) )
- {
- bool bChanged = maOldSelection != pNewCellRanges->GetRangeList();
- maOldSelection = pNewCellRanges->GetRangeList();
- return bChanged;
- }
- maOldSelection.Clear();
- return true;
+ ScCellRangesBase* pOldCellRanges = ScCellRangesBase::getImplementation( xOldSelection );
+ ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( xNewSelection );
+ bool bChanged = !pOldCellRanges || !pNewCellRanges || lclSelectionChanged( pOldCellRanges->GetRangeList(), pNewCellRanges->GetRangeList() );
+ maOldSelection <<= xNewSelection;
+ return bChanged;
}
uno::Any ScVbaEventsHelper::createWorksheet( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) const
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- // Eventually we will be able to pull the Workbook/Worksheet objects
- // directly from basic and register them as listeners
-
// extract sheet index, will throw, if parameter is invalid
- SCTAB nTab = getTabFromArgs( rArgs, nIndex );
-
- // create Workbook
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[ 0 ] <<= uno::Reference< uno::XInterface >();
- aArgs[ 1 ] <<= mxModel;
- uno::Reference< uno::XInterface > xWorkbook( createVBAUnoAPIServiceWithArgs( mpShell, "ooo.vba.excel.Workbook", aArgs ), uno::UNO_SET_THROW );
-
- // create WorkSheet
- String aSheetName;
- mpDoc->GetName( nTab, aSheetName );
- aArgs = uno::Sequence< uno::Any >( 3 );
- aArgs[ 0 ] <<= xWorkbook;
- aArgs[ 1 ] <<= mxModel;
- aArgs[ 2 ] <<= ::rtl::OUString( aSheetName );
- uno::Reference< uno::XInterface > xWorksheet( createVBAUnoAPIServiceWithArgs( mpShell, "ooo.vba.excel.Worksheet", aArgs ), uno::UNO_SET_THROW );
- return uno::Any( xWorksheet );
+ SCTAB nTab = lclGetTabFromArgs( rArgs, nIndex );
+ return uno::Any( excel::getUnoSheetModuleObj( mxModel, nTab ) );
}
uno::Any ScVbaEventsHelper::createRange( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) const
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- uno::Reference< sheet::XSheetCellRangeContainer > xRanges = getXSomethingFromArgs< sheet::XSheetCellRangeContainer >( rArgs, nIndex );
- uno::Reference< table::XCellRange > xRange = getXSomethingFromArgs< table::XCellRange >( rArgs, nIndex );
- if ( !xRanges.is() && !xRange.is() )
- throw lang::IllegalArgumentException();
+ // it is possible to pass an existing VBA Range object
+ uno::Reference< excel::XRange > xVbaRange = getXSomethingFromArgs< excel::XRange >( rArgs, nIndex );
+ if( !xVbaRange.is() )
+ {
+ uno::Reference< sheet::XSheetCellRangeContainer > xRanges = getXSomethingFromArgs< sheet::XSheetCellRangeContainer >( rArgs, nIndex );
+ uno::Reference< table::XCellRange > xRange = getXSomethingFromArgs< table::XCellRange >( rArgs, nIndex );
+ if ( !xRanges.is() && !xRange.is() )
+ throw lang::IllegalArgumentException();
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[ 0 ] <<= uno::Reference< uno::XInterface >(); // dummy parent
- if ( xRanges.is() )
- aArgs[ 1 ] <<= xRanges;
- else
- aArgs[ 1 ] <<= xRange;
- uno::Reference< uno::XInterface > xVbaRange( createVBAUnoAPIServiceWithArgs( mpShell, "ooo.vba.excel.Range", aArgs ), uno::UNO_SET_THROW );
+ uno::Sequence< uno::Any > aArgs( 2 );
+ if ( xRanges.is() )
+ {
+ aArgs[ 0 ] <<= excel::getUnoSheetModuleObj( xRanges );
+ aArgs[ 1 ] <<= xRanges;
+ }
+ else
+ {
+ aArgs[ 0 ] <<= excel::getUnoSheetModuleObj( xRange );
+ aArgs[ 1 ] <<= xRange;
+ }
+ xVbaRange.set( createVBAUnoAPIServiceWithArgs( mpShell, "ooo.vba.excel.Range", aArgs ), uno::UNO_QUERY_THROW );
+ }
return uno::Any( xVbaRange );
}
uno::Any ScVbaEventsHelper::createHyperlink( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) const
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
+ uno::Reference< table::XCell > xCell = getXSomethingFromArgs< table::XCell >( rArgs, nIndex, false );
uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[ 0 ] <<= uno::Reference< uno::XInterface >(); // dummy parent
- aArgs[ 1 ] <<= getXSomethingFromArgs< table::XCell >( rArgs, nIndex, false );
+ aArgs[ 0 ] <<= excel::getUnoSheetModuleObj( xCell );
+ aArgs[ 1 ] <<= xCell;
uno::Reference< uno::XInterface > xHyperlink( createVBAUnoAPIServiceWithArgs( mpShell, "ooo.vba.excel.Hyperlink", aArgs ), uno::UNO_SET_THROW );
return uno::Any( xHyperlink );
}
diff --git a/sc/source/ui/vba/vbaeventshelper.hxx b/sc/source/ui/vba/vbaeventshelper.hxx
index a77f5128b3e9..f1e8a4fb712d 100755
--- a/sc/source/ui/vba/vbaeventshelper.hxx
+++ b/sc/source/ui/vba/vbaeventshelper.hxx
@@ -33,8 +33,6 @@
#include "excelvbahelper.hxx"
#include "rangelst.hxx"
-namespace ooo { namespace vba { namespace excel { class XApplication; } } }
-
class ScVbaEventsListener;
// ============================================================================
@@ -51,16 +49,12 @@ public:
virtual void SAL_CALL disposing( const css::lang::EventObject& rSource ) throw (css::uno::RuntimeException);
protected:
- virtual bool implEventsEnabled() throw (css::uno::RuntimeException);
virtual bool implPrepareEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException);
virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException);
virtual void implPostProcessEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, bool bSuccess, bool bCancel ) throw (css::uno::RuntimeException);
virtual ::rtl::OUString implGetDocumentModuleName( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException);
private:
- /** Extracts a sheet index from the first element of the passed sequence. The
- element may be an integer, or a Calc range or ranges object. */
- static SCTAB getTabFromArgs( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException);
/** Checks if selection has been changed compared to selection of last call.
@return true, if the selection has been changed. */
bool isSelectionChanged( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
@@ -75,11 +69,10 @@ private:
css::uno::Any createWindow() const throw (css::uno::RuntimeException);
private:
- mutable css::uno::WeakReference< ov::excel::XApplication > mxApplication;
::rtl::Reference< ScVbaEventsListener > mxListener;
+ css::uno::Any maOldSelection;
ScDocShell* mpDocShell;
ScDocument* mpDoc;
- ScRangeList maOldSelection;
bool mbOpened;
};
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 9fd22bf89f7a..1386bec7fa70 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -100,7 +100,6 @@ ScVbaNames::Add( const css::uno::Any& Name ,
const css::uno::Any& RefersToR1C1,
const css::uno::Any& RefersToR1C1Local ) throw (css::uno::RuntimeException)
{
-
rtl::OUString sName;
uno::Reference< excel::XRange > xRange;
if ( Name.hasValue() )
@@ -158,6 +157,8 @@ ScVbaNames::Add( const css::uno::Any& Name ,
if ( mxNames->hasByName( sName ) )
mxNames->removeByName(sName);
mxNames->addNewByName( sName , rtl::OUString(sTmp) , aCellAddr , (sal_Int32)nType);
+ uno::Reference< sheet::XNamedRange > xName( mxNames->getByName( sName ), uno::UNO_QUERY_THROW );
+ return uno::Any( uno::Reference< excel::XName >( new ScVbaName( getParent(), mxContext, xName, mxNames, mxModel ) ) );
}
}
return css::uno::Any();
@@ -174,7 +175,7 @@ uno::Reference< container::XEnumeration >
ScVbaNames::createEnumeration() throw (uno::RuntimeException)
{
uno::Reference< container::XEnumerationAccess > xEnumAccess( mxNames, uno::UNO_QUERY_THROW );
- return new NamesEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel , mxNames );
+ return new NamesEnumeration( getParent(), mxContext, xEnumAccess->createEnumeration(), mxModel , mxNames );
}
uno::Any
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 455af075306c..6cd129a6ae2d 100755
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -24,6 +24,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
+#include "vbarange.hxx"
+
#include <vbahelper/helperdecl.hxx>
#include <comphelper/unwrapargs.hxx>
@@ -31,6 +34,8 @@
#include <sfx2/objsh.hxx>
#include <com/sun/star/script/ArrayWrapper.hpp>
+#include <com/sun/star/script/vba/VBAEventId.hpp>
+#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/sheet/XDatabaseRange.hpp>
#include <com/sun/star/sheet/XDatabaseRanges.hpp>
#include <com/sun/star/sheet/XGoalSeek.hpp>
@@ -123,6 +128,7 @@
#include <cellsuno.hxx>
#include <dbcolect.hxx>
#include "docfunc.hxx"
+#include "transobj.hxx"
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
@@ -134,7 +140,7 @@
#include <globstr.hrc>
#include <unonames.hxx>
-#include "vbarange.hxx"
+#include "vbaapplication.hxx"
#include "vbafont.hxx"
#include "vbacomment.hxx"
#include "vbainterior.hxx"
@@ -172,6 +178,9 @@ using namespace ::ooo::vba;
using namespace ::com::sun::star;
using ::std::vector;
+// difference between VBA and file format width, in character units
+const double fExtraWidth = 182.0 / 256.0;
+
// * 1 point = 1/72 inch = 20 twips
// * 1 inch = 72 points = 1440 twips
// * 1 cm = 567 twips
@@ -264,6 +273,26 @@ SfxItemSet* ScVbaRange::getCurrentDataSet( ) throw ( uno::RuntimeException )
return pDataSet;
}
+void ScVbaRange::fireChangeEvent()
+{
+ if( ScVbaApplication::getDocumentEventsEnabled() )
+ {
+ if( ScDocument* pDoc = getScDocument() )
+ {
+ uno::Reference< script::vba::XVBAEventProcessor > xVBAEvents = pDoc->GetVbaEventProcessor();
+ if( xVBAEvents.is() ) try
+ {
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[ 0 ] <<= uno::Reference< excel::XRange >( this );
+ xVBAEvents->processVbaEvent( script::vba::VBAEventId::WORKSHEET_CHANGE, aArgs );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+}
+
class SingleRangeEnumeration : public EnumerationHelper_BASE
{
uno::Reference< XHelperInterface > m_xParent;
@@ -539,19 +568,22 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
sal_Int16 nType = ::comphelper::getINT16(
- xNumberProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) );
+ xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) );
return nType;
}
- bool setNumberFormat( const rtl::OUString& rFormat )
+ bool setNumberFormat( const rtl::OUString& rFormat )
{
- lang::Locale aLocale;
- uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
- xNumProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Locale" ) ) >>= aLocale;
- sal_Int32 nNewIndex = mxFormats->queryKey(rFormat, aLocale, false );
- if ( nNewIndex == -1 ) // format not defined
+ // #163288# treat "General" as "Standard" format
+ sal_Int32 nNewIndex = 0;
+ if( !rFormat.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "General" ) ) )
{
- nNewIndex = mxFormats->addNew( rFormat, aLocale );
+ lang::Locale aLocale;
+ uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
+ xNumProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) ) ) >>= aLocale;
+ nNewIndex = mxFormats->queryKey( rFormat, aLocale, false );
+ if ( nNewIndex == -1 ) // format not defined
+ nNewIndex = mxFormats->addNew( rFormat, aLocale );
}
mxRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberFormat") ), uno::makeAny( nNewIndex ) );
return true;
@@ -561,7 +593,7 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
lang::Locale aLocale;
- xNumberProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Locale" ) ) >>= aLocale;
+ xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) ) ) >>= aLocale;
uno::Reference<util::XNumberFormatTypes> xTypes( mxFormats, uno::UNO_QUERY );
if ( xTypes.is() )
{
@@ -733,8 +765,26 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab
rtl::OUString aString;
if ( aValue >>= aString )
{
- uno::Reference< text::XTextRange > xTextRange( xCell, uno::UNO_QUERY_THROW );
- xTextRange->setString( aString );
+ // The required behavior for a string value is:
+ // 1. If the first character is a single quote, use the rest as a string cell, regardless of the cell's number format.
+ // 2. Otherwise, if the cell's number format is "text", use the string value as a string cell.
+ // 3. Otherwise, parse the string value in English locale, and apply a corresponding number format with the cell's locale
+ // if the cell's number format was "General".
+ // Case 1 is handled here, the rest in ScCellObj::InputEnglishString
+
+ if ( aString.toChar() == '\'' ) // case 1 - handle with XTextRange
+ {
+ rtl::OUString aRemainder( aString.copy(1) ); // strip the quote
+ uno::Reference< text::XTextRange > xTextRange( xCell, uno::UNO_QUERY_THROW );
+ xTextRange->setString( aRemainder );
+ }
+ else
+ {
+ // call implementation method InputEnglishString
+ ScCellObj* pCellObj = dynamic_cast< ScCellObj* >( xCell.get() );
+ if ( pCellObj )
+ pCellObj->InputEnglishString( aString );
+ }
}
else
isExtracted = false;
@@ -1473,7 +1523,7 @@ ScVbaRange::getValue() throw (uno::RuntimeException)
void
-ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) throw (uno::RuntimeException)
+ScVbaRange::setValue( const uno::Any& aValue, ValueSetter& valueSetter, bool bFireEvent ) throw (uno::RuntimeException)
{
uno::TypeClass aClass = aValue.getValueTypeClass();
if ( aClass == uno::TypeClass_SEQUENCE )
@@ -1508,6 +1558,7 @@ ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) thro
{
visitArray( valueSetter );
}
+ if( bFireEvent ) fireChangeEvent();
}
void SAL_CALL
@@ -1522,20 +1573,20 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException)
return;
}
CellValueSetter valueSetter( aValue );
- setValue( aValue, valueSetter );
+ setValue( aValue, valueSetter, true );
}
-void
+void SAL_CALL
ScVbaRange::Clear() throw (uno::RuntimeException)
{
using namespace ::com::sun::star::sheet::CellFlags;
sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
- ClearContents( nFlags );
+ ClearContents( nFlags, true );
}
//helper ClearContent
void
-ScVbaRange::ClearContents( sal_Int32 nFlags ) throw (uno::RuntimeException)
+ScVbaRange::ClearContents( sal_Int32 nFlags, bool bFireEvent ) throw (uno::RuntimeException)
{
// #TODO code within the test below "if ( m_Areas.... " can be removed
// Test is performed only because m_xRange is NOT set to be
@@ -1549,40 +1600,44 @@ ScVbaRange::ClearContents( sal_Int32 nFlags ) throw (uno::RuntimeException)
uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW );
ScVbaRange* pRange = getImplementation( xRange );
if ( pRange )
- pRange->ClearContents( nFlags );
+ pRange->ClearContents( nFlags, false ); // do not fire for single ranges
}
+ // fire change event for the entire range list
+ if( bFireEvent ) fireChangeEvent();
return;
}
uno::Reference< sheet::XSheetOperation > xSheetOperation(mxRange, uno::UNO_QUERY_THROW);
xSheetOperation->clearContents( nFlags );
+ if( bFireEvent ) fireChangeEvent();
}
-void
+
+void SAL_CALL
ScVbaRange::ClearComments() throw (uno::RuntimeException)
{
- ClearContents( sheet::CellFlags::ANNOTATION );
+ ClearContents( sheet::CellFlags::ANNOTATION, false );
}
-void
+void SAL_CALL
ScVbaRange::ClearContents() throw (uno::RuntimeException)
{
- sal_Int32 nClearFlags = ( sheet::CellFlags::VALUE |
- sheet::CellFlags::STRING | sheet::CellFlags::DATETIME |
- sheet::CellFlags::FORMULA );
- ClearContents( nClearFlags );
+ using namespace ::com::sun::star::sheet::CellFlags;
+ sal_Int32 nFlags = VALUE | STRING | DATETIME | FORMULA;
+ ClearContents( nFlags, true );
}
-void
+void SAL_CALL
ScVbaRange::ClearFormats() throw (uno::RuntimeException)
{
- //FIXME: need to check if we need to combine sheet::CellFlags::FORMATTED
- sal_Int32 nClearFlags = sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR;
- ClearContents( nClearFlags );
+ //FIXME: need to check if we need to combine FORMATTED
+ using namespace ::com::sun::star::sheet::CellFlags;
+ sal_Int32 nFlags = HARDATTR | FORMATTED | EDITATTR;
+ ClearContents( nFlags, false );
}
void
-ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::Grammar eGram ) throw (uno::RuntimeException)
+ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::Grammar eGram, bool bFireEvent ) throw (uno::RuntimeException)
{
// If this is a multiple selection apply setFormula over all areas
if ( m_Areas->getCount() > 1 )
@@ -1593,7 +1648,7 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::
return;
}
CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram );
- setValue( rFormula, formulaValueSetter );
+ setValue( rFormula, formulaValueSetter, bFireEvent );
}
uno::Any
@@ -1617,7 +1672,7 @@ void
ScVbaRange::setFormula(const uno::Any &rFormula ) throw (uno::RuntimeException)
{
// #FIXME converting "=$a$1" e.g. CONV_XL_A1 -> CONV_OOO // results in "=$a$1:a1", temporalily disable conversion
- setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );;
+ setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_A1, true );
}
uno::Any
@@ -1629,7 +1684,7 @@ ScVbaRange::getFormulaR1C1() throw (::com::sun::star::uno::RuntimeException)
void
ScVbaRange::setFormulaR1C1(const uno::Any& rFormula ) throw (uno::RuntimeException)
{
- setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
+ setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1, true );
}
uno::Any
@@ -2054,6 +2109,18 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
return xRange->Cells( nRowIndex, nColumnIndex );
}
+ // Performance: Use a common helper method for ScVbaRange::Cells and ScVbaWorksheet::Cells,
+ // instead of creating a new ScVbaRange object in often-called ScVbaWorksheet::Cells
+ return CellsHelper( mxParent, mxContext, mxRange, nRowIndex, nColumnIndex );
+}
+
+// static
+uno::Reference< excel::XRange >
+ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Reference< css::table::XCellRange >& xRange,
+ const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) throw(uno::RuntimeException)
+{
sal_Int32 nRow = 0, nColumn = 0;
sal_Bool bIsIndex = nRowIndex.hasValue();
@@ -2065,7 +2132,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
// convertion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, getCppuType((sal_Int32*)0) )
if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) )
{
- uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
uno::Any aConverted;
try
{
@@ -2076,7 +2143,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
}
if ( bIsColumnIndex && !( nColumnIndex >>= nColumn ) )
{
- uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
uno::Any aConverted;
try
{
@@ -2086,17 +2153,17 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
catch( uno::Exception& ) {} // silence any errors
}
- RangeHelper thisRange( mxRange );
+ RangeHelper thisRange( xRange );
table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< table::XCellRange > xSheetRange = thisRange.getCellRangeFromSheet();
if( !bIsIndex && !bIsColumnIndex ) // .Cells
// #FIXE needs proper parent ( Worksheet )
- return uno::Reference< excel::XRange >( new ScVbaRange( mxParent, mxContext, mxRange ) );
+ return uno::Reference< excel::XRange >( new ScVbaRange( xParent, xContext, xRange ) );
sal_Int32 nIndex = --nRow;
if( bIsIndex && !bIsColumnIndex ) // .Cells(n)
{
- uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, ::uno::UNO_QUERY_THROW);
+ uno::Reference< table::XColumnRowRange > xColumnRowRange(xRange, ::uno::UNO_QUERY_THROW);
sal_Int32 nColCount = xColumnRowRange->getColumns()->getCount();
if ( !nIndex || nIndex < 0 )
@@ -2109,7 +2176,7 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr
--nColumn;
nRow = nRow + thisRangeAddress.StartRow;
nColumn = nColumn + thisRangeAddress.StartColumn;
- return new ScVbaRange( mxParent, mxContext, xSheetRange->getCellRangeByPosition( nColumn, nRow, nColumn, nRow ) );
+ return new ScVbaRange( xParent, xContext, xSheetRange->getCellRangeByPosition( nColumn, nRow, nColumn, nRow ) );
}
void
@@ -3236,7 +3303,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("That command cannot be used on multiple selections" ) ), uno::Reference< uno::XInterface >() );
sal_Int16 nDataOption1 = excel::XlSortDataOption::xlSortNormal;
- sal_Int16 nDataOption2 = excel::XlSortDataOption::xlSortNormal;;
+ sal_Int16 nDataOption2 = excel::XlSortDataOption::xlSortNormal;
sal_Int16 nDataOption3 = excel::XlSortDataOption::xlSortNormal;
ScDocument* pDoc = getScDocument();
@@ -3611,15 +3678,6 @@ ScVbaRange::getDefaultMethodName( ) throw (uno::RuntimeException)
}
-uno::Reference< awt::XDevice >
-getDeviceFromDoc( const uno::Reference< frame::XModel >& xModel ) throw( uno::RuntimeException )
-{
- uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XFrame> xFrame( xController->getFrame(), uno::UNO_QUERY_THROW );
- uno::Reference< awt::XDevice > xDevice( xFrame->getComponentWindow(), uno::UNO_QUERY_THROW );
- return xDevice;
-}
-
// returns calc internal col. width ( in points )
double
ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno::RuntimeException)
@@ -3642,29 +3700,16 @@ ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (u
}
// return Char Width in points
-double getDefaultCharWidth( const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException )
-{
- const static rtl::OUString sDflt( RTL_CONSTASCII_USTRINGPARAM("Default"));
- const static rtl::OUString sCharFontName( RTL_CONSTASCII_USTRINGPARAM("CharFontName"));
- const static rtl::OUString sPageStyles( RTL_CONSTASCII_USTRINGPARAM("PageStyles"));
- // get the font from the default style
- uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameAccess > xNameAccess( xStyleSupplier->getStyleFamilies(), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameAccess > xNameAccess2( xNameAccess->getByName( sPageStyles ), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xProps( xNameAccess2->getByName( sDflt ), uno::UNO_QUERY_THROW );
- rtl::OUString sFontName;
- xProps->getPropertyValue( sCharFontName ) >>= sFontName;
-
- uno::Reference< awt::XDevice > xDevice = getDeviceFromDoc( xModel );
- awt::FontDescriptor aDesc;
- aDesc.Name = sFontName;
- uno::Reference< awt::XFont > xFont( xDevice->getFont( aDesc ), uno::UNO_QUERY_THROW );
- double nCharPixelWidth = xFont->getCharWidth( (sal_Int8)'0' );
-
- double nPixelsPerMeter = xDevice->getInfo().PixelPerMeterX;
- double nCharWidth = nCharPixelWidth / nPixelsPerMeter;
- nCharWidth = nCharWidth * (double)56700;// in twips
- return lcl_TwipsToPoints( (USHORT)nCharWidth );
+double getDefaultCharWidth( ScDocShell* pDocShell )
+{
+ ScDocument* pDoc = pDocShell->GetDocument();
+ OutputDevice* pRefDevice = pDoc->GetRefDevice();
+ ScPatternAttr* pAttr = pDoc->GetDefPattern();
+ ::Font aDefFont;
+ pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice );
+ pRefDevice->SetFont( aDefFont );
+ long nCharWidth = pRefDevice->GetTextWidth( String( '0' ) ); // 1/100th mm
+ return lcl_hmmToPoints( nCharWidth );
}
uno::Any SAL_CALL
@@ -3682,7 +3727,7 @@ ScVbaRange::getColumnWidth() throw (uno::RuntimeException)
if ( pShell )
{
uno::Reference< frame::XModel > xModel = pShell->GetModel();
- double defaultCharWidth = getDefaultCharWidth( xModel );
+ double defaultCharWidth = getDefaultCharWidth( pShell );
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
sal_Int32 nStartCol = thisAddress.StartColumn;
@@ -3697,9 +3742,9 @@ ScVbaRange::getColumnWidth() throw (uno::RuntimeException)
if ( nColTwips != nCurTwips )
return aNULL();
}
- nColWidth = lcl_Round2DecPlaces( lcl_TwipsToPoints( nColTwips ) );
- if ( xModel.is() )
- nColWidth = nColWidth / defaultCharWidth;
+ nColWidth = lcl_TwipsToPoints( nColTwips );
+ if ( nColWidth != 0.0 )
+ nColWidth = ( nColWidth / defaultCharWidth ) - fExtraWidth;
}
nColWidth = lcl_Round2DecPlaces( nColWidth );
return uno::makeAny( nColWidth );
@@ -3724,11 +3769,8 @@ ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeEx
ScDocShell* pDocShell = getScDocShell();
if ( pDocShell )
{
- uno::Reference< frame::XModel > xModel = pDocShell->GetModel();
- if ( xModel.is() )
- {
-
- nColWidth = ( nColWidth * getDefaultCharWidth( xModel ) );
+ if ( nColWidth != 0.0 )
+ nColWidth = ( nColWidth + fExtraWidth ) * getDefaultCharWidth( pDocShell );
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
USHORT nTwips = lcl_pointsToTwips( nColWidth );
@@ -3737,11 +3779,11 @@ ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeEx
SCCOLROW nColArr[2];
nColArr[0] = thisAddress.StartColumn;
nColArr[1] = thisAddress.EndColumn;
- aFunc.SetWidthOrHeight( TRUE, 1, nColArr, thisAddress.Sheet, SC_SIZE_ORIGINAL,
+ // #163561# use mode SC_SIZE_DIRECT: hide for width 0, show for other values
+ aFunc.SetWidthOrHeight( TRUE, 1, nColArr, thisAddress.Sheet, SC_SIZE_DIRECT,
nTwips, TRUE, TRUE );
}
- }
}
uno::Any SAL_CALL
@@ -3901,7 +3943,8 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeExcepti
SCCOLROW nRowArr[2];
nRowArr[0] = thisAddress.StartRow;
nRowArr[1] = thisAddress.EndRow;
- aFunc.SetWidthOrHeight( FALSE, 1, nRowArr, thisAddress.Sheet, SC_SIZE_ORIGINAL,
+ // #163561# use mode SC_SIZE_DIRECT: hide for height 0, show for other values
+ aFunc.SetWidthOrHeight( FALSE, 1, nRowArr, thisAddress.Sheet, SC_SIZE_DIRECT,
nTwips, TRUE, TRUE );
}
@@ -4350,6 +4393,20 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
{
RangeHelper multiCellRange( mxRange );
autoFiltAddress = multiCellRange.getCellRangeAddressable()->getRangeAddress();
+ // #163530# Filter box shows only entry of first row
+ ScDocument* pDocument = ( pShell ? pShell->GetDocument() : NULL );
+ if ( pDocument )
+ {
+ SCCOL nStartCol = autoFiltAddress.StartColumn;
+ SCROW nStartRow = autoFiltAddress.StartRow;
+ SCCOL nEndCol = autoFiltAddress.EndColumn;
+ SCROW nEndRow = autoFiltAddress.EndRow;
+ pDocument->GetDataArea( autoFiltAddress.Sheet, nStartCol, nStartRow, nEndCol, nEndRow, TRUE, true );
+ autoFiltAddress.StartColumn = nStartCol;
+ autoFiltAddress.StartRow = nStartRow;
+ autoFiltAddress.EndColumn = nEndCol;
+ autoFiltAddress.EndRow = nEndRow;
+ }
}
uno::Reference< sheet::XDatabaseRanges > xDBRanges = lcl_GetDataBaseRanges( pShell );
@@ -4369,13 +4426,9 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW );
// set autofilt
xDBRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ), uno::Any(sal_True) );
- // set header
+ // set header (autofilter always need column headers)
uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
- sal_Bool bHasColHeader = sal_False;
- ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL;
-
- bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ) ? sal_True : sal_False;
- xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( bHasColHeader ) );
+ xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( sal_True ) );
}
@@ -4405,7 +4458,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
// Use the normal uno api, sometimes e.g. when you want to use ALL as the filter
// we can't use refresh as the uno interface doesn't have a concept of ALL
// in this case we just call the core calc functionality -
- bool bAll = false;;
+ bool bAll = false;
if ( ( Field >>= nField ) )
{
uno::Reference< sheet::XSheetFilterDescriptor2 > xDesc(
@@ -4543,10 +4596,8 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
}
void SAL_CALL
-ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (uno::RuntimeException)
+ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /* CopyOrigin */ ) throw (uno::RuntimeException)
{
- sal_Bool bCopyOrigin = sal_True;
- CopyOrigin >>= bCopyOrigin;
// It appears ( from the web ) that the undocumented CopyOrigin
// param should contain member of enum XlInsertFormatOrigin
// which can have values xlFormatFromLeftOrAbove or xlFormatFromRightOrBelow
@@ -4581,7 +4632,11 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
xCellRangeMove->insertCells( thisAddress, mode );
- if ( bCopyOrigin )
+
+ // Paste from clipboard only if the clipboard content was copied via VBA, and not already pasted via VBA again.
+ // "Insert" behavior should not depend on random clipboard content previously copied by the user.
+ ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL );
+ if ( pClipObj && pClipObj->GetUseInApi() )
{
// After the insert ( this range ) actually has moved
ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) );
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index e7488e434f30..e8079a855544 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -99,6 +99,7 @@ class ScVbaRange : public ScVbaRange_BASE
sal_Bool mbIsRows;
sal_Bool mbIsColumns;
css::uno::Reference< ov::excel::XValidation > m_xValidation;
+
double getCalcColWidth( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
double getCalcRowHeight( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
void visitArray( ArrayVisitor& vistor );
@@ -107,11 +108,14 @@ class ScVbaRange : public ScVbaRange_BASE
void fillSeries( css::sheet::FillDirection nFillDirection, css::sheet::FillMode nFillMode, css::sheet::FillDateMode nFillDateMode, double fStep, double fEndValue ) throw( css::uno::RuntimeException );
- void ClearContents( sal_Int32 nFlags ) throw (css::uno::RuntimeException);
- virtual void setValue( const css::uno::Any& aValue, ValueSetter& setter) throw ( css::uno::RuntimeException);
- virtual css::uno::Any getValue( ValueGetter& rValueGetter ) throw (css::uno::RuntimeException);
- virtual css::uno::Any getFormulaValue( formula::FormulaGrammar::Grammar ) throw (css::uno::RuntimeException);
- virtual void setFormulaValue( const css::uno::Any& aValue, formula::FormulaGrammar::Grammar ) throw ( css::uno::RuntimeException);
+ void ClearContents( sal_Int32 nFlags, bool bFireEvent ) throw (css::uno::RuntimeException);
+
+ css::uno::Any getValue( ValueGetter& rValueGetter ) throw (css::uno::RuntimeException);
+ void setValue( const css::uno::Any& aValue, ValueSetter& setter, bool bFireEvent ) throw ( css::uno::RuntimeException);
+
+ css::uno::Any getFormulaValue( formula::FormulaGrammar::Grammar ) throw (css::uno::RuntimeException);
+ void setFormulaValue( const css::uno::Any& aValue, formula::FormulaGrammar::Grammar, bool bFireEvent ) throw ( css::uno::RuntimeException);
+
css::uno::Reference< ov::excel::XRange > getArea( sal_Int32 nIndex ) throw( css::uno::RuntimeException );
ScCellRangeObj* getCellRangeObj( ) throw ( css::uno::RuntimeException );
ScCellRangesObj* getCellRangesObj() throw ( css::uno::RuntimeException );
@@ -120,6 +124,10 @@ class ScVbaRange : public ScVbaRange_BASE
css::uno::Reference< ov::excel::XRange > PreviousNext( bool bIsPrevious );
css::uno::Reference< ov::excel::XRange > SpecialCellsImpl( sal_Int32 nType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException );
css::awt::Point getPosition() throw ( css::uno::RuntimeException );
+
+ /** Fires a Worksheet_Change event for this range or range list. */
+ void fireChangeEvent();
+
protected:
virtual ScCellRangesBase* getCellRangesBase() throw ( css::uno::RuntimeException );
virtual SfxItemSet* getCurrentDataSet( ) throw ( css::uno::RuntimeException );
@@ -149,6 +157,12 @@ public:
const rtl::OUString& sRangeName, ScDocShell* pDocSh,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( css::uno::RuntimeException );
+ static css::uno::Reference< ov::excel::XRange > CellsHelper(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::table::XCellRange >& xRange,
+ const css::uno::Any &nRowIndex, const css::uno::Any &nColumnIndex ) throw(css::uno::RuntimeException);
+
// Attributes
virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
virtual void SAL_CALL setValue( const css::uno::Any& aValue ) throw ( css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index 4bd0f1d60547..28e54de859ad 100755..100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -38,7 +38,9 @@
#include <rtl/ustrbuf.hxx>
#include <filter/msfilter/msvbahelper.hxx>
#include <oox/helper/helper.hxx>
+#include <svx/unoshape.hxx>
#include "vbafont.hxx"
+#include "drwlayer.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -237,13 +239,38 @@ void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName ) throw (uno:
sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement() throw (uno::RuntimeException)
{
- // TODO
- return excel::XlPlacement::xlMoveAndSize;
+ sal_Int32 nRet = excel::XlPlacement::xlMoveAndSize;
+ SvxShape* pShape = SvxShape::getImplementation( mxShape );
+ if(pShape)
+ {
+ SdrObject* pObj = pShape->GetSdrObject();
+ if (pObj)
+ {
+ ScAnchorType eType = ScDrawLayer::GetAnchor(pObj);
+ if (eType == SCA_PAGE)
+ nRet = excel::XlPlacement::xlFreeFloating;
+ }
+ }
+ return nRet;
}
-void SAL_CALL ScVbaSheetObjectBase::setPlacement( sal_Int32 /*nPlacement*/ ) throw (uno::RuntimeException)
+void SAL_CALL ScVbaSheetObjectBase::setPlacement( sal_Int32 nPlacement ) throw (uno::RuntimeException)
{
- // TODO
+ SvxShape* pShape = SvxShape::getImplementation( mxShape );
+ if(pShape)
+ {
+ SdrObject* pObj = pShape->GetSdrObject();
+ if (pObj)
+ {
+ ScAnchorType eType = SCA_CELL;
+ if ( nPlacement == excel::XlPlacement::xlFreeFloating )
+ eType = SCA_PAGE;
+
+ // xlMove is not supported, treated as SCA_CELL (xlMoveAndSize)
+
+ ScDrawLayer::SetAnchor(pObj, eType);
+ }
+ }
}
sal_Bool SAL_CALL ScVbaSheetObjectBase::getPrintObject() throw (uno::RuntimeException)
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 28469c4685a2..1e2acd6252b8 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -300,7 +300,7 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime
}
css::uno::Any SAL_CALL
-ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException)
+ScVbaWorkbook::Styles( const uno::Any& Item ) throw (uno::RuntimeException)
{
// quick look and Styles object doesn't seem to have a valid parent
// or a least the object browser just shows an object that has no
@@ -313,18 +313,16 @@ ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException)
// Amelia Wang
uno::Any SAL_CALL
-ScVbaWorkbook::Names( const css::uno::Any& aIndex ) throw (uno::RuntimeException)
+ScVbaWorkbook::Names( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
- uno::Reference< frame::XModel > xModel( getModel() );
+ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xProps( xModel, uno::UNO_QUERY_THROW );
uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NamedRanges") ) ), uno::UNO_QUERY_THROW );
- uno::Reference< XCollection > xNames( new ScVbaNames( this , mxContext , xNamedRanges , xModel ));
- if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
- {
+ uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, xModel ) );
+ if ( aIndex.hasValue() )
+ return uno::Any( xNames->Item( aIndex, uno::Any() ) );
return uno::Any( xNames );
}
- return uno::Any( xNames->Item( aIndex, uno::Any() ) );
-}
rtl::OUString&
ScVbaWorkbook::getServiceImplName()
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 7efee1505dcb..a9f1970be34e 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -46,7 +46,9 @@
#include <com/sun/star/document/XTypeDetection.hpp>
#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/script/vba/VBAEventId.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
+#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
#include <com/sun/star/script/ModuleType.hpp>
@@ -73,15 +75,19 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
ScDocShell* pShell = excel::getDocShell( xModel );
if ( pShell )
{
+ String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ pShell->GetBasicManager()->SetName( aPrjName );
+
+ /* Set library container to VBA compatibility mode. This will create
+ the VBA Globals object and store it in the Basic manager of the
+ document. */
uno::Reference<script::XLibraryContainer> xLibContainer = pShell->GetBasicContainer();
uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY_THROW );
xVBACompat->setVBACompatibilityMode( sal_True );
- String aPrjName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
- pShell->GetBasicManager()->SetName( aPrjName );
if( xLibContainer.is() )
{
- if( !xLibContainer->hasByName( aPrjName ) )
+ if( !xLibContainer->hasByName( aPrjName ) )
xLibContainer->createLibrary( aPrjName );
uno::Any aLibAny = xLibContainer->getByName( aPrjName );
uno::Reference< container::XNameContainer > xLib;
@@ -90,8 +96,6 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
{
uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY_THROW );
uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY_THROW);
- // bootstrap vbaglobals
- xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals")));
uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAObjectModuleObjectProvider"))), uno::UNO_QUERY_THROW );
// set up the module info for the workbook and sheets in the nealy created
// spreadsheet
@@ -130,6 +134,18 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
}
}
}
+
+ /* Trigger the Workbook_Open event, event processor will register
+ itself as listener for specific events. */
+ try
+ {
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pShell->GetDocument()->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Sequence< uno::Any > aArgs;
+ xVbaEvents->processVbaEvent( script::vba::VBAEventId::WORKBOOK_OPEN, aArgs );
+ }
+ catch( uno::Exception& )
+ {
+ }
}
}
@@ -200,9 +216,41 @@ ScVbaWorkbooks::createCollectionObject( const css::uno::Any& aSource )
uno::Any SAL_CALL
-ScVbaWorkbooks::Add() throw (uno::RuntimeException)
+ScVbaWorkbooks::Add( const uno::Any& Template ) throw (uno::RuntimeException)
{
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( VbaDocumentsBase::Add() , uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XSpreadsheetDocument > xSpreadDoc;
+ sal_Int32 nWorkbookType = 0;
+ ::rtl::OUString aTemplateFileName;
+ if( Template >>= nWorkbookType )
+ {
+ // nWorkbookType is a constant from XlWBATemplate (added in Excel 2007)
+ // TODO: create chart-sheet if supported by Calc
+
+ xSpreadDoc.set( createDocument(), uno::UNO_QUERY_THROW );
+ // create a document with one sheet only
+ uno::Reference< sheet::XSpreadsheets > xSheets( xSpreadDoc->getSheets(), uno::UNO_SET_THROW );
+ uno::Reference< container::XIndexAccess > xSheetsIA( xSheets, uno::UNO_QUERY_THROW );
+ while( xSheetsIA->getCount() > 1 )
+ {
+ uno::Reference< container::XNamed > xSheetName( xSheetsIA->getByIndex( xSheetsIA->getCount() - 1 ), uno::UNO_QUERY_THROW );
+ xSheets->removeByName( xSheetName->getName() );
+ }
+ }
+ else if( Template >>= aTemplateFileName )
+ {
+ // TODO: create document from template
+ xSpreadDoc.set( createDocument(), uno::UNO_QUERY_THROW );
+ }
+ else if( !Template.hasValue() )
+ {
+ // regular spreadsheet document with configured number of sheets
+ xSpreadDoc.set( createDocument(), uno::UNO_QUERY_THROW );
+ }
+ else
+ {
+ // illegal argument
+ throw uno::RuntimeException();
+ }
// need to set up the document modules ( and vba mode ) here
setUpDocumentModules( xSpreadDoc );
@@ -211,10 +259,10 @@ ScVbaWorkbooks::Add() throw (uno::RuntimeException)
return uno::Any();
}
-void
+void SAL_CALL
ScVbaWorkbooks::Close() throw (uno::RuntimeException)
{
- VbaDocumentsBase::Close();
+ closeDocuments();
}
bool
@@ -254,7 +302,7 @@ ScVbaWorkbooks::getFileFilterType( const rtl::OUString& rFileName )
}
// #TODO# #FIXME# can any of the unused params below be used?
-uno::Any
+uno::Any SAL_CALL
ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLinks*/, const uno::Any& ReadOnly, const uno::Any& Format, const uno::Any& /*Password*/, const uno::Any& /*WriteResPassword*/, const uno::Any& /*IgnoreReadOnlyRecommended*/, const uno::Any& /*Origin*/, const uno::Any& Delimiter, const uno::Any& /*Editable*/, const uno::Any& /*Notify*/, const uno::Any& /*Converter*/, const uno::Any& /*AddToMru*/ ) throw (uno::RuntimeException)
{
// we need to detect if this is a URL, if not then assume its a file path
@@ -333,7 +381,7 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi
else if ( !isSpreadSheetFile( sType ) )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Bad Format")), uno::Reference< uno::XInterface >() );
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( VbaDocumentsBase::Open( rFileName, ReadOnly, sProps ), uno::UNO_QUERY_THROW );
+ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( openDocument( rFileName, ReadOnly, sProps ), uno::UNO_QUERY_THROW );
uno::Any aRet = getWorkbook( mxContext, xSpreadDoc, mxParent );
uno::Reference< excel::XWorkbook > xWBook( aRet, uno::UNO_QUERY );
if ( xWBook.is() )
@@ -341,12 +389,6 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi
return aRet;
}
-uno::Any
-ScVbaWorkbooks::Open( const rtl::OUString& Filename, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException)
-{
- return VbaDocumentsBase::Open( Filename, ReadOnly, rProps );
-}
-
rtl::OUString&
ScVbaWorkbooks::getServiceImplName()
{
diff --git a/sc/source/ui/vba/vbaworkbooks.hxx b/sc/source/ui/vba/vbaworkbooks.hxx
index 5d6210244d80..3392829f1a05 100644
--- a/sc/source/ui/vba/vbaworkbooks.hxx
+++ b/sc/source/ui/vba/vbaworkbooks.hxx
@@ -60,12 +60,9 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
// XWorkbooks
- virtual css::uno::Any SAL_CALL Add() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Template ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Close( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& UpdateLinks, const css::uno::Any& ReadOnly, const css::uno::Any& Format, const css::uno::Any& Password, const css::uno::Any& WriteResPassword, const css::uno::Any& IgnoreReadOnlyRecommended, const css::uno::Any& Origin, const css::uno::Any& Delimiter, const css::uno::Any& Editable, const css::uno::Any& Notify, const css::uno::Any& Converter, const css::uno::Any& AddToMru ) throw (css::uno::RuntimeException);
-
- // VbaDocumentsBase / XDocumentsBase (to avoid warning C4266 for hiding function on wntmsci)
- virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException);
};
#endif /* SC_VBA_WORKBOOKS_HXX */
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 6ee6fa1f6b19..6491024071b2 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/sheet/XSheetOutline.hpp>
#include <com/sun/star/sheet/XSheetPageBreak.hpp>
#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
+#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
@@ -61,6 +62,7 @@
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
#include <ooo/vba/excel/XlEnableSelection.hpp>
+#include <ooo/vba/excel/XlSheetVisibility.hpp>
#include <ooo/vba/excel/XWorkbook.hpp>
#include <ooo/vba/XControlProvider.hpp>
@@ -94,6 +96,7 @@
#include "vbaworksheets.hxx"
#include "vbahyperlinks.hxx"
#include "vbasheetobjects.hxx"
+#include "vbanames.hxx"
#define STANDARDWIDTH 2267
#define STANDARDHEIGHT 427
@@ -179,20 +182,20 @@ openNewDoc(rtl::OUString aSheetName )
return xModel;
}
-ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : WorksheetImpl_BASE( xParent, xContext )
+ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : WorksheetImpl_BASE( xParent, xContext ), mbVeryHidden( false )
{
}
ScVbaWorksheet::ScVbaWorksheet(const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< sheet::XSpreadsheet >& xSheet,
- const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel)
+ const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel), mbVeryHidden( false )
{
}
ScVbaWorksheet::ScVbaWorksheet( uno::Sequence< uno::Any> const & args,
- uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : WorksheetImpl_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) )
+ uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : WorksheetImpl_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) ), mbVeryHidden( false )
{
- if ( args.getLength() < 2 )
+ if ( args.getLength() < 3 )
throw lang::IllegalArgumentException();
rtl::OUString sSheetName;
@@ -221,24 +224,40 @@ ScVbaWorksheet::setName(const ::rtl::OUString &rName ) throw (uno::RuntimeExcept
xNamed->setName( rName );
}
-sal_Bool
+sal_Int32
ScVbaWorksheet::getVisible() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
- uno::Any aValue = xProps->getPropertyValue
- (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) );
- sal_Bool bRet = false;
- aValue >>= bRet;
- return bRet;
+ bool bVisible = false;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) ) >>= bVisible;
+ using namespace ::ooo::vba::excel::XlSheetVisibility;
+ return bVisible ? xlSheetVisible : (mbVeryHidden ? xlSheetVeryHidden : xlSheetHidden);
}
void
-ScVbaWorksheet::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+ScVbaWorksheet::setVisible( sal_Int32 nVisible ) throw (uno::RuntimeException)
{
+ using namespace ::ooo::vba::excel::XlSheetVisibility;
+ bool bVisible = true;
+ switch( nVisible )
+ {
+ case xlSheetVisible: case 1: // Excel accepts -1 and 1 for visible sheets
+ bVisible = true;
+ mbVeryHidden = false;
+ break;
+ case xlSheetHidden:
+ bVisible = false;
+ mbVeryHidden = false;
+ break;
+ case xlSheetVeryHidden:
+ bVisible = false;
+ mbVeryHidden = true;
+ break;
+ default:
+ throw uno::RuntimeException();
+ }
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
- uno::Any aValue( bVisible );
- xProps->setPropertyValue
- (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), aValue);
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), uno::Any( bVisible ) );
}
sal_Int16
@@ -639,7 +658,10 @@ uno::Reference< excel::XRange >
ScVbaWorksheet::Cells( const ::uno::Any &nRow, const ::uno::Any &nCol )
throw (uno::RuntimeException)
{
- return getSheetRange()->Cells( nRow, nCol );
+ // Performance optimization for often-called Cells method:
+ // Use a common helper method instead of creating a new ScVbaRange object
+ uno::Reference< table::XCellRange > xRange( getSheet(), uno::UNO_QUERY_THROW );
+ return ScVbaRange::CellsHelper( this, mxContext, xRange, nRow, nCol );
}
uno::Reference< excel::XRange >
@@ -716,8 +738,15 @@ ScVbaWorksheet::Hyperlinks( const uno::Any& aIndex ) throw (uno::RuntimeExceptio
uno::Any SAL_CALL
ScVbaWorksheet::Names( const css::uno::Any& aIndex ) throw (uno::RuntimeException)
{
- uno::Reference< excel::XWorkbook > xWorkbook( getParent(), uno::UNO_QUERY_THROW );
- return xWorkbook->Names( aIndex );
+ // fake sheet-local names by returning all global names
+ // #163498# initialize Names object with correct parent (this worksheet)
+ // TODO: real sheet-local names...
+ uno::Reference< beans::XPropertySet > xProps( mxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XNamedRanges > xNamedRanges( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NamedRanges") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, mxModel ) );
+ if ( aIndex.hasValue() )
+ return uno::Any( xNames->Item( aIndex, uno::Any() ) );
+ return uno::Any( xNames );
}
uno::Any SAL_CALL
@@ -888,7 +917,8 @@ ScVbaWorksheet::getFormControls()
// get the www-standard container ( maybe we should access the
// 'www-standard' by name rather than index, this seems an
// implementation detail
- xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
+ if( xIndexAccess->hasElements() )
+ xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY );
}
catch( uno::Exception& )
diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx
index 78bcc2503a49..ff5850b7c445 100644
--- a/sc/source/ui/vba/vbaworksheet.hxx
+++ b/sc/source/ui/vba/vbaworksheet.hxx
@@ -62,6 +62,7 @@ class ScVbaWorksheet : public WorksheetImpl_BASE
css::uno::Reference< ov::excel::XChartObjects > mxCharts;
css::uno::Reference< ov::excel::XHyperlinks > mxHlinks;
::rtl::Reference< ScVbaSheetObjectsBase > mxButtons;
+ bool mbVeryHidden;
css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
css::uno::Reference< ov::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
@@ -91,8 +92,8 @@ public:
// Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Int32 nVisible ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 12d153dab1e4..52d3217d7881 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -139,7 +139,6 @@ void ScPreviewShell::Construct( Window* pParent )
if (pDrawBC)
StartListening(*pDrawBC);
-// pPreview->Show(); // wird vom Sfx angezeigt
pHorScroll->Show();
pVerScroll->Show();
pCorner->Show();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 90bfe0c24e5c..93d1edd7fee5 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1549,7 +1549,7 @@ void ScTabView::SelectNextTab( short nDir, BOOL bExtendSelection )
// SetTabNo - angezeigte Tabelle
-void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection )
+void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection, bool bSameTabButMoved )
{
if ( !ValidTab(nTab) )
{
@@ -1681,7 +1681,7 @@ void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection )
pGridWin[i]->UpdateEditViewPos();
}
- TabChanged(); // DrawView
+ TabChanged( bSameTabButMoved ); // DrawView
aViewData.GetViewShell()->WindowChanged(); // falls das aktive Fenster anders ist
if ( !bUnoRefDialog )
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index f0ac3fc42869..f5a4a37784a9 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -267,7 +267,7 @@ void ScTabView::DoAddWin( ScGridWindow* pWin )
//==================================================================
-void ScTabView::TabChanged()
+void ScTabView::TabChanged( bool bSameTabButMoved )
{
if (pDrawView)
{
@@ -339,7 +339,7 @@ void ScTabView::TabChanged()
{
ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController );
if (pImp)
- pImp->SheetChanged();
+ pImp->SheetChanged( bSameTabButMoved );
}
}
}
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index 2fc2bba072d9..4b0060c88c4d 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -96,10 +96,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL))
SFX_CHILDWINDOW_REGISTRATION(GalleryChildWindow::GetChildWindowId());
SFX_CHILDWINDOW_REGISTRATION(ScSpellDialogChildWindow::GetChildWindowId());
SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
-
- //<!--Added by PengYunQuan for Validity Cell Range Picker
SFX_CHILDWINDOW_REGISTRATION(ScValidityRefChildWin::GetChildWindowId());
- //-->Added by PengYunQuan for Validity Cell Range Picker
}
SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" )
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 1a3dd6928a17..12f08ec6d0e2 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -249,7 +249,7 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
// kann und dann auch die aktive View umgeschaltet werden muss.
SCTAB nNewTab = nActiveTab;
- BOOL bForce = FALSE;
+ bool bStayOnActiveTab = true;
switch (nId)
{
case SC_TAB_INSERTED:
@@ -260,7 +260,7 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
if ( nTab1 < nNewTab ) // vorher geloescht
--nNewTab;
else if ( nTab1 == nNewTab ) // aktuelle geloescht
- bForce = TRUE;
+ bStayOnActiveTab = false;
break;
case SC_TAB_MOVED:
if ( nNewTab == nTab1 ) // verschobene Tabelle
@@ -282,7 +282,7 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
break;
case SC_TAB_HIDDEN:
if ( nTab1 == nNewTab ) // aktuelle ausgeblendet
- bForce = TRUE;
+ bStayOnActiveTab = false;
break;
}
@@ -290,7 +290,8 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
if ( nNewTab >= pDoc->GetTableCount() )
nNewTab = pDoc->GetTableCount() - 1;
- SetTabNo( nNewTab, bForce );
+ BOOL bForce = !bStayOnActiveTab;
+ SetTabNo( nNewTab, bForce, FALSE, bStayOnActiveTab );
}
else if (rHint.ISA(ScIndexHint))
{
diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk
index 09578f6ef6a8..ff4696409d48 100644
--- a/sc/util/makefile.mk
+++ b/sc/util/makefile.mk
@@ -51,7 +51,7 @@ RESLIB1LIST=\
$(SRS)$/pagedlg.srs \
$(SRS)$/navipi.srs \
$(SRS)$/cctrl.srs \
- $(SOLARCOMMONRESDIR)$/sfx.srs
+
RESLIB1NAME=sc
RESLIB1IMAGES=\
diff --git a/sc/workben/test.cxx b/sc/workben/test.cxx
index 4caa49e3adcd..b6b640a8a4ba 100644
--- a/sc/workben/test.cxx
+++ b/sc/workben/test.cxx
@@ -29,7 +29,7 @@
#include <svtools/libcall.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/window.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <vcl/help.hxx>
diff --git a/scaddins/prj/build.lst b/scaddins/prj/build.lst
index c2ade63c0b5d..6f51161232d3 100644
--- a/scaddins/prj/build.lst
+++ b/scaddins/prj/build.lst
@@ -1,4 +1,4 @@
-ca scaddins : l10n vcl NULL
+ca scaddins : LIBXSLT:libxslt l10n vcl NULL
ca scaddins usr1 - all sc_mkout NULL
ca scaddins\source\datefunc nmake - all sc_dfunc NULL
ca scaddins\source\analysis nmake - all sc_analysis NULL
diff --git a/sccomp/prj/build.lst b/sccomp/prj/build.lst
index 8e1e0d0181cb..6884378f77a0 100644
--- a/sccomp/prj/build.lst
+++ b/sccomp/prj/build.lst
@@ -1,4 +1,4 @@
-scc sccomp : l10n offuh comphelper LPSOLVE:lpsolve tools rsc NULL
+scc sccomp : l10n offuh comphelper LPSOLVE:lpsolve tools rsc LIBXSLT:libxslt NULL
scc sccomp usr1 - all scc_mkout NULL
scc sccomp\prj get - all scc_prj NULL
scc sccomp\source\solver nmake - all scc_solver NULL