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>
This commit is contained in:
@@ -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*/ )
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user