Kaydet (Commit) 41379970 authored tarafından Eike Rathke's avatar Eike Rathke

while at it, avoid repeated operator[] access

Change-Id: Iff569f738252492df66a7c9cee654fc58ec67c98
üst dec711e6
......@@ -284,16 +284,19 @@ void ScXMLConverter::ConvertCellRangeAddress(OUString& sFormula)
OUStringBuffer sBuffer(sFormula.getLength());
bool bInQuotationMarks(false);
sal_Unicode chPrevious('=');
for (sal_Int32 i = 0; i < sFormula.getLength(); ++i)
const sal_Unicode* p = sFormula.getStr();
const sal_Unicode* const pStop = p + sFormula.getLength();
for ( ; p < pStop; ++p)
{
if (sFormula[i] == '\'')
const sal_Unicode c = *p;
if (c == '\'')
bInQuotationMarks = !bInQuotationMarks;
if (bInQuotationMarks)
sBuffer.append(sFormula[i]);
else if ((sFormula[i] != '.') ||
sBuffer.append(c);
else if ((c != '.') ||
!((chPrevious == ':') || (chPrevious == ' ') || (chPrevious == '=')))
sBuffer.append(sFormula[i]);
chPrevious = sFormula[i];
sBuffer.append(c);
chPrevious = c;
}
sFormula = sBuffer.makeStringAndClear();
......
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