[Libreoffice-commits] core.git: 19 commits - cui/source scripting/source sc/source svl/source svtools/source svx/source sw/source vcl/generic

Caolán McNamara caolanm at redhat.com
Sat Mar 29 11:12:36 PDT 2014


 cui/source/customize/cfg.cxx                       |   49 ++-----
 sc/source/ui/inc/tabview.hxx                       |    2 
 sc/source/ui/view/tabview.cxx                      |  145 ++++++++-------------
 sc/source/ui/view/tabview3.cxx                     |   10 -
 scripting/source/stringresource/stringresource.cxx |   83 +++++-------
 svl/source/misc/strmadpt.cxx                       |    3 
 svtools/source/brwbox/datwin.cxx                   |   17 --
 svtools/source/brwbox/datwin.hxx                   |    2 
 svx/source/dialog/svxbmpnumvalueset.cxx            |    3 
 svx/source/svdraw/svddrgmt.cxx                     |   39 -----
 svx/source/svdraw/svdedxv.cxx                      |    2 
 svx/source/svdraw/svdmrkv1.cxx                     |   14 --
 sw/source/core/docnode/section.cxx                 |    7 -
 sw/source/core/edit/edtox.cxx                      |   22 ---
 sw/source/core/frmedt/tblsel.cxx                   |    2 
 sw/source/core/uibase/docvw/edtwin2.cxx            |   60 --------
 sw/source/core/uibase/shells/basesh.cxx            |    2 
 sw/source/core/uibase/shells/drwbassh.cxx          |    5 
 vcl/generic/print/common_gfx.cxx                   |   12 -
 19 files changed, 140 insertions(+), 339 deletions(-)

New commits:
commit ca5eb633dd1f89d0a077aefa47fd049afe399192
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 17:55:09 2014 +0000

    coverity#984152 Uninitialized pointer field
    
    Change-Id: Ibc4837a5c0652edcf52c58883a490467e43e6eb8

diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index 161ca75..03a15234 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -391,6 +391,9 @@ void  SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
 
 SvxNumValueSet::SvxNumValueSet(Window* pParent, WinBits nWinBits)
     : ValueSet(pParent, nWinBits)
+    , nPageType(0)
+    , bHTMLMode(false)
+    , pVDev(NULL)
 {
 }
 
commit 7cdbf12f20c51353d90010e06203407586284843
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 17:28:52 2014 +0000

    coverity#982292 Logically dead code
    
    Change-Id: I7862ffc1ba51b1083e7cd1fe428fd9a0e134bc38

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index cb0ae07..e65a4fb 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2130,11 +2130,11 @@ void SvxConfigPage::MoveEntry( bool bMoveUp )
 bool SvxConfigPage::MoveEntryData(
     SvTreeListEntry* pSourceEntry, SvTreeListEntry* pTargetEntry )
 {
-    //modified by shizhoubo for issue53677
-    if ( NULL == pSourceEntry || NULL == pTargetEntry )
-     {
-         return false;
-     }
+    //#i53677#
+    if (NULL == pSourceEntry || NULL == pTargetEntry)
+    {
+        return false;
+    }
 
     // Grab the entries list for the currently selected menu
     SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
@@ -2142,39 +2142,26 @@ bool SvxConfigPage::MoveEntryData(
     SvxConfigEntry* pSourceData =
         (SvxConfigEntry*) pSourceEntry->GetUserData();
 
-    if ( pTargetEntry == NULL )
-    {
-        RemoveEntry( pEntries, pSourceData );
-        pEntries->insert(
-            pEntries->begin(), pSourceData );
+    SvxConfigEntry* pTargetData =
+        (SvxConfigEntry*) pTargetEntry->GetUserData();
 
-        GetSaveInData()->SetModified( true );
-
-        return true;
-    }
-    else
+    if ( pSourceData != NULL && pTargetData != NULL )
     {
-        SvxConfigEntry* pTargetData =
-            (SvxConfigEntry*) pTargetEntry->GetUserData();
-
-        if ( pSourceData != NULL && pTargetData != NULL )
-        {
-            // remove the source entry from our list
-            RemoveEntry( pEntries, pSourceData );
+        // remove the source entry from our list
+        RemoveEntry( pEntries, pSourceData );
 
-            SvxEntries::iterator iter = pEntries->begin();
-            SvxEntries::const_iterator end = pEntries->end();
+        SvxEntries::iterator iter = pEntries->begin();
+        SvxEntries::const_iterator end = pEntries->end();
 
-            // advance the iterator to the position of the target entry
-            while (*iter != pTargetData && ++iter != end) ;
+        // advance the iterator to the position of the target entry
+        while (*iter != pTargetData && ++iter != end) ;
 
-            // insert the source entry at the position after the target
-            pEntries->insert( ++iter, pSourceData );
+        // insert the source entry at the position after the target
+        pEntries->insert( ++iter, pSourceData );
 
-            GetSaveInData()->SetModified( true );
+        GetSaveInData()->SetModified( true );
 
-            return true;
-        }
+        return true;
     }
 
     return false;
commit 28d202cdc471585a7c7fba366b6247a561c8a5f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 17:15:45 2014 +0000

    coverity#735516 Logically dead code
    
    Change-Id: I080944f3e3d6e5fd715d1da355f9dc1e92abbd87

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 29be25a..f0a7423 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -451,7 +451,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
         return sal_False;
     }
 
-    const SwLayoutFrm *pEnd = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
+    const SwLayoutFrm *pEnd = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper();
     OSL_ENSURE( pEnd, "without frame nothing works" );
 
     bool bTblIsValid, bValidChartSel;
commit 89283cdc4eacc9916eb95d9626703d7bea004575
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 17:14:21 2014 +0000

    coverity#735510 Logically dead code
    
    Change-Id: I8d06dfdae79045b978ab3f477209173396b88574

diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 224ebf7..bbb6c47 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -3147,17 +3147,14 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
 {
     if (DragStat().CheckMinMoved(rPnt))
     {
-        Point aPnt(rPnt);
         bool bNeuMoveOnly=getSdrDragView().IsMoveOnlyDragging();
         bAtCenter=false;
         SdrCrookMode eNeuMode=getSdrDragView().GetCrookMode();
         bool bNeuContortion=!bNeuMoveOnly && ((bContortionAllowed && !getSdrDragView().IsCrookNoContortion()) || !bNoContortionAllowed);
         bResize=!getSdrDragView().IsOrtho() && bResizeAllowed && !bNeuMoveOnly;
         bool bNeuRotate=bRotateAllowed && !bNeuContortion && !bNeuMoveOnly && eNeuMode==SDRCROOK_ROTATE;
-        long nSA=0;
 
-        if (nSA==0)
-            aPnt=GetSnapPos(aPnt);
+        Point aPnt(GetSnapPos(rPnt));
 
         Point aNeuCenter(aMarkCenter.X(),aStart.Y());
 
@@ -3250,23 +3247,6 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
 
             if (bResize)
             {
-                if (nSA!=0)
-                { // angle snapping
-                    long nWink0=nPntWink;
-                    nPntWink+=nSA/2;
-                    nPntWink/=nSA;
-                    nPntWink*=nSA;
-                    BigInt a2(nNeuRad);
-                    a2*=BigInt(nWink);
-                    a2/=BigInt(nWink0);
-                    nNeuRad=long(a2);
-
-                    if (bVertical)
-                        aNeuCenter.X()=aStart.X()+nNeuRad;
-                    else
-                        aNeuCenter.Y()=aStart.Y()+nNeuRad;
-                }
-
                 long nMul=(long)(nUmfang*NormAngle360(nPntWink)/36000);
 
                 if (bAtCenter)
@@ -3281,23 +3261,6 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
 
                 if (nWink==0)
                     bValid=false;
-
-                if (bValid && nSA!=0)
-                { // angle snapping
-                    long nWink0=nWink;
-                    nWink+=nSA/2;
-                    nWink/=nSA;
-                    nWink*=nSA;
-                    BigInt a2(nNeuRad);
-                    a2*=BigInt(nWink);
-                    a2/=BigInt(nWink0);
-                    nNeuRad=long(a2);
-
-                    if (bVertical)
-                        aNeuCenter.X()=aStart.X()+nNeuRad;
-                    else
-                        aNeuCenter.Y()=aStart.Y()+nNeuRad;
-                }
             }
         }
 
commit e9c7da896f1b9dd66ee57883607afe566f2c5d67
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:58:06 2014 +0000

    coverity#704394 Logically dead code
    
    Change-Id: I380730d3f915fb5cd9e2e2be272d4c9c56dd0831

diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index 20484ab..3b1f87e 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -219,7 +219,7 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
         rightside.push_back( Point( aLastRect.Right()+1, aLastRect.Bottom()+1 ) );
 
         // cool, we can concatenate rectangles
-        int nDX = -65536, nDY = 65536;
+        const int nDX = -65536, nDY = 65536;
         int nNewDX = 0, nNewDY = 0;
 
         Point aLastPoint = leftside.front();
@@ -234,9 +234,7 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
             {
                 nNewDX = aPoint.X() - aLastPoint.X();
                 nNewDY = aPoint.Y() - aLastPoint.Y();
-                if( nNewDX == 0 && nDX == 0 )
-                    continue;
-                if( nDX != 0 && nNewDX != 0 &&
+                if( nNewDX != 0 &&
                     (double)nNewDY/(double)nNewDX == (double)nDY/(double)nDX )
                     continue;
             }
@@ -245,8 +243,6 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
         }
 
         aLastPoint = rightside.back();
-        nDX = -65536;
-        nDY = 65536;
         PSBinLineTo (aLastPoint, rOldPoint, rColumn);
         rightside.pop_back();
         while( rightside.begin() != rightside.end() )
@@ -257,9 +253,7 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
             {
                 nNewDX = aPoint.X() - aLastPoint.X();
                 nNewDY = aPoint.Y() - aLastPoint.Y();
-                if( nNewDX == 0 && nDX == 0 )
-                    continue;
-                if( nDX != 0 && nNewDX != 0 &&
+                if( nNewDX != 0 &&
                     (double)nNewDY/(double)nNewDX == (double)nDY/(double)nDX )
                     continue;
             }
commit e67a148d52fc565b00bd6d101cf9d6e0c67a95b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:50:24 2014 +0000

    coverity#704379 Logically dead code
    
    bNotify is set to true in only one place, and bDone is set to true
    and the only use of bNotify is inside a !bDone block so it can
    only be false there
    
    Change-Id: I05b09d5e1e1406e1268f2e97b0f50db36c391727

diff --git a/sw/source/core/uibase/shells/drwbassh.cxx b/sw/source/core/uibase/shells/drwbassh.cxx
index ef3aef3..71ce949 100644
--- a/sw/source/core/uibase/shells/drwbassh.cxx
+++ b/sw/source/core/uibase/shells/drwbassh.cxx
@@ -120,7 +120,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
     sal_Bool bAlignPossible = pSh->IsAlignPossible();
 
     sal_Bool bTopParam = sal_True, bBottomParam = sal_True;
-    bool bNotify = false;
     bool bDone = false;
     SfxBindings& rBind = GetView().GetViewFrame()->GetBindings();
 
@@ -400,7 +399,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
                     pSh->LeaveSelFrmMode();
                     // #105852# FME
                 }
-                bNotify = true;
             }
             break;
 
@@ -602,9 +600,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
             pSh->SetModified();
         else if (bChanged)
             pSdrView->GetModel()->SetChanged(true);
-        // 40220: After Delete from DrawObjecs over the API GPF through self-destruction
-        if(bNotify)
-            GetView().AttrChangedNotify(pSh); // Shell switch if applicable...
     }
 }
 
commit 0ca2b5d566707730085a929376fcf6c4a40ca728
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:44:28 2014 +0000

    coverity#704377 Logically dead code
    
    Change-Id: I817c0c092ee6efa19c4250d9c9dba0861801a440

diff --git a/sw/source/core/uibase/shells/basesh.cxx b/sw/source/core/uibase/shells/basesh.cxx
index 4419770..27901b3 100644
--- a/sw/source/core/uibase/shells/basesh.cxx
+++ b/sw/source/core/uibase/shells/basesh.cxx
@@ -1828,8 +1828,6 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
                 break;
             case FN_FRAME_WRAP_CONTOUR:
                 aWrap.SetContour(!aWrap.IsContour());
-                if (nSurround == SURROUND_THROUGHT)
-                    nSurround = SURROUND_PARALLEL;
                 break;
             case FN_FRAME_WRAPTHRU_TRANSP:
                 if (aWrap.IsContour())
commit 30f4edef8a48eeecf4177ec222723d0972f00b90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:40:10 2014 +0000

    coverity#704374 Logically dead code
    
    in order for bContinue && pSdrView && bQuickBalloon to
    be true bContinue must be true, but if it was true then
    it would have entered the prior bContinue && bQuickBalloon
    condition, and all legs of that set bContinue to false
    
    Change-Id: If81cc389cb4e9604b34e0ae76d0f763585f4c7c1

diff --git a/sw/source/core/uibase/docvw/edtwin2.cxx b/sw/source/core/uibase/docvw/edtwin2.cxx
index f2779a0..859d964 100644
--- a/sw/source/core/uibase/docvw/edtwin2.cxx
+++ b/sw/source/core/uibase/docvw/edtwin2.cxx
@@ -417,66 +417,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
         }
     }
 
-    if( bContinue && pSdrView && bQuickBalloon)
-    {
-        SdrViewEvent aVEvt;
-        SdrHitKind eHit = pSdrView->PickAnything(aPos, aVEvt);
-        const SvxURLField *pField;
-        SdrObject* pObj = NULL;
-
-        if ((pField = aVEvt.pURLField) != 0)
-        {
-            // hit an URL field
-            if (pField)
-            {
-                pObj = aVEvt.pObj;
-                sTxt = pField->GetURL();
-
-                bContinue = false;
-            }
-        }
-        if (bContinue && eHit == SDRHIT_TEXTEDIT)
-        {
-            // look for URL field in DrawText object that is opened for editing
-            OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
-            const SvxFieldItem* pFieldItem;
-
-            if (pSdrView->AreObjectsMarked())
-            {
-                const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
-
-                if (rMarkList.GetMarkCount() == 1)
-                    pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-            }
-
-            if (pObj && pObj->ISA(SdrTextObj) && pOLV &&
-                    (pFieldItem = pOLV->GetFieldUnderMousePointer()) != 0)
-            {
-                pField = dynamic_cast<const SvxURLField*>(pFieldItem->GetField());
-
-                if (pField )
-                {
-                    sTxt = ((const SvxURLField*) pField)->GetURL();
-                    bContinue = false;
-                }
-            }
-        }
-        if (!sTxt.isEmpty() && pObj)
-        {
-            sTxt = URIHelper::removePassword( sTxt, INetURLObject::WAS_ENCODED,
-                                           INetURLObject::DECODE_UNAMBIGUOUS);
-
-            Rectangle aLogicPix = LogicToPixel(pObj->GetLogicRect());
-            Rectangle aScreenRect(OutputToScreenPixel(aLogicPix.TopLeft()),
-                                OutputToScreenPixel(aLogicPix.BottomRight()));
-
-            if (bBalloon)
-                Help::ShowBalloon(this, rEvt.GetMousePosPixel(), aScreenRect, sTxt);
-            else
-                Help::ShowQuickHelp(this, aScreenRect, sTxt);
-        }
-    }
-
     if( bContinue )
         Window::RequestHelp( rEvt );
 }
commit f4175a127f2076590d126e8f237ea76f95789ccf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:29:49 2014 +0000

    coverity#704354 Logically dead code
    
    also coverity#704355 and coverity#704356
    
    Change-Id: I132b9881792fcc4bac59d8227141e53dda7ee725

diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 8e8165e..999567e 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -308,28 +308,12 @@ void SwEditShell::ApplyAutoMark()
         rtl_TextEncoding eChrSet = ::osl_getThreadTextEncoding();
 
         // SearchOptions to be used in loop below
-        bool bCaseSensitive = true;
-        bool bWordOnly      = false;
-        bool bSrchInSel     = false;
-        bool bLEV_Relaxed   = true;
         sal_Int32 nLEV_Other    = 2;    //  -> changedChars;
         sal_Int32 nLEV_Longer   = 3;    //! -> deletedChars;
         sal_Int32 nLEV_Shorter  = 1;    //! -> insertedChars;
         sal_Int32 nTransliterationFlags = 0;
 
-        sal_Int32 nSrchFlags = 0;
-        if (!bCaseSensitive)
-        {
-            nSrchFlags |= SearchFlags::ALL_IGNORE_CASE;
-            nTransliterationFlags |= TransliterationModules_IGNORE_CASE;
-        }
-        if ( bWordOnly)
-            nSrchFlags |= SearchFlags::NORM_WORD_ONLY;
-        if ( bLEV_Relaxed)
-            nSrchFlags |= SearchFlags::LEV_RELAXED;
-        if ( bSrchInSel)
-            nSrchFlags |= (SearchFlags::REG_NOT_BEGINOFLINE |
-                            SearchFlags::REG_NOT_ENDOFLINE );
+        sal_Int32 nSrchFlags = SearchFlags::LEV_RELAXED;
 
         OUString sEmpty;
         SearchOptions aSearchOpt(
@@ -363,8 +347,8 @@ void SwEditShell::ApplyAutoMark()
                     OUString sWordOnly    = sLine.getToken(0, ';', nTokenPos);
 
                     //3.
-                    bCaseSensitive  = !sCase.isEmpty() && !comphelper::string::equals(sCase, cZero);
-                    bWordOnly       = !sWordOnly.isEmpty() && !comphelper::string::equals(sWordOnly, cZero);
+                    bool bCaseSensitive = !sCase.isEmpty() && !comphelper::string::equals(sCase, cZero);
+                    bool bWordOnly = !sWordOnly.isEmpty() && !comphelper::string::equals(sWordOnly, cZero);
 
                     if (!bCaseSensitive)
                     {
commit 55033ba6062ae2c5855a0f3c49ec0a7c6a88904f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:27:00 2014 +0000

    coverity#704353 Logically dead code
    
    Change-Id: I6d8ae15ca5ec647b1429fb47a3e976501165e780

diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 499fe8a..e57287a 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -411,7 +411,6 @@ void SwSection::SetEditInReadonly(bool const bFlag)
 
 void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
 {
-    bool bRemake = false;
     bool bUpdateFtn = false;
     switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
     {
@@ -519,12 +518,6 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
         break;
     }
 
-    if( bRemake )
-    {
-        GetFmt()->DelFrms();
-        GetFmt()->MakeFrms();
-    }
-
     if( bUpdateFtn )
     {
         SwSectionNode* pSectNd = GetFmt()->GetSectionNode( false );
commit 9037a4035b4283de803151154b8c073944ff3c45
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:17:22 2014 +0000

    coverity#704332 Logically dead code
    
    Change-Id: I63f5e59b53ce24e26b2aa6ccd5eb0551899d143d

diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index 858caad..ac2fe27 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -578,13 +578,8 @@ SdrHdl* SdrMarkView::GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) cons
 bool SdrMarkView::MarkNextGluePoint(const Point& /*rPnt*/, bool /*bPrev*/)
 {
     ForceUndirtyMrkPnt();
-    bool bChgd=false;
     SortMarkedObjects();
-
-    if (bChgd) {
-        MarkListHasChanged();
-    }
-    return bChgd;
+    return false;
 }
 
 const Rectangle& SdrMarkView::GetMarkedGluePointsRect() const
commit ac4015e883cefc11910bcc2575c4616a42203fda
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:16:52 2014 +0000

    coverity#704330 Logically dead code
    
    Change-Id: I71ab7f7f8b9695dcd3814e5c3bea62f515ffde4f

diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index 8ff28e3..858caad 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -256,13 +256,8 @@ bool SdrMarkView::MarkPoints(const Rectangle* pRect, bool bUnmark)
 bool SdrMarkView::MarkNextPoint(const Point& /*rPnt*/, bool /*bPrev*/)
 {
     ForceUndirtyMrkPnt();
-    bool bChgd=false;
     SortMarkedObjects();
-
-    if (bChgd) {
-        MarkListHasChanged();
-    }
-    return bChgd;
+    return false;
 }
 
 const Rectangle& SdrMarkView::GetMarkedPointsRect() const
commit 9a65828453056aecdd749ef4290ba46d4068a72d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:15:44 2014 +0000

    coverity#704328 Logically dead code
    
    Change-Id: I7d443e7e40a3705b36477c04902f6f0fa9944059

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 430dc18..91be14d 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -618,7 +618,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
         pTextEditOutliner->SetEndPasteOrDropHdl(LINK(this,SdrObjEditView, EndPasteOrDropHdl));
 
         // It is just necessary to make the visualized page known. Set it.
-        pTextEditOutliner->setVisualizedPage(pPV ? pPV->GetPage() : 0);
+        pTextEditOutliner->setVisualizedPage(pPV->GetPage());
 
         pTextEditOutliner->SetTextObjNoInit( dynamic_cast< SdrTextObj* >( mxTextEditObj.get() ) );
 
commit dcfbd7bc4e5f4044ea795b3c9964727ac7c195f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:13:12 2014 +0000

    coverity#704316 odd pDtorNotify hackery
    
    Change-Id: I9faa61bb85ec6d89c6f5c9829d137fabb3e98c4a

diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 2c4170e..a85d104 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -192,7 +192,7 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
     ,pHeaderBar( 0 )
     ,pEventWin( pParent )
     ,pCornerWin( 0 )
-    ,pDtorNotify( 0 )
+    ,bInDtor( false )
     ,bInPaint( false )
     ,bInCommand( false )
     ,bNoScrollBack( false )
@@ -220,8 +220,7 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
 
 BrowserDataWin::~BrowserDataWin()
 {
-    if( pDtorNotify )
-        *pDtorNotify = sal_True;
+    bInDtor = true;
 
     for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
         delete aInvalidRegion[ i ];
@@ -411,16 +410,13 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
     if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
          nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
     {
-        sal_Bool bDeleted = sal_False;
-        pDtorNotify = &bDeleted;
         bInCommand = true;
         MouseButtonDown( aMouseEvt );
-        if( bDeleted )
+        if( bInDtor )
             return;
         MouseButtonUp( aMouseEvt );
-        if( bDeleted )
+        if( bInDtor )
             return;
-        pDtorNotify = 0;
         bInCommand = false;
     }
 
@@ -428,12 +424,9 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
     CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
                         rEvt.IsMouseEvent(), rEvt.GetData() );
     bInCommand = true;
-    sal_Bool bDeleted = sal_False;
-    pDtorNotify = &bDeleted;
     GetParent()->Command( aEvt );
-    if( bDeleted )
+    if( bInDtor )
         return;
-    pDtorNotify = 0;
     bInCommand = false;
 
     if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 45dd7a8..0c7209d 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -106,7 +106,7 @@ public:
     BrowserHeader*  pHeaderBar;     // only for BROWSER_HEADERBAR_NEW
     Window*         pEventWin;      // Window of forwarded events
     ScrollBarBox*   pCornerWin;     // Window in the corner btw the ScrollBars
-    sal_Bool*           pDtorNotify;
+    bool            bInDtor;
     AutoTimer       aMouseTimer;    // recalls MouseMove on dragging out
     MouseEvent      aRepeatEvt;     // a MouseEvent to repeat
     Point           aLastMousePos;  // prevents pseudo-MouseMoves
commit fac0a3b9522d08b1fb60ee25999ecd4577495ac9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 16:07:39 2014 +0000

    coverity#704312 Logically dead code
    
    Change-Id: Iba394b382ad072593e2b646f1243169bced82ddf

diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index 03beb02..a55a0fa 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -328,8 +328,7 @@ SvLockBytesInputStream::readSomeBytes(uno::Sequence< sal_Int8 > & rData,
         {
             nError = m_xLockBytes->ReadAt(m_nPosition,
                                           rData.getArray(),
-                                          nMaxBytesToRead < 0 ?
-                                              0 : nMaxBytesToRead,
+                                          nMaxBytesToRead,
                                           &nCount);
             if (nError != ERRCODE_NONE && nError != ERRCODE_IO_PENDING)
                 throw io::IOException();
commit e57401aeb0b3eccb1178b941515c398675a1a43f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 15:11:17 2014 +0000

    coverity#704287 Logically dead code
    
    Change-Id: Iab22d2d12319bc01f9aebc1dcf40f47881d40446

diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 39a42a7..feac457 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -481,57 +481,54 @@ void StringResourceImpl::newLocale( const Locale& locale )
     }
 
     // TODO?: Check if locale is valid? How?
-    bool bValid = true;
-    if( bValid )
-    {
-        LocaleItem* pLocaleItem = new LocaleItem( locale );
-        m_aLocaleItemVector.push_back( pLocaleItem );
-        pLocaleItem->m_bModified = true;
-
-        // Copy strings from default locale
-        LocaleItem* pCopyFromItem = m_pDefaultLocaleItem;
-        if( pCopyFromItem == NULL )
-            pCopyFromItem = m_pCurrentLocaleItem;
-        if( pCopyFromItem != NULL && loadLocale( pCopyFromItem ) )
+    //if (!bValid)
+    //{
+    //    OUString errorMsg("StringResourceImpl: Invalid locale");
+    //    throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+    //}
+
+    LocaleItem* pLocaleItem = new LocaleItem( locale );
+    m_aLocaleItemVector.push_back( pLocaleItem );
+    pLocaleItem->m_bModified = true;
+
+    // Copy strings from default locale
+    LocaleItem* pCopyFromItem = m_pDefaultLocaleItem;
+    if( pCopyFromItem == NULL )
+        pCopyFromItem = m_pCurrentLocaleItem;
+    if( pCopyFromItem != NULL && loadLocale( pCopyFromItem ) )
+    {
+        const IdToStringMap& rSourceMap = pCopyFromItem->m_aIdToStringMap;
+        IdToStringMap& rTargetMap = pLocaleItem->m_aIdToStringMap;
+        IdToStringMap::const_iterator it;
+        for( it = rSourceMap.begin(); it != rSourceMap.end(); ++it )
         {
-            const IdToStringMap& rSourceMap = pCopyFromItem->m_aIdToStringMap;
-            IdToStringMap& rTargetMap = pLocaleItem->m_aIdToStringMap;
-            IdToStringMap::const_iterator it;
-            for( it = rSourceMap.begin(); it != rSourceMap.end(); ++it )
-            {
-                OUString aId  = (*it).first;
-                OUString aStr = (*it).second;
-                rTargetMap[ aId ] = aStr;
-            }
-
-            const IdToIndexMap& rSourceIndexMap = pCopyFromItem->m_aIdToIndexMap;
-            IdToIndexMap& rTargetIndexMap = pLocaleItem->m_aIdToIndexMap;
-            IdToIndexMap::const_iterator it_index;
-            for( it_index = rSourceIndexMap.begin(); it_index != rSourceIndexMap.end(); ++it_index )
-            {
-                OUString aId  = (*it_index).first;
-                sal_Int32 nIndex = (*it_index).second;
-                rTargetIndexMap[ aId ] = nIndex;
-            }
-            pLocaleItem->m_nNextIndex = pCopyFromItem->m_nNextIndex;
+            OUString aId  = (*it).first;
+            OUString aStr = (*it).second;
+            rTargetMap[ aId ] = aStr;
         }
 
-        if( m_pCurrentLocaleItem == NULL )
-            m_pCurrentLocaleItem = pLocaleItem;
-
-        if( m_pDefaultLocaleItem == NULL )
+        const IdToIndexMap& rSourceIndexMap = pCopyFromItem->m_aIdToIndexMap;
+        IdToIndexMap& rTargetIndexMap = pLocaleItem->m_aIdToIndexMap;
+        IdToIndexMap::const_iterator it_index;
+        for( it_index = rSourceIndexMap.begin(); it_index != rSourceIndexMap.end(); ++it_index )
         {
-            m_pDefaultLocaleItem = pLocaleItem;
-            m_bDefaultModified = true;
+            OUString aId  = (*it_index).first;
+            sal_Int32 nIndex = (*it_index).second;
+            rTargetIndexMap[ aId ] = nIndex;
         }
-
-        implModified();
+        pLocaleItem->m_nNextIndex = pCopyFromItem->m_nNextIndex;
     }
-    else
+
+    if( m_pCurrentLocaleItem == NULL )
+        m_pCurrentLocaleItem = pLocaleItem;
+
+    if( m_pDefaultLocaleItem == NULL )
     {
-        OUString errorMsg("StringResourceImpl: Invalid locale");
-        throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 );
+        m_pDefaultLocaleItem = pLocaleItem;
+        m_bDefaultModified = true;
     }
+
+    implModified();
 }
 
 void StringResourceImpl::removeLocale( const Locale& locale )
commit 44aa2dc9765f7c76997fb0a66877c3a4f97818d4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 15:08:47 2014 +0000

    coverity#704282 Logically dead code
    
    Change-Id: Ife5b038c56a3609ac66fee67abf2e3f2cd48daee

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 61d4520..6bf0323 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2020,12 +2020,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
             if ( eMode == SC_UPDATE_ALL && nRow2 >= MAXROW )
                 aEnd.Y() = pGridWin[i]->GetOutputSizePixel().Height();
 
-            bool bShowChanges = true;           //! ...
-            if (bShowChanges)
-            {
-                aStart.X() -= nLayoutSign;      // include change marks
-                aStart.Y() -= 1;
-            }
+            aStart.X() -= nLayoutSign;      // include change marks
+            aStart.Y() -= 1;
 
             bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS );
             if (bMarkClipped)
@@ -2038,8 +2034,6 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
                 {
                     long nMarkPixel = (long)( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
                     aStart.X() -= nMarkPixel * nLayoutSign;
-                    if (!bShowChanges)
-                        aStart.X() -= nLayoutSign;      // cell grid
                 }
             }
 
commit 245dddf171ae384ee8ec551d362db431f164c738
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 15:07:55 2014 +0000

    coverity#704280 Logically dead code
    
    Change-Id: I4ba45a63373d5edf709688594cd25be4ff1385ec

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 503edd2..5b814a3 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -176,7 +176,7 @@ private:
 
     void            InitScrollBar( ScrollBar& rScrollBar, long nMaxVal );
     DECL_LINK(      ScrollHdl, ScrollBar* );
-    DECL_LINK(      EndScrollHdl, ScrollBar* );
+    DECL_LINK(      EndScrollHdl, void* );
 
     DECL_LINK(      SplitHdl, Splitter* );
     void            DoHSplit(long nSplitPos);
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 7aa8cee..b9307f8 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -979,7 +979,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
     return bDone;
 }
 
-IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
+IMPL_LINK_NOARG(ScTabView, EndScrollHdl)
 {
     if ( bDragging )
     {
@@ -991,8 +991,6 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
 
 IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
 {
-    sal_Bool bOnlineScroll = sal_True;      //! Optionen
-
     bool bHoriz = ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight );
     long nViewPos;
     if ( bHoriz )
@@ -1071,73 +1069,70 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
         }
     }
 
-    if ( bOnlineScroll || eType != SCROLL_DRAG )
+    long nDelta = pScroll->GetDelta();
+    switch ( eType )
     {
-        long nDelta = pScroll->GetDelta();
-        switch ( eType )
-        {
-            case SCROLL_LINEUP:
-                nDelta = -1;
-                break;
-            case SCROLL_LINEDOWN:
-                nDelta = 1;
-                break;
-            case SCROLL_PAGEUP:
-                if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
-                if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
-                if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
-                if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
-                if (nDelta==0) nDelta=-1;
-                break;
-            case SCROLL_PAGEDOWN:
-                if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
-                if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
-                if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
-                if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
-                if (nDelta==0) nDelta=1;
-                break;
-            case SCROLL_DRAG:
+        case SCROLL_LINEUP:
+            nDelta = -1;
+            break;
+        case SCROLL_LINEDOWN:
+            nDelta = 1;
+            break;
+        case SCROLL_PAGEUP:
+            if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
+            if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
+            if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
+            if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
+            if (nDelta==0) nDelta=-1;
+            break;
+        case SCROLL_PAGEDOWN:
+            if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
+            if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
+            if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
+            if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
+            if (nDelta==0) nDelta=1;
+            break;
+        case SCROLL_DRAG:
+            {
+                //  nur in die richtige Richtung scrollen, nicht um ausgeblendete
+                //  Bereiche herumzittern
+
+                long nScrollMin = 0;        // RangeMin simulieren
+                if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
+                    nScrollMin = aViewData.GetFixPosX();
+                if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
+                    nScrollMin = aViewData.GetFixPosY();
+
+                long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
+                nDelta = nScrollPos - nViewPos;
+                if ( nScrollPos > nPrevDragPos )
                 {
-                    //  nur in die richtige Richtung scrollen, nicht um ausgeblendete
-                    //  Bereiche herumzittern
-
-                    long nScrollMin = 0;        // RangeMin simulieren
-                    if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
-                        nScrollMin = aViewData.GetFixPosX();
-                    if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
-                        nScrollMin = aViewData.GetFixPosY();
-
-                    long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
-                    nDelta = nScrollPos - nViewPos;
-                    if ( nScrollPos > nPrevDragPos )
-                    {
-                        if (nDelta<0) nDelta=0;
-                    }
-                    else if ( nScrollPos < nPrevDragPos )
-                    {
-                        if (nDelta>0) nDelta=0;
-                    }
-                    else
-                        nDelta = 0;
-                    nPrevDragPos = nScrollPos;
+                    if (nDelta<0) nDelta=0;
                 }
-                break;
-            default:
-            {
-                // added to avoid warnings
+                else if ( nScrollPos < nPrevDragPos )
+                {
+                    if (nDelta>0) nDelta=0;
+                }
+                else
+                    nDelta = 0;
+                nPrevDragPos = nScrollPos;
             }
-        }
-
-        if (nDelta)
+            break;
+        default:
         {
-            sal_Bool bUpdate = ( eType != SCROLL_DRAG );    // bei Drag die Ranges nicht aendern
-            if ( bHoriz )
-                ScrollX( nDelta, (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
-            else
-                ScrollY( nDelta, (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
+            // added to avoid warnings
         }
     }
 
+    if (nDelta)
+    {
+        sal_Bool bUpdate = ( eType != SCROLL_DRAG );    // bei Drag die Ranges nicht aendern
+        if ( bHoriz )
+            ScrollX( nDelta, (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
+        else
+            ScrollY( nDelta, (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
+    }
+
     return 0;
 }
 
commit eae56604873d987d6da062c4882be04c68fffd92
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 29 15:07:11 2014 +0000

    coverity#704279 Logically dead code
    
    Change-Id: If6dd6c00e4c5aa544d687200e86a30fcf843700d

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index c445316..7aa8cee 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -981,33 +981,9 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
 
 IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
 {
-    sal_Bool bOnlineScroll = sal_True;      //! Optionen
-
     if ( bDragging )
     {
-        if ( bOnlineScroll )                // nur Ranges aktualisieren
-            UpdateScrollBars();
-        else
-        {
-            long nScrollMin = 0;        // RangeMin simulieren
-            if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
-                nScrollMin = aViewData.GetFixPosX();
-            if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
-                nScrollMin = aViewData.GetFixPosY();
-
-            if ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight )
-            {
-                ScHSplitPos eWhich = (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
-                long nDelta = GetScrollBarPos( *pScroll ) + nScrollMin - aViewData.GetPosX(eWhich);
-                if (nDelta) ScrollX( nDelta, eWhich );
-            }
-            else                            // VScroll...
-            {
-                ScVSplitPos eWhich = (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
-                long nDelta = GetScrollBarPos( *pScroll ) + nScrollMin - aViewData.GetPosY(eWhich);
-                if (nDelta) ScrollY( nDelta, eWhich );
-            }
-        }
+        UpdateScrollBars();
         bDragging = false;
     }
     return 0;


More information about the Libreoffice-commits mailing list