summaryrefslogtreecommitdiff
path: root/comphelper/source/misc/storagehelper.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2017-01-13 20:47:46 -0500
committerKohei Yoshida <libreoffice@kohei.us>2017-01-14 17:30:30 +0000
commit4ae705d02df0ddf75b97d0e94add6994626f487e (patch)
tree019b0b47b2d777a83c4996ffec2022384ed72755 /comphelper/source/misc/storagehelper.cxx
parentefce216ca5d2b852c9fccc52ee68d1e27279d900 (diff)
tdf#97597: Ensure that each parsing thread has its own buffer.
Change-Id: I93077f954a49b3922930e4fc86c80228be0f4dd2 Reviewed-on: https://gerrit.libreoffice.org/33069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'comphelper/source/misc/storagehelper.cxx')
-rw-r--r--comphelper/source/misc/storagehelper.cxx46
1 files changed, 34 insertions, 12 deletions
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index 4730794de6e1..394a0aab578f 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -317,17 +317,28 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromInputStr
const OUString& aFormat,
const uno::Reference < io::XInputStream >& xStream,
const uno::Reference< uno::XComponentContext >& rxContext,
- bool bRepairStorage )
+ bool bRepairStorage, bool bUseBufferedStream )
throw ( uno::Exception )
{
uno::Sequence< beans::PropertyValue > aProps( 1 );
- aProps[0].Name = "StorageFormat";
- aProps[0].Value <<= aFormat;
+ sal_Int32 nPos = 0;
+ aProps[nPos].Name = "StorageFormat";
+ aProps[nPos].Value <<= aFormat;
+ ++nPos;
if ( bRepairStorage )
{
- aProps.realloc( 2 );
- aProps[1].Name = "RepairPackage";
- aProps[1].Value <<= bRepairStorage;
+ aProps.realloc(nPos+1);
+ aProps[nPos].Name = "RepairPackage";
+ aProps[nPos].Value <<= bRepairStorage;
+ ++nPos;
+ }
+
+ if (bUseBufferedStream)
+ {
+ aProps.realloc(nPos+1);
+ aProps[nPos].Name = "UseBufferedStream";
+ aProps[nPos].Value <<= bUseBufferedStream;
+ ++nPos;
}
uno::Sequence< uno::Any > aArgs( 3 );
@@ -349,17 +360,28 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
const uno::Reference < io::XStream >& xStream,
sal_Int32 nStorageMode,
const uno::Reference< uno::XComponentContext >& rxContext,
- bool bRepairStorage )
+ bool bRepairStorage, bool bUseBufferedStream )
throw ( uno::Exception )
{
uno::Sequence< beans::PropertyValue > aProps( 1 );
- aProps[0].Name = "StorageFormat";
- aProps[0].Value <<= aFormat;
+ sal_Int32 nPos = 0;
+ aProps[nPos].Name = "StorageFormat";
+ aProps[nPos].Value <<= aFormat;
+ ++nPos;
if ( bRepairStorage )
{
- aProps.realloc( 2 );
- aProps[1].Name = "RepairPackage";
- aProps[1].Value <<= bRepairStorage;
+ aProps.realloc(nPos+1);
+ aProps[nPos].Name = "RepairPackage";
+ aProps[nPos].Value <<= bRepairStorage;
+ ++nPos;
+ }
+
+ if (bUseBufferedStream)
+ {
+ aProps.realloc(nPos+1);
+ aProps[nPos].Name = "UseBufferedStream";
+ aProps[nPos].Value <<= bUseBufferedStream;
+ ++nPos;
}
uno::Sequence< uno::Any > aArgs( 3 );