[Libreoffice-commits] core.git: 10 commits - extensions/source i18npool/source oox/source sdext/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Fri Sep 26 03:18:01 PDT 2014


 extensions/source/plugin/aqua/macmgr.mm               |    2 
 extensions/source/plugin/inc/plugin/impl.hxx          |    2 
 extensions/source/plugin/unx/unxmgr.cxx               |    2 
 extensions/source/plugin/win/winmgr.cxx               |    2 
 i18npool/source/nativenumber/nativenumbersupplier.cxx |  144 ++++++++++--------
 oox/source/docprop/ooxmldocpropimport.cxx             |    2 
 sdext/source/presenter/PresenterSpritePane.hxx        |   18 +-
 svx/source/fmcomp/gridcell.cxx                        |    3 
 sw/source/core/crsr/crsrsh.cxx                        |    9 -
 sw/source/core/unocore/unostyle.cxx                   |    2 
 10 files changed, 104 insertions(+), 82 deletions(-)

New commits:
commit 4652700776666e385946c47235363c1120846d5d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 11:16:18 2014 +0100

    Resolves: fdo#84261 unexpected exception -> clang builds terminate
    
    Change-Id: I545ed112b54fb3d81e67b0f42230811cd48de626

diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index e274143..c711f2f 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -63,7 +63,7 @@ Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const
 
 namespace {
 
-Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException)
+Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException, css::io::IOException)
 {
     Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW );
     Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW );
commit 8305efa9e8c3af4792b4ab96dbee908e004b3356
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 10:11:02 2014 +0100

    coverity#983665 Uncaught exception
    
    Change-Id: I3d0cd9a9bde8c3705abd876e832b6b7e56bb7fad

diff --git a/extensions/source/plugin/aqua/macmgr.mm b/extensions/source/plugin/aqua/macmgr.mm
index 1c26cf2..878571a 100644
--- a/extensions/source/plugin/aqua/macmgr.mm
+++ b/extensions/source/plugin/aqua/macmgr.mm
@@ -584,7 +584,7 @@ static rtl::OUString FindFolderURL(  FSVolumeRefNum vRefNum, OSType folderType )
     return aRet;
 }
 
-Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw()
+Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw(css::uno::RuntimeException, std::exception)
 {
     static Sequence<PluginDescription> aDescriptions;
     static sal_Bool bHavePlugins = sal_False;
diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx
index c9b545e..a22af7c 100644
--- a/extensions/source/plugin/inc/plugin/impl.hxx
+++ b/extensions/source/plugin/inc/plugin/impl.hxx
@@ -303,7 +303,7 @@ public:
     virtual Reference< com::sun::star::plugin::XPluginContext > SAL_CALL createPluginContext() throw(std::exception) SAL_OVERRIDE;
 
     // has to be implemented per system
-    virtual Sequence< com::sun::star::plugin::PluginDescription > SAL_CALL impl_getPluginDescriptions(void) throw();
+    virtual Sequence< com::sun::star::plugin::PluginDescription > SAL_CALL impl_getPluginDescriptions() throw(css::uno::RuntimeException, std::exception);
     // calls system specific impl_getPluginDescriptions
     // checks whether plugins are disabled
     virtual Sequence< com::sun::star::plugin::PluginDescription > SAL_CALL getPluginDescriptions()
diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx
index b1aae92..0433aea 100644
--- a/extensions/source/plugin/unx/unxmgr.cxx
+++ b/extensions/source/plugin/unx/unxmgr.cxx
@@ -234,7 +234,7 @@ static void CheckPluginRegistryFiles( const OString& rPath, list< PluginDescript
         closedir( pDIR );
 }
 
-Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw()
+Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw(css::uno::RuntimeException, std::exception)
 {
     static Sequence<PluginDescription> aDescriptions;
     static bool bHavePlugins = false;
diff --git a/extensions/source/plugin/win/winmgr.cxx b/extensions/source/plugin/win/winmgr.cxx
index 8f531e7..881ec27 100644
--- a/extensions/source/plugin/win/winmgr.cxx
+++ b/extensions/source/plugin/win/winmgr.cxx
@@ -299,7 +299,7 @@ static void add_SO_Plugins( PluginLocationMap & rPlugins )
 }
 
 
-Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions(void) throw()
+Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions() throw(css::uno::RuntimeException, std::exception)
 {
     Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
     static Sequence<PluginDescription > s_aDescriptions( 0 );
commit ecbb4efb1588c11c6c9d606ad429d2641f06576c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 10:07:31 2014 +0100

    coverity#707302 Uncaught exception
    
    Change-Id: I43761e1c06ca4ccc394b13b4ce9f82d390971533

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 6a719c6..e17fce9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -692,7 +692,7 @@ uno::Any SwXStyleFamily::getByIndex(sal_Int32 nTempIndex)
                     aRet.setValue(&xStyle, cppu::UnoType<style::XStyle>::get());
                 }
                 else
-                    throw container::NoSuchElementException();
+                    throw uno::RuntimeException();
             }
             else
                 throw lang::IndexOutOfBoundsException();
commit 73590b7553eb696b80677a5968fe1c2ef56a05e8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:58:13 2014 +0100

    coverity#1241340 Unused value
    
    Change-Id: I5fc73cfab0295cb2d2fd1f895bf2974c473ea30e

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 8077fd4..9016534 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1327,17 +1327,20 @@ void SwCrsrShell::UpdateCrsrPos()
 }
 
 // #i65475# - if Point/Mark in hidden sections, move them out
-static void lcl_CheckHiddenSection( SwNodeIndex& rIdx )
+static bool lcl_CheckHiddenSection( SwNodeIndex& rIdx )
 {
+    bool bOk = true;
     const SwSectionNode* pSectNd = rIdx.GetNode().FindSectionNode();
     if( pSectNd && pSectNd->GetSection().IsHiddenFlag() )
     {
         SwNodeIndex aTmp( *pSectNd );
         const SwNode* pFrmNd =
-        rIdx.GetNodes().FindPrvNxtFrmNode( aTmp, pSectNd->EndOfSectionNode() );
-        SAL_WARN_IF( !pFrmNd, "sw", "found no Node with Frames" );
+            rIdx.GetNodes().FindPrvNxtFrmNode( aTmp, pSectNd->EndOfSectionNode() );
+        bOk = pFrmNd != NULL;
+        SAL_WARN_IF(!bOk, "sw", "found no Node with Frames");
         rIdx = aTmp;
     }
+    return bOk;
 }
 
 /// Try to set the cursor to the next visible content node.
commit d541a89c4ea1866aae673dacc6ae4099f99dee59
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:54:53 2014 +0100

    coverity#982849 try and fix Unrecoverable parse warning
    
    Change-Id: Iba0f175c7c079f2171bab6e5a7419c7d5966c541

diff --git a/sdext/source/presenter/PresenterSpritePane.hxx b/sdext/source/presenter/PresenterSpritePane.hxx
index 28fb261..110499b 100644
--- a/sdext/source/presenter/PresenterSpritePane.hxx
+++ b/sdext/source/presenter/PresenterSpritePane.hxx
@@ -56,7 +56,7 @@ public:
 
     virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
-    using css::lang::XEventListener::disposing;
+    using PresenterPaneBase::disposing;
 
     ::boost::shared_ptr<PresenterSprite> GetSprite();
 
commit ed0d0e84864c6952eb9db47eaed3aef72f08fcc8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:50:40 2014 +0100

    what is it with the explicit voids
    
    Change-Id: I7d3995f16351cb1686003f2ba7a044ac99d6d10b

diff --git a/sdext/source/presenter/PresenterSpritePane.hxx b/sdext/source/presenter/PresenterSpritePane.hxx
index 386ce53..28fb261 100644
--- a/sdext/source/presenter/PresenterSpritePane.hxx
+++ b/sdext/source/presenter/PresenterSpritePane.hxx
@@ -52,25 +52,25 @@ public:
     PresenterSpritePane (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
-    virtual ~PresenterSpritePane (void);
+    virtual ~PresenterSpritePane();
 
-    virtual void SAL_CALL disposing (void) SAL_OVERRIDE;
+    virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
     using css::lang::XEventListener::disposing;
 
-    ::boost::shared_ptr<PresenterSprite> GetSprite (void);
+    ::boost::shared_ptr<PresenterSprite> GetSprite();
 
-    static OUString getImplementationName_static (void);
-    static css::uno::Sequence< OUString > getSupportedServiceNames_static (void);
+    static OUString getImplementationName_static();
+    static css::uno::Sequence< OUString > getSupportedServiceNames_static();
     static css::uno::Reference<css::uno::XInterface> Create(
         const css::uno::Reference<css::uno::XComponentContext>& rxContext);
 
     // XPane
 
-    virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getWindow (void)
+    virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getWindow()
         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
-    virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL getCanvas (void)
+    virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL getCanvas()
         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
     // XWindowListener
@@ -100,7 +100,7 @@ private:
     virtual void CreateCanvases (
         const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) SAL_OVERRIDE;
-    void UpdateCanvases (void);
+    void UpdateCanvases();
 };
 
 } } // end of namespace ::sd::presenter
commit 1ea13f5c953bc388d1615c61113326532e6a1b01
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:44:26 2014 +0100

    coverity#1194914 Overflowed return value
    
    Change-Id: Ic7ec1238a85fd0395aeccc8a10e5f27c63deae95

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index fd140a8..dbafe52 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -4170,7 +4170,8 @@ sal_Int16 SAL_CALL FmXListBoxCell::getSelectedItemPos() throw( RuntimeException,
     {
         UpdateFromColumn();
         sal_Int32 nPos = m_pBox->GetSelectEntryPos();
-        assert(nPos < SHRT_MAX);
+        if (nPos > SHRT_MAX || nPos < SHRT_MIN)
+            throw std::out_of_range("awt::XListBox::getSelectedItemPos can only return a short");
         return nPos;
     }
     return 0;
commit ac35f0e1cc6166005f6bbd3ab8aecbc4e9745bc2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:38:12 2014 +0100

    coverity#1241051 Negative array index read
    
    Change-Id: I958267c88f74523a5aaba0ff6c677aadd2e84dd9

diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 9a5455d..8520a68 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -687,8 +687,11 @@ NativeNumberXmlAttributes SAL_CALL NativeNumberSupplierService::convertToXmlAttr
 
     sal_Int16 number = NumberChar_HalfWidth, type = attShort;
 
+    sal_Int16 langnum = -1;
     if (isValidNatNum(rLocale, nNativeNumberMode)) {
-        sal_Int16 langnum = getLanguageNumber(rLocale);
+        langnum = getLanguageNumber(rLocale);
+    }
+    if (langnum != -1) {
         switch (nNativeNumberMode) {
             case NativeNumberMode::NATNUM0: // Ascii
                 number = NumberChar_HalfWidth;
commit 8d01d16c4bc2531a37dca54526568fd5b533a40f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:35:19 2014 +0100

    coverity#1241117 Negative array index read
    
    Change-Id: I15787a4a2b964de3b12586c823be48c0289fea0f

diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 5c421f9..9a5455d 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -520,50 +520,55 @@ static sal_Int16 SAL_CALL getLanguageNumber( const Locale& rLocale)
 OUString SAL_CALL NativeNumberSupplierService::getNativeNumberString(const OUString& aNumberString, const Locale& rLocale,
                 sal_Int16 nNativeNumberMode, Sequence< sal_Int32 >& offset) throw (RuntimeException)
 {
+    if (!isValidNatNum(rLocale, nNativeNumberMode))
+        return aNumberString;
+
+    sal_Int16 langnum = getLanguageNumber(rLocale);
+    if (langnum == -1)
+        return aNumberString;
+
     const Number *number = 0;
     sal_Int16 num = -1;
 
-    if (isValidNatNum(rLocale, nNativeNumberMode)) {
-        sal_Int16 langnum = getLanguageNumber(rLocale);
-        switch (nNativeNumberMode) {
-            case NativeNumberMode::NATNUM0: // Ascii
-                return NativeToAscii(aNumberString,  0, aNumberString.getLength(), offset, useOffset);
-            case NativeNumberMode::NATNUM1: // Char, Lower
-                num = natnum1[langnum];
-                break;
-            case NativeNumberMode::NATNUM2: // Char, Upper
-                num = natnum2[langnum];
-                break;
-            case NativeNumberMode::NATNUM3: // Char, FullWidth
-                num = NumberChar_FullWidth;
-                break;
-            case NativeNumberMode::NATNUM4: // Text, Lower, Long
-                number = &natnum4[langnum];
-                break;
-            case NativeNumberMode::NATNUM5: // Text, Upper, Long
-                number = &natnum5[langnum];
-                break;
-            case NativeNumberMode::NATNUM6: // Text, FullWidth
-                number = &natnum6[langnum];
-                break;
-            case NativeNumberMode::NATNUM7: // Text. Lower, Short
-                number = &natnum7[langnum];
-                break;
-            case NativeNumberMode::NATNUM8: // Text, Upper, Short
-                number = &natnum8[langnum];
-                break;
-            case NativeNumberMode::NATNUM9: // Char, Hangul
-                num = NumberChar_Hangul_ko;
-                break;
-            case NativeNumberMode::NATNUM10:        // Text, Hangul, Long
-                number = &natnum10;
-                break;
-            case NativeNumberMode::NATNUM11:        // Text, Hangul, Short
-                number = &natnum11;
-                break;
-            default:
-                break;
-        }
+    switch (nNativeNumberMode)
+    {
+        case NativeNumberMode::NATNUM0: // Ascii
+            return NativeToAscii(aNumberString,  0, aNumberString.getLength(), offset, useOffset);
+        case NativeNumberMode::NATNUM1: // Char, Lower
+            num = natnum1[langnum];
+            break;
+        case NativeNumberMode::NATNUM2: // Char, Upper
+            num = natnum2[langnum];
+            break;
+        case NativeNumberMode::NATNUM3: // Char, FullWidth
+            num = NumberChar_FullWidth;
+            break;
+        case NativeNumberMode::NATNUM4: // Text, Lower, Long
+            number = &natnum4[langnum];
+            break;
+        case NativeNumberMode::NATNUM5: // Text, Upper, Long
+            number = &natnum5[langnum];
+            break;
+        case NativeNumberMode::NATNUM6: // Text, FullWidth
+            number = &natnum6[langnum];
+            break;
+        case NativeNumberMode::NATNUM7: // Text. Lower, Short
+            number = &natnum7[langnum];
+            break;
+        case NativeNumberMode::NATNUM8: // Text, Upper, Short
+            number = &natnum8[langnum];
+            break;
+        case NativeNumberMode::NATNUM9: // Char, Hangul
+            num = NumberChar_Hangul_ko;
+            break;
+        case NativeNumberMode::NATNUM10:        // Text, Hangul, Long
+            number = &natnum10;
+            break;
+        case NativeNumberMode::NATNUM11:        // Text, Hangul, Short
+            number = &natnum11;
+            break;
+        default:
+            break;
     }
 
     if (number || num >= 0) {
commit f670636245fb407277e38224058616833994ae3e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 26 09:32:29 2014 +0100

    coverity#1241372 Negative array index read
    
    Change-Id: I73bae29c6cc737d341381c010face6b587b31598

diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index a8f08ba..5c421f9 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -611,28 +611,38 @@ sal_Unicode SAL_CALL NativeNumberSupplierService::getNativeNumberChar( const sal
                     return j;
         return inChar;
     }
-    else if (isNumber(inChar) && isValidNatNum(rLocale, nNativeNumberMode)) {
-        sal_Int16 langnum = getLanguageNumber(rLocale);
-        switch (nNativeNumberMode) {
-            case NativeNumberMode::NATNUM1: // Char, Lower
-            case NativeNumberMode::NATNUM4: // Text, Lower, Long
-            case NativeNumberMode::NATNUM7: // Text. Lower, Short
-                return NumberChar[natnum1[langnum]][inChar - NUMBER_ZERO];
-            case NativeNumberMode::NATNUM2: // Char, Upper
-            case NativeNumberMode::NATNUM5: // Text, Upper, Long
-            case NativeNumberMode::NATNUM8: // Text, Upper, Short
-                return NumberChar[natnum2[langnum]][inChar - NUMBER_ZERO];
-            case NativeNumberMode::NATNUM3: // Char, FullWidth
-            case NativeNumberMode::NATNUM6: // Text, FullWidth
-                return NumberChar[NumberChar_FullWidth][inChar - NUMBER_ZERO];
-            case NativeNumberMode::NATNUM9: // Char, Hangul
-            case NativeNumberMode::NATNUM10:        // Text, Hangul, Long
-            case NativeNumberMode::NATNUM11:        // Text, Hangul, Short
-                return NumberChar[NumberChar_Hangul_ko][inChar - NUMBER_ZERO];
-            default:
-                break;
-        }
+
+    if (!isNumber(inChar))
+        return inChar;
+
+    if (!isValidNatNum(rLocale, nNativeNumberMode))
+        return inChar;
+
+    sal_Int16 langnum = getLanguageNumber(rLocale);
+    if (langnum == -1)
+        return inChar;
+
+    switch (nNativeNumberMode)
+    {
+        case NativeNumberMode::NATNUM1: // Char, Lower
+        case NativeNumberMode::NATNUM4: // Text, Lower, Long
+        case NativeNumberMode::NATNUM7: // Text. Lower, Short
+            return NumberChar[natnum1[langnum]][inChar - NUMBER_ZERO];
+        case NativeNumberMode::NATNUM2: // Char, Upper
+        case NativeNumberMode::NATNUM5: // Text, Upper, Long
+        case NativeNumberMode::NATNUM8: // Text, Upper, Short
+            return NumberChar[natnum2[langnum]][inChar - NUMBER_ZERO];
+        case NativeNumberMode::NATNUM3: // Char, FullWidth
+        case NativeNumberMode::NATNUM6: // Text, FullWidth
+            return NumberChar[NumberChar_FullWidth][inChar - NUMBER_ZERO];
+        case NativeNumberMode::NATNUM9: // Char, Hangul
+        case NativeNumberMode::NATNUM10:        // Text, Hangul, Long
+        case NativeNumberMode::NATNUM11:        // Text, Hangul, Short
+            return NumberChar[NumberChar_Hangul_ko][inChar - NUMBER_ZERO];
+        default:
+            break;
     }
+
     return inChar;
 }
 


More information about the Libreoffice-commits mailing list