[Libreoffice-commits] core.git: 4 commits - oox/source sc/source

Caolán McNamara caolanm at redhat.com
Sat Sep 12 13:12:45 PDT 2015


 oox/source/ole/vbaexport.cxx        |   20 +++++++++++++-------
 sc/source/filter/excel/xestream.cxx |    4 +++-
 sc/source/filter/inc/xestream.hxx   |    5 ++++-
 sc/source/ui/src/scfuncs.src        |    2 +-
 4 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit 45ccb2c8e5a2fde4316d750764652fbe1b20ae24
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 12 20:45:00 2015 +0100

    coverity#1323913 Uninitialized pointer field
    
    Change-Id: Ibcaac09b90f5f2bfa466b94dbb91bb75ae32e7ff

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 0088002..88f74b4c 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -62,10 +62,15 @@ void exportUTF16String(SvStream& rStrm, const OUString& rString)
 
 }
 
-VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, sal_Size nChunkSize):
-    mrCompressedStream(rCompressedStream),
-    mpUncompressedData(pData),
-    mnChunkSize(nChunkSize)
+VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, sal_Size nChunkSize)
+    : mrCompressedStream(rCompressedStream)
+    , mpUncompressedData(pData)
+    , mpCompressedChunkStream(0)
+    , mnChunkSize(nChunkSize)
+    , mnCompressedCurrent(0)
+    , mnCompressedEnd(0)
+    , mnDecompressedCurrent(0)
+    , mnDecompressedEnd(0)
 {
 }
 
commit 70c1cf031dd8179f8eeb33faf842df4d001bf149
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 12 20:42:17 2015 +0100

    coverity#1323912 Improper use of negative value
    
    Change-Id: I7c403ccb40bfddee2e30ba10e755187490857596

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 904056d..0088002 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -630,9 +630,10 @@ void exportModuleStream(SvStream& rStrm, const OUString& rSourceCode, const OUSt
 
     exportString(aModuleStream, "Attribute VB_Name = \"" + aElementName + "\"\r\n");
     OUString aSourceCode = rSourceCode.replaceFirst("Option VBASupport 1\n", "");
-    sal_Int32 nPos = aSourceCode.indexOf("Rem Attribute VBA_ModuleType=");
-    sal_Int32 nEndPos = aSourceCode.indexOf("\n", nPos);
-    aSourceCode = aSourceCode.replaceAt(nPos, nEndPos - nPos+1, "");
+    const sal_Int32 nPos = aSourceCode.indexOf("Rem Attribute VBA_ModuleType=");
+    const sal_Int32 nEndPos = nPos != -1 ? aSourceCode.indexOf("\n", nPos) : -1;
+    if (nPos != -1 && nEndPos != -1)
+        aSourceCode = aSourceCode.replaceAt(nPos, nEndPos - nPos+1, "");
     aSourceCode = aSourceCode.replaceAll("\n", "\r\n");
     exportString(aModuleStream, aSourceCode);
     aModuleStream.Seek(0);
commit 67f5012d78cabc84a63d232140e34d3658c8c7a0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 12 20:40:25 2015 +0100

    coverity#1038332 Uncaught exception
    
    Change-Id: I02d8a2ab6821922c318d4b83a1381b65d8521e1e

diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index bedb24f..1595019 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1051,7 +1051,9 @@ ScDocShell* XclExpXmlStream::getDocShell()
 }
 
 bool XclExpXmlStream::exportDocument()
-    throw (css::uno::RuntimeException, std::exception)
+    throw (css::uno::RuntimeException,
+           css::ucb::ContentCreationException,
+           std::exception)
 {
     ScDocShell* pShell = getDocShell();
     ScDocument& rDoc = pShell->GetDocument();
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index ac75f7f..56dc6ec 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_SOURCE_FILTER_INC_XESTREAM_HXX
 
 #include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/ucb/ContentCreationException.hpp>
 
 #include <map>
 #include <stack>
@@ -320,7 +321,9 @@ public:
 
     // ignore
     virtual bool exportDocument()
-        throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+        throw (css::uno::RuntimeException,
+               css::ucb::ContentCreationException,
+               std::exception) SAL_OVERRIDE;
 
     // only needed for import; ignore
     virtual bool importDocument() throw() SAL_OVERRIDE;
commit 23b530d3e7d0c63318510dd353ba9896e16b802e
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Sep 12 09:16:24 2015 +0000

    #i126516# Document the return values for the TYPE() formula function in the online help too.
    
    (cherry picked from commit 4149f99e7bede959d8bec6b4131a205d6e98d6b7)

diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 39018e9..00b093e 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -2633,7 +2633,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
     {
         String 1 // Description
         {
-            Text [ en-US ] = "Defines the data type of a value." ;
+            Text [ en-US ] = "Returns the data type of a value (1 = number, 2 = text, 4 = Boolean value, 8 = formula, 16 = error value, 64 = array)." ;
         };
         ExtraData =
         {


More information about the Libreoffice-commits mailing list