From f8da45ddb7d5be0c93e9e1efd5ecd7055ee824e4 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 25 Jan 2014 08:40:27 +0100 Subject: [PATCH] fix PPC build --- ...-satisfy-oox-helper-helper.hxx-s-con.patch | 88 +++++++++++++++++++ libreoffice.spec | 3 + 2 files changed, 91 insertions(+) create mode 100644 0001-Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch diff --git a/0001-Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch b/0001-Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch new file mode 100644 index 0000000..bdb4170 --- /dev/null +++ b/0001-Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch @@ -0,0 +1,88 @@ +From 6e489b4024f68fa7d07a1e41aca4ec119b43a3b7 Mon Sep 17 00:00:00 2001 +From: Douglas Mencken +Date: Mon, 16 Dec 2013 09:34:58 -0500 +Subject: [PATCH] Use sal_Int32 to satisfy oox/helper/helper.hxx's + convertLittleEndian +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes build error "no matching function for call to oox::ByteOrderConverter::convertLittleEndian(int&)" + +workaround rather maddening endian-specific template bustage + +together these two master patches hopefully fix the PPC build + +(also includes: Change-Id: I69dc97c93ef5efe8d71074ac3eca06a3bbc45253) + +Change-Id: I899f151ff99737247ce4090f59897eba842c40ba +Reviewed-on: https://gerrit.libreoffice.org/7099 +Reviewed-by: Michael Stahl +Tested-by: Michael Stahl +Reviewed-on: https://gerrit.libreoffice.org/7607 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + oox/source/crypto/AgileEngine.cxx | 2 +- + oox/source/crypto/DocumentDecryption.cxx | 17 +++++++++++++++-- + oox/source/crypto/Standard2007Engine.cxx | 2 +- + 3 files changed, 17 insertions(+), 4 deletions(-) + +diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx +index f56e669..86d7025 100644 +--- a/oox/source/crypto/AgileEngine.cxx ++++ b/oox/source/crypto/AgileEngine.cxx +@@ -106,7 +106,7 @@ bool AgileEngine::calculateHashFinal(const OUString& rPassword, vector data(mInfo.hashSize + 4, 0); + +- for (int i = 0; i < mInfo.spinCount; i++) ++ for (sal_Int32 i = 0; i < mInfo.spinCount; i++) + { + ByteOrderConverter::writeLittleEndian( &data[0], i ); + std::copy(hash.begin(), hash.end(), data.begin() + 4); +diff --git a/oox/source/crypto/DocumentDecryption.cxx b/oox/source/crypto/DocumentDecryption.cxx +index 0d1c729..47fa006 100644 +--- a/oox/source/crypto/DocumentDecryption.cxx ++++ b/oox/source/crypto/DocumentDecryption.cxx +@@ -289,9 +289,22 @@ bool DocumentDecryption::readStandard2007EncryptionInfo(BinaryInputStream& rStre + if( (nHeaderSize < actualHeaderSize) ) + return false; + +- rStream >> info.header; ++ rStream >> info.header.flags; ++ rStream >> info.header.sizeExtra; ++ rStream >> info.header.algId; ++ rStream >> info.header.algIdHash; ++ rStream >> info.header.keyBits; ++ rStream >> info.header.providedType; ++ rStream >> info.header.reserved1; ++ rStream >> info.header.reserved2; ++ + rStream.skip( nHeaderSize - actualHeaderSize ); +- rStream >> info.verifier; ++ ++ rStream >> info.verifier.saltSize; ++ rStream.readArray(info.verifier.salt, SAL_N_ELEMENTS(info.verifier.salt)); ++ rStream.readArray(info.verifier.encryptedVerifier, SAL_N_ELEMENTS(info.verifier.encryptedVerifier)); ++ rStream >> info.verifier.encryptedVerifierHashSize; ++ rStream.readArray(info.verifier.encryptedVerifierHash, SAL_N_ELEMENTS(info.verifier.encryptedVerifierHash)); + + if( info.verifier.saltSize != 16 ) + return false; +diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx +index b437846..13697d2 100644 +--- a/oox/source/crypto/Standard2007Engine.cxx ++++ b/oox/source/crypto/Standard2007Engine.cxx +@@ -129,7 +129,7 @@ bool Standard2007Engine::calculateEncryptionKey(const OUString& rPassword) + // data = iterator (4bytes) + hash + vector data(RTL_DIGEST_LENGTH_SHA1 + 4, 0); + +- for (int i = 0; i < 50000; i++) ++ for (sal_Int32 i = 0; i < 50000; ++i) + { + ByteOrderConverter::writeLittleEndian( &data[0], i ); + std::copy(hash.begin(), hash.end(), data.begin() + 4); +-- +1.8.4.2 + diff --git a/libreoffice.spec b/libreoffice.spec index 5346b53..1948a7f 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -274,6 +274,7 @@ Patch12: 0001-Resolves-rhbz-1035092-no-shortcut-key-for-Italian-To.patch Patch13: 0001-Resolves-rhbz-912529-Kerkis-SmallCaps-shown-instead-.patch Patch14: 0001-Resolves-rhbz-1038189-refresh-printer-list-when-prin.patch Patch15: 0001-Related-rhbz-1047871-conditional-formatting-doesn-t-.patch +Patch16: 0001-Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -1024,6 +1025,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc %patch13 -p1 -b .rhbz-912529-Kerkis-SmallCaps-shown-instead-.patch %patch14 -p1 -b .rhbz-1038189-refresh-printer-list-when-prin.patch %patch15 -p1 -b .rhbz-1047871-conditional-formatting-doesn-t-.patch +%patch16 -p1 -b .Use-sal_Int32-to-satisfy-oox-helper-helper.hxx-s-con.patch # TODO: check this # these are horribly incomplete--empty translations and copied english @@ -2133,6 +2135,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %changelog * Fri Jan 24 2014 David Tardon - 1:4.2.0.3-3 - enable EOT support +- fix PPC build * Thu Jan 23 2014 David Tardon - 1:4.2.0.3-2 - stop showing math and startcenter in menu (again)