summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 13:11:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 13:34:17 +0100
commit0d653000a6c07327d6db1f95be3d21d50d505423 (patch)
tree31c38f67117af9f72664dbba170eb822fc4e1193 /sw/source/ui
parent7f91d6cceeeafb588f545be4c383e312d9e42bf7 (diff)
improve function-local statics in sw
Change-Id: I36b0e9b2819a442f01182f551dbc2bf7d5c878f4 Reviewed-on: https://gerrit.libreoffice.org/63788 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx10
-rw-r--r--sw/source/ui/dialog/swuiexp.cxx10
-rw-r--r--sw/source/ui/envelp/envfmt.cxx5
-rw-r--r--sw/source/ui/fldui/fldedt.cxx5
-rw-r--r--sw/source/ui/inc/swuiexp.hxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx5
-rw-r--r--sw/source/ui/table/convert.cxx5
-rw-r--r--sw/source/ui/vba/vbaaddin.cxx8
-rw-r--r--sw/source/ui/vba/vbaaddins.cxx8
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx8
-rw-r--r--sw/source/ui/vba/vbaautotextentry.cxx16
-rw-r--r--sw/source/ui/vba/vbabookmark.cxx8
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx8
-rw-r--r--sw/source/ui/vba/vbaborders.cxx16
-rw-r--r--sw/source/ui/vba/vbacell.cxx8
-rw-r--r--sw/source/ui/vba/vbacells.cxx8
-rw-r--r--sw/source/ui/vba/vbacolumn.cxx8
-rw-r--r--sw/source/ui/vba/vbacolumns.cxx8
-rw-r--r--sw/source/ui/vba/vbadialog.cxx8
-rw-r--r--sw/source/ui/vba/vbadialogs.cxx8
-rw-r--r--sw/source/ui/vba/vbadocument.cxx8
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.cxx16
-rw-r--r--sw/source/ui/vba/vbadocuments.cxx8
-rw-r--r--sw/source/ui/vba/vbafield.cxx16
-rw-r--r--sw/source/ui/vba/vbafind.cxx8
-rw-r--r--sw/source/ui/vba/vbafont.cxx8
-rw-r--r--sw/source/ui/vba/vbaframe.cxx8
-rw-r--r--sw/source/ui/vba/vbaframes.cxx8
-rw-r--r--sw/source/ui/vba/vbaglobals.cxx27
-rw-r--r--sw/source/ui/vba/vbaheaderfooter.cxx8
-rw-r--r--sw/source/ui/vba/vbaheadersfooters.cxx8
-rw-r--r--sw/source/ui/vba/vbalistformat.cxx8
-rw-r--r--sw/source/ui/vba/vbalistgalleries.cxx8
-rw-r--r--sw/source/ui/vba/vbalistgallery.cxx8
-rw-r--r--sw/source/ui/vba/vbalistlevel.cxx8
-rw-r--r--sw/source/ui/vba/vbalistlevels.cxx8
-rw-r--r--sw/source/ui/vba/vbalisttemplate.cxx8
-rw-r--r--sw/source/ui/vba/vbalisttemplates.cxx8
-rw-r--r--sw/source/ui/vba/vbamailmerge.cxx7
-rw-r--r--sw/source/ui/vba/vbaoptions.cxx8
-rw-r--r--sw/source/ui/vba/vbapagesetup.cxx8
-rw-r--r--sw/source/ui/vba/vbapane.cxx8
-rw-r--r--sw/source/ui/vba/vbapanes.cxx8
-rw-r--r--sw/source/ui/vba/vbaparagraph.cxx16
-rw-r--r--sw/source/ui/vba/vbaparagraphformat.cxx8
-rw-r--r--sw/source/ui/vba/vbarange.cxx8
-rw-r--r--sw/source/ui/vba/vbareplacement.cxx8
-rw-r--r--sw/source/ui/vba/vbarevision.cxx8
-rw-r--r--sw/source/ui/vba/vbarevisions.cxx8
-rw-r--r--sw/source/ui/vba/vbarow.cxx8
-rw-r--r--sw/source/ui/vba/vbarows.cxx8
-rw-r--r--sw/source/ui/vba/vbasection.cxx8
-rw-r--r--sw/source/ui/vba/vbasections.cxx8
-rw-r--r--sw/source/ui/vba/vbaselection.cxx8
-rw-r--r--sw/source/ui/vba/vbastyle.cxx8
-rw-r--r--sw/source/ui/vba/vbastyles.cxx8
-rw-r--r--sw/source/ui/vba/vbasystem.cxx8
-rw-r--r--sw/source/ui/vba/vbatable.cxx8
-rw-r--r--sw/source/ui/vba/vbatableofcontents.cxx8
-rw-r--r--sw/source/ui/vba/vbatables.cxx8
-rw-r--r--sw/source/ui/vba/vbatablesofcontents.cxx8
-rw-r--r--sw/source/ui/vba/vbatabstop.cxx8
-rw-r--r--sw/source/ui/vba/vbatabstops.cxx8
-rw-r--r--sw/source/ui/vba/vbatemplate.cxx8
-rw-r--r--sw/source/ui/vba/vbavariable.cxx8
-rw-r--r--sw/source/ui/vba/vbavariables.cxx8
-rw-r--r--sw/source/ui/vba/vbaview.cxx8
-rw-r--r--sw/source/ui/vba/vbawindow.cxx8
-rw-r--r--sw/source/ui/vba/vbawrapformat.cxx8
69 files changed, 222 insertions, 374 deletions
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 278f0d7178ec..4b804ebee59e 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -756,10 +756,9 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, Button*, void)
pTableSet->Put( SwPtrItem( FN_TABLE_REP, pRep.get() ));
}
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(GetFrameWeld(), pTableSet.get(), &rSh));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(rFact.CreateSwTableTabDlg(GetFrameWeld(), pTableSet.get(), &rSh));
if( RET_OK == pDlg->Execute() )
pTableSet->Put( *pDlg->GetOutputItemSet() );
else if( bNewSet )
@@ -771,10 +770,9 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, Button*, void)
IMPL_LINK( SwInsertDBColAutoPilot, AutoFormatHdl, Button*, pButton, void )
{
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
- ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(pButton->GetFrameWeld(), pView->GetWrtShellPtr(), false, m_xTAutoFormat.get()));
+ ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(rFact.CreateSwAutoFormatDlg(pButton->GetFrameWeld(), pView->GetWrtShellPtr(), false, m_xTAutoFormat.get()));
if( RET_OK == pDlg->Execute())
m_xTAutoFormat.reset(pDlg->FillAutoFormatOfIndex());
}
diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx
index ba351e57ced5..c016cc6189a4 100644
--- a/sw/source/ui/dialog/swuiexp.cxx
+++ b/sw/source/ui/dialog/swuiexp.cxx
@@ -52,12 +52,10 @@
namespace swui
{
- static SwAbstractDialogFactory_Impl* pFactory=nullptr;
- SwAbstractDialogFactory * GetFactory()
+ SwAbstractDialogFactory& GetFactory()
{
- if ( !pFactory )
- pFactory = new SwAbstractDialogFactory_Impl;
- return pFactory;
+ static SwAbstractDialogFactory_Impl aFactory;
+ return aFactory;
}
}
@@ -65,7 +63,7 @@ extern "C"
{
SAL_DLLPUBLIC_EXPORT SwAbstractDialogFactory* SwCreateDialogFactory()
{
- return ::swui::GetFactory();
+ return &::swui::GetFactory();
}
}
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 7c2ca553fc69..061a778b8780 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -250,11 +250,10 @@ void SwEnvFormatPage::Edit(const OString& rIdent, bool bSender)
SfxAllItemSet aTmpSet(*pCollSet);
::ConvertAttrCharToGen(aTmpSet);
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
const OUString sFormatStr = pColl->GetName();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(GetDialogFrameWeld(), pSh->GetView(), aTmpSet, SwCharDlgMode::Env, &sFormatStr));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(rFact.CreateSwCharDlg(GetDialogFrameWeld(), pSh->GetView(), aTmpSet, SwCharDlgMode::Env, &sFormatStr));
if (pDlg->Execute() == RET_OK)
{
SfxItemSet aOutputSet( *pDlg->GetOutputItemSet() );
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 2f4dfe8020bb..dfbb9e08183e 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -328,10 +328,9 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, Button*, void)
}
aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, static_cast<sal_uInt16>(nEditPos)));
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
- ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSwAddressAbstractDlg(this, aSet));
+ ScopedVclPtr<SfxAbstractDialog> pDlg(rFact.CreateSwAddressAbstractDlg(this, aSet));
if (RET_OK == pDlg->Execute())
{
pSh->UpdateFields( *pCurField );
diff --git a/sw/source/ui/inc/swuiexp.hxx b/sw/source/ui/inc/swuiexp.hxx
index 6e9993b0717f..226127c5e595 100644
--- a/sw/source/ui/inc/swuiexp.hxx
+++ b/sw/source/ui/inc/swuiexp.hxx
@@ -21,7 +21,7 @@
namespace swui
{
- SwAbstractDialogFactory * GetFactory();
+ SwAbstractDialogFactory& GetFactory();
}
#endif
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 37eac609f416..fabcae7a521e 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -190,9 +190,8 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, RenameHdl, Button*, void)
uno::Reference<uno::XInterface> xTmp;
aObj >>= xTmp;
uno::Reference<container::XNamed> xNamed(xTmp, uno::UNO_QUERY);
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(pFact->CreateSwRenameXNamedDlg(GetFrameWeld(), xNamed, xNameAccess));
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
+ ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(rFact.CreateSwRenameXNamedDlg(GetFrameWeld(), xNamed, xNameAccess));
pDlg->SetForbiddenChars(BookmarkTable::aForbiddenChars + OUStringLiteral1(BookmarkTable::cSeparator));
if (pDlg->Execute())
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 3fff72fbd012..6ac46df8eaae 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -171,10 +171,9 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable)
IMPL_LINK_NOARG(SwConvertTableDlg, AutoFormatHdl, weld::Button&, void)
{
- SwAbstractDialogFactory* pFact = swui::GetFactory();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ SwAbstractDialogFactory& rFact = swui::GetFactory();
- ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(m_xDialog.get(), pShell, false, mxTAutoFormat.get()));
+ ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(rFact.CreateSwAutoFormatDlg(m_xDialog.get(), pShell, false, mxTAutoFormat.get()));
if (RET_OK == pDlg->Execute())
mxTAutoFormat.reset(pDlg->FillAutoFormatOfIndex());
}
diff --git a/sw/source/ui/vba/vbaaddin.cxx b/sw/source/ui/vba/vbaaddin.cxx
index deb7734d3a6d..263619fbf539 100644
--- a/sw/source/ui/vba/vbaaddin.cxx
+++ b/sw/source/ui/vba/vbaaddin.cxx
@@ -83,12 +83,10 @@ SwVbaAddin::getServiceImplName()
uno::Sequence< OUString >
SwVbaAddin::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Addin";
- }
+ "ooo.vba.word.Addin"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx
index a9c5e355bfc2..dc7e032a0563 100644
--- a/sw/source/ui/vba/vbaaddins.cxx
+++ b/sw/source/ui/vba/vbaaddins.cxx
@@ -88,12 +88,10 @@ SwVbaAddins::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaAddins::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Addins";
- }
+ "ooo.vba.word.Addins"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 8eacf19b6ae2..578a2b3d6c35 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -415,12 +415,10 @@ SwVbaApplication::getServiceImplName()
uno::Sequence< OUString >
SwVbaApplication::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Application";
- }
+ "ooo.vba.word.Application"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaautotextentry.cxx b/sw/source/ui/vba/vbaautotextentry.cxx
index e6bd1fd457f3..c4207b826fa3 100644
--- a/sw/source/ui/vba/vbaautotextentry.cxx
+++ b/sw/source/ui/vba/vbaautotextentry.cxx
@@ -84,12 +84,10 @@ SwVbaAutoTextEntry::getServiceImplName()
uno::Sequence< OUString >
SwVbaAutoTextEntry::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.AutoTextEntry";
- }
+ "ooo.vba.word.AutoTextEntry"
+ };
return aServiceNames;
}
@@ -125,12 +123,10 @@ SwVbaAutoTextEntries::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaAutoTextEntries::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.AutoTextEntries";
- }
+ "ooo.vba.word.AutoTextEntries"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbabookmark.cxx b/sw/source/ui/vba/vbabookmark.cxx
index 02a806413e7d..b3334ea57e7d 100644
--- a/sw/source/ui/vba/vbabookmark.cxx
+++ b/sw/source/ui/vba/vbabookmark.cxx
@@ -92,12 +92,10 @@ SwVbaBookmark::getServiceImplName()
uno::Sequence< OUString >
SwVbaBookmark::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Bookmark";
- }
+ "ooo.vba.word.Bookmark"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx
index ca1cbe14ed01..82b813f43bba 100644
--- a/sw/source/ui/vba/vbabookmarks.cxx
+++ b/sw/source/ui/vba/vbabookmarks.cxx
@@ -215,12 +215,10 @@ SwVbaBookmarks::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaBookmarks::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Bookmarks";
- }
+ "ooo.vba.word.Bookmarks"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx
index 2b0d276a9138..f60dfc7152d6 100644
--- a/sw/source/ui/vba/vbaborders.cxx
+++ b/sw/source/ui/vba/vbaborders.cxx
@@ -139,12 +139,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.word.Border";
- }
+ "ooo.vba.word.Border"
+ };
return aServiceNames;
}
public:
@@ -351,12 +349,10 @@ SwVbaBorders::getServiceImplName()
uno::Sequence< OUString >
SwVbaBorders::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Borders";
- }
+ "ooo.vba.word.Borders"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbacell.cxx b/sw/source/ui/vba/vbacell.cxx
index 21b257b3cb48..2040e0b82d8d 100644
--- a/sw/source/ui/vba/vbacell.cxx
+++ b/sw/source/ui/vba/vbacell.cxx
@@ -97,12 +97,10 @@ SwVbaCell::getServiceImplName()
uno::Sequence< OUString >
SwVbaCell::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Cell";
- }
+ "ooo.vba.word.Cell"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbacells.cxx b/sw/source/ui/vba/vbacells.cxx
index cddf9c2fe2c1..6cc969d492e7 100644
--- a/sw/source/ui/vba/vbacells.cxx
+++ b/sw/source/ui/vba/vbacells.cxx
@@ -201,12 +201,10 @@ SwVbaCells::getServiceImplName()
uno::Sequence<OUString>
SwVbaCells::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Cells";
- }
+ "ooo.vba.word.Cells"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbacolumn.cxx b/sw/source/ui/vba/vbacolumn.cxx
index 676d93e1712f..5e6c4abe21df 100644
--- a/sw/source/ui/vba/vbacolumn.cxx
+++ b/sw/source/ui/vba/vbacolumn.cxx
@@ -84,12 +84,10 @@ SwVbaColumn::getServiceImplName()
uno::Sequence< OUString >
SwVbaColumn::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Column";
- }
+ "ooo.vba.word.Column"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbacolumns.cxx b/sw/source/ui/vba/vbacolumns.cxx
index 41a87cf6463e..e2049400efa6 100644
--- a/sw/source/ui/vba/vbacolumns.cxx
+++ b/sw/source/ui/vba/vbacolumns.cxx
@@ -138,12 +138,10 @@ SwVbaColumns::getServiceImplName()
uno::Sequence<OUString>
SwVbaColumns::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Columns";
- }
+ "ooo.vba.word.Columns"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbadialog.cxx b/sw/source/ui/vba/vbadialog.cxx
index 1a91e28cd50a..dae23e63f353 100644
--- a/sw/source/ui/vba/vbadialog.cxx
+++ b/sw/source/ui/vba/vbadialog.cxx
@@ -59,12 +59,10 @@ SwVbaDialog::getServiceImplName()
uno::Sequence< OUString >
SwVbaDialog::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Dialog";
- }
+ "ooo.vba.word.Dialog"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbadialogs.cxx b/sw/source/ui/vba/vbadialogs.cxx
index f4de6d75f8af..22c2c48c6a1d 100644
--- a/sw/source/ui/vba/vbadialogs.cxx
+++ b/sw/source/ui/vba/vbadialogs.cxx
@@ -41,12 +41,10 @@ SwVbaDialogs::getServiceImplName()
uno::Sequence< OUString >
SwVbaDialogs::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Dialogs";
- }
+ "ooo.vba.word.Dialogs"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 557b5bb9ca1c..1fd1b3253b90 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -609,12 +609,10 @@ SwVbaDocumentOutgoingConnectionPoint::Unadvise( sal_uInt32 Cookie )
uno::Sequence< OUString >
SwVbaDocument::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Document";
- }
+ "ooo.vba.word.Document"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index 130471a35d12..f9997f9f9a9c 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -625,12 +625,10 @@ SwVbaBuiltInDocumentProperty::getServiceImplName()
uno::Sequence<OUString>
SwVbaBuiltInDocumentProperty::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.DocumentProperty";
- }
+ "ooo.vba.word.DocumentProperty"
+ };
return aServiceNames;
}
typedef ::cppu::WeakImplHelper< css::container::XIndexAccess
@@ -777,12 +775,10 @@ SwVbaBuiltinDocumentProperties::getServiceImplName()
uno::Sequence<OUString>
SwVbaBuiltinDocumentProperties::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.DocumentProperties";
- }
+ "ooo.vba.word.DocumentProperties"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx
index 968c0b7904df..4424a890cdfd 100644
--- a/sw/source/ui/vba/vbadocuments.cxx
+++ b/sw/source/ui/vba/vbadocuments.cxx
@@ -150,12 +150,10 @@ SwVbaDocuments::getServiceImplName()
uno::Sequence<OUString>
SwVbaDocuments::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Documents";
- }
+ "ooo.vba.word.Documents"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 5b9f8802ecbd..14d5e5769a57 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -60,12 +60,10 @@ SwVbaField::getServiceImplName()
uno::Sequence<OUString>
SwVbaField::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Field";
- }
+ "ooo.vba.word.Field"
+ };
return aServiceNames;
}
@@ -518,12 +516,10 @@ SwVbaFields::getElementType()
uno::Sequence<OUString>
SwVbaFields::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Fields";
- }
+ "ooo.vba.word.Fields"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx
index 2620b441f365..c866c7c64774 100644
--- a/sw/source/ui/vba/vbafind.cxx
+++ b/sw/source/ui/vba/vbafind.cxx
@@ -398,12 +398,10 @@ SwVbaFind::getServiceImplName()
uno::Sequence< OUString >
SwVbaFind::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Find";
- }
+ "ooo.vba.word.Find"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx
index 848dbc292f9e..a4748c8ce218 100644
--- a/sw/source/ui/vba/vbafont.cxx
+++ b/sw/source/ui/vba/vbafont.cxx
@@ -224,12 +224,10 @@ SwVbaFont::getShadow()
uno::Sequence< OUString >
SwVbaFont::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Font";
- }
+ "ooo.vba.word.Font"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaframe.cxx b/sw/source/ui/vba/vbaframe.cxx
index 656fc9a6f699..c59994faed16 100644
--- a/sw/source/ui/vba/vbaframe.cxx
+++ b/sw/source/ui/vba/vbaframe.cxx
@@ -52,12 +52,10 @@ SwVbaFrame::getServiceImplName()
uno::Sequence< OUString >
SwVbaFrame::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Frame";
- }
+ "ooo.vba.word.Frame"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaframes.cxx b/sw/source/ui/vba/vbaframes.cxx
index 7951b83ccb56..f414fdb8ee5d 100644
--- a/sw/source/ui/vba/vbaframes.cxx
+++ b/sw/source/ui/vba/vbaframes.cxx
@@ -88,12 +88,10 @@ SwVbaFrames::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaFrames::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Frames";
- }
+ "ooo.vba.word.Frames"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx
index 40e95e467dbe..a85f0c767cff 100644
--- a/sw/source/ui/vba/vbaglobals.cxx
+++ b/sw/source/ui/vba/vbaglobals.cxx
@@ -144,34 +144,25 @@ SwVbaGlobals::getServiceImplName()
uno::Sequence< OUString >
SwVbaGlobals::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Globals";
- }
+ "ooo.vba.word.Globals"
+ };
return aServiceNames;
}
uno::Sequence< OUString >
SwVbaGlobals::getAvailableServiceNames( )
{
- static bool bInit = false;
- static uno::Sequence< OUString > serviceNames( SwVbaGlobals_BASE::getAvailableServiceNames() );
- if ( !bInit )
+ static uno::Sequence< OUString > const serviceNames = [&]()
{
- OUString names[] = {
- OUString( "ooo.vba.word.Document" ),
+ uno::Sequence< OUString > tmp = SwVbaGlobals_BASE::getAvailableServiceNames();
+ tmp.realloc( tmp.getLength() + 1 );
+ tmp[ tmp.getLength() - 1 ] = "ooo.vba.word.Document";
// #FIXME #TODO make Application a proper service
// OUString( "ooo.vba.word.Application" ),
- };
- sal_Int32 nWordServices = SAL_N_ELEMENTS( names );
- sal_Int32 startIndex = serviceNames.getLength();
- serviceNames.realloc( serviceNames.getLength() + nWordServices );
- for ( sal_Int32 index = 0; index < nWordServices; ++index )
- serviceNames[ startIndex + index ] = names[ index ];
- bInit = true;
- }
+ return tmp;
+ }();
return serviceNames;
}
diff --git a/sw/source/ui/vba/vbaheaderfooter.cxx b/sw/source/ui/vba/vbaheaderfooter.cxx
index 21bd2debe849..e5feadede78f 100644
--- a/sw/source/ui/vba/vbaheaderfooter.cxx
+++ b/sw/source/ui/vba/vbaheaderfooter.cxx
@@ -92,12 +92,10 @@ SwVbaHeaderFooter::getServiceImplName()
uno::Sequence< OUString >
SwVbaHeaderFooter::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Pane";
- }
+ "ooo.vba.word.Pane"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaheadersfooters.cxx b/sw/source/ui/vba/vbaheadersfooters.cxx
index 1d8a10563273..e3b67babd090 100644
--- a/sw/source/ui/vba/vbaheadersfooters.cxx
+++ b/sw/source/ui/vba/vbaheadersfooters.cxx
@@ -127,12 +127,10 @@ SwVbaHeadersFooters::getServiceImplName()
uno::Sequence<OUString>
SwVbaHeadersFooters::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.HeadersFooters";
- }
+ "ooo.vba.word.HeadersFooters"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbalistformat.cxx b/sw/source/ui/vba/vbalistformat.cxx
index 25c8a8ab0426..8fb67d9dda76 100644
--- a/sw/source/ui/vba/vbalistformat.cxx
+++ b/sw/source/ui/vba/vbalistformat.cxx
@@ -101,12 +101,10 @@ SwVbaListFormat::getServiceImplName()
uno::Sequence< OUString >
SwVbaListFormat::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.ListFormat";
- }
+ "ooo.vba.word.ListFormat"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbalistgalleries.cxx b/sw/source/ui/vba/vbalistgalleries.cxx
index 1627631ec39d..6a2895417a85 100644
--- a/sw/source/ui/vba/vbalistgalleries.cxx
+++ b/sw/source/ui/vba/vbalistgalleries.cxx
@@ -93,12 +93,10 @@ SwVbaListGalleries::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaListGalleries::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.ListGalleries";
- }
+ "ooo.vba.word.ListGalleries"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbalistgallery.cxx b/sw/source/ui/vba/vbalistgallery.cxx
index f41dcbd639d3..0312755f5b04 100644
--- a/sw/source/ui/vba/vbalistgallery.cxx
+++ b/sw/source/ui/vba/vbalistgallery.cxx
@@ -50,12 +50,10 @@ SwVbaListGallery::getServiceImplName()
uno::Sequence< OUString >
SwVbaListGallery::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.ListGallery";
- }
+ "ooo.vba.word.ListGallery"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbalistlevel.cxx b/sw/source/ui/vba/vbalistlevel.cxx
index b7ef212d2864..5754566b7a5f 100644
--- a/sw/source/ui/vba/vbalistlevel.cxx
+++ b/sw/source/ui/vba/vbalistlevel.cxx
@@ -377,12 +377,10 @@ SwVbaListLevel::getServiceImplName()
uno::Sequence< OUString >
SwVbaListLevel::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.ListLevel";
- }
+ "ooo.vba.word.ListLevel"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbalistlevels.cxx b/sw/source/ui/vba/vbalistlevels.cxx
index b92fdd29cfb7..d6cefff1385f 100644
--- a/sw/source/ui/vba/vbalistlevels.cxx
+++ b/sw/source/ui/vba/vbalistlevels.cxx
@@ -96,12 +96,10 @@ SwVbaListLevels::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaListLevels::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.ListLevels";
- }
+ "ooo.vba.word.ListLevels"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbalisttemplate.cxx b/sw/source/ui/vba/vbalisttemplate.cxx
index 97ea48983fc3..b94a24d43e01 100644
--- a/sw/source/ui/vba/vbalisttemplate.cxx
+++ b/sw/source/ui/vba/vbalisttemplate.cxx
@@ -58,12 +58,10 @@ SwVbaListTemplate::getServiceImplName()
uno::Sequence< OUString >
SwVbaListTemplate::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.ListTemplate";
- }
+ "ooo.vba.word.ListTemplate"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbalisttemplates.cxx b/sw/source/ui/vba/vbalisttemplates.cxx
index 84a979301901..2983a987b798 100644
--- a/sw/source/ui/vba/vbalisttemplates.cxx
+++ b/sw/source/ui/vba/vbalisttemplates.cxx
@@ -90,12 +90,10 @@ SwVbaListTemplates::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaListTemplates::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.ListTemplates";
- }
+ "ooo.vba.word.ListTemplates"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbamailmerge.cxx b/sw/source/ui/vba/vbamailmerge.cxx
index 48973f80963f..dfcbad372f76 100644
--- a/sw/source/ui/vba/vbamailmerge.cxx
+++ b/sw/source/ui/vba/vbamailmerge.cxx
@@ -49,12 +49,7 @@ OUString SwVbaMailMerge::getServiceImplName() { return OUString("SwVbaMailMerge"
css::uno::Sequence<OUString> SwVbaMailMerge::getServiceNames()
{
- static css::uno::Sequence<OUString> aServiceNames;
- if (aServiceNames.getLength() == 0)
- {
- aServiceNames.realloc(1);
- aServiceNames[0] = "ooo.vba.word.MailMerge";
- }
+ static css::uno::Sequence<OUString> const aServiceNames{ "ooo.vba.word.MailMerge" };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbaoptions.cxx b/sw/source/ui/vba/vbaoptions.cxx
index dcf505a8adb7..3c5ec99192ff 100644
--- a/sw/source/ui/vba/vbaoptions.cxx
+++ b/sw/source/ui/vba/vbaoptions.cxx
@@ -266,12 +266,10 @@ SwVbaOptions::getServiceImplName()
uno::Sequence< OUString >
SwVbaOptions::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Options";
- }
+ "ooo.vba.word.Options"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbapagesetup.cxx b/sw/source/ui/vba/vbapagesetup.cxx
index e8f7bbbd8e70..f859180a2c28 100644
--- a/sw/source/ui/vba/vbapagesetup.cxx
+++ b/sw/source/ui/vba/vbapagesetup.cxx
@@ -253,12 +253,10 @@ SwVbaPageSetup::getServiceImplName()
uno::Sequence< OUString >
SwVbaPageSetup::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.PageSetup";
- }
+ "ooo.vba.word.PageSetup"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbapane.cxx b/sw/source/ui/vba/vbapane.cxx
index 118538da3263..48b0bb2b16ac 100644
--- a/sw/source/ui/vba/vbapane.cxx
+++ b/sw/source/ui/vba/vbapane.cxx
@@ -56,12 +56,10 @@ SwVbaPane::getServiceImplName()
uno::Sequence< OUString >
SwVbaPane::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Pane";
- }
+ "ooo.vba.word.Pane"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbapanes.cxx b/sw/source/ui/vba/vbapanes.cxx
index 28edd7be2985..3124049890ef 100644
--- a/sw/source/ui/vba/vbapanes.cxx
+++ b/sw/source/ui/vba/vbapanes.cxx
@@ -104,12 +104,10 @@ SwVbaPanes::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaPanes::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Panes";
- }
+ "ooo.vba.word.Panes"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaparagraph.cxx b/sw/source/ui/vba/vbaparagraph.cxx
index 42db168edb41..ff81be8bb37c 100644
--- a/sw/source/ui/vba/vbaparagraph.cxx
+++ b/sw/source/ui/vba/vbaparagraph.cxx
@@ -64,12 +64,10 @@ SwVbaParagraph::getServiceImplName()
uno::Sequence< OUString >
SwVbaParagraph::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Paragraph";
- }
+ "ooo.vba.word.Paragraph"
+ };
return aServiceNames;
}
@@ -168,12 +166,10 @@ SwVbaParagraphs::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaParagraphs::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Paragraphs";
- }
+ "ooo.vba.word.Paragraphs"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaparagraphformat.cxx b/sw/source/ui/vba/vbaparagraphformat.cxx
index 33f16d6f9d55..6c87d194bb13 100644
--- a/sw/source/ui/vba/vbaparagraphformat.cxx
+++ b/sw/source/ui/vba/vbaparagraphformat.cxx
@@ -556,12 +556,10 @@ SwVbaParagraphFormat::getServiceImplName()
uno::Sequence< OUString >
SwVbaParagraphFormat::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.ParagraphFormat";
- }
+ "ooo.vba.word.ParagraphFormat"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index bb1a9fde7fbc..a187c78813c0 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -418,12 +418,10 @@ SwVbaRange::getServiceImplName()
uno::Sequence< OUString >
SwVbaRange::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Range";
- }
+ "ooo.vba.word.Range"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbareplacement.cxx b/sw/source/ui/vba/vbareplacement.cxx
index c0de490dc483..4bc8ce98bb9c 100644
--- a/sw/source/ui/vba/vbareplacement.cxx
+++ b/sw/source/ui/vba/vbareplacement.cxx
@@ -57,12 +57,10 @@ SwVbaReplacement::getServiceImplName()
uno::Sequence< OUString >
SwVbaReplacement::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Replacement";
- }
+ "ooo.vba.word.Replacement"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbarevision.cxx b/sw/source/ui/vba/vbarevision.cxx
index a82c5a5f59db..dc2fc81b0b4d 100644
--- a/sw/source/ui/vba/vbarevision.cxx
+++ b/sw/source/ui/vba/vbarevision.cxx
@@ -84,12 +84,10 @@ SwVbaRevision::getServiceImplName()
uno::Sequence< OUString >
SwVbaRevision::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Revision";
- }
+ "ooo.vba.word.Revision"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbarevisions.cxx b/sw/source/ui/vba/vbarevisions.cxx
index 223e523c1c56..10ddb2c3f90f 100644
--- a/sw/source/ui/vba/vbarevisions.cxx
+++ b/sw/source/ui/vba/vbarevisions.cxx
@@ -164,12 +164,10 @@ SwVbaRevisions::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaRevisions::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Revisions";
- }
+ "ooo.vba.word.Revisions"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbarow.cxx b/sw/source/ui/vba/vbarow.cxx
index dac431539e3c..2a0cd0fd8054 100644
--- a/sw/source/ui/vba/vbarow.cxx
+++ b/sw/source/ui/vba/vbarow.cxx
@@ -112,12 +112,10 @@ SwVbaRow::getServiceImplName()
uno::Sequence< OUString >
SwVbaRow::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Row";
- }
+ "ooo.vba.word.Row"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
index 4b9b98ce66f1..839a5021e870 100644
--- a/sw/source/ui/vba/vbarows.cxx
+++ b/sw/source/ui/vba/vbarows.cxx
@@ -355,12 +355,10 @@ SwVbaRows::getServiceImplName()
uno::Sequence<OUString>
SwVbaRows::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Rows";
- }
+ "ooo.vba.word.Rows"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbasection.cxx b/sw/source/ui/vba/vbasection.cxx
index bce9b3769dc1..024c51023509 100644
--- a/sw/source/ui/vba/vbasection.cxx
+++ b/sw/source/ui/vba/vbasection.cxx
@@ -74,12 +74,10 @@ SwVbaSection::getServiceImplName()
uno::Sequence< OUString >
SwVbaSection::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Section";
- }
+ "ooo.vba.word.Section"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbasections.cxx b/sw/source/ui/vba/vbasections.cxx
index 74f5b7bb05a0..a134af69ed0f 100644
--- a/sw/source/ui/vba/vbasections.cxx
+++ b/sw/source/ui/vba/vbasections.cxx
@@ -181,12 +181,10 @@ SwVbaSections::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaSections::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Sections";
- }
+ "ooo.vba.word.Sections"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index 55e16e70490b..f8b5206866db 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -1159,12 +1159,10 @@ SwVbaSelection::getServiceImplName()
uno::Sequence< OUString >
SwVbaSelection::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Selection";
- }
+ "ooo.vba.word.Selection"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx
index 103a9b15d7f3..6f0c88f7a0a7 100644
--- a/sw/source/ui/vba/vbastyle.cxx
+++ b/sw/source/ui/vba/vbastyle.cxx
@@ -218,12 +218,10 @@ SwVbaStyle::getServiceImplName()
uno::Sequence< OUString >
SwVbaStyle::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.XStyle";
- }
+ "ooo.vba.word.XStyle"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbastyles.cxx b/sw/source/ui/vba/vbastyles.cxx
index 9f7de35ddf57..e247f0128116 100644
--- a/sw/source/ui/vba/vbastyles.cxx
+++ b/sw/source/ui/vba/vbastyles.cxx
@@ -358,12 +358,10 @@ SwVbaStyles::getServiceImplName()
uno::Sequence< OUString >
SwVbaStyles::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.XStyles";
- }
+ "ooo.vba.word.XStyles"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 035628818564..2ee7a68d8a1d 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -268,12 +268,10 @@ SwVbaSystem::getServiceImplName()
uno::Sequence< OUString >
SwVbaSystem::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.System";
- }
+ "ooo.vba.word.System"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbatable.cxx b/sw/source/ui/vba/vbatable.cxx
index 488ba6583a1d..5629a848edbd 100644
--- a/sw/source/ui/vba/vbatable.cxx
+++ b/sw/source/ui/vba/vbatable.cxx
@@ -118,12 +118,10 @@ SwVbaTable::getServiceImplName()
uno::Sequence<OUString>
SwVbaTable::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Table";
- }
+ "ooo.vba.word.Table"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbatableofcontents.cxx b/sw/source/ui/vba/vbatableofcontents.cxx
index 778c8cfdf5d6..1c1e7ff2a9fb 100644
--- a/sw/source/ui/vba/vbatableofcontents.cxx
+++ b/sw/source/ui/vba/vbatableofcontents.cxx
@@ -102,12 +102,10 @@ SwVbaTableOfContents::getServiceImplName()
uno::Sequence< OUString >
SwVbaTableOfContents::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.TableOfContents";
- }
+ "ooo.vba.word.TableOfContents"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx
index eb9b4441de89..3c431a1fa928 100644
--- a/sw/source/ui/vba/vbatables.cxx
+++ b/sw/source/ui/vba/vbatables.cxx
@@ -221,12 +221,10 @@ SwVbaTables::getElementType()
uno::Sequence<OUString>
SwVbaTables::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Tables";
- }
+ "ooo.vba.word.Tables"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbatablesofcontents.cxx b/sw/source/ui/vba/vbatablesofcontents.cxx
index 13b171337481..5c0616f8212b 100644
--- a/sw/source/ui/vba/vbatablesofcontents.cxx
+++ b/sw/source/ui/vba/vbatablesofcontents.cxx
@@ -170,12 +170,10 @@ SwVbaTablesOfContents::getServiceImplName()
uno::Sequence<OUString>
SwVbaTablesOfContents::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.TablesOfContents";
- }
+ "ooo.vba.word.TablesOfContents"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbatabstop.cxx b/sw/source/ui/vba/vbatabstop.cxx
index bce16115a332..38d4cfdba583 100644
--- a/sw/source/ui/vba/vbatabstop.cxx
+++ b/sw/source/ui/vba/vbatabstop.cxx
@@ -40,12 +40,10 @@ SwVbaTabStop::getServiceImplName()
uno::Sequence< OUString >
SwVbaTabStop::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.TabStop";
- }
+ "ooo.vba.word.TabStop"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbatabstops.cxx b/sw/source/ui/vba/vbatabstops.cxx
index fbcddca22ba6..0c2ee09dea33 100644
--- a/sw/source/ui/vba/vbatabstops.cxx
+++ b/sw/source/ui/vba/vbatabstops.cxx
@@ -258,12 +258,10 @@ SwVbaTabStops::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaTabStops::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.TabStops";
- }
+ "ooo.vba.word.TabStops"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx
index c33cdb000b8d..60eb84befbce 100644
--- a/sw/source/ui/vba/vbatemplate.cxx
+++ b/sw/source/ui/vba/vbatemplate.cxx
@@ -121,12 +121,10 @@ SwVbaTemplate::getServiceImplName()
uno::Sequence< OUString >
SwVbaTemplate::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Template";
- }
+ "ooo.vba.word.Template"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbavariable.cxx b/sw/source/ui/vba/vbavariable.cxx
index 01cacf146851..e28e959790d9 100644
--- a/sw/source/ui/vba/vbavariable.cxx
+++ b/sw/source/ui/vba/vbavariable.cxx
@@ -84,12 +84,10 @@ SwVbaVariable::getServiceImplName()
uno::Sequence< OUString >
SwVbaVariable::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Variable";
- }
+ "ooo.vba.word.Variable"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbavariables.cxx b/sw/source/ui/vba/vbavariables.cxx
index eac1278452b6..919b5d07c268 100644
--- a/sw/source/ui/vba/vbavariables.cxx
+++ b/sw/source/ui/vba/vbavariables.cxx
@@ -84,12 +84,10 @@ SwVbaVariables::getServiceImplName()
css::uno::Sequence<OUString>
SwVbaVariables::getServiceNames()
{
- static uno::Sequence< OUString > sNames;
- if ( sNames.getLength() == 0 )
+ static uno::Sequence< OUString > const sNames
{
- sNames.realloc( 1 );
- sNames[0] = "ooo.vba.word.Variables";
- }
+ "ooo.vba.word.Variables"
+ };
return sNames;
}
diff --git a/sw/source/ui/vba/vbaview.cxx b/sw/source/ui/vba/vbaview.cxx
index 49e5076c89f3..372f8e614118 100644
--- a/sw/source/ui/vba/vbaview.cxx
+++ b/sw/source/ui/vba/vbaview.cxx
@@ -380,12 +380,10 @@ SwVbaView::getServiceImplName()
uno::Sequence< OUString >
SwVbaView::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.View";
- }
+ "ooo.vba.word.View"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index aba495a199b8..fc914cc5769b 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -169,12 +169,10 @@ SwVbaWindow::getServiceImplName()
uno::Sequence< OUString >
SwVbaWindow::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.Window";
- }
+ "ooo.vba.word.Window"
+ };
return aServiceNames;
}
diff --git a/sw/source/ui/vba/vbawrapformat.cxx b/sw/source/ui/vba/vbawrapformat.cxx
index 0d161b2ab4b2..a0e63b325657 100644
--- a/sw/source/ui/vba/vbawrapformat.cxx
+++ b/sw/source/ui/vba/vbawrapformat.cxx
@@ -227,12 +227,10 @@ SwVbaWrapFormat::getServiceImplName()
uno::Sequence< OUString >
SwVbaWrapFormat::getServiceNames()
{
- static uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ static uno::Sequence< OUString > const aServiceNames
{
- aServiceNames.realloc( 1 );
- aServiceNames[ 0 ] = "ooo.vba.word.WrapFormat";
- }
+ "ooo.vba.word.WrapFormat"
+ };
return aServiceNames;
}