Kaydet (Commit) 903a5855 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

No need for extra heap allocation

Change-Id: Ibc5424873f6cd4e5e4d9ee37823845b14f17c7fb
üst ab10f03e
......@@ -96,7 +96,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C
SwView* m_pView;
// List of all Redline-authors.
std::vector<OUString>* m_pAuthorNames;
std::vector<OUString> m_pAuthorNames;
// DictionaryList listener to trigger spellchecking or hyphenation
css::uno::Reference< css::linguistic2::XLinguServiceEventListener > m_xLinguServiceEventListener;
......
......@@ -887,7 +887,6 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
DELETEZ(m_pNavigationConfig);
DELETEZ(m_pToolbarConfig);
DELETEZ(m_pWebToolbarConfig);
DELETEZ(m_pAuthorNames);
DELETEZ(m_pDBConfig);
if( m_pColorConfig )
{
......
......@@ -417,12 +417,12 @@ void SwModule::SetRedlineAuthor(const OUString &rAuthor)
OUString SwModule::GetRedlineAuthor(sal_uInt16 nPos)
{
OSL_ENSURE(nPos < m_pAuthorNames->size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
while(!(nPos < m_pAuthorNames->size()))
OSL_ENSURE(nPos < m_pAuthorNames.size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
while(!(nPos < m_pAuthorNames.size()))
{
InsertRedlineAuthor("nn");
}
return (*m_pAuthorNames)[nPos];
return m_pAuthorNames[nPos];
}
static ColorData lcl_GetAuthorColor(sal_uInt16 nPos)
......@@ -450,9 +450,9 @@ boost::property_tree::ptree lcl_AuthorToJson(const OUString& rAuthor, size_t nIn
OUString SwModule::GetRedlineAuthorInfo()
{
boost::property_tree::ptree aTable;
for (size_t nAuthor = 0; nAuthor < m_pAuthorNames->size(); ++nAuthor)
for (size_t nAuthor = 0; nAuthor < m_pAuthorNames.size(); ++nAuthor)
{
boost::property_tree::ptree aAuthor = lcl_AuthorToJson((*m_pAuthorNames)[nAuthor], nAuthor);
boost::property_tree::ptree aAuthor = lcl_AuthorToJson(m_pAuthorNames[nAuthor], nAuthor);
aTable.push_back(std::make_pair("", aAuthor));
}
......@@ -467,11 +467,11 @@ sal_uInt16 SwModule::InsertRedlineAuthor(const OUString& rAuthor)
{
sal_uInt16 nPos = 0;
while(nPos < m_pAuthorNames->size() && (*m_pAuthorNames)[nPos] != rAuthor)
while(nPos < m_pAuthorNames.size() && m_pAuthorNames[nPos] != rAuthor)
++nPos;
if (nPos == m_pAuthorNames->size())
m_pAuthorNames->push_back(rAuthor);
if (nPos == m_pAuthorNames.size())
m_pAuthorNames.push_back(rAuthor);
return nPos;
}
......
......@@ -184,8 +184,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
m_pStdFontConfig = new SwStdFontConfig;
m_pAuthorNames = new std::vector<OUString>; // All Redlining-Authors
StartListening( *SfxGetpApp() );
if (!utl::ConfigManager::IsAvoidConfig())
......
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