Kaydet (Commit) 5b12914f authored tarafından August Sodora's avatar August Sodora

SvStringsDtor->std::vector

üst c0d93b26
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <editeng/svxenum.hxx> #include <editeng/svxenum.hxx>
class SvStringsDtor;
class Color; class Color;
class SfxItemSet; class SfxItemSet;
class SfxRequest; class SfxRequest;
...@@ -107,7 +106,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C ...@@ -107,7 +106,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C
SwView* pView; SwView* pView;
// List of all Redline-authors. // List of all Redline-authors.
SvStringsDtor* pAuthorNames; std::vector<String>* pAuthorNames;
// DictionaryList listener to trigger spellchecking or hyphenation // DictionaryList listener to trigger spellchecking or hyphenation
::com::sun::star::uno::Reference< ::com::sun::star::uno::Reference<
......
...@@ -434,23 +434,23 @@ void SwModule::SetRedlineAuthor(const String &rAuthor) ...@@ -434,23 +434,23 @@ void SwModule::SetRedlineAuthor(const String &rAuthor)
const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos)
{ {
OSL_ENSURE(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash OSL_ENSURE(nPos < pAuthorNames->size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
while (!(nPos<pAuthorNames->Count())) while(!(nPos < pAuthorNames->size()))
{ {
InsertRedlineAuthor(String(RTL_CONSTASCII_USTRINGPARAM("nn"))); InsertRedlineAuthor(String(RTL_CONSTASCII_USTRINGPARAM("nn")));
}; };
return *pAuthorNames->GetObject(nPos); return (*pAuthorNames)[nPos];
} }
sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor) sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor)
{ {
sal_uInt16 nPos = 0; sal_uInt16 nPos = 0;
while (nPos < pAuthorNames->Count() && *pAuthorNames->GetObject(nPos) != rAuthor) while(nPos < pAuthorNames->size() && (*pAuthorNames)[nPos] != rAuthor)
nPos++; ++nPos;
if (nPos == pAuthorNames->Count()) if (nPos == pAuthorNames->size())
pAuthorNames->Insert(new String(rAuthor), nPos); pAuthorNames->push_back(rAuthor);
return nPos; return nPos;
} }
......
...@@ -200,7 +200,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, ...@@ -200,7 +200,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pStdFontConfig = new SwStdFontConfig; pStdFontConfig = new SwStdFontConfig;
pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors pAuthorNames = new std::vector<String>; // All Redlining-Authors
// replace SvxAutocorrect with SwAutocorrect // replace SvxAutocorrect with SwAutocorrect
SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment