[Libreoffice-commits] core.git: 17 commits - cui/source dbaccess/source include/svl io/source sc/source sd/source sfx2/source

Caolán McNamara caolanm at redhat.com
Wed Mar 12 04:02:45 PDT 2014


 cui/source/tabpages/backgrnd.cxx                            |    4 +-
 cui/source/tabpages/numpages.cxx                            |    4 +-
 cui/source/tabpages/paragrph.cxx                            |    2 +
 dbaccess/source/ui/control/FieldDescControl.cxx             |    2 +
 include/svl/filerec.hxx                                     |    9 ++++-
 io/source/TextInputStream/TextInputStream.cxx               |   11 +++++-
 io/source/TextOutputStream/TextOutputStream.cxx             |    4 +-
 sc/source/filter/excel/xename.cxx                           |    5 ++-
 sd/source/ui/slidesorter/controller/SlsTransferableData.cxx |   19 +++++-------
 sd/source/ui/slidesorter/shell/SlideSorter.cxx              |   10 +++++-
 sd/source/ui/unoidl/unopage.cxx                             |    5 ++-
 sd/source/ui/view/drtxtob.cxx                               |    2 -
 sfx2/source/dialog/tabdlg.cxx                               |    2 +
 sfx2/source/sidebar/SidebarController.cxx                   |   12 +++++--
 14 files changed, 63 insertions(+), 28 deletions(-)

New commits:
commit f7092fe74a5bf02edce229459dac9d2d014ee267
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:47:06 2014 +0000

    coverity#708189 Uninitialized scalar field
    
    Change-Id: I558cda577595d6807d85bb41ac93500d02d461a6

diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index c40dfde..e744873 100644
--- a/include/svl/filerec.hxx
+++ b/include/svl/filerec.hxx
@@ -328,8 +328,13 @@ protected:
     sal_uInt8               _nRecordVer;    // Version des Gesamt-Inhalts
     sal_uInt8               _nRecordType;   // Record Type aus dem Header
 
-                        // Drei-Phasen-Ctor f"ur Subklassen
-                        SfxSingleRecordReader() {}
+    // Drei-Phasen-Ctor f"ur Subklassen
+    SfxSingleRecordReader()
+        : _nRecordTag(0)
+        , _nRecordVer(0)
+        , _nRecordType(0)
+    {
+    }
     void                Construct_Impl( SvStream *pStream )
                         {
                             SfxMiniRecordReader::Construct_Impl(
commit 5d71f829597afb27a3cb6238e6f1a80b36527710
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:45:21 2014 +0000

    coverity#707937 Uninitialized pointer field
    
    Change-Id: I25b92686b08137a5292de620d4e348019c21a739

diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index 7754ec5..5a388d1 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -97,8 +97,10 @@ public:
 };
 
 OTextOutputStream::OTextOutputStream()
+    : mbEncodingInitialized(false)
+    , mConvUnicode2Text(NULL)
+    , mContextUnicode2Text(NULL)
 {
-    mbEncodingInitialized = false;
 }
 
 OTextOutputStream::~OTextOutputStream()
commit 51f85041ef84d2a66f316fc5284d65260d1ef440
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:44:07 2014 +0000

    coverity#707936 Uninitialized pointer field
    
    Change-Id: I0ae177349408fd49832056fbc4c300e8e77b2417

diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index 3485877..b94c24d 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -117,10 +117,15 @@ public:
 };
 
 OTextInputStream::OTextInputStream()
-    : mSeqSource( READ_BYTE_COUNT ), mpBuffer( NULL ), mnBufferSize( 0 )
-    , mnCharsInBuffer( 0 ), mbReachedEOF( sal_False )
+    : mbEncodingInitialized(false)
+    , mConvText2Unicode(NULL)
+    , mContextText2Unicode(NULL)
+    , mSeqSource(READ_BYTE_COUNT)
+    , mpBuffer(NULL)
+    , mnBufferSize(0)
+    , mnCharsInBuffer(0)
+    , mbReachedEOF(sal_False)
 {
-    mbEncodingInitialized = false;
 }
 
 OTextInputStream::~OTextInputStream()
commit aabee84e8c5adf174e7d40586c0c6406960abcbe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:40:05 2014 +0000

    coverity#704794 Unchecked dynamic_cast
    
    Change-Id: Idbfdfe687ac94f1e1135c8a877a7b133056a875f

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 844fcb2..65a1467 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1295,6 +1295,8 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
     SFX_APP();
     SfxTabPage *pPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
     DBG_ASSERT( pPage, "no active Page" );
+    if (!pPage)
+        return sal_False;
 #ifdef DBG_UTIL
     Data_Impl* pDataObject = Find( pImpl->aData, pTabCtrl->GetCurPageId() );
     DBG_ASSERT( pDataObject, "no Data structur for current page" );
commit 17b0d011dafb5053fe8de2819d00ff746798bd77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:29:28 2014 +0000

    coverity#1027775 Dereference null return value
    
    Change-Id: I27dc7645969e6311bc6c0a3d593924ea41dfdf5d

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index ee839fc..39b5488 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -496,9 +496,15 @@ void SidebarController::UpdateConfigurations (void)
         // with the deck.
         mpTabBar->HighlightDeck(sNewDeckId);
 
-        SwitchToDeck(
-            *ResourceManager::Instance().GetDeckDescriptor(sNewDeckId),
-            maCurrentContext);
+        const DeckDescriptor* pDescriptor =
+            ResourceManager::Instance().GetDeckDescriptor(sNewDeckId);
+
+        if (pDescriptor)
+        {
+            SwitchToDeck(
+                *pDescriptor,
+                maCurrentContext);
+        }
     }
 }
 
commit f51f202f24fc116c4d39beaa4a3ba94b8200b113
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:27:24 2014 +0000

    coverity#705469 Dereference null return value
    
    Change-Id: I8880f0f441456fe1951145551ef6dfa0e9d65b66

diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index fad69b3..b15659e 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -610,7 +610,10 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
                 ScRangeList aRangeList;
                 for( sal_uInt16 nIdx = 0, nCount = rDoc.GetPrintRangeCount( nScTab ); nIdx < nCount; ++nIdx )
                 {
-                    ScRange aRange( *rDoc.GetPrintRange( nScTab, nIdx ) );
+                    const ScRange* pPrintRange = rDoc.GetPrintRange( nScTab, nIdx );
+                    if (!pPrintRange)
+                        continue;
+                    ScRange aRange( *pPrintRange );
                     // Calc document does not care about sheet index in print ranges
                     aRange.aStart.SetTab( nScTab );
                     aRange.aEnd.SetTab( nScTab );
commit 756d36a1cc3bbb3431f2c42c9a0265353f6047b1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:25:42 2014 +0000

    coverity#705463 Dereference null return value
    
    Change-Id: Icf620e065e3b15a8d900a6da00fe979cc45c1f07

diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 241d44d..75397a1 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -619,6 +619,8 @@ IMPL_LINK( OFieldDescControl, FormatClickHdl, Button *, /*pButton*/ )
     SvxCellHorJustify rOldJustify = pActFieldDescr->GetHorJustify();
     Reference< XNumberFormatsSupplier >  xSupplier = GetFormatter()->getNumberFormatsSupplier();
     SvNumberFormatsSupplierObj* pSupplierImpl = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+    if (!pSupplierImpl)
+        return 0;
 
     SvNumberFormatter* pFormatter = pSupplierImpl->GetNumberFormatter();
     if(::dbaui::callColumnFormatDialog(this,pFormatter,pActFieldDescr->GetType(),nOldFormatKey,rOldJustify,sal_True))
commit 861643e63f60c8967659e03b7059ec2d6798c277
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:24:24 2014 +0000

    coverity#705462 Dereference null return value
    
    Change-Id: Ic859f10a4fb70371f7616b4c17bb4c5040fd5051

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index d08fcfd..df84b78 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -381,6 +381,8 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
     {
         const SfxBoolItem* pBoolItem = (SfxBoolItem*)GetOldItem(
                             rOutSet, SID_ATTR_PARA_REGISTER);
+        if (!pBoolItem)
+            return bModified;
         SfxBoolItem* pRegItem = (SfxBoolItem*)pBoolItem->Clone();
         sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
         bool bSet = pRegItem->GetValue();
commit 936bcd6f9aafecc0db05e51e52ce6400812f3d37
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:22:49 2014 +0000

    coverity#705461 Dereference null return value
    
    Change-Id: Icc9dac3f198432f0b548cbe9c559658ee26ba1cc

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index c2c7077..828529d 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1016,8 +1016,10 @@ sal_Bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSe
 {
     sal_uInt16 nWhich = GetWhich( nSlot );
     const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot );
-    const SfxItemSet& rOldSet = GetItemSet();
     DBG_ASSERT(pOld,"FillItemSetWithWallpaperItem: Item not found");
+    if (!pOld)
+        return sal_False;
+    const SfxItemSet& rOldSet = GetItemSet();
 
     SvxBrushItem        rOldItem( (const CntWallpaperItem&)*pOld, nWhich );
     SvxGraphicPosition  eOldPos     = rOldItem.GetGraphicPos();
commit 31d620abf59f54e603d86aea198770a0aeb489b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:20:17 2014 +0000

    coverity#705795 Dereference before null check
    
    Change-Id: I9cf31d5d4a260f0b33539479599610a91875e2e1

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index c75cf24..0ec0d18 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -845,7 +845,7 @@ void  SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
         delete pSaveNum;
         pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
     }
-    if(*pSaveNum != *pActNum)
+    if(pActNum && *pSaveNum != *pActNum)
     {
         *pActNum = *pSaveNum;
         m_pExamplesVS->SetNoSelection();
commit 604cab6cb413a48cb06e7ddc8d9fe92fc6f05f56
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:19:15 2014 +0000

    coverity#705794 Dereference before null check
    
    Change-Id: I63735efaecfad348e04a55a41c5c446cb88db067

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index c8d612d..c75cf24 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -615,7 +615,7 @@ void  SvxNumPickTabPage::ActivatePage(const SfxItemSet& rSet)
         delete pSaveNum;
         pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
     }
-    if(*pSaveNum != *pActNum)
+    if(pActNum && *pSaveNum != *pActNum)
     {
         *pActNum = *pSaveNum;
         m_pExamplesVS->SetNoSelection();
commit 50d20866aa90150680e6d39998081fc148638c73
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:17:50 2014 +0000

    fix coverity#704768
    
    Change-Id: I6b3403ad1b1f18a4cf32a933bb721f9c6cab44f7

diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 4666cc3..5c2a56e 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -534,9 +534,9 @@ bool SlideSorter::RelocateToWindow (::Window* pParentWindow)
     {
         mpViewShell->ViewShell::RelocateToParentWindow(pParentWindow);
         pNewWindow = mpViewShell->GetParentWindow();
+    }
     else
         pNewWindow = NULL;
-    }
 
     SetupControls(pNewWindow);
     SetupListeners();
commit 40ad078ffb84872c9771922c2bef23fed4416bcf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:17:06 2014 +0000

    fix coverity#704768
    
    Change-Id: Ifa33288c01d9b1f8f578db5b4a0f5f03ab5ceaad

diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 24b92c9..4666cc3 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -529,18 +529,16 @@ bool SlideSorter::RelocateToWindow (::Window* pParentWindow)
 
     ReleaseListeners();
 
-    Window *pParentWindow;
+    ::Window *pNewWindow = NULL;
     if (mpViewShell)
     {
         mpViewShell->ViewShell::RelocateToParentWindow(pParentWindow);
-        pParentWindow = mpViewShell->GetParentWindow();
-    }
+        pNewWindow = mpViewShell->GetParentWindow();
     else
-    {
-        pParentWindow = NULL;
+        pNewWindow = NULL;
     }
 
-    SetupControls(pParentWindow);
+    SetupControls(pNewWindow);
     SetupListeners();
 
     // For accessibility we have to shortly hide the content window.  This
commit d689dad8376764340c5adf9eaea91ad90481bd93
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:09:51 2014 +0000

    coverity#704775 Dereference after null check
    
    Change-Id: I03bbcfb7394568d816925a7633657bc48419f2c0

diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index e228ff2..edb0736 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -443,7 +443,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
     else
     {
         // paragraph spacing
-        OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+        OutlinerView* pOLV = mpView ? mpView->GetTextEditOutlinerView() : NULL;
         if( pOLV )
         {
             ESelection aSel = pOLV->GetSelection();
commit 2308b4171c4d52f67e4ef8750d20c22dd8330f01
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:08:43 2014 +0000

    coverity#704772 Dereference after null check
    
    Change-Id: Ic0c56aa9e6f19828df3e81266cc4740167012815

diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 52e3ac7..2c35b3b 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -1347,7 +1347,10 @@ Reference< drawing::XShape >  SdGenericDrawPage::_CreateShape( SdrObject *pObj )
     DBG_ASSERT( GetPage(), "SdGenericDrawPage::_CreateShape(), can't create shape for disposed page!" );
     DBG_ASSERT( pObj, "SdGenericDrawPage::_CreateShape(), invalid call with pObj == 0!" );
 
-    if( GetPage() && pObj )
+    if (!pObj)
+        return Reference< drawing::XShape >();
+
+    if (GetPage())
     {
         PresObjKind eKind = GetPage()->GetPresObjKind(pObj);
 
commit d60ecf4b1566e3c1d2ad060f798f283923492eae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:06:29 2014 +0000

    coverity#704768 Dereference after null check
    
    Change-Id: Ia101fcbc4b7288bccdc2fbd990124f4381f6f7f4

diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 9e9c189..24b92c9 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -529,10 +529,18 @@ bool SlideSorter::RelocateToWindow (::Window* pParentWindow)
 
     ReleaseListeners();
 
-    if (mpViewShell != NULL)
+    Window *pParentWindow;
+    if (mpViewShell)
+    {
         mpViewShell->ViewShell::RelocateToParentWindow(pParentWindow);
+        pParentWindow = mpViewShell->GetParentWindow();
+    }
+    else
+    {
+        pParentWindow = NULL;
+    }
 
-    SetupControls(mpViewShell->GetParentWindow());
+    SetupControls(pParentWindow);
     SetupListeners();
 
     // For accessibility we have to shortly hide the content window.  This
commit a91d7e2d33d3c29afb78f05fb70cf5b03c97fb3a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 12 10:04:35 2014 +0000

    coverity#704766 Dereference after null check
    
    Change-Id: I8491260f198e80138241de891ef29cc8ab21a008

diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
index baa5c3b..4851989 100644
--- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
@@ -38,24 +38,21 @@ SdTransferable* TransferableData::CreateTransferable (
     return pTransferable;
 }
 
-
-
-
 ::boost::shared_ptr<TransferableData> TransferableData::GetFromTransferable (const SdTransferable* pTransferable)
 {
-    ::boost::shared_ptr<TransferableData> pData;
-    for (sal_Int32 nIndex=0,nCount=pTransferable->GetUserDataCount(); nIndex<nCount; ++nIndex)
+    if (pTransferable)
     {
-        pData = ::boost::dynamic_pointer_cast<TransferableData>(pTransferable->GetUserData(nIndex));
-        if (pData)
-            return pData;
+        for (sal_Int32 nIndex=0,nCount=pTransferable->GetUserDataCount(); nIndex<nCount; ++nIndex)
+        {
+            ::boost::shared_ptr<TransferableData> xData =
+                ::boost::dynamic_pointer_cast<TransferableData>(pTransferable->GetUserData(nIndex));
+            if (xData)
+                return xData;
+        }
     }
     return ::boost::shared_ptr<TransferableData>();
 }
 
-
-
-
 TransferableData::TransferableData (
     SlideSorterViewShell* pViewShell,
     const ::std::vector<Representative>& rRepresentatives)


More information about the Libreoffice-commits mailing list