From f3916075d7c454abfe93e8b487b2f518f80d526c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 31 Oct 2019 08:06:46 +0200 Subject: tdf#125688 remove intermediate OUStringBuffer in ScXMLContentContext, shaves 5% off load time Change-Id: I5dee5be8e1c005dd4c34f6bc4aa12532199e47b7 Reviewed-on: https://gerrit.libreoffice.org/81817 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/filter/xml/xmlconti.cxx | 12 +++--------- sc/source/filter/xml/xmlconti.hxx | 3 --- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'sc/source') diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx index 884b8b79a4f4..cbb451ecf599 100644 --- a/sc/source/filter/xml/xmlconti.cxx +++ b/sc/source/filter/xml/xmlconti.cxx @@ -31,7 +31,6 @@ ScXMLContentContext::ScXMLContentContext( ScXMLImport& rImport, const OUString& rLName, OUStringBuffer& sTempValue) : ScXMLImportContext( rImport, nPrfx, rLName ), - sOUText(), sValue(sTempValue) { } @@ -60,9 +59,9 @@ SvXMLImportContextRef ScXMLContentContext::CreateChildContext( sal_uInt16 nPrefi } if (nRepeat) for (sal_Int32 j = 0; j < nRepeat; ++j) - sOUText.append(' '); + sValue.append(' '); else - sOUText.append(' '); + sValue.append(' '); } return new SvXMLImportContext( GetImport(), nPrefix, rLName ); @@ -70,12 +69,7 @@ SvXMLImportContextRef ScXMLContentContext::CreateChildContext( sal_uInt16 nPrefi void ScXMLContentContext::Characters( const OUString& rChars ) { - sOUText.append(rChars); -} - -void ScXMLContentContext::EndElement() -{ - sValue.append(sOUText.toString()); + sValue.append(rChars); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlconti.hxx b/sc/source/filter/xml/xmlconti.hxx index f7d07d10e2da..ee862c173ead 100644 --- a/sc/source/filter/xml/xmlconti.hxx +++ b/sc/source/filter/xml/xmlconti.hxx @@ -24,7 +24,6 @@ class ScXMLContentContext : public ScXMLImportContext { - OUStringBuffer sOUText; OUStringBuffer& sValue; public: @@ -40,8 +39,6 @@ public: const css::uno::Reference& xAttrList ) override; virtual void Characters( const OUString& rChars ) override; - - virtual void EndElement() override; }; #endif -- cgit