diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-05 15:38:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-08 08:51:31 +0200 |
commit | c40a0d8c80a6b6d1354b0dc9695a8476a0a15599 (patch) | |
tree | 42488d8bce28b3b124cc7b393ecf3ef0d48edfe3 /package | |
parent | a1bba53d6fbc56537da0296c27db5cc443c8bca7 (diff) |
tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 3
Individually, these don't make much difference, but they add up
to a halving the time to save on my machine.
ManifestImport::characters was spending time adding data to an OUString,
so convert that to an OUStringBuffer.
Change-Id: I267e701f4e7998044763f44199b1fe8a37325b68
Reviewed-on: https://gerrit.libreoffice.org/70311
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/manifest/ManifestImport.cxx | 8 | ||||
-rw-r--r-- | package/source/manifest/ManifestImport.hxx | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index 7f2ef54bb293..b333cf5c9831 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -173,7 +173,7 @@ void ManifestImport::doEncryptedCipherValue() { aKeyInfoSequence[2].Name = "CipherValue"; uno::Sequence < sal_Int8 > aDecodeBuffer; - ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters); + ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters.toString()); aKeyInfoSequence[2].Value <<= aDecodeBuffer; aCurrentCharacters = ""; // consumed } @@ -187,7 +187,7 @@ void ManifestImport::doEncryptedKeyId() { aKeyInfoSequence[0].Name = "KeyId"; uno::Sequence < sal_Int8 > aDecodeBuffer; - ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters); + ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters.toString()); aKeyInfoSequence[0].Value <<= aDecodeBuffer; aCurrentCharacters = ""; // consumed } @@ -201,7 +201,7 @@ void ManifestImport::doEncryptedKeyPacket() { aKeyInfoSequence[1].Name = "KeyPacket"; uno::Sequence < sal_Int8 > aDecodeBuffer; - ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters); + ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters.toString()); aKeyInfoSequence[1].Value <<= aDecodeBuffer; aCurrentCharacters = ""; // consumed } @@ -510,7 +510,7 @@ void SAL_CALL ManifestImport::endElement( const OUString& aName ) void SAL_CALL ManifestImport::characters( const OUString& aChars ) { - aCurrentCharacters += aChars; + aCurrentCharacters.append(aChars); } void SAL_CALL ManifestImport::ignorableWhitespace( const OUString& /*aWhitespaces*/ ) diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx index 15023374bf71..671713d48ffd 100644 --- a/package/source/manifest/ManifestImport.hxx +++ b/package/source/manifest/ManifestImport.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <vector> +#include <rtl/ustrbuf.hxx> #include <HashMaps.hxx> @@ -54,7 +55,7 @@ class ManifestImport final : public cppu::WeakImplHelper < css::xml::sax::XDocum std::vector< css::beans::NamedValue > aKeyInfoSequence; std::vector< css::uno::Sequence< css::beans::NamedValue > > aKeys; std::vector< css::beans::PropertyValue > aSequence; - OUString aCurrentCharacters; + OUStringBuffer aCurrentCharacters; ManifestStack aStack; bool bIgnoreEncryptData; bool bPgpEncryption; |