"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scribus/text/scworditerator.cpp" between
scribus-1.5.6.tar.xz and scribus-1.5.6.1.tar.xz

About: Scribus is a Linux desktop publishing program. Unstable version.

scworditerator.cpp  (scribus-1.5.6.tar.xz):scworditerator.cpp  (scribus-1.5.6.1.tar.xz)
skipping to change at line 26 skipping to change at line 26
m_wordIterator = getWordIterator(); m_wordIterator = getWordIterator();
} }
ScWordIterator::~ScWordIterator() ScWordIterator::~ScWordIterator()
{ {
if (m_wordIterator) if (m_wordIterator)
{ {
delete m_wordIterator; delete m_wordIterator;
m_wordIterator = nullptr; m_wordIterator = nullptr;
} }
if (m_unicodeString)
{
delete m_unicodeString;
m_unicodeString = nullptr;
}
} }
BreakIterator* ScWordIterator::getWordIterator() BreakIterator* ScWordIterator::getWordIterator()
{ {
if (m_wordIterator != nullptr) if (m_wordIterator != nullptr)
return m_wordIterator; return m_wordIterator;
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
m_wordIterator = BreakIterator::createWordInstance(Locale(), status); m_wordIterator = BreakIterator::createWordInstance(Locale(), status);
if (U_FAILURE(status)) if (U_FAILURE(status))
{ {
delete m_wordIterator; delete m_wordIterator;
m_wordIterator = nullptr; m_wordIterator = nullptr;
return nullptr; return nullptr;
} }
m_wordIterator->setText((const UChar*) m_story.plainText().utf16()); if (m_unicodeString)
{
delete m_unicodeString;
m_unicodeString = nullptr;
}
m_unicodeString = new icu::UnicodeString((const UChar*) m_story.plainText
().utf16());
m_wordIterator->setText(*m_unicodeString);
return m_wordIterator; return m_wordIterator;
} }
int ScWordIterator::firstWord() int ScWordIterator::firstWord()
{ {
int len = m_story.length(); int len = m_story.length();
int pos = m_wordIterator->first(); int pos = m_wordIterator->first();
while (pos < len) while (pos < len)
{ {
 End of changes. 2 change blocks. 
1 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)