summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel
diff options
context:
space:
mode:
authorNémeth László <nemeth@numbertext.org>2015-01-26 19:13:53 +0000
committerNémeth László <nemeth@numbertext.org>2015-01-26 19:20:45 +0000
commit8820d21f81a9b6f89e40216f2191c019651cfe4d (patch)
treebb2d4a6bcd29d3ce4288b74a18d437930dd966bd /sc/source/filter/excel
parentace8f9c2a31795cc2329c6bb27deacde9f4c18df (diff)
Revert "fdo#88810 avoid unnecessary massive O(U)String allocations in XLSX export"
This reverts commit ace8f9c2a31795cc2329c6bb27deacde9f4c18df. (Interestingly, reverting the original patch in the master pushed this one in libreoffice-4-4 automatically, sorry.) Change-Id: I0d3048b58aea0c84fa0b287e711a5d7cda7ab8fc Reviewed-on: https://gerrit.libreoffice.org/14188 Reviewed-by: Németh László <nemeth@numbertext.org> Tested-by: Németh László <nemeth@numbertext.org>
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r--sc/source/filter/excel/xestream.cxx10
-rw-r--r--sc/source/filter/excel/xetable.cxx14
2 files changed, 3 insertions, 21 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 188fcd668250..e5ff50c431c7 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -718,11 +718,6 @@ OString XclXmlUtils::ToOString( const OUString& s )
return OUStringToOString( s, RTL_TEXTENCODING_UTF8 );
}
-bool XclXmlUtils::TryToChar( char * s, const ScAddress& rAddress )
-{
- return rAddress.TryFormat(s, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1));
-}
-
OString XclXmlUtils::ToOString( const ScAddress& rAddress )
{
OUString sAddress(rAddress.Format(SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1)));
@@ -765,11 +760,6 @@ static ScAddress lcl_ToAddress( const XclAddress& rAddress )
return aAddress;
}
-bool XclXmlUtils::TryToChar( sal_Char * s, const XclAddress& rAddress )
-{
- return TryToChar( s, lcl_ToAddress( rAddress ));
-}
-
OString XclXmlUtils::ToOString( const XclAddress& rAddress )
{
return ToOString( lcl_ToAddress( rAddress ) );
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index f32cdce88223..23adf6e3f0db 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -41,11 +41,6 @@ using namespace ::oox;
namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
-// max string length of simple addresses (eg. ABC1000000\0)
-#if MAXROWCOUNT_DEFINE < 9999999
-#define SIMPLEADDRESSLEN 11
-#endif
-
// Helper records for cell records
XclExpStringRec::XclExpStringRec( const XclExpRoot& rRoot, const OUString& rResult ) :
@@ -635,10 +630,9 @@ static OString lcl_GetStyleId( XclExpXmlStream& rStrm, const XclExpCellBase& rCe
void XclExpNumberCell::SaveXml( XclExpXmlStream& rStrm )
{
- char fastAdr[SIMPLEADDRESSLEN];
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::TryToChar( fastAdr, GetXclPos() ) ? fastAdr : XclXmlUtils::ToOString( GetXclPos() ).getStr(),
+ XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
XML_s, lcl_GetStyleId( rStrm, *this ).getStr(),
XML_t, "n",
// OOXTODO: XML_cm, XML_vm, XML_ph
@@ -929,12 +923,11 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
{
const char* sType = NULL;
OUString sValue;
- char fastAdr[SIMPLEADDRESSLEN];
XclXmlUtils::GetFormulaTypeAndValue( mrScFmlaCell, sType, sValue );
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::TryToChar( fastAdr, GetXclPos() ) ? fastAdr : XclXmlUtils::ToOString( GetXclPos() ).getStr(),
+ XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
XML_s, lcl_GetStyleId( rStrm, *this ).getStr(),
XML_t, sType,
// OOXTODO: XML_cm, XML_vm, XML_ph
@@ -1314,10 +1307,9 @@ bool XclExpRkCell::TryMerge( const XclExpCellBase& rCell )
void XclExpRkCell::WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& rAddress, sal_uInt32 nXFId, sal_uInt16 nRelCol )
{
- char fastAdr[SIMPLEADDRESSLEN];
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_c,
- XML_r, XclXmlUtils::TryToChar( fastAdr, rAddress ) ? fastAdr : XclXmlUtils::ToOString( rAddress ).getStr(),
+ XML_r, XclXmlUtils::ToOString( rAddress ).getStr(),
XML_s, lcl_GetStyleId( rStrm, nXFId ).getStr(),
XML_t, "n",
// OOXTODO: XML_cm, XML_vm, XML_ph