diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-09-28 01:18:44 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-09-29 10:46:57 +0200 |
commit | 5f3ec872c2a53586b6ab29d836a89c50882f8a0c (patch) | |
tree | c38eef7ff7d7ea692712721d204037302af1ce87 /sw | |
parent | 27a236601b3be2a625a64bf07bfdf50f462f6e43 (diff) |
sFormel is just a duplicate of rFormel
Change-Id: Ib3eb3f517845776ba3ed51f63692f18d51c3f1cc
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index d9b255adae33..a2a4dddddcfa 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1926,7 +1926,6 @@ void SwDoc::ReplaceUsedDBs( const std::vector<String>& rUsedDBNames, const String& rNewName, OUString& rFormel ) { const CharClass& rCC = GetAppCharClass(); - String sFormel(rFormel); String sNewName( rNewName ); sNewName.SearchAndReplace( DB_DELIM, '.'); //the command type is not part of the condition @@ -1942,19 +1941,17 @@ void SwDoc::ReplaceUsedDBs( const std::vector<String>& rUsedDBNames, sDBName = sDBName.GetToken(0, DB_DELIM); if( !sDBName.Equals( sUpperNewNm )) { - xub_StrLen nPos = 0; - - while ((nPos = sFormel.Search(sDBName, nPos)) != STRING_NOTFOUND) + sal_Int32 nPos = 0; + while ((nPos = rFormel.indexOf(sDBName, nPos))>=0) { - if( sFormel.GetChar( nPos + sDBName.Len() ) == '.' && - (!nPos || !rCC.isLetterNumeric( sFormel, nPos - 1 ))) + if( rFormel[nPos + sDBName.Len()] == '.' && + (!nPos || !rCC.isLetterNumeric( rFormel, nPos - 1 ))) { rFormel = rFormel.replaceAt(nPos, sDBName.Len(), sNewName); //prevent re-searching - this is useless and provokes //endless loops when names containing each other and numbers are exchanged //e.g.: old ?12345.12345 new: i12345.12345 nPos = nPos + sNewName.Len(); - sFormel = rFormel; } } } |