From bcd0033046be0c8bcc1c6ddda18645570250f083 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 9 Oct 2013 17:46:54 -0400 Subject: Some cleanups to avoid unnecessary getString() calls. Change-Id: I334d64f7731915d27e3b81781c91e330dc446010 --- sc/source/core/data/column.cxx | 2 +- sc/source/core/data/column2.cxx | 7 +++---- sc/source/filter/excel/excrecds.cxx | 5 ++--- sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'sc') diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index bdfb9c56c390..5270e4c18eec 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1866,7 +1866,7 @@ public: for (; it != itEnd; ++it, ++nRow) { const svl::SharedString& rStr = *it; - if (rStr.getString().isEmpty()) + if (rStr.isEmpty()) { // String cell with empty value is used to special-case cell value removal. maDestPos.miCellPos = mrDestCol.GetCellStore().set_empty( diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index f66bd9041baf..ca9281f830c0 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -578,11 +578,10 @@ public: void operator() (size_t /*nRow*/, const svl::SharedString& rSS) { - OUString aStr = rSS.getString(); - if (aStr.getLength() > mnMaxLen) + if (rSS.getLength() > mnMaxLen) { - mnMaxLen = aStr.getLength(); - maMaxLenStr = aStr; + mnMaxLen = rSS.getLength(); + maMaxLenStr = rSS.getString(); } } diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index d7bea0b4533b..232371b65bce 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -721,10 +721,9 @@ bool XclExpAutofilter::AddEntry( const ScQueryEntry& rEntry ) bool bConflict = false; OUString sText; const ScQueryEntry::Item& rItem = rItems[0]; - OUString aQueryStr = rItem.maString.getString(); - if (!aQueryStr.isEmpty()) + if (!rItem.maString.isEmpty()) { - sText = aQueryStr; + sText = rItem.maString.getString(); switch( rEntry.eOp ) { case SC_CONTAINS: diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 1fd98cd1d730..e7f568c34e03 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -294,12 +294,11 @@ void ScChangeTrackingExportHelper::WriteStringCell(const ScCellValue& rCell) rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING); SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, true, true); - OUString aStr = rCell.mpString->getString(); - if (!aStr.isEmpty()) + if (!rCell.mpString->isEmpty()) { SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false); bool bPrevCharWasSpace(true); - rExport.GetTextParagraphExport()->exportText(aStr, bPrevCharWasSpace); + rExport.GetTextParagraphExport()->exportText(rCell.mpString->getString(), bPrevCharWasSpace); } } -- cgit