From 5b12914f96ef0891c7e20f6edc63d58dc6cc1e17 Mon Sep 17 00:00:00 2001 From: August Sodora Date: Fri, 13 Jan 2012 18:05:49 -0500 Subject: SvStringsDtor->std::vector --- sw/inc/swmodule.hxx | 3 +-- sw/source/ui/app/swmodul1.cxx | 14 +++++++------- sw/source/ui/app/swmodule.cxx | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index df7f34bd7338..70cae0f5008d 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -41,7 +41,6 @@ #include #include -class SvStringsDtor; class Color; class SfxItemSet; class SfxRequest; @@ -107,7 +106,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C SwView* pView; // List of all Redline-authors. - SvStringsDtor* pAuthorNames; + std::vector* pAuthorNames; // DictionaryList listener to trigger spellchecking or hyphenation ::com::sun::star::uno::Reference< diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index ccd38e170456..3998e422dd16 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -434,23 +434,23 @@ void SwModule::SetRedlineAuthor(const String &rAuthor) const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) { - OSL_ENSURE(nPosCount(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash - while (!(nPosCount())) + OSL_ENSURE(nPos < pAuthorNames->size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash + while(!(nPos < pAuthorNames->size())) { InsertRedlineAuthor(String(RTL_CONSTASCII_USTRINGPARAM("nn"))); }; - return *pAuthorNames->GetObject(nPos); + return (*pAuthorNames)[nPos]; } sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor) { sal_uInt16 nPos = 0; - while (nPos < pAuthorNames->Count() && *pAuthorNames->GetObject(nPos) != rAuthor) - nPos++; + while(nPos < pAuthorNames->size() && (*pAuthorNames)[nPos] != rAuthor) + ++nPos; - if (nPos == pAuthorNames->Count()) - pAuthorNames->Insert(new String(rAuthor), nPos); + if (nPos == pAuthorNames->size()) + pAuthorNames->push_back(rAuthor); return nPos; } diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 5881215f5090..bbaff8f75a53 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -200,7 +200,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pStdFontConfig = new SwStdFontConfig; - pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors + pAuthorNames = new std::vector; // All Redlining-Authors // replace SvxAutocorrect with SwAutocorrect SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); -- cgit