diff options
Diffstat (limited to 'package/source')
65 files changed, 446 insertions, 351 deletions
diff --git a/package/source/manifest/Base64Codec.cxx b/package/source/manifest/Base64Codec.cxx index b9ffed0b0514..cf539d0790c4 100644 --- a/package/source/manifest/Base64Codec.cxx +++ b/package/source/manifest/Base64Codec.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. @@ -30,10 +31,11 @@ #include "Base64Codec.hxx" #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> -using namespace rtl; using namespace osl; using namespace com::sun::star; +using ::rtl::OUStringBuffer; + const sal_Char aBase64EncodeTable[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', @@ -202,3 +204,5 @@ void Base64Codec::decodeBase64(uno::Sequence< sal_uInt8 >& aBuffer, const rtl::O aBuffer = uno::Sequence<sal_uInt8>(pBuffer, nSecondLength); delete[] pBuffer; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/Base64Codec.hxx b/package/source/manifest/Base64Codec.hxx index 04398c7bba29..8cae2a7037fd 100644 --- a/package/source/manifest/Base64Codec.hxx +++ b/package/source/manifest/Base64Codec.hxx @@ -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. @@ -43,3 +44,5 @@ public: static void decodeBase64(com::sun::star::uno::Sequence<sal_uInt8>& aPass, const rtl::OUString& sBuffer); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx index d53337236bb2..65b9c6181727 100644 --- a/package/source/manifest/ManifestDefines.hxx +++ b/package/source/manifest/ManifestDefines.hxx @@ -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. @@ -65,3 +66,5 @@ #define DERIVED_KEY_SIZE "16" #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 6175bdc4e613..e173e8da8d53 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.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. @@ -29,29 +30,23 @@ #include "precompiled_package.hxx" #include <ManifestExport.hxx> #include <ManifestDefines.hxx> -#ifndef _COM_SUN_STAR_XML_SAX_XATTRIBUTELIST_HXX #include <com/sun/star/xml/sax/XAttributeList.hpp> -#endif #include <rtl/ustrbuf.hxx> -#ifndef _BASE64_CODEC_HXX_ #include <Base64Codec.hxx> -#endif #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> -#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HXX #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_BEANS_PROPERTYVALUE_HPP #include <com/sun/star/beans/PropertyValue.hpp> -#endif #include <comphelper/documentconstants.hxx> #include <comphelper/attributelist.hxx> -using namespace rtl; using namespace com::sun::star::beans; using namespace com::sun::star::uno; using namespace com::sun::star::xml::sax; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const Sequence < Sequence < PropertyValue > > &rManList ) { const OUString sFileEntryElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_FILE_ENTRY ) ); @@ -166,11 +161,7 @@ ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const S { // this is ODF12 generation, let encrypted streams contain start-key-generation entry bStoreStartKeyGeneration = sal_True; - - // starting from ODF12 the version should be also in manifest:manifest element - pRootAttrList->AddAttribute ( OUString( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_VERSION ) ), - sCdataAttribute, - aDocVersion ); + pRootAttrList->AddAttribute ( sVersionAttribute, sCdataAttribute, aDocVersion ); } } else @@ -326,3 +317,5 @@ ManifestExport::ManifestExport(Reference < XDocumentHandler > xHandler, const S xHandler->endElement( sManifestElement ); xHandler->endDocument(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestExport.hxx b/package/source/manifest/ManifestExport.hxx index 13407a9dbbe2..73b8cce89725 100644 --- a/package/source/manifest/ManifestExport.hxx +++ b/package/source/manifest/ManifestExport.hxx @@ -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. @@ -44,3 +45,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index 85de919a9acf..58310e5ed116 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.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. @@ -29,18 +30,17 @@ #include "precompiled_package.hxx" #include <ManifestImport.hxx> #include <ManifestDefines.hxx> -#ifndef _BASE64_CODEC_HXX_ #include <Base64Codec.hxx> -#endif #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/beans/PropertyValue.hpp> using namespace com::sun::star::uno; using namespace com::sun::star::beans; using namespace com::sun::star; -using namespace rtl; using namespace std; +using ::rtl::OUString; + // --------------------------------------------------- ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManVector ) : nNumProperty ( 0 ) @@ -136,7 +136,7 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re else if ( aStack.size() > 1 ) { ManifestStack::reverse_iterator aIter = aStack.rbegin(); - aIter++; + ++aIter; if ( aIter->m_aConvertedName.equals( sFileEntryElement ) ) { @@ -318,7 +318,7 @@ void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax ::rtl::OUString ManifestImport::ConvertName( const ::rtl::OUString& aName ) { ::rtl::OUString aConvertedName; - for ( ManifestStack::reverse_iterator aIter = aStack.rbegin(); !aConvertedName.getLength() && aIter != aStack.rend(); aIter++ ) + for ( ManifestStack::reverse_iterator aIter = aStack.rbegin(); !aConvertedName.getLength() && aIter != aStack.rend(); ++aIter ) { if ( !aIter->m_aNamespaces.empty() ) aConvertedName = ConvertNameWithNamespace( aName, aIter->m_aNamespaces ); @@ -330,3 +330,4 @@ void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax return aConvertedName; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx index f83c8b6c49df..4b74d903ee76 100644 --- a/package/source/manifest/ManifestImport.hxx +++ b/package/source/manifest/ManifestImport.hxx @@ -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. @@ -29,9 +30,7 @@ #define _MANIFEST_IMPORT_HXX #include <cppuhelper/implbase1.hxx> // helper for implementations -#ifndef _COM_SUN_STAR_XML_SAX_XDUCUMENTHANDLER_HPP_ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif #include <vector> #include <HashMaps.hxx> @@ -41,7 +40,7 @@ namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } } -typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, eqFunc > StringHashMap; +typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, eqFunc > StringHashMap; struct ManifestScopeEntry { @@ -129,3 +128,5 @@ public: throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx index 5beefc177b39..9e973a65d31e 100644 --- a/package/source/manifest/ManifestReader.cxx +++ b/package/source/manifest/ManifestReader.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. @@ -30,24 +31,13 @@ #include <ManifestReader.hxx> #include <ManifestImport.hxx> #include <cppuhelper/factory.hxx> -#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_SAXPARSEEXCEPTION_HPP #include <com/sun/star/xml/sax/SAXParseException.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP #include <com/sun/star/xml/sax/XParser.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#endif #include <vector> -using namespace ::rtl; using namespace ::std; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -57,6 +47,7 @@ using namespace ::com::sun::star::registry; using namespace ::com::sun::star::packages; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::packages::manifest; +using ::rtl::OUString; ManifestReader::ManifestReader( const Reference < XMultiServiceFactory > & xNewFactory ) : xFactory ( xNewFactory ) @@ -148,3 +139,5 @@ Reference < XSingleServiceFactory > ManifestReader::createServiceFactory( Refere ManifestReader_createInstance, static_getSupportedServiceNames()); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestReader.hxx b/package/source/manifest/ManifestReader.hxx index 92c99587f212..7454e26b0e98 100644 --- a/package/source/manifest/ManifestReader.hxx +++ b/package/source/manifest/ManifestReader.hxx @@ -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. @@ -29,12 +30,8 @@ #define _MANIFEST_READER_HXX #include <cppuhelper/implbase2.hxx> -#ifndef _COM_SUN_STAR_PACKAGES_MANIFEST_XMANIFESTREADER_HPP #include <com/sun/star/packages/manifest/XManifestReader.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; } @@ -71,3 +68,5 @@ public: static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx index dc4dbea2486e..ef829ff5ac03 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.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. @@ -30,21 +31,11 @@ #include <ManifestWriter.hxx> #include <ManifestExport.hxx> #include <cppuhelper/factory.hxx> -#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP #include <com/sun/star/io/XActiveDataSource.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP #include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_XML_SAX_SAXEXCEPTION_HPP #include <com/sun/star/xml/sax/SAXException.hpp> -#endif #include <osl/diagnose.hxx> @@ -133,3 +124,5 @@ Reference < XSingleServiceFactory > ManifestWriter::createServiceFactory( Refere ManifestWriter_createInstance, static_getSupportedServiceNames()); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestWriter.hxx b/package/source/manifest/ManifestWriter.hxx index 3c5097e55cb2..eac775b08ad2 100644 --- a/package/source/manifest/ManifestWriter.hxx +++ b/package/source/manifest/ManifestWriter.hxx @@ -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. @@ -29,12 +30,8 @@ #define _MANIFEST_WRITER_HXX #include <cppuhelper/implbase2.hxx> -#ifndef _COM_SUN_STAR_PACKAGES_MANIFEST_XMANIFESTWRITER_HPP #include <com/sun/star/packages/manifest/XManifestWriter.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; class XSingleServiceFactory; } @@ -72,3 +69,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/UnoRegister.cxx b/package/source/manifest/UnoRegister.cxx index 34dd874206e1..e8bf0e9604d3 100644 --- a/package/source/manifest/UnoRegister.cxx +++ b/package/source/manifest/UnoRegister.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. @@ -30,15 +31,12 @@ #include <ManifestReader.hxx> #include <ManifestWriter.hxx> #include <cppuhelper/factory.hxx> -#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP #include <com/sun/star/registry/XRegistryKey.hpp> -#endif -#include <vos/diagnose.hxx> +#include <osl/diagnose.h> #include <ZipPackage.hxx> #include <zipfileaccess.hxx> -using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; @@ -46,6 +44,8 @@ using namespace ::com::sun::star::registry; using namespace ::com::sun::star::packages; using namespace ::com::sun::star::packages::manifest; +using rtl::OUString; + // C functions to implement this as a component extern "C" void SAL_CALL component_getImplementationEnvironment( @@ -89,3 +89,4 @@ extern "C" void * SAL_CALL component_getFactory( return pRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/disposelistener.cxx b/package/source/xstor/disposelistener.cxx index 73c0689a6a40..97b06e790051 100644 --- a/package/source/xstor/disposelistener.cxx +++ b/package/source/xstor/disposelistener.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. @@ -55,3 +56,4 @@ void SAL_CALL OChildDispListener_Impl::disposing( const lang::EventObject& Sourc m_pStorage->ChildIsDisposed( Source.Source ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/disposelistener.hxx b/package/source/xstor/disposelistener.hxx index 73feb249e3de..8c8e02096027 100644 --- a/package/source/xstor/disposelistener.hxx +++ b/package/source/xstor/disposelistener.hxx @@ -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. @@ -49,3 +50,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index fcb118f4b967..1a95d186e7be 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.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. @@ -656,12 +657,12 @@ uno::Any SAL_CALL OInputCompStream::getPropertyValue( const ::rtl::OUString& aPr } ::rtl::OUString aPropertyName; - if ( aProp.equalsAscii( "IsEncrypted" ) ) + if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) ) aPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ); else aPropertyName = aProp; - if ( aPropertyName.equalsAscii( "RelationsInfo" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) throw beans::UnknownPropertyException(); // TODO // all the provided properties are accessible @@ -757,3 +758,4 @@ void SAL_CALL OInputCompStream::removeVetoableChangeListener( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index fcb472e3f92a..98bafe333efb 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -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. @@ -126,3 +127,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index 32ebc7068ec3..8a4908e27cbc 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.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. @@ -196,7 +197,6 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList } else { - sal_Bool bNewElement = sal_False; ::rtl::Reference< OHierarchyElement_Impl > aElement; OHierarchyElementList_Impl::iterator aIter = m_aChildren.find( aNextName ); if ( aIter != m_aChildren.end() ) @@ -204,7 +204,6 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList if ( !aElement.is() ) { - bNewElement = sal_True; uno::Reference< embed::XStorage > xChildStorage = xOwnStor->openStorageElement( aNextName, embed::ElementModes::READWRITE ); if ( !xChildStorage.is() ) @@ -359,3 +358,4 @@ void SAL_CALL OHierarchyElement_Impl::reverted( const ::com::sun::star::lang::Ev { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/ohierarchyholder.hxx b/package/source/xstor/ohierarchyholder.hxx index d36d784ac839..15c207ff5ab9 100644 --- a/package/source/xstor/ohierarchyholder.hxx +++ b/package/source/xstor/ohierarchyholder.hxx @@ -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. @@ -37,7 +38,7 @@ #include <rtl/ref.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <list> #include <vector> @@ -51,7 +52,7 @@ struct eqFunc return r1 == r2; } }; -typedef ::std::hash_map< ::rtl::OUString, +typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::Reference< OHierarchyElement_Impl >, ::rtl::OUStringHash, eqFunc > OHierarchyElementList_Impl; @@ -139,3 +140,4 @@ public: #endif // _OHIERARCHYHOLDER +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index 0cd3f595c2b3..0c8ee1527b0d 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.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. @@ -178,3 +179,4 @@ sal_Int64 SAL_CALL OInputSeekStream::getLength() return m_xSeekable->getLength(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx index 92a611af16aa..8203be6ec8b9 100644 --- a/package/source/xstor/oseekinstream.hxx +++ b/package/source/xstor/oseekinstream.hxx @@ -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. @@ -66,3 +67,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 9a5876b3e6df..bb1eb8598705 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.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. @@ -116,14 +117,14 @@ void SetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySet >& if ( !xPropertySet.is() ) throw uno::RuntimeException(); - ::rtl::OUString aString_EncryptionKey = ::rtl::OUString::createFromAscii( "EncryptionKey" ); + ::rtl::OUString aString_EncryptionKey (RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ); try { xPropertySet->setPropertyValue( aString_EncryptionKey, uno::makeAny( aKey ) ); } catch ( uno::Exception& aException ) { ::package::StaticAddLog( aException.Message ); - ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't set encryption" ) ) ); + ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't set encryption") ) ); OSL_ENSURE( sal_False, "Can't write encryption related properties!\n" ); throw io::IOException(); // TODO } @@ -136,7 +137,7 @@ uno::Any GetEncryptionKeyProperty_Impl( const uno::Reference< beans::XPropertySe if ( !xPropertySet.is() ) throw uno::RuntimeException(); - ::rtl::OUString aString_EncryptionKey = ::rtl::OUString::createFromAscii( "EncryptionKey" ); + ::rtl::OUString aString_EncryptionKey (RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ); try { return xPropertySet->getPropertyValue( aString_EncryptionKey ); } @@ -175,7 +176,7 @@ sal_Bool KillFile( const ::rtl::OUString& aURL, const uno::Reference< lang::XMul { uno::Reference < ucb::XSimpleFileAccess > xAccess( xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess" ) ) ), uno::UNO_QUERY ); if ( xAccess.is() ) @@ -187,7 +188,7 @@ sal_Bool KillFile( const ::rtl::OUString& aURL, const uno::Reference< lang::XMul catch( uno::Exception& aException ) { ::package::StaticAddLog( aException.Message ); - ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) ); + ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception") ) ); } return bRet; @@ -201,21 +202,21 @@ const sal_Int32 n_ConstBufferSize = 32000; ::rtl::OUString aTempURL; uno::Reference < beans::XPropertySet > xTempFile( - xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile") ) ), uno::UNO_QUERY ); if ( !xTempFile.is() ) throw uno::RuntimeException(); // TODO try { - xTempFile->setPropertyValue( ::rtl::OUString::createFromAscii( "RemoveFile" ), uno::makeAny( sal_False ) ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile") ), uno::makeAny( sal_False ) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri") ) ); aUrl >>= aTempURL; } catch ( uno::Exception& aException ) { ::package::StaticAddLog( aException.Message ); - ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) ); + ::package::StaticAddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception") ) ); } if ( !aTempURL.getLength() ) @@ -230,7 +231,7 @@ uno::Reference< io::XStream > CreateMemoryStream( const uno::Reference< lang::XM if ( !xFactory.is() ) throw uno::RuntimeException(); - return uno::Reference< io::XStream >( xFactory->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.comp.MemoryStream" ) ), uno::UNO_QUERY_THROW ); + return uno::Reference< io::XStream >( xFactory->createInstance (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.MemoryStream") ) ), uno::UNO_QUERY_THROW); } } // anonymous namespace @@ -373,7 +374,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted() uno::Reference< beans::XPropertySet > xPropSet( m_xPackageStream, uno::UNO_QUERY ); if ( xPropSet.is() ) { - uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "WasEncrypted" ) ); + uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WasEncrypted") ) ); if ( !( aValue >>= bWasEncr ) ) { OSL_ENSURE( sal_False, "The property WasEncrypted has wrong type!\n" ); @@ -383,7 +384,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted() sal_Bool bToBeEncr = sal_False; for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAscii( "Encrypted" ) ) + if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) { if ( !( m_aProps[nInd].Value >>= bToBeEncr ) ) { @@ -434,7 +435,7 @@ void OWriteStream_Impl::SetDecrypted() for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAscii( "Encrypted" ) ) + if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) m_aProps[nInd].Value <<= sal_False; } } @@ -458,7 +459,7 @@ void OWriteStream_Impl::SetEncrypted( const ::comphelper::SequenceAsHashMap& aEn // introduce encryption info for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAscii( "Encrypted" ) ) + if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) m_aProps[nInd].Value <<= sal_True; } @@ -480,7 +481,7 @@ void OWriteStream_Impl::DisposeWrappers() catch ( uno::RuntimeException& aRuntimeException ) { AddLog( aRuntimeException.Message ); - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Quiet exception" ) ) ); + AddLog( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OSL_LOG_PREFIX "Quiet exception") ) ); } m_pAntiImpl = NULL; @@ -520,11 +521,11 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor ::rtl::OUString aTempURL = GetNewTempFileURL( GetServiceFactory() ); try { - if ( aTempURL && xStream.is() ) + if ( aTempURL.getLength() && xStream.is() ) { uno::Reference < ucb::XSimpleFileAccess > xTempAccess( GetServiceFactory()->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -545,7 +546,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor catch( packages::WrongPasswordException& aWrongPasswordException ) { AddLog( aWrongPasswordException.Message ); - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); + AddLog( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow") ) ); KillFile( aTempURL, GetServiceFactory() ); throw; @@ -553,7 +554,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor catch( uno::Exception& aException ) { AddLog( aException.Message ); - AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); + AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow") ) ); KillFile( aTempURL, GetServiceFactory() ); throw; @@ -614,7 +615,7 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor { uno::Reference < ucb::XSimpleFileAccess > xTempAccess( GetServiceFactory()->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -670,7 +671,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetTempFileAsStream() // the temporary file is not used if the cache is used uno::Reference < ucb::XSimpleFileAccess > xTempAccess( GetServiceFactory()->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -715,7 +716,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream() // the temporary file is not used if the cache is used uno::Reference < ucb::XSimpleFileAccess > xTempAccess( GetServiceFactory()->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -795,7 +796,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt { xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value ); } - else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) aProps[nInd].Value >>= m_bUseCommonEncryption; else throw lang::IllegalArgumentException(); @@ -821,9 +822,9 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt throw uno::RuntimeException(); // set to be encrypted but do not use encryption key - xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ), + xPropertySet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ), uno::makeAny( uno::Sequence< sal_Int8 >() ) ); - xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "Encrypted" ), + xPropertySet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Encrypted") ), uno::makeAny( sal_True ) ); } @@ -902,7 +903,7 @@ void OWriteStream_Impl::Commit() for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAscii( "Size" ) ) + if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) { if ( m_pAntiImpl && !m_bHasInsertedStreamOptimization && m_pAntiImpl->m_xSeekable.is() ) { @@ -920,9 +921,9 @@ void OWriteStream_Impl::Commit() throw uno::RuntimeException(); // set to be encrypted but do not use encryption key - xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ), + xPropertySet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ), uno::makeAny( uno::Sequence< sal_Int8 >() ) ); - xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "Encrypted" ), + xPropertySet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Encrypted") ), uno::makeAny( sal_True ) ); } else if ( m_bHasCachedEncryptionData ) @@ -930,7 +931,7 @@ void OWriteStream_Impl::Commit() if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); - xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ), + xPropertySet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ), uno::makeAny( m_aEncryptionData.getUnpackedValueOrDefault( PACKAGE_ENCRYPTIONDATA_SHA1UTF8, uno::Sequence< sal_Int8 >() ) ) ); } @@ -1015,14 +1016,14 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aResult[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + if ( aResult[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) { aResult[nInd].Value <<= bUseCommonEncryption; return aResult; } aResult.realloc( ++nLen ); - aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); + aResult[nLen - 1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") ); aResult[nLen - 1].Value <<= bUseCommonEncryption; } else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) @@ -1039,14 +1040,14 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aResult[nInd].Name.equalsAscii( "RelationsInfo" ) ) + if ( aResult[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) { aResult[nInd].Value = aValue; return aResult; } aResult.realloc( ++nLen ); - aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "RelationsInfo" ); + aResult[nLen - 1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RelationsInfo") ); aResult[nLen - 1].Value = aValue; } @@ -1128,17 +1129,17 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) { - aResult[0].Name = ::rtl::OUString::createFromAscii("MediaType"); - aResult[1].Name = ::rtl::OUString::createFromAscii("Compressed"); - aResult[2].Name = ::rtl::OUString::createFromAscii("Size"); + aResult[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType") ); + aResult[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed") ); + aResult[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size") ); if ( m_nStorageType == embed::StorageFormats::PACKAGE ) - aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted"); + aResult[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Encrypted") ); } else { - aResult[0].Name = ::rtl::OUString::createFromAscii("Compressed"); - aResult[1].Name = ::rtl::OUString::createFromAscii("Size"); + aResult[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed") ); + aResult[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size") ); } @@ -1536,7 +1537,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io: uno::Reference < io::XStream > xTempFile; if ( !xTargetStream.is() ) xTempFile = uno::Reference < io::XStream >( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile") ) ), uno::UNO_QUERY ); else xTempFile = xTargetStream; @@ -1632,12 +1633,12 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar throw uno::RuntimeException(); sal_Bool bEncr = sal_False; - xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Encrypted" ) ) >>= bEncr; + xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) ) >>= bEncr; if ( !bEncr ) throw packages::NoEncryptionException(); uno::Sequence< sal_Int8 > aEncrKey; - xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ) ) >>= aEncrKey; + xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey") ) ) >>= aEncrKey; if ( !SequencesEqual( aNewKey, aEncrKey ) && !SequencesEqual( aOldKey, aEncrKey ) ) throw packages::WrongPasswordException(); @@ -1971,16 +1972,16 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea // now the properties can be copied // the order of the properties setting is not important for StorageStream API - ::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "Compressed" ); + ::rtl::OUString aPropName (RTL_CONSTASCII_USTRINGPARAM("Compressed") ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { - aPropName = ::rtl::OUString::createFromAscii( "MediaType" ); + aPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType" ) ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { - aPropName = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); + aPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); } } @@ -2462,7 +2463,7 @@ void OWriteStream::CloseOutput_Impl() for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( m_pImpl->m_aProps[nInd].Name.equalsAscii( "Size" ) ) + if ( m_pImpl->m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) m_pImpl->m_aProps[nInd].Value <<= ((sal_Int32)m_xSeekable->getLength()); } } @@ -2639,7 +2640,7 @@ void SAL_CALL OWriteStream::dispose() uno::Any aCaught( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( - ::rtl::OUString::createFromAscii( "Can not commit/revert the storage!\n" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can not commit/revert the storage!\n") ), uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -3195,7 +3196,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa } } else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE - && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) { sal_Bool bUseCommonEncryption = sal_False; if ( aValue >>= bUseCommonEncryption ) @@ -3227,7 +3228,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->m_aProps[nInd].Value = aValue; } } - else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfoStream" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfoStream" ) ) ) { uno::Reference< io::XInputStream > xInRelStream; if ( ( aValue >>= xInRelStream ) && xInRelStream.is() ) @@ -3248,7 +3249,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); // TODO } - else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfo" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) { if ( aValue >>= m_pImpl->m_aNewRelInfo ) { @@ -3256,10 +3257,10 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); // TODO } - else if ( aPropertyName.equalsAscii( "Size" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) throw beans::PropertyVetoException(); // TODO else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE - && ( aPropertyName.equalsAscii( "IsEncrypted" ) || aPropertyName.equalsAscii( "Encrypted" ) ) ) + && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) ) throw beans::PropertyVetoException(); // TODO else throw beans::UnknownPropertyException(); // TODO @@ -3283,21 +3284,21 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) throw lang::DisposedException(); } - if ( aProp.equalsAscii( "RelId" ) ) + if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelId" ) ) ) { return uno::makeAny( m_pImpl->GetNewRelId() ); } ::rtl::OUString aPropertyName; - if ( aProp.equalsAscii( "IsEncrypted" ) ) + if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) ) aPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ); else aPropertyName = aProp; if ( ( ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) - && aPropertyName.equalsAscii( "MediaType" ) ) - || ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "Encrypted" ) ) - || aPropertyName.equalsAscii( "Compressed" ) ) + && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + || ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Compressed" ) ) ) { m_pImpl->GetStreamProperties(); @@ -3308,9 +3309,9 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) } } else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE - && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) return uno::makeAny( m_pImpl->m_bUseCommonEncryption ); - else if ( aPropertyName.equalsAscii( "Size" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) { CheckInitOnDemand(); @@ -3510,7 +3511,7 @@ void SAL_CALL OWriteStream::commit() m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Problems on commit!" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Problems on commit!") ), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ), aCaught ); } @@ -3574,7 +3575,7 @@ void SAL_CALL OWriteStream::revert() m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) ); uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Problems on revert!" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Problems on revert!") ), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ), aCaught ); } @@ -3627,3 +3628,4 @@ void SAL_CALL OWriteStream::removeTransactionListener( const uno::Reference< emb } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index 08f862b22f6c..e3b8d583ccfb 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -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. @@ -189,10 +190,10 @@ public: void AddLog( const ::rtl::OUString& aMessage ); sal_Bool UsesCommonEncryption_Impl() { return m_bUseCommonEncryption; } - sal_Bool HasTempFile_Impl() { return ( m_aTempURL.getLength() != 0 ); } + sal_Bool HasTempFile_Impl() const { return ( m_aTempURL.getLength() != 0 ); } sal_Bool IsTransacted(); - sal_Bool HasWriteOwner_Impl() { return ( m_pAntiImpl != NULL ); } + sal_Bool HasWriteOwner_Impl() const { return ( m_pAntiImpl != NULL ); } void InsertIntoPackageFolder( const ::rtl::OUString& aName, @@ -203,7 +204,6 @@ public: sal_Bool HasCachedEncryptionData() { return m_bHasCachedEncryptionData; } ::comphelper::SequenceAsHashMap& GetCachedEncryptionData() { return m_aEncryptionData; } - sal_Bool IsModified() { return m_bHasDataToFlush || m_bFlushed; } sal_Bool IsEncrypted(); void SetDecrypted(); @@ -415,3 +415,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/register.cxx b/package/source/xstor/register.cxx index 808788345bfc..022091b0a3c9 100644 --- a/package/source/xstor/register.cxx +++ b/package/source/xstor/register.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. @@ -71,3 +72,4 @@ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServic } // extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/selfterminatefilestream.cxx b/package/source/xstor/selfterminatefilestream.cxx index 61df5e486250..bb4cde077011 100644 --- a/package/source/xstor/selfterminatefilestream.cxx +++ b/package/source/xstor/selfterminatefilestream.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. @@ -47,7 +48,7 @@ OSelfTerminateFileStream::OSelfTerminateFileStream( const uno::Reference< lang:: // otherwise an exception is thrown in constructor m_xFileAccess.set( xOwnFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY_THROW ); m_xInputStream.set( m_xFileAccess->openFileRead( aURL ), uno::UNO_SET_THROW ); @@ -151,3 +152,4 @@ sal_Int64 SAL_CALL OSelfTerminateFileStream::getLength() return m_xSeekable->getLength(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/selfterminatefilestream.hxx b/package/source/xstor/selfterminatefilestream.hxx index e0dde5d837e8..16bc65c5d6cd 100644 --- a/package/source/xstor/selfterminatefilestream.hxx +++ b/package/source/xstor/selfterminatefilestream.hxx @@ -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. @@ -74,3 +75,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx index 8756b1d61815..f43f96dd5744 100644 --- a/package/source/xstor/switchpersistencestream.cxx +++ b/package/source/xstor/switchpersistencestream.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. @@ -184,7 +185,7 @@ void SwitchablePersistenceStream::CopyAndSwitchPersistenceTo( const uno::Referen if ( !xTargetStream.is() ) { xTargetStream = uno::Reference < io::XStream >( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile") ) ), uno::UNO_QUERY_THROW ); xTargetSeek = uno::Reference< io::XSeekable >( xTargetStream, uno::UNO_QUERY_THROW ); @@ -486,3 +487,4 @@ void SAL_CALL SwitchablePersistenceStream::waitForCompletion() asyncOutputMonitor->waitForCompletion(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/switchpersistencestream.hxx b/package/source/xstor/switchpersistencestream.hxx index f37d0ed892fa..a1f47b4063db 100644 --- a/package/source/xstor/switchpersistencestream.hxx +++ b/package/source/xstor/switchpersistencestream.hxx @@ -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. @@ -118,3 +119,4 @@ public: #endif //_SPSTREAM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index 12aa89e03db0..e0e1ce8148e4 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.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. @@ -67,15 +68,15 @@ sal_Bool CheckPackageSignature_Impl( const uno::Reference< io::XInputStream >& x uno::Sequence< ::rtl::OUString > SAL_CALL OStorageFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.StorageFactory"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.StorageFactory"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory") ); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.StorageFactory") ); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OStorageFactory::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.StorageFactory"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.StorageFactory") ); } //------------------------------------------------------------------------- @@ -92,7 +93,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance() { // TODO: reimplement TempStream service to support XStream interface uno::Reference < io::XStream > xTempStream( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile") ) ), uno::UNO_QUERY ); if ( !xTempStream.is() ) @@ -165,7 +166,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr uno::Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess( m_xFactory->createInstance ( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); if ( !xTempAccess.is() ) @@ -195,23 +196,23 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr if ( aURL.getLength() ) { aPropsToSet.realloc(1); - aPropsToSet[0].Name = ::rtl::OUString::createFromAscii( "URL" ); + aPropsToSet[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL") ); aPropsToSet[0].Value <<= aURL; } for ( sal_Int32 nInd = 0, nNumArgs = 1; nInd < aDescr.getLength(); nInd++ ) { - if ( aDescr[nInd].Name.equalsAscii( "InteractionHandler" ) - || aDescr[nInd].Name.equalsAscii( "Password" ) - || aDescr[nInd].Name.equalsAscii( "RepairPackage" ) - || aDescr[nInd].Name.equalsAscii( "StatusIndicator" ) ) - // || aDescr[nInd].Name.equalsAscii( "Unpacked" ) // TODO: + if ( aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" ) ) + || aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) + || aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) + || aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StatusIndicator" ) ) ) + // || aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Unpacked" ) ) // TODO: { aPropsToSet.realloc( ++nNumArgs ); aPropsToSet[nNumArgs-1].Name = aDescr[nInd].Name; aPropsToSet[nNumArgs-1].Value = aDescr[nInd].Value; } - else if ( aDescr[nInd].Name.equalsAscii( "StorageFormat" ) ) + else if ( aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StorageFormat" ) ) ) { ::rtl::OUString aFormatName; sal_Int32 nFormatID = 0; @@ -322,3 +323,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OStorageFactory::getSupportedServiceNa return impl_staticGetSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/xfactory.hxx b/package/source/xstor/xfactory.hxx index cdc6c3abe584..86dca8dc264c 100644 --- a/package/source/xstor/xfactory.hxx +++ b/package/source/xstor/xfactory.hxx @@ -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. @@ -72,3 +73,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 851fea6b086b..79728a00a9d6 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.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. @@ -487,15 +488,15 @@ void OStorage_Impl::OpenOwnPackage() sal_Int32 nArgNum = 2; for ( sal_Int32 aInd = 0; aInd < m_xProperties.getLength(); aInd++ ) { - if ( m_xProperties[aInd].Name.equalsAscii( "RepairPackage" ) - || m_xProperties[aInd].Name.equalsAscii( "ProgressHandler" ) ) + if ( m_xProperties[aInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) + || m_xProperties[aInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ProgressHandler" ) ) ) { beans::NamedValue aNamedValue( m_xProperties[aInd].Name, m_xProperties[aInd].Value ); aArguments.realloc( ++nArgNum ); aArguments[nArgNum-1] <<= aNamedValue; } - else if ( m_xProperties[aInd].Name.equalsAscii( "Password" ) ) + else if ( m_xProperties[aInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) ) { // TODO: implement password setting for documents // the password entry must be removed after setting @@ -4843,7 +4844,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { - if ( aPropertyName.equalsAscii( "MediaType" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { aValue >>= m_pImpl->m_aMediaType; m_pImpl->m_bControlMediaType = sal_True; @@ -4851,7 +4852,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, m_pImpl->m_bBroadcastModified = sal_True; m_pImpl->m_bIsModified = sal_True; } - else if ( aPropertyName.equalsAscii( "Version" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Version" ) ) ) { aValue >>= m_pImpl->m_aVersion; m_pImpl->m_bControlVersion = sal_True; @@ -4863,20 +4864,20 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, m_pImpl->m_bIsModified = sal_True; } } - else if ( ( m_pData->m_bIsRoot && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) - || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) - || aPropertyName.equalsAscii( "IsInconsistent" ) - || aPropertyName.equalsAscii( "URL" ) - || aPropertyName.equalsAscii( "RepairPackage" ) ) ) - || aPropertyName.equalsAscii( "IsRoot" ) - || aPropertyName.equalsAscii( "MediaTypeFallbackUsed" ) ) + else if ( ( m_pData->m_bIsRoot && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasEncryptedEntries" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasNonEncryptedEntries" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsInconsistent" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsRoot" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaTypeFallbackUsed" ) ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); else throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { - if ( aPropertyName.equalsAscii( "RelationsInfoStream" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfoStream" ) ) ) { uno::Reference< io::XInputStream > xInRelStream; if ( ( aValue >>= xInRelStream ) && xInRelStream.is() ) @@ -4899,7 +4900,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); } - else if ( aPropertyName.equalsAscii( "RelationsInfo" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) { if ( aValue >>= m_pImpl->m_aRelInfo ) { @@ -4911,9 +4912,9 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); } - else if ( ( m_pData->m_bIsRoot && ( aPropertyName.equalsAscii( "URL" ) - || aPropertyName.equalsAscii( "RepairPackage" ) ) ) - || aPropertyName.equalsAscii( "IsRoot" ) ) + else if ( ( m_pData->m_bIsRoot && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsRoot" ) ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); else throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -4942,9 +4943,9 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa } if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE - && ( aPropertyName.equalsAscii( "MediaType" ) - || aPropertyName.equalsAscii( "MediaTypeFallbackUsed" ) - || aPropertyName.equalsAscii( "Version" ) ) ) + && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaTypeFallbackUsed" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Version" ) ) ) ) { try { @@ -4968,25 +4969,25 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa aCaught ); } - if ( aPropertyName.equalsAscii( "MediaType" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) return uno::makeAny( m_pImpl->m_aMediaType ); - else if ( aPropertyName.equalsAscii( "Version" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Version" ) ) ) return uno::makeAny( m_pImpl->m_aVersion ); else return uno::makeAny( m_pImpl->m_bMTFallbackUsed ); } - else if ( aPropertyName.equalsAscii( "IsRoot" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsRoot" ) ) ) { return uno::makeAny( m_pData->m_bIsRoot ); } - else if ( aPropertyName.equalsAscii( "OpenMode" ) ) + else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OpenMode" ) ) ) { return uno::makeAny( m_pImpl->m_nStorageMode ); } else if ( m_pData->m_bIsRoot ) { - if ( aPropertyName.equalsAscii( "URL" ) - || aPropertyName.equalsAscii( "RepairPackage" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) ) { for ( sal_Int32 aInd = 0; aInd < m_pImpl->m_xProperties.getLength(); aInd++ ) { @@ -4994,15 +4995,15 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa return m_pImpl->m_xProperties[aInd].Value; } - if ( aPropertyName.equalsAscii( "URL" ) ) + if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) ) return uno::makeAny( ::rtl::OUString() ); return uno::makeAny( sal_False ); // RepairPackage } else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE - && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) - || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) - || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) + && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasEncryptedEntries" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasNonEncryptedEntries" ) ) + || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsInconsistent" ) ) ) ) { try { m_pImpl->ReadContents(); @@ -5907,7 +5908,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: Currently it is only implemented for MediaType property of substorages, might be changed in future - if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || !aPropertyName.equalsAscii( "MediaType" ) ) + if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || !aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStorage ) @@ -6245,3 +6246,4 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index a49de3af6f3a..2811616424c0 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -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. @@ -296,8 +297,6 @@ class OStorage : public ::com::sun::star::lang::XTypeProvider , public ::com::sun::star::embed::XTransactedObject , public ::com::sun::star::embed::XTransactionBroadcaster , public ::com::sun::star::util::XModifiable - // , public ::com::sun::star::container::XNameAccess - // , public ::com::sun::star::lang::XComponent , public ::com::sun::star::embed::XEncryptionProtectedSource2 , public ::com::sun::star::beans::XPropertySet , public ::com::sun::star::embed::XOptimizedStorage @@ -851,3 +850,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/ByteChucker.cxx b/package/source/zipapi/ByteChucker.cxx index 3b93c4696148..8ff31dc49926 100644 --- a/package/source/zipapi/ByteChucker.cxx +++ b/package/source/zipapi/ByteChucker.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. @@ -110,3 +111,5 @@ ByteChucker& ByteChucker::operator << (sal_uInt32 nuInt32) WriteBytes( a4Sequence ); return *this; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 40998c3de70d..50546707d54e 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.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. @@ -189,3 +190,5 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt32& ruInt32) } return *this; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/CRC32.cxx b/package/source/zipapi/CRC32.cxx index 2ee6b1feea1a..bea1a3382ccd 100644 --- a/package/source/zipapi/CRC32.cxx +++ b/package/source/zipapi/CRC32.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. @@ -38,7 +39,6 @@ #include <PackageConstants.hxx> #include <com/sun/star/io/XInputStream.hpp> -using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::io; @@ -94,3 +94,5 @@ sal_Int32 SAL_CALL CRC32::updateStream( Reference < XInputStream > & xStream ) return nTotal; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/Deflater.cxx b/package/source/zipapi/Deflater.cxx index ac12a8cb5831..b2c1edb07cbc 100644 --- a/package/source/zipapi/Deflater.cxx +++ b/package/source/zipapi/Deflater.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. @@ -210,3 +211,5 @@ void SAL_CALL Deflater::end( ) } pStream = NULL; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/EntryInputStream.cxx b/package/source/zipapi/EntryInputStream.cxx index 671ef7381f9d..047f1716e0f5 100644 --- a/package/source/zipapi/EntryInputStream.cxx +++ b/package/source/zipapi/EntryInputStream.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. @@ -33,15 +34,16 @@ #include <rtl/digest.h> #include <memory.h> // for memcpy -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; +using ::rtl::OUString; + /** Provides access to the compressed data in a zipfile. * - * 04/12/00 - uncompresses the stream into memory and seeks on it 'in memory' + * uncompresses the stream into memory and seeks on it 'in memory' * This and the ZipPackageBuffer used in the ZipOutputStream are memory hogs * and will hopefully be replaced eventually * @@ -52,7 +54,7 @@ using namespace com::sun::star::packages::zip::ZipConstants; EntryInputStream::EntryInputStream( Reference < io::XInputStream > xNewInput, const ZipEntry & rNewEntry, - const vos::ORef < EncryptionData > &xEncryptData, + const rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bGetRawStream) : xStream( xNewInput ) , xSeek( xNewInput, UNO_QUERY ) @@ -199,3 +201,5 @@ sal_Int64 SAL_CALL EntryInputStream::getLength( ) { return nUncompressedSize; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/EntryInputStream.hxx b/package/source/zipapi/EntryInputStream.hxx index c04a5dc2d33b..8a5bf0dc835f 100644 --- a/package/source/zipapi/EntryInputStream.hxx +++ b/package/source/zipapi/EntryInputStream.hxx @@ -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. @@ -32,12 +33,8 @@ #include <com/sun/star/io/XSeekable.hpp> #include <Inflater.hxx> #include <com/sun/star/packages/zip/ZipEntry.hpp> -#ifndef _VOS_REF_H_ -#include <vos/ref.hxx> -#endif -#ifndef _ENCRYPTION_DATA_HXX +#include <rtl/ref.hxx> #include <EncryptionData.hxx> -#endif class EntryInputStream : public cppu::WeakImplHelper2< com::sun::star::io::XInputStream, com::sun::star::io::XSeekable > { @@ -47,7 +44,7 @@ protected: sal_Int64 nEnd, nCurrent, nUncompressedSize; sal_Bool bRawStream, bHaveInMemory, bEncrypted; com::sun::star::uno::Sequence < sal_Int8 > aBuffer; - const vos::ORef < EncryptionData > xEncryptionData; + const rtl::Reference < EncryptionData > xEncryptionData; const com::sun::star::packages::zip::ZipEntry aEntry; Inflater aInflater; void readIntoMemory() @@ -55,7 +52,7 @@ protected: public: EntryInputStream( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xInput, const com::sun::star::packages::zip::ZipEntry &rNewEntry, - const vos::ORef < EncryptionData > &xEncryptData, + const rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bGetRawStream = sal_False); virtual ~EntryInputStream(); @@ -84,3 +81,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx index e95809a35dad..26ba278cc9de 100644 --- a/package/source/zipapi/Inflater.cxx +++ b/package/source/zipapi/Inflater.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. @@ -160,3 +161,4 @@ sal_Int32 Inflater::doInflateBytes (Sequence < sal_Int8 > &rBuffer, sal_Int32 n return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx index 8a8d96556bae..5e167490d632 100644 --- a/package/source/zipapi/MemoryByteGrabber.hxx +++ b/package/source/zipapi/MemoryByteGrabber.hxx @@ -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. @@ -175,3 +176,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XFileStream.cxx b/package/source/zipapi/XFileStream.cxx index 9e7156ee82b3..6afe8079c5ec 100644 --- a/package/source/zipapi/XFileStream.cxx +++ b/package/source/zipapi/XFileStream.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. @@ -45,7 +46,7 @@ using ::rtl::OUString; XFileStream::XFileStream( ZipEntry & rEntry, com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream, com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewTempStream, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bNewRawStream, sal_Bool bIsEncrypted ) : maEntry ( rEntry ) @@ -225,3 +226,5 @@ sal_Int64 SAL_CALL XFileStream::getLength( ) { return mnZipSize; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XFileStream.hxx b/package/source/zipapi/XFileStream.hxx index 0cf82c5f35cd..51518de9591c 100644 --- a/package/source/zipapi/XFileStream.hxx +++ b/package/source/zipapi/XFileStream.hxx @@ -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. @@ -31,12 +32,8 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <cppuhelper/implbase2.hxx> -#ifndef _VOS_REF_H_ -#include <vos/ref.hxx> -#endif -#ifndef _INFLATER_HXX +#include <rtl/ref.hxx> #include <Inflater.hxx> -#endif #include <ZipEntry.hxx> namespace com { namespace sun { namespace star { @@ -58,7 +55,7 @@ protected: com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > mxTempOut; com::sun::star::uno::Sequence < sal_Int8 > maBuffer, maCompBuffer; ZipEntry maEntry; - vos::ORef < EncryptionData > mxData; + rtl::Reference < EncryptionData > mxData; rtlCipher maCipher; Inflater maInflater; sal_Bool mbRawStream, mbFinished; @@ -69,7 +66,7 @@ public: XFileStream( ZipEntry & rEntry, com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream, com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewTempStream, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bRawStream, sal_Bool bIsEncrypted ); virtual ~XFileStream(); @@ -94,3 +91,5 @@ public: throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XMemoryStream.cxx b/package/source/zipapi/XMemoryStream.cxx index c5ffe9ac874c..7003bf1b814b 100644 --- a/package/source/zipapi/XMemoryStream.cxx +++ b/package/source/zipapi/XMemoryStream.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. @@ -50,3 +51,5 @@ XMemoryStream::~XMemoryStream(void) static_cast< XInputStream* > ( this ) , static_cast< XSeekable* > ( this ) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XMemoryStream.hxx b/package/source/zipapi/XMemoryStream.hxx index 89db08a6c4ed..935712abbe42 100644 --- a/package/source/zipapi/XMemoryStream.hxx +++ b/package/source/zipapi/XMemoryStream.hxx @@ -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,3 +41,5 @@ public: throw(com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index a75af35914a1..1cad883f972a 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.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. @@ -57,7 +58,7 @@ using ::rtl::OUString; XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder, ZipEntry & rEntry, Reference < XInputStream > xNewZipStream, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Int8 nStreamMode, sal_Bool bIsEncrypted, const ::rtl::OUString& aMediaType, @@ -90,7 +91,7 @@ XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder, mnZipSize = maEntry.nSize; mnZipEnd = maEntry.nMethod == DEFLATED ? maEntry.nOffset + maEntry.nCompressedSize : maEntry.nOffset + maEntry.nSize; } - sal_Bool bHaveEncryptData = ( !rData.isEmpty() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False; + sal_Bool bHaveEncryptData = ( rData.is() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False; sal_Bool bMustDecrypt = ( nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False; if ( bMustDecrypt ) @@ -115,7 +116,7 @@ XUnbufferedStream::XUnbufferedStream( SotMutexHolderRef aMutexHolder, // allows to read package raw stream XUnbufferedStream::XUnbufferedStream( const Reference < XInputStream >& xRawStream, - const vos::ORef < EncryptionData > &rData ) + const rtl::Reference < EncryptionData > &rData ) : maMutexHolder( new SotMutexHolder ) , mxZipStream ( xRawStream ) , mxZipSeek ( xRawStream, UNO_QUERY ) @@ -168,10 +169,12 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa if ( mnMyCurrent + nRequestedBytes > mnZipSize + maHeader.getLength() ) nRequestedBytes = static_cast < sal_Int32 > ( mnZipSize + maHeader.getLength() - mnMyCurrent ); - sal_Int32 nRead = 0, nLastRead = 0, nTotal = 0; + sal_Int32 nTotal = 0; aData.realloc ( nRequestedBytes ); if ( nRequestedBytes ) { + sal_Int32 nRead = 0; + sal_Int32 nLastRead = 0; if ( mbRawStream ) { sal_Int64 nDiff = mnZipEnd - mnZipCurrent; @@ -300,8 +303,8 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa if ( 0 ) { uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - uno::Reference< ucb::XSimpleFileAccess > xAccess( xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY ); - uno::Reference< io::XOutputStream > xOut = xAccess->openFileWrite( ::rtl::OUString::createFromAscii( "file:///d:/777/Encrypted/picture" ) ); + uno::Reference< ucb::XSimpleFileAccess > xAccess( xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOut = xAccess->openFileWrite(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "file:///d:/777/Encrypted/picture") ) ); xOut->writeBytes( aData ); xOut->closeOutput(); } @@ -358,3 +361,5 @@ sal_Int64 SAL_CALL XUnbufferedStream::getLength( ) return mnZipSize; } */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx index 321ec10b8032..0de13efd6340 100644 --- a/package/source/zipapi/XUnbufferedStream.hxx +++ b/package/source/zipapi/XUnbufferedStream.hxx @@ -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. @@ -27,13 +28,12 @@ #ifndef _XUNBUFFERED_STREAM_HXX #define _XUNBUFFERED_STREAM_HXX -#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <cppuhelper/implbase1.hxx> -#include <vos/ref.hxx> +#include <rtl/ref.hxx> #include <Inflater.hxx> #include <ZipEntry.hxx> #include <CRC32.hxx> @@ -57,7 +57,7 @@ protected: com::sun::star::uno::Reference < com::sun::star::io::XSeekable > mxZipSeek; com::sun::star::uno::Sequence < sal_Int8 > maCompBuffer, maHeader; ZipEntry maEntry; - vos::ORef < EncryptionData > mxData; + rtl::Reference < EncryptionData > mxData; rtlCipher maCipher; Inflater maInflater; sal_Bool mbRawStream, mbWrappedRaw, mbFinished; @@ -71,7 +71,7 @@ public: SotMutexHolderRef aMutexHolder, ZipEntry & rEntry, com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewZipStream, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Int8 nStreamMode, sal_Bool bIsEncrypted, const ::rtl::OUString& aMediaType, @@ -79,7 +79,7 @@ public: // allows to read package raw stream XUnbufferedStream( const com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xRawStream, - const vos::ORef < EncryptionData > &rData ); + const rtl::Reference < EncryptionData > &rData ); virtual ~XUnbufferedStream(); @@ -106,3 +106,5 @@ public: */ }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/ZipEnumeration.cxx b/package/source/zipapi/ZipEnumeration.cxx index 367c29f6d4a7..767aacc92a54 100644 --- a/package/source/zipapi/ZipEnumeration.cxx +++ b/package/source/zipapi/ZipEnumeration.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. @@ -51,3 +52,5 @@ const ZipEntry* SAL_CALL ZipEnumeration::nextElement() else return NULL; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index dcd5669897e3..080005b66128 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.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. @@ -44,17 +45,13 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> -#ifndef _CRC32_HXX_ #include <CRC32.hxx> -#endif #include <string.h> // for memcpy #include <vector> #include <comphelper/storagehelper.hxx> -using namespace vos; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::io; using namespace com::sun::star::uno; @@ -64,6 +61,7 @@ using namespace com::sun::star::packages; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; +using rtl::OUString; /** This class is used to read entries from a zip file */ @@ -126,10 +124,10 @@ void ZipFile::setInputStream ( Reference < XInputStream > xNewStream ) aGrabber.setInputStream ( xStream ); } -sal_Bool ZipFile::StaticGetCipher ( const ORef < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode ) +sal_Bool ZipFile::StaticGetCipher ( const rtl::Reference < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode ) { sal_Bool bResult = sal_False; - if ( ! xEncryptionData.isEmpty() ) + if ( xEncryptionData.is() ) { Sequence < sal_uInt8 > aDerivedKey (16); rtlCipherError aResult; @@ -157,7 +155,7 @@ sal_Bool ZipFile::StaticGetCipher ( const ORef < EncryptionData > & xEncryptionD return bResult; } -void ZipFile::StaticFillHeader ( const ORef < EncryptionData > & rData, +void ZipFile::StaticFillHeader ( const rtl::Reference < EncryptionData > & rData, sal_Int32 nSize, const ::rtl::OUString& aMediaType, sal_Int8 * & pHeader ) @@ -224,7 +222,7 @@ void ZipFile::StaticFillHeader ( const ORef < EncryptionData > & rData, pHeader += nMediaTypeLength; } -sal_Bool ZipFile::StaticFillData ( ORef < EncryptionData > & rData, +sal_Bool ZipFile::StaticFillData ( rtl::Reference < EncryptionData > & rData, sal_Int32 &rSize, ::rtl::OUString& aMediaType, Reference < XInputStream > &rStream ) @@ -289,11 +287,11 @@ sal_Bool ZipFile::StaticFillData ( ORef < EncryptionData > & rData, } Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< XInputStream >& xStream, - const ORef < EncryptionData > &rData ) + const rtl::Reference < EncryptionData > &rData ) throw ( packages::WrongPasswordException, ZipIOException, RuntimeException ) { - if ( rData.isEmpty() ) - throw ZipIOException( OUString::createFromAscii( "Encrypted stream without encryption data!\n" ), + if ( !rData.is() ) + throw ZipIOException( OUString(RTL_CONSTASCII_USTRINGPARAM( "Encrypted stream without encryption data!\n" )), Reference< XInterface >() ); if ( !rData->aKey.getLength() ) @@ -301,7 +299,7 @@ Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< Reference< XSeekable > xSeek( xStream, UNO_QUERY ); if ( !xSeek.is() ) - throw ZipIOException( OUString::createFromAscii( "The stream must be seekable!\n" ), + throw ZipIOException( OUString(RTL_CONSTASCII_USTRINGPARAM( "The stream must be seekable!\n" )), Reference< XInterface >() ); @@ -329,9 +327,9 @@ Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const Reference< return new XUnbufferedStream ( xStream, rData ); } -sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffer, const ORef < EncryptionData > &rData ) +sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffer, const rtl::Reference < EncryptionData > &rData ) { - if ( !rData.isValid() || !rData->aKey.getLength() ) + if ( !rData.is() || !rData->aKey.getLength() ) return sal_False; sal_Bool bRet = sal_False; @@ -360,6 +358,7 @@ sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffe aDigestResult = rtl_digest_getSHA1 ( aDigest, aDigestSeq.getArray(), RTL_DIGEST_LENGTH_SHA1 ); OSL_ASSERT ( aDigestResult == rtl_Digest_E_None ); + (void)aDigestResult; // If we don't have a digest, then we have to assume that the password is correct if ( rData->aDigest.getLength() != 0 && @@ -378,7 +377,7 @@ sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffe return bRet; } -sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const ORef < EncryptionData > &rData ) +sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const rtl::Reference < EncryptionData > &rData ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -402,7 +401,7 @@ sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const ORef < EncryptionD #if 0 Reference < XInputStream > ZipFile::createFileStream( ZipEntry & rEntry, - const ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bRawStream, sal_Bool bIsEncrypted ) { @@ -412,7 +411,7 @@ Reference < XInputStream > ZipFile::createFileStream( } Reference < XInputStream > ZipFile::createMemoryStream( ZipEntry & rEntry, - const ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bRawStream, sal_Bool bIsEncrypted ) { @@ -435,7 +434,7 @@ Reference < XInputStream > ZipFile::createMemoryStream( // we have the salt. If we have the salt, then check if we have the encryption key // if not, return rawStream instead. - sal_Bool bHaveEncryptData = ( !rData.isEmpty() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False; + sal_Bool bHaveEncryptData = ( rData.is() && rData->aSalt.getLength() && rData->aInitVector.getLength() && rData->nIterationCount != 0 ) ? sal_True : sal_False; sal_Bool bMustDecrypt = ( !bRawStream && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False; if ( bMustDecrypt ) @@ -495,7 +494,7 @@ Reference < XInputStream > ZipFile::createMemoryStream( Reference < XInputStream > ZipFile::createUnbufferedStream( SotMutexHolderRef aMutexHolder, ZipEntry & rEntry, - const ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Int8 nStreamMode, sal_Bool bIsEncrypted, ::rtl::OUString aMediaType ) @@ -512,7 +511,7 @@ ZipEnumeration * SAL_CALL ZipFile::entries( ) } Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bIsEncrypted, SotMutexHolderRef aMutexHolder ) throw(IOException, ZipException, RuntimeException) @@ -529,7 +528,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry, // if we have a digest, then this file is an encrypted one and we should // check if we can decrypt it or not - if ( bIsEncrypted && !rData.isEmpty() && rData->aDigest.getLength() ) + if ( bIsEncrypted && rData.is() && rData->aDigest.getLength() ) bNeedRawStream = !hasValidPassword ( rEntry, rData ); return createUnbufferedStream ( aMutexHolder, @@ -540,7 +539,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry, } Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bIsEncrypted, SotMutexHolderRef aMutexHolder ) throw ( packages::WrongPasswordException, @@ -560,8 +559,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry, { // in case no digest is provided there is no way // to detect password correctness - if ( rData.isEmpty() ) - throw ZipException( OUString::createFromAscii( "Encrypted stream without encryption data!\n" ), + if ( !rData.is() ) + throw ZipException( OUString(RTL_CONSTASCII_USTRINGPARAM( "Encrypted stream without encryption data!\n" )), Reference< XInterface >() ); // if we have a digest, then this file is an encrypted one and we should @@ -581,7 +580,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry, } Reference< XInputStream > SAL_CALL ZipFile::getRawData( ZipEntry& rEntry, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, sal_Bool bIsEncrypted, SotMutexHolderRef aMutexHolder ) throw(IOException, ZipException, RuntimeException) @@ -596,7 +595,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getRawData( ZipEntry& rEntry, Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream( ZipEntry& rEntry, - const vos::ORef < EncryptionData > &rData, + const rtl::Reference < EncryptionData > &rData, const ::rtl::OUString& aMediaType, SotMutexHolderRef aMutexHolder ) throw ( packages::NoEncryptionException, @@ -606,7 +605,7 @@ Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream( { ::osl::MutexGuard aGuard( m_aMutex ); - if ( rData.isEmpty() ) + if ( !rData.is() ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( rEntry.nOffset <= 0 ) @@ -640,29 +639,38 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry ) aGrabber >> nExtraLen; rEntry.nOffset = static_cast < sal_Int32 > (aGrabber.getPosition()) + nPathLen + nExtraLen; - // read always in UTF8, some tools seem not to set UTF8 bit - uno::Sequence < sal_Int8 > aNameBuffer( nPathLen ); - sal_Int32 nRead = aGrabber.readBytes( aNameBuffer, nPathLen ); - if ( nRead < aNameBuffer.getLength() ) - aNameBuffer.realloc( nRead ); + sal_Bool bBroken = sal_False; - ::rtl::OUString sLOCPath = rtl::OUString::intern( (sal_Char *) aNameBuffer.getArray(), - aNameBuffer.getLength(), - RTL_TEXTENCODING_UTF8 ); + try + { + // read always in UTF8, some tools seem not to set UTF8 bit + uno::Sequence < sal_Int8 > aNameBuffer( nPathLen ); + sal_Int32 nRead = aGrabber.readBytes( aNameBuffer, nPathLen ); + if ( nRead < aNameBuffer.getLength() ) + aNameBuffer.realloc( nRead ); - if ( rEntry.nPathLen == -1 ) // the file was created + ::rtl::OUString sLOCPath = rtl::OUString::intern( (sal_Char *) aNameBuffer.getArray(), + aNameBuffer.getLength(), + RTL_TEXTENCODING_UTF8 ); + + if ( rEntry.nPathLen == -1 ) // the file was created + { + rEntry.nPathLen = nPathLen; + rEntry.sPath = sLOCPath; + } + + // the method can be reset for internal use so it is not checked + bBroken = rEntry.nVersion != nVersion + || rEntry.nFlag != nFlag + || rEntry.nTime != nTime + || rEntry.nPathLen != nPathLen + || !rEntry.sPath.equals( sLOCPath ); + } + catch(::std::bad_alloc &) { - rEntry.nPathLen = nPathLen; - rEntry.sPath = sLOCPath; + bBroken = sal_True; } - // the method can be reset for internal use so it is not checked - sal_Bool bBroken = rEntry.nVersion != nVersion - || rEntry.nFlag != nFlag - || rEntry.nTime != nTime - || rEntry.nPathLen != nPathLen - || !rEntry.sPath.equals( sLOCPath ); - if ( bBroken && !bRecoveryMode ) throw ZipIOException( OUString( RTL_CONSTASCII_USTRINGPARAM( "The stream seems to be broken!" ) ), Reference< XInterface >() ); @@ -846,7 +854,7 @@ sal_Int32 ZipFile::recover() // the buffer should contain at least one header, // or if it is end of the file, at least the postheader with sizes and hash while( nPos < nBufSize - 30 - || ( aBuffer.getLength() < nToRead && nPos < nBufSize - 16 ) ) + || ( nBufSize < nToRead && nPos < nBufSize - 16 ) ) { if ( nPos < nBufSize - 30 && pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 3 && pBuffer[nPos+3] == 4 ) @@ -928,7 +936,7 @@ sal_Int32 ZipFile::recover() aMemGrabber >> nCompressedSize; aMemGrabber >> nSize; - for( EntryHash::iterator aIter = aEntries.begin(); aIter != aEntries.end(); aIter++ ) + for( EntryHash::iterator aIter = aEntries.begin(); aIter != aEntries.end(); ++aIter ) { ZipEntry aTmp = (*aIter).second; @@ -1060,3 +1068,4 @@ void ZipFile::getSizeAndCRC( sal_Int32 nOffset, sal_Int32 nCompressedSize, sal_I *nCRC = aCRC.getValue(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 16457ec12493..1ba30b2cb3d3 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.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. @@ -34,12 +35,11 @@ #include <PackageConstants.hxx> #include <ZipEntry.hxx> #include <ZipFile.hxx> -#include <vos/ref.hxx> +#include <rtl/ref.hxx> #include <com/sun/star/io/XOutputStream.hpp> #include <comphelper/storagehelper.hxx> -using namespace rtl; using namespace com::sun::star::io; using namespace com::sun::star::uno; using namespace com::sun::star::packages; @@ -80,7 +80,7 @@ void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel ) } void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry, - vos::ORef < EncryptionData > &xEncryptData, + rtl::Reference < EncryptionData > &xEncryptData, sal_Bool bEncrypt) throw(IOException, RuntimeException) { @@ -105,7 +105,7 @@ void SAL_CALL ZipOutputStream::putNextEntry( ZipEntry& rEntry, aDigest = rtl_digest_createSHA1(); mnDigested = 0; rEntry.nFlag |= 1 << 4; - pCurrentEncryptData = xEncryptData.getBodyPtr(); + pCurrentEncryptData = xEncryptData.get(); } sal_Int32 nLOCLength = writeLOC(rEntry); rEntry.nOffset = static_cast < sal_Int32 > (aChucker.GetPosition()) - nLOCLength; @@ -133,7 +133,6 @@ void SAL_CALL ZipOutputStream::closeEntry( ) } if (pEntry->nCompressedSize != aDeflater.getTotalOut()) { - //VOS_DEBUG_ONLY("Invalid entry compressed size"); // Different compression strategies make the merit of this // test somewhat dubious pEntry->nCompressedSize = aDeflater.getTotalOut(); @@ -175,6 +174,7 @@ void SAL_CALL ZipOutputStream::closeEntry( ) reinterpret_cast < sal_uInt8 * > ( pCurrentEncryptData->aDigest.getArray() ), RTL_DIGEST_LENGTH_SHA1 ); OSL_ASSERT( aDigestResult == rtl_Digest_E_None ); + (void)aDigestResult; rtl_digest_destroySHA1 ( aDigest ); } pCurrentEntry = NULL; @@ -261,6 +261,7 @@ void ZipOutputStream::doDeflate() mnDigested = mnDigested + nEat; } OSL_ASSERT( aDigestResult == rtl_Digest_E_None ); + (void)aDigestResult; aEncryptionBuffer.realloc ( nLength ); @@ -268,6 +269,7 @@ void ZipOutputStream::doDeflate() aCipherResult = rtl_cipher_encode ( aCipher, pTmpBuffer, nLength, reinterpret_cast < sal_uInt8 * > (aEncryptionBuffer.getArray()), nLength ); OSL_ASSERT( aCipherResult == rtl_Cipher_E_None ); + (void)aCipherResult; aChucker.WriteBytes( aEncryptionBuffer ); aCRC.update ( aEncryptionBuffer ); @@ -427,3 +429,4 @@ void ZipOutputStream::dosDateToTMDate ( tm &rTime, sal_uInt32 nDosDate) } */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zipapi/makefile.mk b/package/source/zipapi/makefile.mk index a9548ace659b..1b941fadd99b 100644 --- a/package/source/zipapi/makefile.mk +++ b/package/source/zipapi/makefile.mk @@ -37,7 +37,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- .IF "$(L10N_framework)"=="" -#CFLAGS+=/Ob0 /Od .IF "$(SYSTEM_ZLIB)" == "YES" CFLAGS+=-DSYSTEM_ZLIB .ENDIF diff --git a/package/source/zippackage/ContentInfo.hxx b/package/source/zippackage/ContentInfo.hxx index 6d88d17e3780..baf5078147a2 100644 --- a/package/source/zippackage/ContentInfo.hxx +++ b/package/source/zippackage/ContentInfo.hxx @@ -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. @@ -28,9 +29,7 @@ #define _CONTENT_INFO_HXX_ #include <com/sun/star/container/XNameContainer.hpp> -#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEl_HPP_ #include <com/sun/star/lang/XUnoTunnel.hpp> -#endif #include <ZipPackageFolder.hxx> #include <ZipPackageStream.hxx> @@ -67,3 +66,5 @@ public: }; } } } } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index fca0e09f63bd..afc913237023 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.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. @@ -37,7 +38,6 @@ #include <ZipFile.hxx> #include <PackageConstants.hxx> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/packages/zip/ZipConstants.hpp> #include <com/sun/star/packages/manifest/XManifestReader.hpp> #include <com/sun/star/packages/manifest/XManifestWriter.hpp> @@ -84,7 +84,6 @@ #include <comphelper/ofopxmlhelper.hxx> #include <comphelper/documentconstants.hxx> -using namespace rtl; using namespace std; using namespace osl; using namespace cppu; @@ -103,6 +102,9 @@ using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::manifest; using namespace com::sun::star::packages::zip::ZipConstants; +using ::rtl::OUString; +using ::rtl::OString; + #define LOGFILE_AUTHOR "mg115289" @@ -208,7 +210,7 @@ ZipPackage::~ZipPackage( void ) #if 0 // As all folders and streams contain references to their parents, // we must remove these references so that they will be deleted when - // the hash_map of the root folder is cleared, releasing all subfolders + // the boost::unordered_map of the root folder is cleared, releasing all subfolders // and substreams which in turn release theirs, etc. When m_xRootFolder is // released when this destructor completes, the folder tree should be // deleted fully (and automagically). @@ -595,18 +597,18 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) do { ::rtl::OUString aCommand = aParam.getToken( 0, '&', nIndex ); - if ( aCommand.equals( OUString::createFromAscii( "repairpackage" ) ) ) + if ( aCommand.equals( OUString(RTL_CONSTASCII_USTRINGPARAM( "repairpackage" )) ) ) { m_bForceRecovery = sal_True; break; } - else if ( aCommand.equals( OUString::createFromAscii( "purezip" ) ) ) + else if ( aCommand.equals( OUString(RTL_CONSTASCII_USTRINGPARAM( "purezip" )) ) ) { m_nFormat = embed::StorageFormats::ZIP; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); break; } - else if ( aCommand.equals( OUString::createFromAscii( "ofopxml" ) ) ) + else if ( aCommand.equals( OUString(RTL_CONSTASCII_USTRINGPARAM( "ofopxml" )) ) ) { m_nFormat = embed::StorageFormats::OFOPXML; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); @@ -619,7 +621,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) m_aURL = aParamUrl; Content aContent ( m_aURL, uno::Reference < XCommandEnvironment >() ); - Any aAny = aContent.getPropertyValue( OUString::createFromAscii( "Size" ) ); + Any aAny = aContent.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "Size" )) ); sal_uInt64 aSize = 0; // kind of optimisation: treat empty files as nonexistent files // and write to such files directly. Note that "Size" property is optional. @@ -653,9 +655,9 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) } else if ( ( aArguments[ind] >>= aNamedValue ) ) { - if ( aNamedValue.Name.equalsAscii( "RepairPackage" ) ) + if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) ) aNamedValue.Value >>= m_bForceRecovery; - else if ( aNamedValue.Name.equalsAscii( "PackageFormat" ) ) + else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PackageFormat" ) ) ) { // setting this argument to true means Package format // setting it to false means plain Zip format @@ -667,7 +669,7 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } - else if ( aNamedValue.Name.equalsAscii( "StorageFormat" ) ) + else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StorageFormat" ) ) ) { ::rtl::OUString aFormatName; sal_Int32 nFormatID = 0; @@ -696,14 +698,14 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } - else if ( aNamedValue.Name.equalsAscii( "AllowRemoveOnInsert" ) ) + else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AllowRemoveOnInsert" ) ) ) { aNamedValue.Value >>= m_bAllowRemoveOnInsert; m_pRootFolder->setRemoveOnInsertMode_Impl( m_bAllowRemoveOnInsert ); } // for now the progress handler is not used, probably it will never be - // if ( aNamedValue.Name.equalsAscii( "ProgressHandler" ) + // if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ProgressHandler" ) ) } else { @@ -979,14 +981,14 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut ) try { - vos::ORef < EncryptionData > xEmpty; + rtl::Reference < EncryptionData > xEmpty; aZipOut.putNextEntry( *pEntry, xEmpty ); aZipOut.write( aType, 0, nBufferLength ); aZipOut.closeEntry(); } catch ( ::com::sun::star::io::IOException & r ) { - VOS_ENSURE( 0, "Error adding mimetype to the ZipOutputStream" ); + OSL_ENSURE( 0, "Error adding mimetype to the ZipOutputStream" ); throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ), static_cast < OWeakObject * > ( this ), @@ -1016,7 +1018,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence Sequence < PropertyValue > * pSequence = aManifestSequence.getArray(); for (vector < Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end(); aIter != aEnd; - aIter++, pSequence++) + ++aIter, ++pSequence) *pSequence= (*aIter); xWriter->writeManifestSequence ( xManOutStream, aManifestSequence ); @@ -1024,14 +1026,14 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence pBuffer->realloc( nBufferLength ); // the manifest.xml is never encrypted - so pass an empty reference - vos::ORef < EncryptionData > xEmpty; + rtl::Reference < EncryptionData > xEmpty; aZipOut.putNextEntry( *pEntry, xEmpty ); aZipOut.write( pBuffer->getSequence(), 0, nBufferLength ); aZipOut.closeEntry(); } else { - VOS_ENSURE ( 0, "Couldn't get a ManifestWriter!" ); + OSL_ENSURE ( 0, "Couldn't get a ManifestWriter!" ); IOException aException; throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Couldn't get a ManifestWriter!" ) ), @@ -1062,7 +1064,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< Sequ for ( vector< uno::Sequence< beans::PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end(); aIter != aEnd; - aIter++) + ++aIter) { ::rtl::OUString aPath; ::rtl::OUString aType; @@ -1087,7 +1089,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< Sequ pBuffer->realloc( nBufferLength ); // there is no encryption in this format currently - vos::ORef < EncryptionData > xEmpty; + rtl::Reference < EncryptionData > xEmpty; aZipOut.putNextEntry( *pEntry, xEmpty ); aZipOut.write( pBuffer->getSequence(), 0, nBufferLength ); aZipOut.closeEntry(); @@ -1312,7 +1314,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() { Exception aDetect; sal_Int64 aSize = 0; - Any aAny = aOriginalContent.setPropertyValue( OUString::createFromAscii( "Size" ), makeAny( aSize ) ); + Any aAny = aOriginalContent.setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "Size" )), makeAny( aSize ) ); if( !( aAny >>= aDetect ) ) bTruncSuccess = sal_True; } @@ -1335,7 +1337,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() aArg.Sink = xSink; aArg.Properties = Sequence< Property >( 0 ); // unused - aOriginalContent.executeCommand( OUString::createFromAscii( "open" ), makeAny( aArg ) ); + aOriginalContent.executeCommand( OUString(RTL_CONSTASCII_USTRINGPARAM( "open" )), makeAny( aArg ) ); } catch( Exception& ) { @@ -1434,7 +1436,7 @@ void SAL_CALL ZipPackage::commitChanges() { // write directly in case of local file uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleAccess( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess") ) ), uno::UNO_QUERY ); OSL_ENSURE( xSimpleAccess.is(), "Can't instatiate SimpleFileAccess service!\n" ); uno::Reference< io::XTruncate > xOrigTruncate; @@ -1530,9 +1532,9 @@ void ZipPackage::DisconnectFromTargetAndThrowException_Impl( const uno::Referenc ::rtl::OUString aTempURL; try { uno::Reference< beans::XPropertySet > xTempFile( xTempStream, uno::UNO_QUERY_THROW ); - uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString::createFromAscii( "Uri" ) ); + uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri") ) ); aUrl >>= aTempURL; - xTempFile->setPropertyValue( ::rtl::OUString::createFromAscii( "RemoveFile" ), + xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile") ), uno::makeAny( sal_False ) ); } catch ( uno::Exception& ) @@ -1711,3 +1713,5 @@ void SAL_CALL ZipPackage::removeVetoableChangeListener( const OUString& /*Proper throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageBuffer.cxx b/package/source/zippackage/ZipPackageBuffer.cxx index e6468c8539f0..d6a20eb0b96c 100644 --- a/package/source/zippackage/ZipPackageBuffer.cxx +++ b/package/source/zippackage/ZipPackageBuffer.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. @@ -134,3 +135,5 @@ sal_Int64 SAL_CALL ZipPackageBuffer::getLength( ) { return m_nEnd; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageEntry.cxx b/package/source/zippackage/ZipPackageEntry.cxx index 7514e7b6f55a..df789850189f 100644 --- a/package/source/zippackage/ZipPackageEntry.cxx +++ b/package/source/zippackage/ZipPackageEntry.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. @@ -37,7 +38,6 @@ #include <comphelper/storagehelper.hxx> -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -45,6 +45,8 @@ using namespace com::sun::star::container; using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; +using rtl::OUString; + ZipPackageEntry::ZipPackageEntry ( bool bNewFolder ) : mbIsFolder ( bNewFolder ) , mbAllowRemoveOnInsert( sal_True ) @@ -134,3 +136,5 @@ void SAL_CALL ZipPackageEntry::removeVetoableChangeListener( const OUString& /*P throw(beans::UnknownPropertyException, WrappedTargetException, RuntimeException) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageEntry.hxx b/package/source/zippackage/ZipPackageEntry.hxx index 767d84511a12..6ae623a50664 100644 --- a/package/source/zippackage/ZipPackageEntry.hxx +++ b/package/source/zippackage/ZipPackageEntry.hxx @@ -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. @@ -32,9 +33,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/container/XNameContainer.hpp> -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif #include <ZipEntry.hxx> #include <cppuhelper/implbase5.hxx> @@ -103,3 +102,5 @@ public: throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index ba83b34910ed..5816b070a152 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.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. @@ -35,7 +36,7 @@ #include <ZipPackageFolderEnumeration.hxx> #include <com/sun/star/packages/zip/ZipConstants.hpp> #include <com/sun/star/embed/StorageFormats.hpp> -#include <vos/diagnose.hxx> +#include <osl/diagnose.h> #include <osl/time.h> #include <rtl/digest.h> #include <ContentInfo.hxx> @@ -55,11 +56,10 @@ using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::io; using namespace cppu; -using namespace rtl; using namespace std; using namespace ::com::sun::star; -using vos::ORef; +using rtl::OUString; namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; } ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory, @@ -97,7 +97,7 @@ sal_Bool ZipPackageFolder::LookForUnexpectedODF12Streams( const ::rtl::OUString& for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); !bHasUnexpected && aCI != aEnd; - aCI++) + ++aCI) { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -155,7 +155,7 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); aCI != aEnd; - aCI++) + ++aCI) { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -333,25 +333,25 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr try { - vos::ORef < EncryptionData > aEmptyEncr; + rtl::Reference < EncryptionData > aEmptyEncr; rZipOut.putNextEntry ( *pTempEntry, aEmptyEncr, sal_False ); rZipOut.rawCloseEntry(); } catch ( ZipException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } catch ( IOException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } } for ( ContentHash::const_iterator aCI = maContents.begin(), aEnd = maContents.end(); aCI != aEnd; - aCI++) + ++aCI) { const OUString &rShortName = (*aCI).first; const ContentInfo &rInfo = *(*aCI).second; @@ -439,7 +439,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr if ( !xStream.is() ) { - VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); + OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); bWritingFailed = sal_True; continue; } @@ -454,7 +454,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr if ( !bToBeCompressed || bRawStream ) { // The raw stream can neither be encrypted nor connected - OSL_ENSURE( !bRawStream || !bToBeCompressed && !bToBeEncrypted, "The stream is already encrypted!\n" ); + OSL_ENSURE( !bRawStream || ( !bToBeCompressed && !bToBeEncrypted ), "The stream is already encrypted!\n" ); xSeek->seek ( bRawStream ? pStream->GetMagicalHackPos() : 0 ); ImplSetStoredData ( *pTempEntry, xStream ); @@ -492,14 +492,14 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } else { - VOS_ENSURE( 0, "The package component requires that every stream either be FROM a package or it must support XSeekable!" ); + OSL_ENSURE( 0, "The package component requires that every stream either be FROM a package or it must support XSeekable!" ); continue; } } } catch ( Exception& ) { - VOS_ENSURE( 0, "The stream provided to the package component has problems!" ); + OSL_ENSURE( 0, "The stream provided to the package component has problems!" ); bWritingFailed = sal_True; continue; } @@ -561,7 +561,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr if ( !xStream.is() ) { // Make sure that we actually _got_ a new one ! - VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); + OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); continue; } } @@ -589,12 +589,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } catch ( ZipException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } catch ( IOException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } } @@ -616,7 +616,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr if ( !xStream.is() ) { // Make sure that we actually _got_ a new one ! - VOS_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); + OSL_ENSURE( 0, "ZipPackageStream didn't have a stream associated with it, skipping!" ); continue; } } @@ -646,12 +646,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } catch ( ZipException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } catch ( IOException& ) { - VOS_ENSURE( 0, "Error writing ZipOutputStream" ); + OSL_ENSURE( 0, "Error writing ZipOutputStream" ); bWritingFailed = sal_True; } @@ -731,7 +731,7 @@ void ZipPackageFolder::releaseUpwardRef( void ) } clearParent(); - VOS_ENSURE ( m_refCount == 1, "Ref-count is not 1!" ); + OSL_ENSURE ( m_refCount == 1, "Ref-count is not 1!" ); #endif } @@ -817,3 +817,5 @@ sal_Bool SAL_CALL ZipPackageFolder::supportsService( OUString const & rServiceNa { return rServiceName == getSupportedServiceNames()[0]; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx index 562e42d9e266..ed1bfbdf1d30 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.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. @@ -77,3 +78,5 @@ sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService( OUString const & { return rServiceName == getSupportedServiceNames()[0]; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.hxx b/package/source/zippackage/ZipPackageFolderEnumeration.hxx index bea038d684f3..d136faa9be49 100644 --- a/package/source/zippackage/ZipPackageFolderEnumeration.hxx +++ b/package/source/zippackage/ZipPackageFolderEnumeration.hxx @@ -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. @@ -29,12 +30,8 @@ #include <cppuhelper/implbase2.hxx> // helper for implementations #include <com/sun/star/container/XEnumeration.hpp> -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif -#ifndef _HASH_MAPS_HXX #include <HashMaps.hxx> -#endif class ZipPackageFolderEnumeration : public cppu::WeakImplHelper2 < @@ -46,7 +43,7 @@ protected: ContentHash& rContents; ContentHash::const_iterator aIterator; public: - //ZipPackageFolderEnumeration (std::hash_map < rtl::OUString, com::sun::star::uno::Reference < com::sun::star::container::XNamed >, hashFunc, eqFunc > &rInput); + //ZipPackageFolderEnumeration (boost::unordered_map < rtl::OUString, com::sun::star::uno::Reference < com::sun::star::container::XNamed >, hashFunc, eqFunc > &rInput); ZipPackageFolderEnumeration (ContentHash &rInput); virtual ~ZipPackageFolderEnumeration( void ); @@ -66,3 +63,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageSink.cxx b/package/source/zippackage/ZipPackageSink.cxx index 9a42138a5cb1..2f9202398493 100644 --- a/package/source/zippackage/ZipPackageSink.cxx +++ b/package/source/zippackage/ZipPackageSink.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. @@ -46,3 +47,5 @@ void SAL_CALL ZipPackageSink::setInputStream( const ::com::sun::star::uno::Refer { return xStream; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageSink.hxx b/package/source/zippackage/ZipPackageSink.hxx index 95dac72a836b..a90d40131072 100644 --- a/package/source/zippackage/ZipPackageSink.hxx +++ b/package/source/zippackage/ZipPackageSink.hxx @@ -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. @@ -46,3 +47,5 @@ public: throw(::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index da44dafa000b..823b5c1951ef 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,7 +41,7 @@ #include <ZipPackage.hxx> #include <ZipFile.hxx> #include <EncryptedDataHeader.hxx> -#include <vos/diagnose.hxx> +#include <osl/diagnose.h> #include "wrapstreamforshare.hxx" #include <comphelper/seekableinput.hxx> @@ -56,8 +57,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star; using namespace cppu; -using namespace rtl; +using rtl::OUString; namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; } const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId() @@ -163,7 +164,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCop if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( xEncryptionData.isEmpty() ) + if ( !xEncryptionData.is() ) throw ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Encrypted stream without encryption data!\n" ) ), Reference< XInterface >() ); @@ -203,7 +204,7 @@ Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( sal_B if ( bToBeEncrypted ) { - aKey = ( xEncryptionData.isEmpty() || !bHaveOwnKey ) ? rZipPackage.getEncryptionKey() : + aKey = ( !xEncryptionData.is() || !bHaveOwnKey ) ? rZipPackage.getEncryptionKey() : xEncryptionData->aKey; if ( !aKey.getLength() ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -316,7 +317,7 @@ sal_Bool ZipPackageStream::ParsePackageRawStream() sal_Bool bOk = sal_False; - vos::ORef < EncryptionData > xTempEncrData; + rtl::Reference < EncryptionData > xTempEncrData; sal_Int32 nMagHackSize = 0; Sequence < sal_Int8 > aHeader ( 4 ); @@ -402,7 +403,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData() { if (IsPackageMember()) { - if ( !xEncryptionData.isEmpty() && !bHaveOwnKey ) + if ( xEncryptionData.is() && !bHaveOwnKey ) xEncryptionData->aKey = rZipPackage.getEncryptionKey(); return rZipPackage.getZipFile().getRawData( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() ); } @@ -415,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 > (); } } @@ -433,7 +434,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream( ) { if (IsPackageMember()) { - if ( !xEncryptionData.isEmpty() && !bHaveOwnKey ) + if ( xEncryptionData.is() && !bHaveOwnKey ) xEncryptionData->aKey = rZipPackage.getEncryptionKey(); return rZipPackage.getZipFile().getInputStream( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() ); } @@ -446,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 > (); } } @@ -471,12 +472,12 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream() if ( m_nStreamMode == PACKAGE_STREAM_DETECT ) throw packages::zip::ZipIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( !xEncryptionData.isEmpty() && !bHaveOwnKey ) + if ( xEncryptionData.is() && !bHaveOwnKey ) xEncryptionData->aKey = rZipPackage.getEncryptionKey(); if (IsPackageMember()) { - if ( !xEncryptionData.isEmpty() && !bHaveOwnKey ) + if ( xEncryptionData.is() && !bHaveOwnKey ) xEncryptionData->aKey = rZipPackage.getEncryptionKey(); return rZipPackage.getZipFile().getDataStream( aEntry, xEncryptionData, bIsEncrypted, rZipPackage.GetSharedMutexRef() ); @@ -507,7 +508,7 @@ Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream() if (IsPackageMember()) { - if ( !bIsEncrypted || xEncryptionData.isEmpty() ) + if ( !bIsEncrypted || !xEncryptionData.is() ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return rZipPackage.getZipFile().getWrappedRawStream( aEntry, xEncryptionData, sMediaType, rZipPackage.GetSharedMutexRef() ); @@ -659,7 +660,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, 2 ); bToBeEncrypted = bEnc; - if ( bToBeEncrypted && xEncryptionData.isEmpty()) + if ( bToBeEncrypted && !xEncryptionData.is()) xEncryptionData = new EncryptionData; } else @@ -696,7 +697,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, if ( aNewKey.getLength() ) { - if ( xEncryptionData.isEmpty()) + if ( !xEncryptionData.is()) xEncryptionData = new EncryptionData; xEncryptionData->aKey = aNewKey; @@ -764,7 +765,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EncryptionKey" ) ) ) { - aAny <<= xEncryptionData.isEmpty () ? Sequence < sal_Int8 > () : xEncryptionData->aKey; + aAny <<= !xEncryptionData.is() ? Sequence < sal_Int8 > () : xEncryptionData->aKey; return aAny; } else @@ -800,3 +801,4 @@ sal_Bool SAL_CALL ZipPackageStream::supportsService( OUString const & rServiceNa return rServiceName == getSupportedServiceNames()[0]; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackageStream.hxx b/package/source/zippackage/ZipPackageStream.hxx index 38301d5e7d12..9bdc09d04f92 100644 --- a/package/source/zippackage/ZipPackageStream.hxx +++ b/package/source/zippackage/ZipPackageStream.hxx @@ -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. @@ -31,13 +32,9 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/packages/XDataSinkEncrSupport.hpp> #include <ZipPackageEntry.hxx> -#ifndef _VOS_REF_H_ -#include <vos/ref.hxx> -#endif +#include <rtl/ref.hxx> #include <EncryptionData.hxx> -#ifndef _CPPUHELPER_IMPLBASE2_HXX #include <cppuhelper/implbase2.hxx> -#endif #include <mutexholder.hxx> #define PACKAGE_STREAM_NOTSET 0 @@ -60,7 +57,7 @@ protected: const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; ZipPackage &rZipPackage; sal_Bool bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted; - vos::ORef < EncryptionData > xEncryptionData; + rtl::Reference < EncryptionData > xEncryptionData; sal_uInt8 m_nStreamMode; sal_uInt32 m_nMagicalHackPos; @@ -84,7 +81,7 @@ public: sal_Bool IsFromManifest() const { return m_bFromManifest; } void SetFromManifest( sal_Bool bValue ) { m_bFromManifest = bValue; } - vos::ORef < EncryptionData > & getEncryptionData () + rtl::Reference < EncryptionData > & getEncryptionData () { return xEncryptionData;} const com::sun::star::uno::Sequence < sal_Int8 >& getKey () const { return xEncryptionData->aKey;} @@ -108,10 +105,10 @@ public: void SetToBeEncrypted (sal_Bool bNewValue) { bToBeEncrypted = bNewValue; - if ( bToBeEncrypted && xEncryptionData.isEmpty()) + if ( bToBeEncrypted && !xEncryptionData.is()) xEncryptionData = new EncryptionData; - else if ( !bToBeEncrypted && !xEncryptionData.isEmpty() ) - xEncryptionData.unbind(); + else if ( !bToBeEncrypted && xEncryptionData.is() ) + xEncryptionData.clear(); } void SetPackageMember (sal_Bool bNewValue); void setKey (const com::sun::star::uno::Sequence < sal_Int8 >& rNewKey ) @@ -195,3 +192,5 @@ public: throw (::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/makefile.mk b/package/source/zippackage/makefile.mk index 4bab1649b491..c729b945f0df 100644 --- a/package/source/zippackage/makefile.mk +++ b/package/source/zippackage/makefile.mk @@ -36,11 +36,9 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(L10N_framework)"=="" - # --- Files -------------------------------------------------------- -# the following flag un-inlines function calls and disables optimisations -#CFLAGS+=/Ob0 /Od + +.IF "$(L10N_framework)"=="" SLOFILES= \ $(SLO)$/ZipPackage.obj \ @@ -53,9 +51,6 @@ SLOFILES= \ $(SLO)$/wrapstreamforshare.obj \ $(SLO)$/zipfileaccess.obj -# $(SLO)$/InteractionRequest.obj \ -# $(SLO)$/InteractionContinuation.obj - .ENDIF # L10N_framework # --- Targets ------------------------------------------------------ diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index d3d2eb84d1b7..9afb2f8f9428 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.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. @@ -178,3 +179,4 @@ sal_Int64 SAL_CALL WrapStreamForShare::getLength() return m_xSeekable->getLength(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/wrapstreamforshare.hxx b/package/source/zippackage/wrapstreamforshare.hxx index c799e3ac9b92..85b03c62943c 100644 --- a/package/source/zippackage/wrapstreamforshare.hxx +++ b/package/source/zippackage/wrapstreamforshare.hxx @@ -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. @@ -71,3 +72,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 9acae56ad68a..cb5996aa3c8e 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.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. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_package.hxx" #include <com/sun/star/lang/DisposedException.hpp> -#ifndef _COM_SUN_STAR_LANG_INVALIDARGUMENTEXCEPTION_HPP_ #include <com/sun/star/lang/IllegalArgumentException.hpp> -#endif #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XStream.hpp> @@ -278,7 +277,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getElementNames() uno::Sequence< ::rtl::OUString > aNames( m_pZipFile->GetEntryHash().size() ); sal_Int32 nLen = 0; - for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); aIter++ ) + for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); ++aIter ) { if ( aNames.getLength() < ++nLen ) { @@ -363,7 +362,7 @@ uno::Reference< io::XInputStream > SAL_CALL OZipFileAccess::getStreamByPattern( // Code to compare strings by patterns uno::Sequence< ::rtl::OUString > aPattern = GetPatternsFromString_Impl( aPatternString ); - for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); aIter++ ) + for ( EntryHash::iterator aIter = m_pZipFile->GetEntryHash().begin(); aIter != m_pZipFile->GetEntryHash().end(); ++aIter ) { if ( StringGoodForPattern_Impl( (*aIter).second.sPath, aPattern ) ) { @@ -445,15 +444,15 @@ void SAL_CALL OZipFileAccess::removeEventListener( const uno::Reference< lang::X uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.packages.zip.ZipFileAccess"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.packages.zip.ZipFileAccess"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.zip.ZipFileAccess") ); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.packages.zip.ZipFileAccess") ); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OZipFileAccess::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.package.zip.ZipFileAccess"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.package.zip.ZipFileAccess") ); } //------------------------------------------------------------------------- @@ -490,3 +489,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OZipFileAccess::getSupportedServiceNam return impl_staticGetSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |