summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 08:53:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 12:44:43 +0100
commita73494cf130866d4e678a1f421df56cdba7441d8 (patch)
tree7702df19639902db9fd089adf325e31c59b6ea5d /sc
parent266aab73a88ae5b62fcddaf383107d8e7edc51f2 (diff)
improve function-local statics in sc
Change-Id: Ibde8aa9393591fe405bfad8ddb23ceda77723a35 Reviewed-on: https://gerrit.libreoffice.org/63781 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/calcconfig.cxx8
-rw-r--r--sc/source/core/tool/stylehelper.cxx70
-rw-r--r--sc/source/ui/attrdlg/scuiexp.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx39
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx221
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx25
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx43
-rw-r--r--sc/source/ui/unoobj/docuno.cxx60
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx27
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx69
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx14
-rw-r--r--sc/source/ui/vba/vbaassistant.cxx8
-rw-r--r--sc/source/ui/vba/vbaaxes.cxx8
-rw-r--r--sc/source/ui/vba/vbaaxis.cxx8
-rw-r--r--sc/source/ui/vba/vbaaxistitle.cxx13
-rw-r--r--sc/source/ui/vba/vbaborders.cxx16
-rw-r--r--sc/source/ui/vba/vbacharacters.cxx8
-rw-r--r--sc/source/ui/vba/vbachart.cxx8
-rw-r--r--sc/source/ui/vba/vbachartobject.cxx8
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx8
-rw-r--r--sc/source/ui/vba/vbacharttitle.cxx13
-rw-r--r--sc/source/ui/vba/vbacomment.cxx8
-rw-r--r--sc/source/ui/vba/vbacomments.cxx8
-rw-r--r--sc/source/ui/vba/vbadialog.cxx8
-rw-r--r--sc/source/ui/vba/vbadialogs.cxx8
-rw-r--r--sc/source/ui/vba/vbafiledialog.cxx8
-rw-r--r--sc/source/ui/vba/vbafiledialogitems.cxx8
-rw-r--r--sc/source/ui/vba/vbafont.cxx8
-rw-r--r--sc/source/ui/vba/vbaformatcondition.cxx8
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx8
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx41
-rw-r--r--sc/source/ui/vba/vbainterior.cxx8
-rw-r--r--sc/source/ui/vba/vbamenu.cxx8
-rw-r--r--sc/source/ui/vba/vbamenubar.cxx8
-rw-r--r--sc/source/ui/vba/vbamenubars.cxx8
-rw-r--r--sc/source/ui/vba/vbamenuitem.cxx8
-rw-r--r--sc/source/ui/vba/vbamenuitems.cxx8
-rw-r--r--sc/source/ui/vba/vbamenus.cxx8
-rw-r--r--sc/source/ui/vba/vbaname.cxx8
-rw-r--r--sc/source/ui/vba/vbanames.cxx8
-rw-r--r--sc/source/ui/vba/vbaoleobject.cxx8
-rw-r--r--sc/source/ui/vba/vbaoleobjects.cxx8
-rw-r--r--sc/source/ui/vba/vbaoutline.cxx8
-rw-r--r--sc/source/ui/vba/vbapagebreak.cxx16
-rw-r--r--sc/source/ui/vba/vbapagebreaks.cxx16
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx8
-rw-r--r--sc/source/ui/vba/vbapivotcache.cxx8
-rw-r--r--sc/source/ui/vba/vbapivottable.cxx8
-rw-r--r--sc/source/ui/vba/vbapivottables.cxx8
-rw-r--r--sc/source/ui/vba/vbarange.cxx8
-rw-r--r--sc/source/ui/vba/vbastyle.cxx8
-rw-r--r--sc/source/ui/vba/vbastyles.cxx8
-rw-r--r--sc/source/ui/vba/vbatextframe.cxx8
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx8
-rw-r--r--sc/source/ui/vba/vbawindow.cxx8
-rw-r--r--sc/source/ui/vba/vbawindows.cxx8
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx8
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx8
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx8
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx8
-rw-r--r--sc/source/ui/vba/vbawsfunction.cxx8
61 files changed, 390 insertions, 657 deletions
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 784bd4690df0..5f40c60ad47e 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -29,17 +29,13 @@ using comphelper::ConfigurationListener;
static rtl::Reference<ConfigurationListener> const & getMiscListener()
{
- static rtl::Reference<ConfigurationListener> xListener;
- if (!xListener.is())
- xListener.set(new ConfigurationListener("/org.openoffice.Office.Common/Misc"));
+ static rtl::Reference<ConfigurationListener> xListener(new ConfigurationListener("/org.openoffice.Office.Common/Misc"));
return xListener;
}
static rtl::Reference<ConfigurationListener> const & getFormulaCalculationListener()
{
- static rtl::Reference<ConfigurationListener> xListener;
- if (!xListener.is())
- xListener.set(new ConfigurationListener("/org.openoffice.Office.Calc/Formula/Calculation"));
+ static rtl::Reference<ConfigurationListener> xListener(new ConfigurationListener("/org.openoffice.Office.Calc/Formula/Calculation"));
return xListener;
}
diff --git a/sc/source/core/tool/stylehelper.cxx b/sc/source/core/tool/stylehelper.cxx
index 9d94d9095a39..6e42c06a5df1 100644
--- a/sc/source/core/tool/stylehelper.cxx
+++ b/sc/source/core/tool/stylehelper.cxx
@@ -54,65 +54,33 @@ static const ScDisplayNameMap* lcl_GetStyleNameMap( SfxStyleFamily nType )
{
if ( nType == SfxStyleFamily::Para )
{
- static bool bCellMapFilled = false;
- static ScDisplayNameMap aCellMap[12];
- if ( !bCellMapFilled )
+ static ScDisplayNameMap const aCellMap[]
{
- aCellMap[0].aDispName = ScResId( STR_STYLENAME_STANDARD );
- aCellMap[0].aProgName = SC_STYLE_PROG_STANDARD;
-
- aCellMap[1].aDispName = ScResId( STR_STYLENAME_RESULT );
- aCellMap[1].aProgName = SC_STYLE_PROG_RESULT;
-
- aCellMap[2].aDispName = ScResId( STR_STYLENAME_RESULT1 );
- aCellMap[2].aProgName = SC_STYLE_PROG_RESULT1;
-
- aCellMap[3].aDispName = ScResId( STR_STYLENAME_HEADLINE );
- aCellMap[3].aProgName = SC_STYLE_PROG_HEADLINE;
-
- aCellMap[4].aDispName = ScResId( STR_STYLENAME_HEADLINE1 );
- aCellMap[4].aProgName = SC_STYLE_PROG_HEADLINE1;
-
- aCellMap[5].aDispName = ScResId( STR_PIVOT_STYLENAME_INNER );
- aCellMap[5].aProgName = SC_PIVOT_STYLE_PROG_INNER;
-
- aCellMap[6].aDispName = ScResId( STR_PIVOT_STYLENAME_RESULT );
- aCellMap[6].aProgName = SC_PIVOT_STYLE_PROG_RESULT;
-
- aCellMap[7].aDispName = ScResId( STR_PIVOT_STYLENAME_CATEGORY );
- aCellMap[7].aProgName = SC_PIVOT_STYLE_PROG_CATEGORY;
-
- aCellMap[8].aDispName = ScResId( STR_PIVOT_STYLENAME_TITLE );
- aCellMap[8].aProgName = SC_PIVOT_STYLE_PROG_TITLE;
-
- aCellMap[9].aDispName = ScResId( STR_PIVOT_STYLENAME_FIELDNAME );
- aCellMap[9].aProgName = SC_PIVOT_STYLE_PROG_FIELDNAME;
-
- aCellMap[10].aDispName = ScResId( STR_PIVOT_STYLENAME_TOP );
- aCellMap[10].aProgName = SC_PIVOT_STYLE_PROG_TOP;
-
+ { ScResId( STR_STYLENAME_STANDARD ), OUString(SC_STYLE_PROG_STANDARD) },
+ { ScResId( STR_STYLENAME_RESULT ), OUString(SC_STYLE_PROG_RESULT) },
+ { ScResId( STR_STYLENAME_RESULT1 ), OUString(SC_STYLE_PROG_RESULT1) },
+ { ScResId( STR_STYLENAME_HEADLINE ), OUString(SC_STYLE_PROG_HEADLINE) },
+ { ScResId( STR_STYLENAME_HEADLINE1 ), OUString(SC_STYLE_PROG_HEADLINE1) },
+ { ScResId( STR_PIVOT_STYLENAME_INNER ), OUString(SC_PIVOT_STYLE_PROG_INNER) },
+ { ScResId( STR_PIVOT_STYLENAME_RESULT ), OUString(SC_PIVOT_STYLE_PROG_RESULT) },
+ { ScResId( STR_PIVOT_STYLENAME_CATEGORY ), OUString(SC_PIVOT_STYLE_PROG_CATEGORY) },
+ { ScResId( STR_PIVOT_STYLENAME_TITLE ), OUString(SC_PIVOT_STYLE_PROG_TITLE) },
+ { ScResId( STR_PIVOT_STYLENAME_FIELDNAME ), OUString(SC_PIVOT_STYLE_PROG_FIELDNAME) },
+ { ScResId( STR_PIVOT_STYLENAME_TOP ), OUString(SC_PIVOT_STYLE_PROG_TOP) },
// last entry remains empty
-
- bCellMapFilled = true;
- }
+ { OUString(), OUString() },
+ };
return aCellMap;
}
else if ( nType == SfxStyleFamily::Page )
{
- static bool bPageMapFilled = false;
- static ScDisplayNameMap aPageMap[3];
- if ( !bPageMapFilled )
+ static ScDisplayNameMap const aPageMap[]
{
- aPageMap[0].aDispName = ScResId( STR_STYLENAME_STANDARD );
- aPageMap[0].aProgName = SC_STYLE_PROG_STANDARD;
-
- aPageMap[1].aDispName = ScResId( STR_STYLENAME_REPORT );
- aPageMap[1].aProgName = SC_STYLE_PROG_REPORT;
-
+ { ScResId( STR_STYLENAME_STANDARD ), OUString(SC_STYLE_PROG_STANDARD) },
+ { ScResId( STR_STYLENAME_REPORT ), OUString(SC_STYLE_PROG_REPORT) },
// last entry remains empty
-
- bPageMapFilled = true;
- }
+ { OUString(), OUString() },
+ };
return aPageMap;
}
OSL_FAIL("invalid family");
diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx
index d1129fa55cd8..6a04553b499b 100644
--- a/sc/source/ui/attrdlg/scuiexp.cxx
+++ b/sc/source/ui/attrdlg/scuiexp.cxx
@@ -55,11 +55,9 @@
namespace scui
{
- static ScAbstractDialogFactory_Impl* pFactory=nullptr;
static ScAbstractDialogFactory_Impl* GetFactory()
{
- if ( !pFactory )
- pFactory = new ScAbstractDialogFactory_Impl;
+ static ScAbstractDialogFactory_Impl* pFactory = new ScAbstractDialogFactory_Impl;
return pFactory;
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index a86fe777d6cd..e5a72112972d 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2334,29 +2334,28 @@ ScFormatFilterPlugin* ScFilterCreate();
typedef ScFormatFilterPlugin * (*FilterFn)();
ScFormatFilterPlugin &ScFormatFilter::Get()
{
- static ScFormatFilterPlugin *plugin;
-
- if (plugin != nullptr)
- return *plugin;
-
+ static ScFormatFilterPlugin *plugin = [&]()
+ {
#ifndef DISABLE_DYNLOADING
- OUString sFilterLib(SVLIBRARY("scfilt"));
- static ::osl::Module aModule;
- bool bLoaded = aModule.is();
- if (!bLoaded)
- bLoaded = aModule.loadRelative(&thisModule, sFilterLib);
- if (!bLoaded)
- bLoaded = aModule.load(sFilterLib);
- if (bLoaded)
- {
- oslGenericFunction fn = aModule.getFunctionSymbol( "ScFilterCreate" );
- if (fn != nullptr)
- plugin = reinterpret_cast<FilterFn>(fn)();
- }
- assert(plugin != nullptr);
+ OUString sFilterLib(SVLIBRARY("scfilt"));
+ static ::osl::Module aModule;
+ bool bLoaded = aModule.is();
+ if (!bLoaded)
+ bLoaded = aModule.loadRelative(&thisModule, sFilterLib);
+ if (!bLoaded)
+ bLoaded = aModule.load(sFilterLib);
+ if (bLoaded)
+ {
+ oslGenericFunction fn = aModule.getFunctionSymbol( "ScFilterCreate" );
+ if (fn != nullptr)
+ return reinterpret_cast<FilterFn>(fn)();
+ }
+ assert(false);
+ return static_cast<ScFormatFilterPlugin*>(nullptr);
#else
- plugin = ScFilterCreate();
+ return ScFilterCreate();
#endif
+ }();
return *plugin;
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 5d318c0d3696..d9537c86acf7 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1772,25 +1772,22 @@ void SAL_CALL ScCellRangesBase::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellRangesBase::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- aTypes.realloc(13);
- uno::Type* pPtr = aTypes.getArray();
- pPtr[0] = cppu::UnoType<beans::XPropertySet>::get();
- pPtr[1] = cppu::UnoType<beans::XMultiPropertySet>::get();
- pPtr[2] = cppu::UnoType<beans::XPropertyState>::get();
- pPtr[3] = cppu::UnoType<sheet::XSheetOperation>::get();
- pPtr[4] = cppu::UnoType<chart::XChartDataArray>::get();
- pPtr[5] = cppu::UnoType<util::XIndent>::get();
- pPtr[6] = cppu::UnoType<sheet::XCellRangesQuery>::get();
- pPtr[7] = cppu::UnoType<sheet::XFormulaQuery>::get();
- pPtr[8] = cppu::UnoType<util::XReplaceable>::get();
- pPtr[9] = cppu::UnoType<util::XModifyBroadcaster>::get();
- pPtr[10]= cppu::UnoType<lang::XServiceInfo>::get();
- pPtr[11]= cppu::UnoType<lang::XUnoTunnel>::get();
- pPtr[12]= cppu::UnoType<lang::XTypeProvider>::get();
- }
+ static uno::Sequence<uno::Type> const aTypes
+ {
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<beans::XMultiPropertySet>::get(),
+ cppu::UnoType<beans::XPropertyState>::get(),
+ cppu::UnoType<sheet::XSheetOperation>::get(),
+ cppu::UnoType<chart::XChartDataArray>::get(),
+ cppu::UnoType<util::XIndent>::get(),
+ cppu::UnoType<sheet::XCellRangesQuery>::get(),
+ cppu::UnoType<sheet::XFormulaQuery>::get(),
+ cppu::UnoType<util::XReplaceable>::get(),
+ cppu::UnoType<util::XModifyBroadcaster>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<lang::XUnoTunnel>::get(),
+ cppu::UnoType<lang::XTypeProvider>::get()
+ };
return aTypes;
}
@@ -4142,22 +4139,14 @@ void SAL_CALL ScCellRangesObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellRangesObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(ScCellRangesBase::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 3 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XSheetCellRangeContainer>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<container::XNameContainer>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<container::XEnumerationAccess>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangesBase::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XSheetCellRangeContainer>::get(),
+ cppu::UnoType<container::XNameContainer>::get(),
+ cppu::UnoType<container::XEnumerationAccess>::get()
+ } );
return aTypes;
}
@@ -4750,36 +4739,28 @@ void SAL_CALL ScCellRangeObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellRangeObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(ScCellRangesBase::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 17 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XCellRangeAddressable>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<sheet::XSheetCellRange>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<sheet::XArrayFormulaRange>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<sheet::XArrayFormulaTokens>::get();
- pPtr[nParentLen + 4] = cppu::UnoType<sheet::XCellRangeData>::get();
- pPtr[nParentLen + 5] = cppu::UnoType<sheet::XCellRangeFormula>::get();
- pPtr[nParentLen + 6] = cppu::UnoType<sheet::XMultipleOperation>::get();
- pPtr[nParentLen + 7] = cppu::UnoType<util::XMergeable>::get();
- pPtr[nParentLen + 8] = cppu::UnoType<sheet::XCellSeries>::get();
- pPtr[nParentLen + 9] = cppu::UnoType<table::XAutoFormattable>::get();
- pPtr[nParentLen +10] = cppu::UnoType<util::XSortable>::get();
- pPtr[nParentLen +11] = cppu::UnoType<sheet::XSheetFilterableEx>::get();
- pPtr[nParentLen +12] = cppu::UnoType<sheet::XSubTotalCalculatable>::get();
- pPtr[nParentLen +13] = cppu::UnoType<table::XColumnRowRange>::get();
- pPtr[nParentLen +14] = cppu::UnoType<util::XImportable>::get();
- pPtr[nParentLen +15] = cppu::UnoType<sheet::XCellFormatRangesSupplier>::get();
- pPtr[nParentLen +16] = cppu::UnoType<sheet::XUniqueCellFormatRangesSupplier>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangesBase::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XCellRangeAddressable>::get(),
+ cppu::UnoType<sheet::XSheetCellRange>::get(),
+ cppu::UnoType<sheet::XArrayFormulaRange>::get(),
+ cppu::UnoType<sheet::XArrayFormulaTokens>::get(),
+ cppu::UnoType<sheet::XCellRangeData>::get(),
+ cppu::UnoType<sheet::XCellRangeFormula>::get(),
+ cppu::UnoType<sheet::XMultipleOperation>::get(),
+ cppu::UnoType<util::XMergeable>::get(),
+ cppu::UnoType<sheet::XCellSeries>::get(),
+ cppu::UnoType<table::XAutoFormattable>::get(),
+ cppu::UnoType<util::XSortable>::get(),
+ cppu::UnoType<sheet::XSheetFilterableEx>::get(),
+ cppu::UnoType<sheet::XSubTotalCalculatable>::get(),
+ cppu::UnoType<table::XColumnRowRange>::get(),
+ cppu::UnoType<util::XImportable>::get(),
+ cppu::UnoType<sheet::XCellFormatRangesSupplier>::get(),
+ cppu::UnoType<sheet::XUniqueCellFormatRangesSupplier>::get()
+ } );
return aTypes;
}
@@ -5993,28 +5974,20 @@ void SAL_CALL ScCellObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(ScCellRangeObj::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 9 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<table::XCell>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<sheet::XCellAddressable>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<text::XText>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<container::XEnumerationAccess>::get();
- pPtr[nParentLen + 4] = cppu::UnoType<sheet::XSheetAnnotationAnchor>::get();
- pPtr[nParentLen + 5] = cppu::UnoType<text::XTextFieldsSupplier>::get();
- pPtr[nParentLen + 6] = cppu::UnoType<document::XActionLockable>::get();
- pPtr[nParentLen + 7] = cppu::UnoType<sheet::XFormulaTokens>::get();
- pPtr[nParentLen + 8] = cppu::UnoType<table::XCell2>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangeObj::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<table::XCell>::get(),
+ cppu::UnoType<sheet::XCellAddressable>::get(),
+ cppu::UnoType<text::XText>::get(),
+ cppu::UnoType<container::XEnumerationAccess>::get(),
+ cppu::UnoType<sheet::XSheetAnnotationAnchor>::get(),
+ cppu::UnoType<text::XTextFieldsSupplier>::get(),
+ cppu::UnoType<document::XActionLockable>::get(),
+ cppu::UnoType<sheet::XFormulaTokens>::get(),
+ cppu::UnoType<table::XCell2>::get()
+ } );
return aTypes;
}
@@ -6756,39 +6729,30 @@ void SAL_CALL ScTableSheetObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScTableSheetObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes = ScCellRangeObj::getTypes();
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc(nParentLen + 19);
-
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XSpreadsheet>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<container::XNamed>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<sheet::XSheetPageBreak>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<sheet::XCellRangeMovement>::get();
- pPtr[nParentLen + 4] = cppu::UnoType<table::XTableChartsSupplier>::get();
- pPtr[nParentLen + 5] = cppu::UnoType<sheet::XDataPilotTablesSupplier>::get();
- pPtr[nParentLen + 6] = cppu::UnoType<sheet::XScenariosSupplier>::get();
- pPtr[nParentLen + 7] = cppu::UnoType<sheet::XSheetAnnotationsSupplier>::get();
- pPtr[nParentLen + 8] = cppu::UnoType<drawing::XDrawPageSupplier>::get();
- pPtr[nParentLen + 9] = cppu::UnoType<sheet::XPrintAreas>::get();
- pPtr[nParentLen +10] = cppu::UnoType<sheet::XSheetAuditing>::get();
- pPtr[nParentLen +11] = cppu::UnoType<sheet::XSheetOutline>::get();
- pPtr[nParentLen +12] = cppu::UnoType<util::XProtectable>::get();
- pPtr[nParentLen +13] = cppu::UnoType<sheet::XScenario>::get();
- pPtr[nParentLen +14] = cppu::UnoType<sheet::XScenarioEnhanced>::get();
- pPtr[nParentLen +15] = cppu::UnoType<sheet::XSheetLinkable>::get();
- pPtr[nParentLen +16] = cppu::UnoType<sheet::XExternalSheetName>::get();
- pPtr[nParentLen +17] = cppu::UnoType<document::XEventsSupplier>::get();
- pPtr[nParentLen +18] = cppu::UnoType<table::XTablePivotChartsSupplier>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangeObj::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XSpreadsheet>::get(),
+ cppu::UnoType<container::XNamed>::get(),
+ cppu::UnoType<sheet::XSheetPageBreak>::get(),
+ cppu::UnoType<sheet::XCellRangeMovement>::get(),
+ cppu::UnoType<table::XTableChartsSupplier>::get(),
+ cppu::UnoType<sheet::XDataPilotTablesSupplier>::get(),
+ cppu::UnoType<sheet::XScenariosSupplier>::get(),
+ cppu::UnoType<sheet::XSheetAnnotationsSupplier>::get(),
+ cppu::UnoType<drawing::XDrawPageSupplier>::get(),
+ cppu::UnoType<sheet::XPrintAreas>::get(),
+ cppu::UnoType<sheet::XSheetAuditing>::get(),
+ cppu::UnoType<sheet::XSheetOutline>::get(),
+ cppu::UnoType<util::XProtectable>::get(),
+ cppu::UnoType<sheet::XScenario>::get(),
+ cppu::UnoType<sheet::XScenarioEnhanced>::get(),
+ cppu::UnoType<sheet::XSheetLinkable>::get(),
+ cppu::UnoType<sheet::XExternalSheetName>::get(),
+ cppu::UnoType<document::XEventsSupplier>::get(),
+ cppu::UnoType<table::XTablePivotChartsSupplier>::get()
+ } );
return aTypes;
}
@@ -8521,20 +8485,9 @@ void SAL_CALL ScTableColumnObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScTableColumnObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(ScCellRangeObj::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 1 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<container::XNamed>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangeObj::getTypes(),
+ uno::Sequence<uno::Type> { cppu::UnoType<container::XNamed>::get() } );
return aTypes;
}
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index c5505e6ebe1e..8886ee8b4f51 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -21,6 +21,7 @@
#include <svl/intitem.hxx>
#include <svl/zforlist.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cursuno.hxx>
@@ -66,22 +67,14 @@ void SAL_CALL ScCellCursorObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScCellCursorObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(ScCellRangeObj::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 3 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XSheetCellCursor>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<sheet::XUsedAreaCursor>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<table::XCellCursor>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScCellRangeObj::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XSheetCellCursor>::get(),
+ cppu::UnoType<sheet::XUsedAreaCursor>::get(),
+ cppu::UnoType<table::XCellCursor>::get()
+ } );
return aTypes;
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 3a56fb138e25..56a409e5f0a0 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -623,18 +623,15 @@ void SAL_CALL ScDataPilotDescriptorBase::release() throw()
Sequence< uno::Type > SAL_CALL ScDataPilotDescriptorBase::getTypes()
{
- static Sequence< uno::Type > aTypes;
- if ( aTypes.getLength() == 0 )
- {
- aTypes.realloc( 6 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[ 0 ] = cppu::UnoType<XDataPilotDescriptor>::get();
- pPtr[ 1 ] = cppu::UnoType<XPropertySet>::get();
- pPtr[ 2 ] = cppu::UnoType<XDataPilotDataLayoutFieldSupplier>::get();
- pPtr[ 3 ] = cppu::UnoType<lang::XUnoTunnel>::get();
- pPtr[ 4 ] = cppu::UnoType<lang::XTypeProvider>::get();
- pPtr[ 5 ] = cppu::UnoType<lang::XServiceInfo>::get();
- }
+ static Sequence< uno::Type > const aTypes
+ {
+ cppu::UnoType<XDataPilotDescriptor>::get(),
+ cppu::UnoType<XPropertySet>::get(),
+ cppu::UnoType<XDataPilotDataLayoutFieldSupplier>::get(),
+ cppu::UnoType<lang::XUnoTunnel>::get(),
+ cppu::UnoType<lang::XTypeProvider>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ };
return aTypes;
}
@@ -1094,21 +1091,13 @@ void SAL_CALL ScDataPilotTableObj::release() throw()
Sequence< uno::Type > SAL_CALL ScDataPilotTableObj::getTypes()
{
- static Sequence< uno::Type > aTypes;
- if ( aTypes.getLength() == 0 )
- {
- Sequence< uno::Type > aParentTypes = ScDataPilotDescriptorBase::getTypes();
- sal_Int32 nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 2 );
- uno::Type* pPtr = aTypes.getArray();
- for (sal_Int32 i = 0; i < nParentLen; ++i)
- pPtr[ i ] = pParentPtr[ i ]; // parent types first
-
- pPtr[ nParentLen ] = cppu::UnoType<XDataPilotTable2>::get();
- pPtr[ nParentLen+1 ] = cppu::UnoType<XModifyBroadcaster>::get();
- }
+ static const Sequence< uno::Type > aTypes = comphelper::concatSequences(
+ ScDataPilotDescriptorBase::getTypes(),
+ Sequence< uno::Type >
+ {
+ cppu::UnoType<XDataPilotTable2>::get(),
+ cppu::UnoType<XModifyBroadcaster>::get()
+ } );
return aTypes;
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3c6baec93899..734cf6b89088 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1265,13 +1265,8 @@ void SAL_CALL ScModelObj::release() throw()
uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
+ static const uno::Sequence<uno::Type> aTypes = [&]()
{
- uno::Sequence<uno::Type> aParentTypes(SfxBaseModel::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
uno::Sequence<uno::Type> aAggTypes;
if ( GetFormatter().is() )
{
@@ -1283,36 +1278,29 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes()
aAggTypes = (*xNumProv)->getTypes();
}
}
- long nAggLen = aAggTypes.getLength();
- const uno::Type* pAggPtr = aAggTypes.getConstArray();
-
- const long nThisLen = 16;
- aTypes.realloc( nParentLen + nAggLen + nThisLen );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XSpreadsheetDocument>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<document::XActionLockable>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<sheet::XCalculatable>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<util::XProtectable>::get();
- pPtr[nParentLen + 4] = cppu::UnoType<drawing::XDrawPagesSupplier>::get();
- pPtr[nParentLen + 5] = cppu::UnoType<sheet::XGoalSeek>::get();
- pPtr[nParentLen + 6] = cppu::UnoType<sheet::XConsolidatable>::get();
- pPtr[nParentLen + 7] = cppu::UnoType<sheet::XDocumentAuditing>::get();
- pPtr[nParentLen + 8] = cppu::UnoType<style::XStyleFamiliesSupplier>::get();
- pPtr[nParentLen + 9] = cppu::UnoType<view::XRenderable>::get();
- pPtr[nParentLen +10] = cppu::UnoType<document::XLinkTargetSupplier>::get();
- pPtr[nParentLen +11] = cppu::UnoType<beans::XPropertySet>::get();
- pPtr[nParentLen +12] = cppu::UnoType<lang::XMultiServiceFactory>::get();
- pPtr[nParentLen +13] = cppu::UnoType<lang::XServiceInfo>::get();
- pPtr[nParentLen +14] = cppu::UnoType<util::XChangesNotifier>::get();
- pPtr[nParentLen +15] = cppu::UnoType<sheet::opencl::XOpenCLSelection>::get();
-
- long i;
- for (i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
-
- for (i=0; i<nAggLen; i++)
- pPtr[nParentLen+nThisLen+i] = pAggPtr[i]; // aggregated types last
- }
+ return comphelper::concatSequences(
+ SfxBaseModel::getTypes(),
+ aAggTypes,
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XSpreadsheetDocument>::get(),
+ cppu::UnoType<document::XActionLockable>::get(),
+ cppu::UnoType<sheet::XCalculatable>::get(),
+ cppu::UnoType<util::XProtectable>::get(),
+ cppu::UnoType<drawing::XDrawPagesSupplier>::get(),
+ cppu::UnoType<sheet::XGoalSeek>::get(),
+ cppu::UnoType<sheet::XConsolidatable>::get(),
+ cppu::UnoType<sheet::XDocumentAuditing>::get(),
+ cppu::UnoType<style::XStyleFamiliesSupplier>::get(),
+ cppu::UnoType<view::XRenderable>::get(),
+ cppu::UnoType<document::XLinkTargetSupplier>::get(),
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<lang::XMultiServiceFactory>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<util::XChangesNotifier>::get(),
+ cppu::UnoType<sheet::opencl::XOpenCLSelection>::get(),
+ } );
+ }();
return aTypes;
}
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 7c53309b1082..c2c297a822a9 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -37,6 +37,7 @@
#include <editeng/editeng.hxx>
#include <editeng/editobj.hxx>
#include <editeng/flditem.hxx>
+#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -1334,23 +1335,15 @@ uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames()
uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aParentTypes(OComponentHelper::getTypes());
- long nParentLen = aParentTypes.getLength();
- const uno::Type* pParentPtr = aParentTypes.getConstArray();
-
- aTypes.realloc( nParentLen + 4 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<text::XTextField>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<beans::XPropertySet>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<lang::XUnoTunnel>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<lang::XServiceInfo>::get();
-
- for (long i=0; i<nParentLen; i++)
- pPtr[i] = pParentPtr[i]; // parent types first
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ OComponentHelper::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<text::XTextField>::get(),
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<lang::XUnoTunnel>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get()
+ } );
return aTypes;
}
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 6c9321b8756b..dea3ad87b8e9 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -156,17 +156,14 @@ uno::Any SAL_CALL ScViewPaneBase::queryInterface( const uno::Type& rType )
uno::Sequence<uno::Type> SAL_CALL ScViewPaneBase::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
+ static uno::Sequence<uno::Type> aTypes
{
- aTypes.realloc(5);
- uno::Type* pPtr = aTypes.getArray();
- pPtr[0] = cppu::UnoType<sheet::XViewPane>::get();
- pPtr[1] = cppu::UnoType<sheet::XCellRangeReferrer>::get();
- pPtr[2] = cppu::UnoType<view::XFormLayerAccess>::get();
- pPtr[3] = cppu::UnoType<lang::XServiceInfo>::get();
- pPtr[4] = cppu::UnoType<lang::XTypeProvider>::get();
- }
+ cppu::UnoType<sheet::XViewPane>::get(),
+ cppu::UnoType<sheet::XCellRangeReferrer>::get(),
+ cppu::UnoType<view::XFormLayerAccess>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<lang::XTypeProvider>::get(),
+ };
return aTypes;
}
@@ -578,40 +575,24 @@ void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
uno::Sequence<uno::Type> SAL_CALL ScTabViewObj::getTypes()
{
- static uno::Sequence<uno::Type> aTypes;
- if ( aTypes.getLength() == 0 )
- {
- uno::Sequence<uno::Type> aViewPaneTypes(ScViewPaneBase::getTypes());
- long nViewPaneLen = aViewPaneTypes.getLength();
- const uno::Type* pViewPanePtr = aViewPaneTypes.getConstArray();
-
- uno::Sequence<uno::Type> aControllerTypes(SfxBaseController::getTypes());
- long nControllerLen = aControllerTypes.getLength();
- const uno::Type* pControllerPtr = aControllerTypes.getConstArray();
-
- long nParentLen = nViewPaneLen + nControllerLen;
-
- aTypes.realloc( nParentLen + 12 );
- uno::Type* pPtr = aTypes.getArray();
- pPtr[nParentLen + 0] = cppu::UnoType<sheet::XSpreadsheetView>::get();
- pPtr[nParentLen + 1] = cppu::UnoType<container::XEnumerationAccess>::get();
- pPtr[nParentLen + 2] = cppu::UnoType<container::XIndexAccess>::get();
- pPtr[nParentLen + 3] = cppu::UnoType<view::XSelectionSupplier>::get();
- pPtr[nParentLen + 4] = cppu::UnoType<beans::XPropertySet>::get();
- pPtr[nParentLen + 5] = cppu::UnoType<sheet::XViewSplitable>::get();
- pPtr[nParentLen + 6] = cppu::UnoType<sheet::XViewFreezable>::get();
- pPtr[nParentLen + 7] = cppu::UnoType<sheet::XRangeSelection>::get();
- pPtr[nParentLen + 8] = cppu::UnoType<lang::XUnoTunnel>::get();
- pPtr[nParentLen + 9] = cppu::UnoType<sheet::XEnhancedMouseClickBroadcaster>::get();
- pPtr[nParentLen + 10] = cppu::UnoType<sheet::XActivationBroadcaster>::get();
- pPtr[nParentLen + 11] = cppu::UnoType<datatransfer::XTransferableSupplier>::get();
-
- long i;
- for (i=0; i<nViewPaneLen; i++)
- pPtr[i] = pViewPanePtr[i]; // parent types first
- for (i=0; i<nControllerLen; i++)
- pPtr[nViewPaneLen+i] = pControllerPtr[i];
- }
+ static const uno::Sequence<uno::Type> aTypes = comphelper::concatSequences(
+ ScViewPaneBase::getTypes(),
+ SfxBaseController::getTypes(),
+ uno::Sequence<uno::Type>
+ {
+ cppu::UnoType<sheet::XSpreadsheetView>::get(),
+ cppu::UnoType<container::XEnumerationAccess>::get(),
+ cppu::UnoType<container::XIndexAccess>::get(),
+ cppu::UnoType<view::XSelectionSupplier>::get(),
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<sheet::XViewSplitable>::get(),
+ cppu::UnoType<sheet::XViewFreezable>::get(),
+ cppu::UnoType<sheet::XRangeSelection>::get(),
+ cppu::UnoType<lang::XUnoTunnel>::get(),
+ cppu::UnoType<sheet::XEnhancedMouseClickBroadcaster>::get(),
+ cppu::UnoType<sheet::XActivationBroadcaster>::get(),
+ cppu::UnoType<datatransfer::XTransferableSupplier>::get()
+ } );
return aTypes;
}
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 9102d50afef7..0375aed29e28 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -916,11 +916,7 @@ ScVbaApplication::Calculate()
/// @throws uno::RuntimeException
static uno::Reference< util::XPathSettings > const & lcl_getPathSettingsService( const uno::Reference< uno::XComponentContext >& xContext )
{
- static uno::Reference< util::XPathSettings > xPathSettings;
- if ( !xPathSettings.is() )
- {
- xPathSettings.set( util::PathSettings::create( xContext ) );
- }
+ static uno::Reference< util::XPathSettings > xPathSettings( util::PathSettings::create( xContext ) );
return xPathSettings;
}
@@ -1476,12 +1472,10 @@ ScVbaApplication::getServiceImplName()
uno::Sequence< OUString >
ScVbaApplication::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Application";
- }
+ "ooo.vba.excel.Application"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaassistant.cxx b/sc/source/ui/vba/vbaassistant.cxx
index 583d32ce9502..bfdc8c9b7e4d 100644
--- a/sc/source/ui/vba/vbaassistant.cxx
+++ b/sc/source/ui/vba/vbaassistant.cxx
@@ -108,12 +108,10 @@ ScVbaAssistant::getServiceImplName()
uno::Sequence< OUString >
ScVbaAssistant::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.Assistant";
- }
+ "ooo.vba.Assistant"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index 09c8195d0bd3..7a1a7ad643fe 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -201,12 +201,10 @@ ScVbaAxes::getServiceImplName()
uno::Sequence< OUString >
ScVbaAxes::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Axes";
- }
+ "ooo.vba.excel.Axes"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx
index 9d21e52baed0..9a8eb9598478 100644
--- a/sc/source/ui/vba/vbaaxis.cxx
+++ b/sc/source/ui/vba/vbaaxis.cxx
@@ -646,12 +646,10 @@ ScVbaAxis::getServiceImplName()
uno::Sequence< OUString >
ScVbaAxis::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Axis";
- }
+ "ooo.vba.excel.Axis"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx
index 42813da67025..9029c2dbac50 100644
--- a/sc/source/ui/vba/vbaaxistitle.cxx
+++ b/sc/source/ui/vba/vbaaxistitle.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "vbaaxistitle.hxx"
+#include <comphelper/sequence.hxx>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -34,15 +35,9 @@ ScVbaAxisTitle::getServiceImplName()
uno::Sequence< OUString >
ScVbaAxisTitle::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
- {
- uno::Sequence< OUString > BaseServiceNames = AxisTitleBase::getServiceNames();
- aServiceNames.realloc( BaseServiceNames.getLength() + 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.AxisTitle";
- for ( sal_Int32 index = 1; index < (BaseServiceNames.getLength() + 1); ++index )
- aServiceNames[ index ] = BaseServiceNames[ index ];
- }
+ static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences(
+ AxisTitleBase::getServiceNames(),
+ uno::Sequence<OUString> { "ooo.vba.excel.AxisTitle" } );
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 5bf4bdf9b2d9..73d0d8016409 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -148,12 +148,10 @@ protected:
}
virtual css::uno::Sequence<OUString> getServiceNames() override
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Border";
- }
+ "ooo.vba.excel.Border"
+ };
return aServiceNames;
}
public:
@@ -574,12 +572,10 @@ ScVbaBorders::getServiceImplName()
uno::Sequence< OUString >
ScVbaBorders::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Borders";
- }
+ "ooo.vba.excel.Borders"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx
index 137c32cda823..61284330f96f 100644
--- a/sc/source/ui/vba/vbacharacters.cxx
+++ b/sc/source/ui/vba/vbacharacters.cxx
@@ -123,12 +123,10 @@ ScVbaCharacters::getServiceImplName()
uno::Sequence< OUString >
ScVbaCharacters::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Characters";
- }
+ "ooo.vba.excel.Characters"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index a49255b1d564..fa769944e1be 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -1051,12 +1051,10 @@ ScVbaChart::getServiceImplName()
uno::Sequence< OUString >
ScVbaChart::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Chart";
- }
+ "ooo.vba.excel.Chart"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx
index 8337d037e8ec..c6311ebe51d6 100644
--- a/sc/source/ui/vba/vbachartobject.cxx
+++ b/sc/source/ui/vba/vbachartobject.cxx
@@ -136,12 +136,10 @@ ScVbaChartObject::getServiceImplName()
uno::Sequence< OUString >
ScVbaChartObject::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.ChartObject";
- }
+ "ooo.vba.excel.ChartObject"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index beb97e5b0ea6..8eed4924c3d5 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -195,12 +195,10 @@ ScVbaChartObjects::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaChartObjects::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.ChartObjects";
- }
+ "ooo.vba.excel.ChartObjects"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx
index 7b4f64fc49ef..cf49708a9ce8 100644
--- a/sc/source/ui/vba/vbacharttitle.cxx
+++ b/sc/source/ui/vba/vbacharttitle.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "vbacharttitle.hxx"
+#include <comphelper/sequence.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -34,15 +35,9 @@ ScVbaChartTitle::getServiceImplName()
uno::Sequence< OUString >
ScVbaChartTitle::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
- {
- uno::Sequence< OUString > BaseServiceNames = ChartTitleBase::getServiceNames();
- aServiceNames.realloc( BaseServiceNames.getLength() + 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Chart";
- for ( sal_Int32 index = 1; index < (BaseServiceNames.getLength() + 1); ++index )
- aServiceNames[ index ] = BaseServiceNames[ index ];
- }
+ static uno::Sequence< OUString > const aServiceNames = comphelper::concatSequences(
+ ChartTitleBase::getServiceNames(),
+ uno::Sequence< OUString > { "ooo.vba.excel.Chart" } );
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx
index 0d1e2fb73d11..dac9a040f1a9 100644
--- a/sc/source/ui/vba/vbacomment.cxx
+++ b/sc/source/ui/vba/vbacomment.cxx
@@ -223,12 +223,10 @@ ScVbaComment::getServiceImplName()
uno::Sequence< OUString >
ScVbaComment::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.ScVbaComment";
- }
+ "ooo.vba.excel.ScVbaComment"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx
index 537f80290087..5841df0f84b1 100644
--- a/sc/source/ui/vba/vbacomments.cxx
+++ b/sc/source/ui/vba/vbacomments.cxx
@@ -98,12 +98,10 @@ ScVbaComments::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaComments::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.Comments";
- }
+ "ooo.vba.excel.Comments"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx
index e7f2b316adae..316f714ed494 100644
--- a/sc/source/ui/vba/vbadialog.cxx
+++ b/sc/source/ui/vba/vbadialog.cxx
@@ -71,12 +71,10 @@ ScVbaDialog::getServiceImplName()
uno::Sequence< OUString >
ScVbaDialog::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Dialog";
- }
+ "ooo.vba.excel.Dialog"
+ };
return aServiceNames;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx
index 8ab7cafb0415..5d2a388338c1 100644
--- a/sc/source/ui/vba/vbadialogs.cxx
+++ b/sc/source/ui/vba/vbadialogs.cxx
@@ -41,12 +41,10 @@ ScVbaDialogs::getServiceImplName()
uno::Sequence< OUString >
ScVbaDialogs::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Dialogs";
- }
+ "ooo.vba.excel.Dialogs"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbafiledialog.cxx b/sc/source/ui/vba/vbafiledialog.cxx
index 0a3a7d33cfa9..00b3f2b8bfe8 100644
--- a/sc/source/ui/vba/vbafiledialog.cxx
+++ b/sc/source/ui/vba/vbafiledialog.cxx
@@ -152,12 +152,10 @@ ScVbaFileDialog::getServiceImplName()
uno::Sequence<OUString>
ScVbaFileDialog::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.FileDialog";
- }
+ "ooo.vba.FileDialog"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbafiledialogitems.cxx b/sc/source/ui/vba/vbafiledialogitems.cxx
index bd78a4d77b66..8c0210c70fdc 100644
--- a/sc/source/ui/vba/vbafiledialogitems.cxx
+++ b/sc/source/ui/vba/vbafiledialogitems.cxx
@@ -105,12 +105,10 @@ ScVbaFileDialogSelectedItems::getServiceImplName()
uno::Sequence<OUString>
ScVbaFileDialogSelectedItems::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.FileDialogSelectedItems";
- }
+ "ooo.vba.FileDialogSelectedItems"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index bd0f410de6fe..c22bfb4c828f 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -327,12 +327,10 @@ ScVbaFont::getServiceImplName()
uno::Sequence< OUString >
ScVbaFont::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Font";
- }
+ "ooo.vba.excel.Font"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx
index b32a922a5402..dcedad96775b 100644
--- a/sc/source/ui/vba/vbaformatcondition.cxx
+++ b/sc/source/ui/vba/vbaformatcondition.cxx
@@ -148,12 +148,10 @@ ScVbaFormatCondition::getServiceImplName()
uno::Sequence< OUString >
ScVbaFormatCondition::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.FormatCondition";
- }
+ "ooo.vba.excel.FormatCondition"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index fe80278ca7ea..94c34908fdf0 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -282,12 +282,10 @@ ScVbaFormatConditions::getServiceImplName()
uno::Sequence< OUString >
ScVbaFormatConditions::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.FormatConditions";
- }
+ "ooo.vba.excel.FormatConditions"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index fba08ce1711f..250173052f6a 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <comphelper/sequence.hxx>
#include <cppuhelper/component_context.hxx>
#include "vbaapplication.hxx"
@@ -225,26 +226,18 @@ ScVbaGlobals::MenuBars( const uno::Any& aIndex )
uno::Sequence< OUString > SAL_CALL
ScVbaGlobals::getAvailableServiceNames( )
{
- static bool bInit = false;
- static uno::Sequence< OUString > serviceNames( ScVbaGlobals_BASE::getAvailableServiceNames() );
- if ( !bInit )
- {
- const OUString names[] = {
- OUString( "ooo.vba.excel.Range" ),
- OUString( "ooo.vba.excel.Workbook" ),
- OUString( "ooo.vba.excel.Window" ),
- OUString( "ooo.vba.excel.Worksheet" ),
- OUString( "ooo.vba.excel.Application" ),
- OUString( "ooo.vba.excel.Hyperlink" ),
- OUString( "com.sun.star.script.vba.VBASpreadsheetEventProcessor" )
- };
- sal_Int32 nExcelServices = SAL_N_ELEMENTS( names );
- sal_Int32 startIndex = serviceNames.getLength();
- serviceNames.realloc( serviceNames.getLength() + nExcelServices );
- for ( sal_Int32 index = 0; index < nExcelServices; ++index )
- serviceNames[ startIndex + index ] = names[ index ];
- bInit = true;
- }
+ static const uno::Sequence< OUString > serviceNames = comphelper::concatSequences(
+ ScVbaGlobals_BASE::getAvailableServiceNames(),
+ uno::Sequence< OUString >
+ {
+ "ooo.vba.excel.Range",
+ "ooo.vba.excel.Workbook",
+ "ooo.vba.excel.Window",
+ "ooo.vba.excel.Worksheet",
+ "ooo.vba.excel.Application",
+ "ooo.vba.excel.Hyperlink",
+ "com.sun.star.script.vba.VBASpreadsheetEventProcessor"
+ } );
return serviceNames;
}
@@ -257,12 +250,10 @@ ScVbaGlobals::getServiceImplName()
uno::Sequence< OUString >
ScVbaGlobals::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Globals" ;
- }
+ "ooo.vba.excel.Globals"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index 7b57de6ac3ac..573deeeffeb3 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -420,12 +420,10 @@ ScVbaInterior::getServiceImplName()
uno::Sequence< OUString >
ScVbaInterior::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Interior";
- }
+ "ooo.vba.excel.Interior"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx
index 0e023ac17e0a..d45c35e74c32 100644
--- a/sc/source/ui/vba/vbamenu.cxx
+++ b/sc/source/ui/vba/vbamenu.cxx
@@ -56,12 +56,10 @@ ScVbaMenu::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenu::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Menu";
- }
+ "ooo.vba.excel.Menu"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenubar.cxx b/sc/source/ui/vba/vbamenubar.cxx
index 2c7c04b1597a..2812ec753c5a 100644
--- a/sc/source/ui/vba/vbamenubar.cxx
+++ b/sc/source/ui/vba/vbamenubar.cxx
@@ -38,12 +38,10 @@ ScVbaMenuBar::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenuBar::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.MenuBar";
- }
+ "ooo.vba.excel.MenuBar"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx
index fb5eb65ea7a5..3e845fb33455 100644
--- a/sc/source/ui/vba/vbamenubars.cxx
+++ b/sc/source/ui/vba/vbamenubars.cxx
@@ -103,12 +103,10 @@ ScVbaMenuBars::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenuBars::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.MenuBars";
- }
+ "ooo.vba.excel.MenuBars"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenuitem.cxx b/sc/source/ui/vba/vbamenuitem.cxx
index 1ef5836cfe91..d38d9311946a 100644
--- a/sc/source/ui/vba/vbamenuitem.cxx
+++ b/sc/source/ui/vba/vbamenuitem.cxx
@@ -54,12 +54,10 @@ ScVbaMenuItem::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenuItem::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.MenuItem";
- }
+ "ooo.vba.excel.MenuItem"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx
index fc89a1e3415b..7edb660b4dd8 100644
--- a/sc/source/ui/vba/vbamenuitems.cxx
+++ b/sc/source/ui/vba/vbamenuitems.cxx
@@ -123,12 +123,10 @@ ScVbaMenuItems::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenuItems::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.MenuItems";
- }
+ "ooo.vba.excel.MenuItems"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx
index d2a73bf10bde..6fb57e1cd400 100644
--- a/sc/source/ui/vba/vbamenus.cxx
+++ b/sc/source/ui/vba/vbamenus.cxx
@@ -109,12 +109,10 @@ ScVbaMenus::getServiceImplName()
uno::Sequence<OUString>
ScVbaMenus::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Menus";
- }
+ "ooo.vba.excel.Menus"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index e89ba81d48b5..874f290e51be 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -214,12 +214,10 @@ ScVbaName::getServiceImplName()
uno::Sequence< OUString >
ScVbaName::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Name";
- }
+ "ooo.vba.excel.Name"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index cd986a8e2a2a..16a56fd943be 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -248,12 +248,10 @@ ScVbaNames::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaNames::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.NamedRanges";
- }
+ "ooo.vba.excel.NamedRanges"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx
index e241fbb6ea88..87f78dd33503 100644
--- a/sc/source/ui/vba/vbaoleobject.cxx
+++ b/sc/source/ui/vba/vbaoleobject.cxx
@@ -145,12 +145,10 @@ ScVbaOLEObject::getServiceImplName()
uno::Sequence< OUString >
ScVbaOLEObject::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.OLEObject";
- }
+ "ooo.vba.excel.OLEObject"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx
index 5d285984fb77..299f2f7e89ba 100644
--- a/sc/source/ui/vba/vbaoleobjects.cxx
+++ b/sc/source/ui/vba/vbaoleobjects.cxx
@@ -175,12 +175,10 @@ ScVbaOLEObjects::getServiceImplName()
uno::Sequence< OUString >
ScVbaOLEObjects::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.OLEObjects";
- }
+ "ooo.vba.excel.OLEObjects"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx
index 67c521e9be73..1710db41904b 100644
--- a/sc/source/ui/vba/vbaoutline.cxx
+++ b/sc/source/ui/vba/vbaoutline.cxx
@@ -46,12 +46,10 @@ ScVbaOutline::getServiceImplName()
uno::Sequence< OUString >
ScVbaOutline::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Outline";
- }
+ "ooo.vba.excel.Outline"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx
index f95bdfac7bd8..0ad41e1a2caa 100644
--- a/sc/source/ui/vba/vbapagebreak.cxx
+++ b/sc/source/ui/vba/vbapagebreak.cxx
@@ -98,12 +98,10 @@ ScVbaHPageBreak::getServiceImplName()
uno::Sequence< OUString >
ScVbaHPageBreak::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.HPageBreak";
- }
+ "ooo.vba.excel.HPageBreak"
+ };
return aServiceNames;
}
@@ -131,12 +129,10 @@ ScVbaVPageBreak::getServiceImplName()
uno::Sequence< OUString >
ScVbaVPageBreak::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.VPageBreak";
- }
+ "ooo.vba.excel.VPageBreak"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx
index 268a4f77a669..027b40fa2731 100644
--- a/sc/source/ui/vba/vbapagebreaks.cxx
+++ b/sc/source/ui/vba/vbapagebreaks.cxx
@@ -250,12 +250,10 @@ ScVbaHPageBreaks::getServiceImplName()
uno::Sequence< OUString >
ScVbaHPageBreaks::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.HPageBreaks";
- }
+ "ooo.vba.excel.HPageBreaks"
+ };
return aServiceNames;
}
@@ -309,12 +307,10 @@ ScVbaVPageBreaks::getServiceImplName()
uno::Sequence< OUString >
ScVbaVPageBreaks::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.VPageBreaks";
- }
+ "ooo.vba.excel.VPageBreaks"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index b82cc3cf8b01..bec8c378b264 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -624,12 +624,10 @@ ScVbaPageSetup::getServiceImplName()
uno::Sequence< OUString >
ScVbaPageSetup::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.PageSetup";
- }
+ "ooo.vba.excel.PageSetup"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapivotcache.cxx b/sc/source/ui/vba/vbapivotcache.cxx
index db42296a52c4..4ff4e36b60d6 100644
--- a/sc/source/ui/vba/vbapivotcache.cxx
+++ b/sc/source/ui/vba/vbapivotcache.cxx
@@ -40,12 +40,10 @@ ScVbaPivotCache::getServiceImplName()
uno::Sequence< OUString >
ScVbaPivotCache::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.PivotCache";
- }
+ "ooo.vba.excel.PivotCache"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapivottable.cxx b/sc/source/ui/vba/vbapivottable.cxx
index a8af3db58e2a..90c6c7a8f4a2 100644
--- a/sc/source/ui/vba/vbapivottable.cxx
+++ b/sc/source/ui/vba/vbapivottable.cxx
@@ -43,12 +43,10 @@ ScVbaPivotTable::getServiceImplName()
uno::Sequence< OUString >
ScVbaPivotTable::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.PivotTable";
- }
+ "ooo.vba.excel.PivotTable"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx
index 4c22a93d808f..b87257203f59 100644
--- a/sc/source/ui/vba/vbapivottables.cxx
+++ b/sc/source/ui/vba/vbapivottables.cxx
@@ -75,12 +75,10 @@ ScVbaPivotTables::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaPivotTables::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.PivotTables";
- }
+ "ooo.vba.excel.PivotTables"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index d3bdf3a59796..84d5dba6f258 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -5607,12 +5607,10 @@ ScVbaRange::getServiceImplName()
uno::Sequence< OUString >
ScVbaRange::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Range";
- }
+ "ooo.vba.excel.Range"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx
index 4c82b44629c7..0493dc976915 100644
--- a/sc/source/ui/vba/vbastyle.cxx
+++ b/sc/source/ui/vba/vbastyle.cxx
@@ -172,12 +172,10 @@ ScVbaStyle::getServiceImplName()
uno::Sequence< OUString >
ScVbaStyle::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.XStyle";
- }
+ "ooo.vba.excel.XStyle"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx
index 77ce226cf089..8668119b6fa8 100644
--- a/sc/source/ui/vba/vbastyles.cxx
+++ b/sc/source/ui/vba/vbastyles.cxx
@@ -187,12 +187,10 @@ ScVbaStyles::getServiceImplName()
uno::Sequence< OUString >
ScVbaStyles::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.XStyles";
- }
+ "ooo.vba.excel.XStyles"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx
index 6c420fa9bc41..1d010b1f09b5 100644
--- a/sc/source/ui/vba/vbatextframe.cxx
+++ b/sc/source/ui/vba/vbatextframe.cxx
@@ -51,12 +51,10 @@ ScVbaTextFrame::getServiceImplName()
uno::Sequence< OUString >
ScVbaTextFrame::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.TextFrame";
- }
+ "ooo.vba.excel.TextFrame"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index a7abaa6921eb..15b36154d1f4 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -372,12 +372,10 @@ ScVbaValidation::getServiceImplName()
uno::Sequence< OUString >
ScVbaValidation::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Validation";
- }
+ "ooo.vba.excel.Validation"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 4fe117f8ac66..e0498cb7a73a 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -877,12 +877,10 @@ ScVbaWindow::getServiceImplName()
uno::Sequence< OUString >
ScVbaWindow::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Window";
- }
+ "ooo.vba.excel.Window"
+ };
return aServiceNames;
}
namespace window
diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx
index 2edd688eea8e..ccd48331becd 100644
--- a/sc/source/ui/vba/vbawindows.cxx
+++ b/sc/source/ui/vba/vbawindows.cxx
@@ -227,12 +227,10 @@ ScVbaWindows::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaWindows::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.Windows";
- }
+ "ooo.vba.excel.Windows"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index d27fc5567eda..d2d500f56c77 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -405,12 +405,10 @@ ScVbaWorkbook::getServiceImplName()
uno::Sequence< OUString >
ScVbaWorkbook::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Workbook";
- }
+ "ooo.vba.excel.Workbook"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 9ca8f9610eea..2fe1cebccf43 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -280,12 +280,10 @@ ScVbaWorkbooks::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaWorkbooks::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.Workbooks";
- }
+ "ooo.vba.excel.Workbooks"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 6a902d7efa83..d1ac2dcbdd5b 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -1022,12 +1022,10 @@ ScVbaWorksheet::getEnableCalculation( )
uno::Sequence< OUString >
ScVbaWorksheet::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.Worksheet";
- }
+ "ooo.vba.excel.Worksheet"
+ };
return aServiceNames;
}
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 681989b05309..ee287c4ba892 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -463,12 +463,10 @@ ScVbaWorksheets::getServiceImplName()
css::uno::Sequence<OUString>
ScVbaWorksheets::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.excel.Worksheets";
- }
+ "ooo.vba.excel.Worksheets"
+ };
return sNames;
}
diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx
index ebcd120b6f87..6ed142c0fde8 100644
--- a/sc/source/ui/vba/vbawsfunction.cxx
+++ b/sc/source/ui/vba/vbawsfunction.cxx
@@ -295,12 +295,10 @@ ScVbaWSFunction::getServiceImplName()
uno::Sequence< OUString >
ScVbaWSFunction::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.excel.WorksheetFunction";
- }
+ "ooo.vba.excel.WorksheetFunction"
+ };
return aServiceNames;
}