[Libreoffice-commits] core.git: 17 commits - lotuswordpro/source sal/osl sc/inc sc/source sd/source sfx2/source solenv/bin sw/qa sw/source vcl/unx writerperfect/source

Caolán McNamara caolanm at redhat.com
Thu Feb 6 03:58:22 PST 2014


 lotuswordpro/source/filter/lwptablelayout.cxx        |    6 -
 lotuswordpro/source/filter/xfilter/xftable.cxx       |   18 +---
 lotuswordpro/source/filter/xfilter/xftable.hxx       |   14 +--
 sal/osl/unx/pipe.c                                   |    5 +
 sc/inc/cellsuno.hxx                                  |    3 
 sc/inc/viewuno.hxx                                   |    3 
 sc/source/ui/unoobj/cellsuno.cxx                     |    4 -
 sc/source/ui/unoobj/drdefuno.cxx                     |   20 +++--
 sc/source/ui/unoobj/viewuno.cxx                      |    4 -
 sd/source/ui/remotecontrol/DiscoveryService.cxx      |    5 +
 sfx2/source/view/frmload.cxx                         |   72 ++++++++++---------
 solenv/bin/concat-deps.c                             |    2 
 sw/qa/core/Test-BigPtrArray.cxx                      |   15 +--
 sw/source/core/docnode/node.cxx                      |    2 
 sw/source/core/docnode/section.cxx                   |    5 -
 sw/source/core/draw/dcontact.cxx                     |    2 
 sw/source/core/draw/dview.cxx                        |    2 
 sw/source/core/frmedt/fetab.cxx                      |    2 
 vcl/unx/gtk/a11y/atkwrapper.cxx                      |    2 
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx             |    7 +
 writerperfect/source/impress/KeynoteImportFilter.cxx |   13 ++-
 21 files changed, 118 insertions(+), 88 deletions(-)

New commits:
commit 18a16b6bd818d9b3a5e5f3e870cdfad528aa46d4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 11:30:45 2014 +0000

    Related: rhbz#1061864 filtername is somehow NULL
    
    Change-Id: I11930d8401ada43c7fce570131baf2e8a7067ecb

diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 372b8bf..bdd2455 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -892,8 +892,11 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno
                 GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog));
                 if (m_pPseudoFilter != filter)
                 {
-                    const gchar* filtername = gtk_file_filter_get_name( filter );
-                    sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
+                    const gchar* filtername = filter ? gtk_file_filter_get_name(filter) : NULL;
+                    if (filtername)
+                        sFilterName = OUString(filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8);
+                    else
+                        sFilterName = OUString();
                 }
                 else
                     sFilterName = m_aInitialFilter;
commit a9c63ef451ff88734b14b179691bf9d4a22a1e6b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 11:17:38 2014 +0000

    coverity#1038464 Uncaught exception
    
    Change-Id: Ic811b66b7b3ac204ee894fd0931bb96cce11fd8c

diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index ac7bf1a..ff87c4e 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -260,7 +260,8 @@ public:
                                     ::com::sun::star::beans::PropertyVetoException,
                                     ::com::sun::star::lang::IllegalArgumentException,
                                     ::com::sun::star::lang::WrappedTargetException,
-                                    ::com::sun::star::uno::RuntimeException);
+                                    ::com::sun::star::uno::RuntimeException,
+                                    std::exception);
     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
                                     const OUString& PropertyName )
                                 throw(::com::sun::star::beans::UnknownPropertyException,
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index ffe6c48..bf3aea6 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1827,8 +1827,8 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTabViewObj::getPropertySetInf
 void SAL_CALL ScTabViewObj::setPropertyValue(
                         const OUString& aPropertyName, const uno::Any& aValue )
                 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
-                        lang::IllegalArgumentException, lang::WrappedTargetException,
-                        uno::RuntimeException)
+                      lang::IllegalArgumentException, lang::WrappedTargetException,
+                      uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
     OUString aString(aPropertyName);
commit 90f4e15a2c7d7d9120e300032d7aa1cab227d7be
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 11:15:23 2014 +0000

    coverity#1038441 Uncaught exception
    
    Change-Id: I4257734fbff8e54c9f69bc9ec7fbc63fb6c4fa17

diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 5a96987..d97cf37 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -53,14 +53,22 @@ void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
 SfxItemPool* ScDrawDefaultsObj::getModelPool( sal_Bool bReadOnly ) throw()
 {
     SfxItemPool* pRet = NULL;
-    if ( pDocShell )
+
+    try
+    {
+        if ( pDocShell )
+        {
+            ScDrawLayer* pModel = bReadOnly ?
+                            pDocShell->GetDocument()->GetDrawLayer() :
+                            pDocShell->MakeDrawLayer();
+            if ( pModel )
+                pRet = &pModel->GetItemPool();
+        }
+    }
+    catch (...)
     {
-        ScDrawLayer* pModel = bReadOnly ?
-                        pDocShell->GetDocument()->GetDrawLayer() :
-                        pDocShell->MakeDrawLayer();
-        if ( pModel )
-            pRet = &pModel->GetItemPool();
     }
+
     if ( !pRet )
         pRet = SvxUnoDrawPool::getModelPool( bReadOnly );       // uses default pool
 
commit e31ce570aaea6eebfc7040e5d406bc4c43cb55c1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 11:01:27 2014 +0000

    coverity#1038388 Uncaught exception
    
    Change-Id: I87953c40c3110cd15553f1b3f77f25a772436ad7

diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index 9e42591..fcae7ba 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -395,7 +395,8 @@ public:
                                       std::exception);
     virtual void SAL_CALL   setColumnDescriptions( const ::com::sun::star::uno::Sequence<
                                 OUString >& aColumnDescriptions )
-                                    throw(::com::sun::star::uno::RuntimeException);
+                                    throw(::com::sun::star::uno::RuntimeException,
+                                          std::exception);
 
                             // XCellRangesQuery
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetCellRanges > SAL_CALL
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 595b0f3..826b32d 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -3269,8 +3269,8 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesBase::getColumnDescriptions()
 }
 
 void SAL_CALL ScCellRangesBase::setColumnDescriptions(
-                        const uno::Sequence<OUString>& aColumnDescriptions )
-                                                throw(uno::RuntimeException)
+    const uno::Sequence<OUString>& aColumnDescriptions )
+        throw(uno::RuntimeException, std::exception)
 {
     SolarMutexGuard aGuard;
     sal_Bool bDone = false;
commit 48026a8538e683815a94ca556432b149d9f62e11
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:38:54 2014 +0000

    coverity#704878 Dereference after null check
    
    Change-Id: Idb9ab6347c1195c3c0d797274427dd887a5abe9e

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 3eae6c7..75dc74e 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -975,7 +975,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV
 //FEATURE::CONDCOLL
 
     case RES_ATTRSET_CHG:
-        if( GetNodes().IsDocNodes() && IsTxtNode() )
+        if (GetNodes().IsDocNodes() && IsTxtNode() && pOldValue)
         {
             if( SFX_ITEM_SET == ((SwAttrSetChg*)pOldValue)->GetChgSet()->GetItemState(
                 RES_CHRATR_HIDDEN, sal_False ) )
commit 15d5ca2509b1eb60e3e7dd6d170d7074767aabb6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:37:54 2014 +0000

    coverity#704879 Dereference after null check
    
    Change-Id: Id71bc28be456c4883aacd29b560e9ff7d566ff84

diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index df34c73..fecbeb6 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -752,7 +752,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
     switch( nWhich )
     {
     case RES_ATTRSET_CHG:
-        if( GetDepends() )
+        if (GetDepends() && pOld && pNew)
         {
             SfxItemSet* pNewSet = ((SwAttrSetChg*)pNew)->GetChgSet();
             SfxItemSet* pOldSet = ((SwAttrSetChg*)pOld)->GetChgSet();
@@ -820,7 +820,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
         return; // That's it!
 
     case RES_OBJECTDYING:
-        if( !GetDoc()->IsInDtor() &&
+        if( !GetDoc()->IsInDtor() && pOld &&
             ((SwPtrMsgPoolItem *)pOld)->pObject == (void*)GetRegisteredIn() )
         {
             // My Parents will be destroyed, so get the Parent's Parent
commit 1459ce2f6dbc316b284f1720cc3323e30842c07c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:36:03 2014 +0000

    coverity#704880 Dereference after null check
    
    Change-Id: Id4541f939731875a14e076779da475f274a76bd7

diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 24fc8f4..df34c73 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -416,6 +416,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
     switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
     {
     case RES_ATTRSET_CHG:
+        if (pNew && pOld)
         {
             SfxItemSet* pNewSet = ((SwAttrSetChg*)pNew)->GetChgSet();
             SfxItemSet* pOldSet = ((SwAttrSetChg*)pOld)->GetChgSet();
commit 70bfc1acea07f386fc8165a62d337762cf5cddf9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:34:00 2014 +0000

    coverity#704882 Dereference after null check
    
    Change-Id: I262c4d2efab8d3bfbb5edbe4208555cb446caf5c

diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 6f543a6..2989ee4 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -992,7 +992,7 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
             }
             // #i34640# - include spacing for wrapping
             SwRect aRect( pDrawVirtObj->GetAnchoredObj()->GetObjRectWithSpaces() );
-            if( aRect.HasArea() )
+            if (aRect.HasArea() && pPage)
             {
                 SwPageFrm* pPg = (SwPageFrm*)::FindPage( aRect, pPage );
                 if ( pPg )
commit 57ddc98298a747ba23b276a3c6f4c6e2fc6db238
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:32:43 2014 +0000

    coverity#704883 Dereference after null check
    
    Change-Id: Ib5abe9a16fa4879d769f5ee229bc1b02f32fd62e

diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 6233863..b025b98 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -722,7 +722,7 @@ const SwFrm* SwDrawView::CalcAnchor()
 
     if ( aPt != aMyPt )
     {
-        if ( pAnch->IsCntntFrm() )
+        if ( pAnch && pAnch->IsCntntFrm() )
         {
             // allow drawing objects in header/footer,
             // but exclude control objects.
commit c2dc60aed71da33b56650911e8386af31c2a34f0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:30:41 2014 +0000

    coverity#704892 Dereference after null check
    
    Change-Id: If79129131df575c3ea42d50402d49b24744d5331

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 9fd1c78..f39a126 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1869,7 +1869,7 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
         }
 
         // no calculation of end frame if start frame has not been found.
-        if ( 1 == i || !ppPos[0] || !pEnd )
+        if ( 1 == i || !ppPos[0] || !pEnd || !pFrm )
             break;
 
         // find 'closest' table frame to pEnd:
commit cae8e5ff46053e06a36d8d4e8bc7bef6297d23d0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:26:38 2014 +0000

    coverity#983495 Copy into fixed size buffer
    
    Change-Id: If8ebdedb1d073b5e83b639cf69508c69c7f25c69

diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index 9ba0b2e..c3a05bb 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <sal/types.h>
+#include <rtl/strbuf.hxx>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
@@ -800,11 +801,10 @@ public:
 private:
     void test_insert_at_end(const char* numElements)
     {
-        char buff[100] = { 0 };
-        strcat(buff, "test_insert_at_end ");
-        strcat(buff, numElements);
+        OStringBuffer buff("test_insert_at_end ");
+        buff.append(numElements);
         int n = atoi(numElements);
-        PerformanceTracer tracer(buff);
+        PerformanceTracer tracer(buff.getStr());
         BigPtrArray bparr;
         for (int i = 0; i < n; i++)
             bparr.Insert(new BigPtrEntryMock(i), bparr.Count());
@@ -814,11 +814,10 @@ private:
 
     void test_insert_at_front(const char* numElements)
     {
-        char buff[100] = { 0 };
-        strcat(buff, "test_insert_at_front ");
-        strcat(buff, numElements);
+        OStringBuffer buff("test_insert_at_front ");
+        buff.append(numElements);
         int n = atoi(numElements);
-        PerformanceTracer tracer(buff);
+        PerformanceTracer tracer(buff.getStr());
         BigPtrArray bparr;
         for (int i = 0; i < n; i++)
             bparr.Insert(new BigPtrEntryMock(i), 0);
commit 35e193290ed46277e7c404ccde50638c1c3a755a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:23:03 2014 +0000

    coverity#736301 the 2nd arg is a gpointer
    
    Change-Id: I66e57d570c5ae70e69eea2d44812a72a3b67509e

diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index e45add2..ba1e558 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -599,7 +599,7 @@ atk_object_wrapper_class_init (AtkObjectWrapperClass *klass)
 
 static void
 atk_object_wrapper_init (AtkObjectWrapper      *wrapper,
-                         AtkObjectWrapperClass)
+                         AtkObjectWrapperClass*)
 {
    wrapper->mpAction = NULL;
    wrapper->mpComponent = NULL;
commit 61f88fb318f4b2fce2bb6883d46ed08c523b1605
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:18:56 2014 +0000

    coverity#736094 Argument cannot be negative
    
    Change-Id: I8368217e7fb40322de1f03ef68c1ddbe2fc5652a

diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index fec98ee..a64723f 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -604,7 +604,7 @@ int fd;
         size = &local_size;
     }
     *size = file_get_size(name, &rc);
-    if (!rc)
+    if (!rc && *size >= 0)
     {
         fd = open(name, FILE_O_RDONLY | FILE_O_BINARY);
         if (!(fd == -1))
commit ec3dcdfba5c4ae701a3ae22f31bdd8849367e4b3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:17:11 2014 +0000

    coverity#736093 Argument cannot be negative
    
    Change-Id: I54f703c1ce5af70c24ef0ad9d6fa6c717d0ecd37

diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 26da311..1919b60 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -81,6 +81,11 @@ DiscoveryService::DiscoveryService()
 
     // Old implementation for backward compatibility matter
     mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
+    if (mSocket == -1)
+    {
+        SAL_WARN("sd", "DiscoveryService: socket failed: " << errno);
+        return; // would be better to throw, but unsure if caller handles that
+    }
 
     sockaddr_in aAddr;
     memset(&aAddr, 0, sizeof(aAddr));
commit 0ddae2167e7d52bf0f2bda323100f5ebb4ab3dc0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 10:03:02 2014 +0000

    coverity#705403 Argument cannot be negative
    
    Change-Id: I0cf67a4bd5ec95e135511611c236350d4347895e

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index c40c376..b8193b4 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -845,7 +845,7 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow(
 
     ConvertTable(pTmpTable,nStartHeadRow,nEndHeadRow,0,nCol);
 
-    sal_uInt16 nRowNum = static_cast<sal_uInt16>(pTmpTable->GetRowCount());
+    sal_uInt16 nRowNum = pTmpTable->GetRowCount();
     sal_uInt8* CellMark = new sal_uInt8[nRowNum];
     sal_Bool bFindFlag = sal_False;
 
@@ -884,7 +884,7 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable,XFTable* pXFTable,
 {
     sal_uInt16 i;
     sal_uInt8 j;
-    sal_uInt16 nRowNum = static_cast<sal_uInt16>(pTmpTable->GetRowCount());
+    sal_uInt16 nRowNum = pTmpTable->GetRowCount();
     sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn());
 
     XFRow* pXFRow = new XFRow;
@@ -981,7 +981,7 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable,XFTable* pXFTable,
 sal_Bool  LwpTableLayout::FindSplitColMark(XFTable* pXFTable,sal_uInt8* pCellMark,
             sal_uInt8& nMaxColSpan)
 {
-    sal_uInt16 nRowNum = static_cast<sal_uInt16>(pXFTable->GetRowCount());
+    sal_uInt16 nRowNum = pXFTable->GetRowCount();
     sal_uInt8 nColNum = static_cast<sal_uInt8>(pXFTable->GetColumnCount());
     sal_uInt8 nCellMark=0;
     sal_uInt8 nCount;
diff --git a/lotuswordpro/source/filter/xfilter/xftable.cxx b/lotuswordpro/source/filter/xfilter/xftable.cxx
index 678a1a1..0b193ae 100644
--- a/lotuswordpro/source/filter/xfilter/xftable.cxx
+++ b/lotuswordpro/source/filter/xfilter/xftable.cxx
@@ -115,12 +115,11 @@ XFTable& XFTable::operator =(const XFTable& other)
 
 XFTable::~XFTable()
 {
-    std::map<sal_Int32,XFRow*>::iterator it;
+    std::map<sal_uInt16, XFRow*>::iterator it;
     for( it=m_aRows.begin(); it!=m_aRows.end(); ++it )
     {
         XFRow *pRow = (*it).second;
-        if( pRow )
-            delete pRow;
+        delete pRow;
     }
     m_aRows.clear();
     m_aColumns.clear();
@@ -167,13 +166,13 @@ OUString XFTable::GetTableName()
         return m_strName;
 }
 
-sal_Int32   XFTable::GetRowCount()
+sal_uInt16 XFTable::GetRowCount()
 {
-    sal_Int32   rowMax = -1;
-    std::map<sal_Int32,XFRow*>::iterator it;
+    sal_uInt16 rowMax = 0;
+    std::map<sal_uInt16, XFRow*>::iterator it;
     for( it=m_aRows.begin(); it!=m_aRows.end(); ++it )
     {
-        if( it->first>rowMax )
+        if (it->first > rowMax)
             rowMax = it->first;
     }
 
@@ -219,9 +218,6 @@ void    XFTable::ToXml(IXFStream *pStrm)
     else
         pStrm->StartElement( A2OUSTR("table:table") );
 
-    //test code
-//  sal_Int32 rowMax = GetRowCount();
-//  sal_Int32 colMax = GetColumnCount();
     //output columns:
     {
         int lastCol = 0;
@@ -267,7 +263,7 @@ void    XFTable::ToXml(IXFStream *pStrm)
         int     lastRow = 0;
         pAttrList = pStrm->GetAttrList();
 
-        std::map<sal_Int32,XFRow* >::iterator it = m_aRows.begin();
+        std::map<sal_uInt16, XFRow* >::iterator it = m_aRows.begin();
         for( ; it!=m_aRows.end(); ++it )
         {
             int row = (*it).first;
diff --git a/lotuswordpro/source/filter/xfilter/xftable.hxx b/lotuswordpro/source/filter/xfilter/xftable.hxx
index e9ae022..8dae00a 100644
--- a/lotuswordpro/source/filter/xfilter/xftable.hxx
+++ b/lotuswordpro/source/filter/xfilter/xftable.hxx
@@ -98,7 +98,7 @@ public:
 
     OUString   GetTableName();
 
-    sal_Int32   GetRowCount();
+    sal_uInt16  GetRowCount();
 
     XFRow*      GetRow(sal_Int32 row);
 
@@ -112,14 +112,17 @@ public:
 
     virtual void    ToXml(IXFStream *pStrm);
 
-    void        RemoveRow(sal_Int32 row);
+    void RemoveRow(sal_uInt16 row)
+    {
+        m_aRows.erase(row);
+    }
 
 private:
     OUString   m_strName;
     sal_Bool    m_bSubTable;
     XFCell      *m_pOwnerCell;
     XFContentContainer  m_aHeaderRows;
-    std::map<sal_Int32,XFRow*>  m_aRows;
+    std::map<sal_uInt16, XFRow*>  m_aRows;
     std::map<sal_Int32,OUString>   m_aColumns;
     OUString   m_strDefCellStyle;
     OUString   m_strDefRowStyle;
@@ -158,11 +161,6 @@ inline void XFTable::SetDefaultColStyle(OUString style)
     m_strDefColStyle = style;
 }
 
-inline void XFTable::RemoveRow(sal_Int32 row)
-{
-    m_aRows.erase(row);
-}
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c
index b3d1085..e271e94 100644
--- a/sal/osl/unx/pipe.c
+++ b/sal/osl/unx/pipe.c
@@ -383,6 +383,11 @@ void SAL_CALL osl_closePipe( oslPipe pPipe )
         pPipe->m_bIsInShutdown = sal_True;
         pPipe->m_Socket = -1;
         fd = socket(AF_UNIX, SOCK_STREAM, 0);
+        if ( fd < 0 )
+        {
+            OSL_TRACE("socket in osl_destroyPipe failed with error: %s", strerror(errno));
+            return;
+        }
         memset(&addr, 0, sizeof(addr));
 
         OSL_TRACE("osl_destroyPipe : Pipe Name '%s'",pPipe->m_Name);
commit f8a1adaaa395a51e952e42ae61ff8af70741dd56
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 09:59:25 2014 +0000

    coverity#1158398 Uncaught exception
    
    Change-Id: I943b6233554d91e1a14f545e30f95528ca592924

diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index d9be43c..ddb17a1 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -420,45 +420,51 @@ SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XM
 // --------------------------------------------------------------------------------------------------------------------
 bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const
 {
-    const OUString sTemplateRegioName = io_rDescriptor.getOrDefault( "TemplateRegionName", OUString() );
-    const OUString sTemplateName      = io_rDescriptor.getOrDefault( "TemplateName",       OUString() );
-    const OUString sServiceName       = io_rDescriptor.getOrDefault( "DocumentService",    OUString() );
-    const OUString sURL               = io_rDescriptor.getOrDefault( "URL",                OUString() );
-
-    // determine the full URL of the template to use, if any
-    OUString sTemplateURL;
-    if ( !sTemplateRegioName.isEmpty() && !sTemplateName.isEmpty() )
-    {
-        SfxDocumentTemplates aTmpFac;
-        aTmpFac.GetFull( sTemplateRegioName, sTemplateName, sTemplateURL );
-    }
-    else
+    try
     {
-        if ( !sServiceName.isEmpty() )
-            sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName );
+        const OUString sTemplateRegioName = io_rDescriptor.getOrDefault( "TemplateRegionName", OUString() );
+        const OUString sTemplateName      = io_rDescriptor.getOrDefault( "TemplateName",       OUString() );
+        const OUString sServiceName       = io_rDescriptor.getOrDefault( "DocumentService",    OUString() );
+        const OUString sURL               = io_rDescriptor.getOrDefault( "URL",                OUString() );
+
+        // determine the full URL of the template to use, if any
+        OUString sTemplateURL;
+        if ( !sTemplateRegioName.isEmpty() && !sTemplateName.isEmpty() )
+        {
+            SfxDocumentTemplates aTmpFac;
+            aTmpFac.GetFull( sTemplateRegioName, sTemplateName, sTemplateURL );
+        }
         else
-            sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) );
-    }
+        {
+            if ( !sServiceName.isEmpty() )
+                sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName );
+            else
+                sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) );
+        }
 
-    if ( !sTemplateURL.isEmpty() )
-    {
-        // detect the filter for the template. Might still be NULL (if the template is broken, or does not
-        // exist, or some such), but this is handled by our caller the same way as if no template/URL was present.
-        const SfxFilter* pTemplateFilter = impl_detectFilterForURL( sTemplateURL, io_rDescriptor, SFX_APP()->GetFilterMatcher() );
-        if ( pTemplateFilter )
+        if ( !sTemplateURL.isEmpty() )
         {
-            // load the template document, but, well, "as template"
-            io_rDescriptor.put( "FilterName", OUString( pTemplateFilter->GetName() ) );
-            io_rDescriptor.put( "FileName", OUString( sTemplateURL ) );
-            io_rDescriptor.put( "AsTemplate", sal_True );
-
-            // #i21583#
-            // the DocumentService property will finally be used to create the document. Thus, override any possibly
-            // present value with the document service of the template.
-            io_rDescriptor.put( "DocumentService", OUString( pTemplateFilter->GetServiceName() ) );
-            return true;
+            // detect the filter for the template. Might still be NULL (if the template is broken, or does not
+            // exist, or some such), but this is handled by our caller the same way as if no template/URL was present.
+            const SfxFilter* pTemplateFilter = impl_detectFilterForURL( sTemplateURL, io_rDescriptor, SFX_APP()->GetFilterMatcher() );
+            if ( pTemplateFilter )
+            {
+                // load the template document, but, well, "as template"
+                io_rDescriptor.put( "FilterName", OUString( pTemplateFilter->GetName() ) );
+                io_rDescriptor.put( "FileName", OUString( sTemplateURL ) );
+                io_rDescriptor.put( "AsTemplate", sal_True );
+
+                // #i21583#
+                // the DocumentService property will finally be used to create the document. Thus, override any possibly
+                // present value with the document service of the template.
+                io_rDescriptor.put( "DocumentService", OUString( pTemplateFilter->GetServiceName() ) );
+                return true;
+            }
         }
     }
+    catch (...)
+    {
+    }
     return false;
 }
 
commit b0bd6e9e6ed90a14224e30e9e93a6ddff00dbc5d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 6 09:50:28 2014 +0000

    coverity#1158271 Uncaught exception
    
    Change-Id: I1a39ed2fb8542cb1bc5a56ce8f78cafe4618aa79

diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx
index 4efbcb0..ea944e0 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -234,10 +234,17 @@ throw( com::sun::star::uno::RuntimeException )
     if ( xContent.is() )
     {
         ucbhelper::Content aContent( xContent, Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
-        if ( aContent.isFolder() )
+        try
         {
-            input.reset( new writerperfect::DirectoryStream( xContent ) );
-            bIsPackage = true;
+            if ( aContent.isFolder() )
+            {
+                input.reset( new writerperfect::DirectoryStream( xContent ) );
+                bIsPackage = true;
+            }
+        }
+        catch (...)
+        {
+            return OUString();
         }
 
         libetonyek::KEYDocumentType type = libetonyek::KEY_DOCUMENT_TYPE_UNKNOWN;


More information about the Libreoffice-commits mailing list