diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2017-01-13 20:47:46 -0500 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-01-16 20:42:09 +0000 |
commit | 6e55e41632aabbca25ec263cd26a631ca105d0ab (patch) | |
tree | f659efc265d8a6b393edbad403f7e6bda99b4091 /comphelper | |
parent | 0c39bdd960aaa363fd1fcf6608809d3a6068a3d4 (diff) |
tdf#97597: Ensure that each parsing thread has its own buffer.
(cherry picked from commit 4ae705d02df0ddf75b97d0e94add6994626f487e)
Change-Id: I93077f954a49b3922930e4fc86c80228be0f4dd2
Reviewed-on: https://gerrit.libreoffice.org/33069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Reviewed-on: https://gerrit.libreoffice.org/33176
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/storagehelper.cxx | 46 |
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 ); |