summaryrefslogtreecommitdiff
path: root/package/source/zippackage/ZipPackageStream.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'package/source/zippackage/ZipPackageStream.cxx')
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 6343607c8711..018b49aa8bd9 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,12 +41,14 @@
#include <ZipPackage.hxx>
#include <ZipFile.hxx>
#include <EncryptedDataHeader.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include "wrapstreamforshare.hxx"
#include <comphelper/seekableinput.hxx>
#include <comphelper/storagehelper.hxx>
+#include <rtl/instance.hxx>
+
#include <PackageConstants.hxx>
using namespace com::sun::star::packages::zip::ZipConstants;
@@ -56,8 +59,12 @@ using namespace com::sun::star;
using namespace cppu;
using namespace rtl;
-Sequence < sal_Int8 > ZipPackageStream::aImplementationId = Sequence < sal_Int8 > ();
+namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
+const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId()
+{
+ return lcl_CachedImplId::get();
+}
ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
const Reference< XMultiServiceFactory >& xFactory,
@@ -92,10 +99,9 @@ ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
aEntry.nPathLen = -1;
aEntry.nExtraLen = -1;
- if ( !aImplementationId.getLength() )
- {
- aImplementationId = getImplementationId();
- }
+ Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get();
+ if ( !rCachedImplId.getLength() )
+ rCachedImplId = getImplementationId();
}
ZipPackageStream::~ZipPackageStream( void )
@@ -410,12 +416,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData()
}
catch (ZipException &)//rException)
{
- VOS_ENSURE( 0, "ZipException thrown");//rException.Message);
+ OSL_ENSURE( 0, "ZipException thrown");//rException.Message);
return Reference < io::XInputStream > ();
}
catch (Exception &)
{
- VOS_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
+ OSL_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
return Reference < io::XInputStream > ();
}
}
@@ -441,12 +447,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( )
}
catch (ZipException &)//rException)
{
- VOS_ENSURE( 0,"ZipException thrown");//rException.Message);
+ OSL_ENSURE( 0,"ZipException thrown");//rException.Message);
return Reference < io::XInputStream > ();
}
catch (Exception &)
{
- VOS_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
+ OSL_ENSURE( 0, "Exception is thrown during stream wrapping!\n");
return Reference < io::XInputStream > ();
}
}
@@ -795,3 +801,4 @@ sal_Bool SAL_CALL ZipPackageStream::supportsService( OUString const & rServiceNa
return rServiceName == getSupportedServiceNames()[0];
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */