[Libreoffice-commits] core.git: 9 commits - filter/source hwpfilter/source sc/source sd/inc sd/source

Caolán McNamara caolanm at redhat.com
Fri May 30 03:49:27 PDT 2014


 filter/source/graphicfilter/eps/eps.cxx     |    4 +--
 filter/source/graphicfilter/etiff/etiff.cxx |    4 +--
 filter/source/graphicfilter/icgm/cgm.cxx    |    2 -
 filter/source/graphicfilter/icgm/cgm.hxx    |    2 -
 hwpfilter/source/hiodev.cxx                 |    4 +--
 hwpfilter/source/hiodev.h                   |    6 ++---
 sc/source/ui/drawfunc/fudraw.cxx            |    3 ++
 sd/inc/drawdoc.hxx                          |    2 -
 sd/source/core/drawdoc.cxx                  |    7 +++++
 sd/source/core/drawdoc2.cxx                 |   18 +++++++--------
 sd/source/core/drawdoc3.cxx                 |    4 +--
 sd/source/ui/dlg/animobjs.cxx               |    2 -
 sd/source/ui/func/fudraw.cxx                |   33 +++++++++++++++-------------
 sd/source/ui/func/fuexpand.cxx              |    4 +--
 sd/source/ui/func/fusumry.cxx               |    4 +--
 sd/source/ui/unoidl/unomodel.cxx            |   10 ++++----
 sd/source/ui/view/Outliner.cxx              |   17 +++-----------
 sd/source/ui/view/OutlinerIterator.cxx      |    6 ++---
 sd/source/ui/view/outlview.cxx              |    4 +--
 19 files changed, 69 insertions(+), 67 deletions(-)

New commits:
commit 1f0b7e5dc4299ff0c4c52fc69fa97b99d9e9e076
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:54:40 2014 +0100

    coverity#704728 Unchecked dynamic_cast
    
    Change-Id: I2db2d6ffdca1775f21969b523ede56b3fb3fd682

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index bf59fc0..da589b8 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -201,7 +201,6 @@ private:
         com::sun::star::xml::dom::XNode> > maPresObjectInfo;
 
     bool                mbUseEmbedFonts;
-
 protected:
 
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel() SAL_OVERRIDE;
@@ -215,6 +214,7 @@ public:
 
     virtual SdrModel*   AllocModel() const SAL_OVERRIDE;
     virtual SdrPage*    AllocPage(bool bMasterPage) SAL_OVERRIDE;
+    SdPage*             AllocSdPage(bool bMasterPage);
     virtual bool        IsReadOnly() const SAL_OVERRIDE;
     virtual void        SetChanged(bool bFlag = true) SAL_OVERRIDE;
 
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 63d5158..2245654 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -498,12 +498,17 @@ SdrModel* SdDrawDocument::AllocModel() const
     return pNewModel;
 }
 
+SdPage* SdDrawDocument::AllocSdPage(bool bMasterPage)
+{
+    return new SdPage(*this, bMasterPage);
+}
+
 // This method creates a new page (SdPage) and returns a pointer to said page.
 // The drawing engine uses this method to create pages (whose types it does
 // not know, as they are _derivatives_ of SdrPage) when loading.
 SdrPage* SdDrawDocument::AllocPage(bool bMasterPage)
 {
-    return new SdPage(*this, bMasterPage);
+    return AllocSdPage(bMasterPage);
 }
 
 // When the model has changed
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 3d3b8e9..a592640 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -476,7 +476,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
         Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
 
         // Insert handout page
-        SdPage* pHandoutPage = dynamic_cast< SdPage* >( AllocPage(false) );
+        SdPage* pHandoutPage = AllocSdPage(false);
 
         SdPage* pRefPage = NULL;
 
@@ -499,7 +499,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
         InsertPage(pHandoutPage, 0);
 
         // Insert master page and register this with the handout page
-        SdPage* pHandoutMPage = (SdPage*) AllocPage(true);
+        SdPage* pHandoutMPage = AllocSdPage(true);
         pHandoutMPage->SetSize( pHandoutPage->GetSize() );
         pHandoutMPage->SetPageKind(PK_HANDOUT);
         pHandoutMPage->SetBorder( pHandoutPage->GetLftBorder(),
@@ -520,7 +520,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
 
         if (nPageCount == 0)
         {
-            pPage = dynamic_cast< SdPage* >( AllocPage(false) );
+            pPage = AllocSdPage(false);
 
             if( pRefPage )
             {
@@ -574,7 +574,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
         }
 
         // Insert master page, then register this with the page
-        SdPage* pMPage = (SdPage*) AllocPage(true);
+        SdPage* pMPage = AllocSdPage(true);
         pMPage->SetSize( pPage->GetSize() );
         pMPage->SetBorder( pPage->GetLftBorder(),
                            pPage->GetUppBorder(),
@@ -586,7 +586,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
             pMPage->SetLayoutName( pPage->GetLayoutName() );
 
         // Insert notes page
-        SdPage* pNotesPage = (SdPage*) AllocPage(false);
+        SdPage* pNotesPage = AllocSdPage(false);
 
         if( pRefDocument )
             pRefPage = pRefDocument->GetSdPage( 0, PK_NOTES );
@@ -616,7 +616,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
             pNotesPage->SetLayoutName( pPage->GetLayoutName() );
 
         // Insert master page, then register this with the notes page
-        SdPage* pNotesMPage = (SdPage*) AllocPage(true);
+        SdPage* pNotesMPage = AllocSdPage(true);
         pNotesMPage->SetSize( pNotesPage->GetSize() );
         pNotesMPage->SetPageKind(PK_NOTES);
         pNotesMPage->SetBorder( pNotesPage->GetLftBorder(),
@@ -1154,7 +1154,7 @@ void SdDrawDocument::CheckMasterPages()
                     if( nFound == nMaxPages )
                         pRefNotesPage = NULL;
 
-                    SdPage* pNewNotesPage = static_cast<SdPage*>(AllocPage(true));
+                    SdPage* pNewNotesPage = AllocSdPage(true);
                     pNewNotesPage->SetPageKind(PK_NOTES);
                     if( pRefNotesPage )
                     {
@@ -1225,7 +1225,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
     }
 
     // Create new standard page and set it up
-    pStandardPage = (SdPage*) AllocPage(false);
+    pStandardPage = AllocSdPage(false);
 
     // Set the size here since else the presobj autolayout
     // will be wrong.
@@ -1255,7 +1255,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
     pStandardPage->SetTime( pPreviousStandardPage->GetTime() );
 
     // Create new notes page and set it up
-    pNotesPage = (SdPage*) AllocPage(false);
+    pNotesPage = AllocSdPage(false);
     pNotesPage->SetPageKind(PK_NOTES);
 
     // Use master page of current page
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 5621826..bc2af1c 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1807,7 +1807,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
         if( bUndo )
             BegUndo();
 
-        pMaster = (SdPage*) AllocPage(true);
+        pMaster = AllocSdPage(true);
         pMaster->SetSize(pSelectedPage->GetSize());
         pMaster->SetBorder(pSelectedPage->GetLftBorder(),
                            pSelectedPage->GetUppBorder(),
@@ -1822,7 +1822,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
 
         pMaster->SetAutoLayout(AUTOLAYOUT_NONE, true, true);
 
-        pNotesMaster = (SdPage*) AllocPage(true);
+        pNotesMaster = AllocSdPage(true);
         pNotesMaster->SetPageKind(PK_NOTES);
         pNotesMaster->SetSize(pNotes->GetSize());
         pNotesMaster->SetBorder(pNotes->GetLftBorder(),
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 0030348..1989f83 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -173,7 +173,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
 
     // create new document with page
     pMyDoc = new SdDrawDocument(DOCUMENT_TYPE_IMPRESS, NULL);
-    SdPage* pPage = (SdPage*) pMyDoc->AllocPage(false);
+    SdPage* pPage = pMyDoc->AllocSdPage(false);
     pMyDoc->InsertPage(pPage);
 
     pControllerItem = new AnimationControllerItem( SID_ANIMATOR_STATE, this, pBindings );
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index 2467e1a..5626cb4 100644
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -134,7 +134,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
                 if ( nDepth == 0 )
                 {
                     // page with title & structuring!
-                    SdPage* pPage = (SdPage*) mpDoc->AllocPage(false);
+                    SdPage* pPage = mpDoc->AllocSdPage(false);
                     pPage->SetSize(pActualPage->GetSize() );
                     pPage->SetBorder(pActualPage->GetLftBorder(),
                                      pActualPage->GetUppBorder(),
@@ -156,7 +156,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
                     pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
 
                     // notes-page
-                    SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(false);
+                    SdPage* pNotesPage = mpDoc->AllocSdPage(false);
                     pNotesPage->SetSize(pActualNotesPage->GetSize());
                     pNotesPage->SetBorder(pActualNotesPage->GetLftBorder(),
                                           pActualNotesPage->GetUppBorder(),
diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx
index a5ae8c0..0c5731a 100644
--- a/sd/source/ui/func/fusumry.cxx
+++ b/sd/source/ui/func/fusumry.cxx
@@ -117,7 +117,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
                     SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers();
 
                     // page with title & structuring!
-                    pSummaryPage = (SdPage*) mpDoc->AllocPage(false);
+                    pSummaryPage = mpDoc->AllocSdPage(false);
                     pSummaryPage->SetSize(pActualPage->GetSize() );
                     pSummaryPage->SetBorder(pActualPage->GetLftBorder(),
                                      pActualPage->GetUppBorder(),
@@ -137,7 +137,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
                     pSummaryPage->setHeaderFooterSettings(pActualPage->getHeaderFooterSettings());
 
                     // notes-page
-                    SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(false);
+                    SdPage* pNotesPage = mpDoc->AllocSdPage(false);
                     pNotesPage->SetSize(pActualNotesPage->GetSize());
                     pNotesPage->SetBorder(pActualNotesPage->GetLftBorder(),
                                           pActualNotesPage->GetUppBorder(),
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index ce57995..d56b857 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -452,7 +452,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate )
     if( 0 == nPageCount )
     {
         // this is only used for clipboard where we only have one page
-        pStandardPage = (SdPage*) mpDoc->AllocPage(false);
+        pStandardPage = mpDoc->AllocSdPage(false);
 
         Size aDefSize(21000, 29700);   // A4-Hochformat
         pStandardPage->SetSize( aDefSize );
@@ -485,7 +485,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate )
         if( bDuplicate )
             pStandardPage = (SdPage*) pPreviousStandardPage->Clone();
         else
-            pStandardPage = (SdPage*) mpDoc->AllocPage(false);
+            pStandardPage = mpDoc->AllocSdPage(false);
 
         pStandardPage->SetSize( pPreviousStandardPage->GetSize() );
         pStandardPage->SetBorder( pPreviousStandardPage->GetLftBorder(),
@@ -520,7 +520,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate )
         if( bDuplicate )
             pNotesPage = (SdPage*) pPreviousNotesPage->Clone();
         else
-            pNotesPage = (SdPage*) mpDoc->AllocPage(false);
+            pNotesPage = mpDoc->AllocSdPage(false);
 
         pNotesPage->SetSize( pPreviousNotesPage->GetSize() );
         pNotesPage->SetBorder( pPreviousNotesPage->GetLftBorder(),
@@ -2723,7 +2723,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
         SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_NOTES);
 
         // create and instert new draw masterpage
-        SdPage* pMPage = (SdPage*)mpModel->mpDoc->AllocPage(true);
+        SdPage* pMPage = mpModel->mpDoc->AllocSdPage(true);
         pMPage->SetSize( pPage->GetSize() );
         pMPage->SetBorder( pPage->GetLftBorder(),
                            pPage->GetUppBorder(),
@@ -2740,7 +2740,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
         xDrawPage = uno::Reference< drawing::XDrawPage >::query( pMPage->getUnoPage() );
 
         // create and instert new notes masterpage
-        SdPage* pMNotesPage = (SdPage*)mpModel->mpDoc->AllocPage(true);
+        SdPage* pMNotesPage = mpModel->mpDoc->AllocSdPage(true);
         pMNotesPage->SetSize( pRefNotesPage->GetSize() );
         pMNotesPage->SetPageKind(PK_NOTES);
         pMNotesPage->SetBorder( pRefNotesPage->GetLftBorder(),
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 4436bdd..b6b4d41 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -441,7 +441,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
 
     // this page is exemplary
     SdPage* pExample = (SdPage*)mrDoc.GetSdPage((sal_uInt16)nExample, PK_STANDARD);
-    SdPage* pPage = (SdPage*)mrDoc.AllocPage(false);
+    SdPage* pPage = mrDoc.AllocSdPage(false);
 
     pPage->SetLayoutName(pExample->GetLayoutName());
 
@@ -478,7 +478,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
     |* now the notes page
     \*********************************************************************/
     pExample = (SdPage*)mrDoc.GetSdPage((sal_uInt16)nExample, PK_NOTES);
-    SdPage* pNotesPage = (SdPage*)mrDoc.AllocPage(false);
+    SdPage* pNotesPage = mrDoc.AllocSdPage(false);
 
     pNotesPage->SetLayoutName(pExample->GetLayoutName());
 
commit 502f059b1ff8dcd305d31b01a665c9d4255013cd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:27:21 2014 +0100

    coverity#705871 Dereference before null check
    
    Change-Id: I5e52347ce5cee26dffb4d47fc8d320567a0fea31

diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx
index 8ac476b..08bcae4 100644
--- a/sd/source/ui/view/OutlinerIterator.cxx
+++ b/sd/source/ui/view/OutlinerIterator.cxx
@@ -83,14 +83,14 @@ bool IteratorPosition::operator== (const IteratorPosition& aPosition) const
 
 //===== Iterator ==============================================================
 
-Iterator::Iterator (void)
+Iterator::Iterator()
 {
     mpIterator = NULL;
 }
 
 Iterator::Iterator (const Iterator& rIterator)
 {
-    mpIterator = rIterator.mpIterator->Clone();
+    mpIterator = rIterator.mpIterator ? rIterator.mpIterator->Clone() : NULL;
 }
 
 Iterator::Iterator (IteratorImplBase* pObject)
@@ -98,7 +98,7 @@ Iterator::Iterator (IteratorImplBase* pObject)
     mpIterator = pObject;
 }
 
-Iterator::~Iterator (void)
+Iterator::~Iterator()
 {
     delete mpIterator;
 }
commit faf8d79ef617090a710bd98f5ad936dd27a0867d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:25:09 2014 +0100

    coverity#705870 Dereference before null check
    
    Change-Id: Ie4588f8cb0f11b831d091b0f478b78d0472af160

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index d56f754..ba7d1a0 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -816,13 +816,10 @@ void Outliner::DetectChange (void)
     }
 }
 
-
-
-
-bool Outliner::DetectSelectionChange (void)
+bool Outliner::DetectSelectionChange()
 {
     bool bSelectionHasChanged = false;
-    sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
+    sal_uLong nMarkCount = mpView ? mpView->GetMarkedObjectList().GetMarkCount() : 0;
 
     // If mpObj is NULL then we have not yet found our first match.
     // Detecting a change makes no sense.
@@ -853,10 +850,7 @@ bool Outliner::DetectSelectionChange (void)
     return bSelectionHasChanged;
 }
 
-
-
-
-void Outliner::RememberStartPosition (void)
+void Outliner::RememberStartPosition()
 {
     ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
     if ( ! pViewShell)
@@ -909,10 +903,7 @@ void Outliner::RememberStartPosition (void)
     }
 }
 
-
-
-
-void Outliner::RestoreStartPosition (void)
+void Outliner::RestoreStartPosition()
 {
     bool bRestore = true;
     // Take a negative start page index as inidicator that restoring the
commit 6a8e7fde5084b46d62c99aae91e4e6f78c14f178
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:20:33 2014 +0100

    coverity#705861 Dereference before null check
    
    Change-Id: Ia027a5990769413dff323ff0e0b6fd66633b9339

diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index fdc6ea1..f06425d 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -325,32 +325,35 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
 
 bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
 {
-    if ( mpView->IsDragHelpLine() )
+    if (mpView && mpView->IsDragHelpLine())
         mpView->EndDragHelpLine();
 
     if ( bDragHelpLine )
     {
         Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
 
-        if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
+        if (mpView && !aOutputArea.IsInside(rMEvt.GetPosPixel()))
             mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
 
         mpWindow->ReleaseMouse();
     }
 
-    FrameView* pFrameView = mpViewShell->GetFrameView();
-    mpView->SetOrtho( pFrameView->IsOrtho() );
-    mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
-    mpView->SetSnapEnabled(true);
-    mpView->SetCreate1stPointAsCenter(false);
-    mpView->SetResizeAtCenter(false);
-    mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
-    mpView->SetGridSnap(pFrameView->IsGridSnap());
-    mpView->SetBordSnap(pFrameView->IsBordSnap());
-    mpView->SetHlplSnap(pFrameView->IsHlplSnap());
-    mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
-    mpView->SetOPntSnap(pFrameView->IsOPntSnap());
-    mpView->SetOConSnap(pFrameView->IsOConSnap());
+    if (mpView)
+    {
+        FrameView* pFrameView = mpViewShell->GetFrameView();
+        mpView->SetOrtho( pFrameView->IsOrtho() );
+        mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
+        mpView->SetSnapEnabled(true);
+        mpView->SetCreate1stPointAsCenter(false);
+        mpView->SetResizeAtCenter(false);
+        mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
+        mpView->SetGridSnap(pFrameView->IsGridSnap());
+        mpView->SetBordSnap(pFrameView->IsBordSnap());
+        mpView->SetHlplSnap(pFrameView->IsHlplSnap());
+        mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
+        mpView->SetOPntSnap(pFrameView->IsOPntSnap());
+        mpView->SetOConSnap(pFrameView->IsOConSnap());
+    }
 
     bIsInDragMode = false;
     ForcePointer(&rMEvt);
commit 6bbb8b88fd93b8a91f8ef6142635b07f3c11b28e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:13:20 2014 +0100

    coverity#705838 Dereference before null check
    
    Change-Id: I00037e6be04d7839e8387cb8771ef0a963eec371

diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index b2fd676..ddeb4a6 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -104,6 +104,9 @@ void FuDraw::DoModifiers(const MouseEvent& rMEvt)
 
 void FuDraw::ResetModifiers()
 {
+    if (!pView)
+        return;
+
     ScViewData* pViewData = pViewShell->GetViewData();
     const ScViewOptions& rOpt = pViewData->GetOptions();
     const ScGridOptions& rGrid = rOpt.GetGridOptions();
commit 416b56bbf0885c5e3dc6ef6e75885466dce42c30
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:09:17 2014 +0100

    coverity#706003 Unintended sign extension
    
    Change-Id: I888b5610a00a152551776e5d8f82fc5353bc880d

diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 505e495..5778c34 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -155,8 +155,8 @@ private:
     sal_uInt16          nEOICode;
     sal_uInt16          nTableSize;
     sal_uInt16          nCodeSize;
-    sal_uLong           nOffset;
-    sal_uLong           dwShift;
+    sal_uInt32          nOffset;
+    sal_uInt32          dwShift;
 
     com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
 
commit ce0539630a6caa2d575760b3d4e57c98ab167b14
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:08:21 2014 +0100

    coverity#706004 Unintended sign extension
    
    Change-Id: Ia8c12fbb9e546343eccf34b6f8e842983c287b2d

diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx
index 07677b6..492c995 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -89,8 +89,8 @@ private:
     sal_uInt16              nEOICode;
     sal_uInt16              nTableSize;
     sal_uInt16              nCodeSize;
-    sal_uLong               nOffset;
-    sal_uLong               dwShift;
+    sal_uInt32              nOffset;
+    sal_uInt32              dwShift;
 
     com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
 
commit 1680f88b1074cca05e3516ad8ab9967d24c2488a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:06:49 2014 +0100

    coverity#706005 Unintended sign extension
    
    Change-Id: I5670617f03deaac0d8923a38f765c9870eacfc97

diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index a9808b7..2e73107 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -112,7 +112,7 @@ sal_uInt8 CGM::ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision )
     return (sal_uInt8)( nSource >> ( ( nPrecision - 1 ) << 3 ) );
 };
 
-long CGM::ImplGetI( sal_uInt32 nPrecision )
+sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision )
 {
     sal_uInt8* pSource = mpSource + mnParaSize;
     mnParaSize += nPrecision;
diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx
index 25ab80a..e1e7f63 100644
--- a/filter/source/graphicfilter/icgm/cgm.hxx
+++ b/filter/source/graphicfilter/icgm/cgm.hxx
@@ -94,7 +94,7 @@ class CGM
 
         sal_uInt32          ImplGetUI16( sal_uInt32 nAlign = 0 );
         sal_uInt8           ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision );
-        long                ImplGetI( sal_uInt32 nPrecision );
+        sal_Int32           ImplGetI( sal_uInt32 nPrecision );
         sal_uInt32          ImplGetUI( sal_uInt32 nPrecision );
         void                ImplGetSwitch4( sal_uInt8* pSource, sal_uInt8* pDest );
         void                ImplGetSwitch8( sal_uInt8* pSource, sal_uInt8* pDest );
commit dea94c8899842dd687777e99ca2efb1a6a21d7a2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 30 09:04:52 2014 +0100

    coverity#706008 Unintended sign extension
    
    Change-Id: I60f3404ae87aa0d1088110715d0ba1dd32fab09d

diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index 577b5f8..d5f993d 100644
--- a/hwpfilter/source/hiodev.cxx
+++ b/hwpfilter/source/hiodev.cxx
@@ -201,7 +201,7 @@ int HStreamIODev::read2b()
 }
 
 
-long HStreamIODev::read4b()
+int HStreamIODev::read4b()
 {
     int res = (compressed) ? GZREAD(rBuf, 4) : _stream.readBytes(rBuf, 4);
 
@@ -318,7 +318,7 @@ int HMemIODev::read2b()
 }
 
 
-long HMemIODev::read4b()
+int HMemIODev::read4b()
 {
     pos += 4;
     if (pos <= length)
diff --git a/hwpfilter/source/hiodev.h b/hwpfilter/source/hiodev.h
index bc8a82b..40783f5 100644
--- a/hwpfilter/source/hiodev.h
+++ b/hwpfilter/source/hiodev.h
@@ -53,7 +53,7 @@ class DLLEXPORT HIODev
 
         virtual int read1b() = 0;
         virtual int read2b() = 0;
-        virtual long read4b() = 0;
+        virtual int read4b() = 0;
         virtual int readBlock( void *ptr, int size ) = 0;
         virtual int skipBlock( int size ) = 0;
 
@@ -113,7 +113,7 @@ class HStreamIODev : public HIODev
  * Read 4 bytes from stream
  */
         using HIODev::read4b;
-        virtual long read4b() SAL_OVERRIDE;
+        virtual int read4b() SAL_OVERRIDE;
 /**
  * Read some bytes from stream to given pointer as amount of size
  */
@@ -153,7 +153,7 @@ class HMemIODev : public HIODev
         using HIODev::read2b;
         virtual int read2b() SAL_OVERRIDE;
         using HIODev::read4b;
-        virtual long read4b() SAL_OVERRIDE;
+        virtual int read4b() SAL_OVERRIDE;
         virtual int readBlock( void *ptr, int size ) SAL_OVERRIDE;
         virtual int skipBlock( int size ) SAL_OVERRIDE;
     protected:


More information about the Libreoffice-commits mailing list