diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-03 17:28:08 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-06 22:12:50 +0200 |
commit | 33a9039df8819b69b2ed9b08d408ac281a61359a (patch) | |
tree | 2ce4d849753db0769b6946221aa76b662a671786 /sw | |
parent | 5709b98cc23c18074e4d99abafc487e3f37a2eea (diff) |
Simplify loop
Change-Id: Ie6ccc6b7b77fe4d169e39eb1235042dc3c864e92
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/envelp/envfmt.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index a74fe4788bd0..e7bd3179234e 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -185,15 +185,11 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) if (aPaperName.isEmpty()) continue; - sal_Int32 nPos = 0; - bool bFound = false; - while (nPos < m_pSizeFormatBox->GetEntryCount() && !bFound) + sal_Int32 nPos = 0; + while (nPos < m_pSizeFormatBox->GetEntryCount() && + m_pSizeFormatBox->GetEntry(nPos) < aPaperName) { - OUString aEntryName = m_pSizeFormatBox->GetEntry(nPos); - if (aEntryName < aPaperName) - nPos++; - else - bFound = true; + ++nPos; } m_pSizeFormatBox->InsertEntry(aPaperName, nPos); aIDs.insert( aIDs.begin() + nPos, i); |