tdf#123936 Formatting files in module package with clang-format

Change-Id: I3ff80c6c636003d468f384e0d6fbfb5233e0b4da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105696
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Philipp Hofer
2020-11-12 13:09:45 +01:00
committed by Christian Lohmaier
parent 4d4e95be17
commit eb4c2e96f3
10 changed files with 58 additions and 74 deletions

View File

@@ -42,7 +42,8 @@
*/ */
const sal_uInt32 n_ConstHeader = 0x05024d4dL; // "MM\002\005" const sal_uInt32 n_ConstHeader = 0x05024d4dL; // "MM\002\005"
const sal_Int32 n_ConstHeaderSize = 38; // + salt length + iv length + digest length + mediatype length const sal_Int32 n_ConstHeaderSize
= 38; // + salt length + iv length + digest length + mediatype length
const sal_Int16 n_ConstCurrentVersion = 1; const sal_Int16 n_ConstCurrentVersion = 1;
#endif #endif

View File

@@ -30,22 +30,22 @@ const sal_Int32 n_ConstDigestLength = 1024;
const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32 const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32
// the constants related to the manifest.xml entries // the constants related to the manifest.xml entries
#define PKG_MNFST_FULLPATH 0 //FullPath (Put full-path property first for MBA) #define PKG_MNFST_FULLPATH 0 //FullPath (Put full-path property first for MBA)
#define PKG_MNFST_VERSION 1 //Version #define PKG_MNFST_VERSION 1 //Version
#define PKG_MNFST_MEDIATYPE 2 //MediaType #define PKG_MNFST_MEDIATYPE 2 //MediaType
#define PKG_MNFST_INIVECTOR 3 //InitialisationVector #define PKG_MNFST_INIVECTOR 3 //InitialisationVector
#define PKG_MNFST_SALT 4 //Salt #define PKG_MNFST_SALT 4 //Salt
#define PKG_MNFST_ITERATION 5 //IterationCount #define PKG_MNFST_ITERATION 5 //IterationCount
#define PKG_MNFST_UCOMPSIZE 6 //Size #define PKG_MNFST_UCOMPSIZE 6 //Size
#define PKG_MNFST_DIGEST 7 //Digest #define PKG_MNFST_DIGEST 7 //Digest
#define PKG_MNFST_ENCALG 8 //EncryptionAlgorithm #define PKG_MNFST_ENCALG 8 //EncryptionAlgorithm
#define PKG_MNFST_STARTALG 9 //StartKeyAlgorithm #define PKG_MNFST_STARTALG 9 //StartKeyAlgorithm
#define PKG_MNFST_DIGESTALG 10 //DigestAlgorithm #define PKG_MNFST_DIGESTALG 10 //DigestAlgorithm
#define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize #define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize
#define PKG_SIZE_NOENCR_MNFST 3 #define PKG_SIZE_NOENCR_MNFST 3
#define PKG_SIZE_ENCR_MNFST 12 #define PKG_SIZE_ENCR_MNFST 12
// the properties related constants // the properties related constants
#define ENCRYPTION_KEY_PROPERTY "EncryptionKey" #define ENCRYPTION_KEY_PROPERTY "EncryptionKey"

View File

@@ -23,12 +23,13 @@
class ZipEnumeration final class ZipEnumeration final
{ {
EntryHash &rEntryHash; EntryHash& rEntryHash;
EntryHash::const_iterator aIterator; EntryHash::const_iterator aIterator;
public: public:
bool hasMoreElements(); bool hasMoreElements();
const ZipEntry * nextElement(); const ZipEntry* nextElement();
ZipEnumeration( EntryHash &rNewEntryHash ); ZipEnumeration(EntryHash& rNewEntryHash);
~ZipEnumeration(); ~ZipEnumeration();
}; };

View File

@@ -25,18 +25,18 @@
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
class OStorage; class OStorage;
class OChildDispListener_Impl : public ::cppu::WeakImplHelper < css::lang::XEventListener > class OChildDispListener_Impl : public ::cppu::WeakImplHelper<css::lang::XEventListener>
{ {
::osl::Mutex m_aMutex; ::osl::Mutex m_aMutex;
OStorage* m_pStorage; OStorage* m_pStorage;
public: public:
explicit OChildDispListener_Impl( OStorage& aStorage ); explicit OChildDispListener_Impl(OStorage& aStorage);
virtual ~OChildDispListener_Impl() override; virtual ~OChildDispListener_Impl() override;
void OwnerIsDisposed(); void OwnerIsDisposed();
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
}; };
#endif #endif

View File

@@ -21,18 +21,13 @@
/** Provides an Enumeration over the contents of a Zip file */ /** Provides an Enumeration over the contents of a Zip file */
ZipEnumeration::ZipEnumeration( EntryHash & rNewEntryHash) ZipEnumeration::ZipEnumeration(EntryHash& rNewEntryHash)
: rEntryHash(rNewEntryHash) : rEntryHash(rNewEntryHash)
, aIterator(rEntryHash.begin()) , aIterator(rEntryHash.begin())
{ {
} }
ZipEnumeration::~ZipEnumeration() ZipEnumeration::~ZipEnumeration() {}
{ bool ZipEnumeration::hasMoreElements() { return (aIterator != rEntryHash.end()); }
}
bool ZipEnumeration::hasMoreElements()
{
return (aIterator != rEntryHash.end());
}
const ZipEntry* ZipEnumeration::nextElement() const ZipEntry* ZipEnumeration::nextElement()
{ {

View File

@@ -30,25 +30,23 @@ using namespace com::sun::star;
#define THROW_WHERE "" #define THROW_WHERE ""
#endif #endif
ZipPackageFolderEnumeration::ZipPackageFolderEnumeration ( ContentHash &rInput) ZipPackageFolderEnumeration::ZipPackageFolderEnumeration(ContentHash& rInput)
: rContents (rInput) : rContents(rInput)
, aIterator (rContents.begin()) , aIterator(rContents.begin())
{ {
} }
ZipPackageFolderEnumeration::~ZipPackageFolderEnumeration() ZipPackageFolderEnumeration::~ZipPackageFolderEnumeration() {}
{
}
sal_Bool SAL_CALL ZipPackageFolderEnumeration::hasMoreElements( ) sal_Bool SAL_CALL ZipPackageFolderEnumeration::hasMoreElements()
{ {
return (aIterator != rContents.end() ); return (aIterator != rContents.end());
} }
uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement( ) uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement()
{ {
uno::Any aAny; uno::Any aAny;
if (aIterator == rContents.end() ) if (aIterator == rContents.end())
throw container::NoSuchElementException(THROW_WHERE ); throw container::NoSuchElementException(THROW_WHERE);
aAny <<= (*aIterator).second->xTunnel; aAny <<= (*aIterator).second->xTunnel;
++aIterator; ++aIterator;
return aAny; return aAny;
@@ -59,13 +57,13 @@ OUString ZipPackageFolderEnumeration::getImplementationName()
return "ZipPackageFolderEnumeration"; return "ZipPackageFolderEnumeration";
} }
uno::Sequence< OUString > ZipPackageFolderEnumeration::getSupportedServiceNames() uno::Sequence<OUString> ZipPackageFolderEnumeration::getSupportedServiceNames()
{ {
uno::Sequence< OUString > aNames { "com.sun.star.packages.PackageFolderEnumeration" }; uno::Sequence<OUString> aNames{ "com.sun.star.packages.PackageFolderEnumeration" };
return aNames; return aNames;
} }
sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService( OUString const & rServiceName ) sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService(OUString const& rServiceName)
{ {
return cppu::supportsService(this, rServiceName); return cppu::supportsService(this, rServiceName);
} }

View File

@@ -24,28 +24,25 @@
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <HashMaps.hxx> #include <HashMaps.hxx>
class ZipPackageFolderEnumeration final : public cppu::WeakImplHelper class ZipPackageFolderEnumeration final
< : public cppu::WeakImplHelper<css::container::XEnumeration, css::lang::XServiceInfo>
css::container::XEnumeration,
css::lang::XServiceInfo
>
{ {
ContentHash& rContents; ContentHash& rContents;
ContentHash::const_iterator aIterator; ContentHash::const_iterator aIterator;
public: public:
//ZipPackageFolderEnumeration (unordered_map < OUString, css::uno::Reference < css::container::XNamed >, hashFunc, eqFunc > &rInput); //ZipPackageFolderEnumeration (unordered_map < OUString, css::uno::Reference < css::container::XNamed >, hashFunc, eqFunc > &rInput);
ZipPackageFolderEnumeration (ContentHash &rInput); ZipPackageFolderEnumeration(ContentHash& rInput);
virtual ~ZipPackageFolderEnumeration() override; virtual ~ZipPackageFolderEnumeration() override;
// XEnumeration // XEnumeration
virtual sal_Bool SAL_CALL hasMoreElements( ) override; virtual sal_Bool SAL_CALL hasMoreElements() override;
virtual css::uno::Any SAL_CALL nextElement( ) override; virtual css::uno::Any SAL_CALL nextElement() override;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override; virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
}; };
#endif #endif

View File

@@ -20,17 +20,16 @@
#include "ZipPackageSink.hxx" #include "ZipPackageSink.hxx"
ZipPackageSink::ZipPackageSink() ZipPackageSink::ZipPackageSink()
: xStream ( css::uno::Reference < css::io::XInputStream > (nullptr)) : xStream(css::uno::Reference<css::io::XInputStream>(nullptr))
{ {
} }
ZipPackageSink::~ZipPackageSink() ZipPackageSink::~ZipPackageSink() {}
{ void SAL_CALL
} ZipPackageSink::setInputStream(const css::uno::Reference<css::io::XInputStream>& aStream)
void SAL_CALL ZipPackageSink::setInputStream( const css::uno::Reference< css::io::XInputStream >& aStream )
{ {
xStream = aStream; xStream = aStream;
} }
css::uno::Reference< css::io::XInputStream > SAL_CALL ZipPackageSink::getInputStream( ) css::uno::Reference<css::io::XInputStream> SAL_CALL ZipPackageSink::getInputStream()
{ {
return xStream; return xStream;
} }

View File

@@ -22,14 +22,16 @@
#include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XActiveDataSink.hpp>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
class ZipPackageSink final : public ::cppu::WeakImplHelper< css::io::XActiveDataSink > class ZipPackageSink final : public ::cppu::WeakImplHelper<css::io::XActiveDataSink>
{ {
css::uno::Reference < css::io::XInputStream > xStream; css::uno::Reference<css::io::XInputStream> xStream;
public: public:
ZipPackageSink(); ZipPackageSink();
virtual ~ZipPackageSink() override; virtual ~ZipPackageSink() override;
virtual void SAL_CALL setInputStream( const css::uno::Reference< css::io::XInputStream >& aStream ) override; virtual void SAL_CALL
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream( ) override; setInputStream(const css::uno::Reference<css::io::XInputStream>& aStream) override;
virtual css::uno::Reference<css::io::XInputStream> SAL_CALL getInputStream() override;
}; };
#endif #endif

View File

@@ -7905,11 +7905,8 @@ opencl/source/platforminfo.cxx
package/inc/ByteChucker.hxx package/inc/ByteChucker.hxx
package/inc/ByteGrabber.hxx package/inc/ByteGrabber.hxx
package/inc/CRC32.hxx package/inc/CRC32.hxx
package/inc/EncryptedDataHeader.hxx
package/inc/EncryptionData.hxx package/inc/EncryptionData.hxx
package/inc/HashMaps.hxx package/inc/HashMaps.hxx
package/inc/PackageConstants.hxx
package/inc/ZipEnumeration.hxx
package/inc/ZipFile.hxx package/inc/ZipFile.hxx
package/inc/ZipOutputEntry.hxx package/inc/ZipOutputEntry.hxx
package/inc/ZipOutputStream.hxx package/inc/ZipOutputStream.hxx
@@ -7930,7 +7927,6 @@ package/source/manifest/ManifestReader.hxx
package/source/manifest/ManifestWriter.cxx package/source/manifest/ManifestWriter.cxx
package/source/manifest/ManifestWriter.hxx package/source/manifest/ManifestWriter.hxx
package/source/xstor/disposelistener.cxx package/source/xstor/disposelistener.cxx
package/source/xstor/disposelistener.hxx
package/source/xstor/ocompinstream.cxx package/source/xstor/ocompinstream.cxx
package/source/xstor/ocompinstream.hxx package/source/xstor/ocompinstream.hxx
package/source/xstor/ohierarchyholder.cxx package/source/xstor/ohierarchyholder.cxx
@@ -7957,7 +7953,6 @@ package/source/zipapi/XBufferedThreadedStream.cxx
package/source/zipapi/XBufferedThreadedStream.hxx package/source/zipapi/XBufferedThreadedStream.hxx
package/source/zipapi/XUnbufferedStream.cxx package/source/zipapi/XUnbufferedStream.cxx
package/source/zipapi/XUnbufferedStream.hxx package/source/zipapi/XUnbufferedStream.hxx
package/source/zipapi/ZipEnumeration.cxx
package/source/zipapi/ZipFile.cxx package/source/zipapi/ZipFile.cxx
package/source/zipapi/ZipOutputEntry.cxx package/source/zipapi/ZipOutputEntry.cxx
package/source/zipapi/ZipOutputStream.cxx package/source/zipapi/ZipOutputStream.cxx
@@ -7970,10 +7965,6 @@ package/source/zippackage/ZipPackage.cxx
package/source/zippackage/ZipPackageBuffer.cxx package/source/zippackage/ZipPackageBuffer.cxx
package/source/zippackage/ZipPackageEntry.cxx package/source/zippackage/ZipPackageEntry.cxx
package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageFolder.cxx
package/source/zippackage/ZipPackageFolderEnumeration.cxx
package/source/zippackage/ZipPackageFolderEnumeration.hxx
package/source/zippackage/ZipPackageSink.cxx
package/source/zippackage/ZipPackageSink.hxx
package/source/zippackage/ZipPackageStream.cxx package/source/zippackage/ZipPackageStream.cxx
package/source/zippackage/wrapstreamforshare.cxx package/source/zippackage/wrapstreamforshare.cxx
package/source/zippackage/wrapstreamforshare.hxx package/source/zippackage/wrapstreamforshare.hxx