Minor cleanup
Change-Id: I097a9f2a553f163d7af33b7d3e0bac6b79177b7b
This commit is contained in:
@@ -1929,15 +1929,21 @@ OUString SwDoc::ReplaceUsedDBs( const std::vector<String>& rUsedDBNames,
|
|||||||
const OUString sNewName( lcl_CutOffDBCommandType(rNewName) );
|
const OUString sNewName( lcl_CutOffDBCommandType(rNewName) );
|
||||||
OUString sFormula(rFormel);
|
OUString sFormula(rFormel);
|
||||||
|
|
||||||
for( sal_uInt16 i = 0; i < rUsedDBNames.size(); ++i )
|
for( size_t i = 0; i < rUsedDBNames.size(); ++i )
|
||||||
{
|
{
|
||||||
const OUString sDBName( lcl_CutOffDBCommandType(rUsedDBNames[i]) );
|
const OUString sDBName( lcl_CutOffDBCommandType(rUsedDBNames[i]) );
|
||||||
|
|
||||||
if (sDBName!=sNewName)
|
if (sDBName!=sNewName)
|
||||||
{
|
{
|
||||||
sal_Int32 nPos = 0;
|
sal_Int32 nPos = 0;
|
||||||
while ((nPos = sFormula.indexOf(sDBName, nPos))>=0)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
nPos = sFormula.indexOf(sDBName, nPos);
|
||||||
|
if (nPos<0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if( sFormula[nPos + sDBName.getLength()] == '.' &&
|
if( sFormula[nPos + sDBName.getLength()] == '.' &&
|
||||||
(!nPos || !rCC.isLetterNumeric( sFormula, nPos - 1 )))
|
(!nPos || !rCC.isLetterNumeric( sFormula, nPos - 1 )))
|
||||||
{
|
{
|
||||||
@@ -1945,7 +1951,7 @@ OUString SwDoc::ReplaceUsedDBs( const std::vector<String>& rUsedDBNames,
|
|||||||
//prevent re-searching - this is useless and provokes
|
//prevent re-searching - this is useless and provokes
|
||||||
//endless loops when names containing each other and numbers are exchanged
|
//endless loops when names containing each other and numbers are exchanged
|
||||||
//e.g.: old ?12345.12345 new: i12345.12345
|
//e.g.: old ?12345.12345 new: i12345.12345
|
||||||
nPos = nPos + sNewName.getLength();
|
nPos += sNewName.getLength();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user