summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/fldui/changedb.cxx3
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx5
-rw-r--r--sw/source/ui/misc/num.cxx5
3 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index d6eefe4b4cd6..12855877550c 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -94,7 +94,8 @@ void SwChangeDBDlg::FillDBPopup()
Sequence< OUString > aDBNames = xDBContext->getElementNames();
const OUString* pDBNames = aDBNames.getConstArray();
sal_Int32 nDBCount = aDBNames.getLength();
- for(sal_Int32 i = 0; i < nDBCount; i++)
+ aAllDBNames.reserve(nDBCount);
+ for (sal_Int32 i = 0; i < nDBCount; i++)
{
aAllDBNames.push_back(pDBNames[i]);
}
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 8a6524490692..9cdba0b23534 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -518,8 +518,9 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
::FillCharStyleListBox(*rCharFormatLB.get(), pDocShell);
std::vector<OUString> aList;
- for(sal_Int32 j = 0; j < rCharFormatLB->GetEntryCount(); j++)
- aList.push_back( rCharFormatLB->GetEntry(j) );
+ aList.reserve(rCharFormatLB->GetEntryCount());
+ for (sal_Int32 j = 0; j < rCharFormatLB->GetEntryCount(); j++)
+ aList.push_back(rCharFormatLB->GetEntry(j));
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(dynamic_cast< const SwWebDocShell *>( pDocShell ) != nullptr);
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index c3eaedb5b7e9..b127062e75bf 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -931,8 +931,9 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
::FillCharStyleListBox(*rCharFormatLB.get(), pDocShell);
std::vector<OUString> aList;
- for(sal_Int32 j = 0; j < rCharFormatLB->GetEntryCount(); j++)
- aList.push_back( rCharFormatLB->GetEntry(j) );
+ aList.reserve(rCharFormatLB->GetEntryCount());
+ for (sal_Int32 j = 0; j < rCharFormatLB->GetEntryCount(); j++)
+ aList.push_back(rCharFormatLB->GetEntry(j));
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;