summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-19 18:08:44 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-10-20 14:36:29 +0200
commit4d49249d8a63f310ff42bec1a0ae0bf35d0bb336 (patch)
treebbdba41935f7b4ce7f5564948d9826827c53c60a
parenta8e4f75fe264f6ece37c154951cff53f2f4fa3e4 (diff)
Work around what looks like MSVC 2013 miscompilation
Change-Id: Ic2ed1b00d9d29f004f1e3cd60af863d6aafc7188 (cherry picked from commit e58f9cad29404670085803a8010729a735759088)
-rw-r--r--oox/source/ole/vbaexport.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index d56d97481702..cf28e64b7fec 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -410,7 +410,12 @@ void VBAEncryption::writeVersionEnc()
sal_uInt8 VBAEncryption::calculateProjKey(const OUString& rProjectKey)
{
- sal_uInt8 nProjKey = 0;
+ sal_uInt32 nProjKey = 0;
+ // use sal_uInt32 instead of sal_uInt8 to avoid miscompilation at least
+ // under "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101
+ // for x64" with --enable-64-bit and --enable-dbgutil, causing
+ // CppunitTest_oox_vba_encryption's TestVbaEncryption::testProjKey1 to
+ // fail with actual 53 vs. expected 223
sal_Int32 n = rProjectKey.getLength();
const sal_Unicode* pString = rProjectKey.getStr();
for (sal_Int32 i = 0; i < n; ++i)