[Libreoffice-commits] core.git: 3 commits - filter/source formula/source sw/source

Caolán McNamara caolanm at redhat.com
Mon Aug 3 07:12:34 PDT 2015


 filter/source/msfilter/msdffimp.cxx                       |    9 +++++++--
 formula/source/ui/dlg/formula.cxx                         |    3 +--
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |    2 --
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit d60b265d0e364a8c0581eca10d61faa6f29c9ef5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 15:04:22 2015 +0100

    coverity#1314995 Logically dead code
    
    Change-Id: I3ff55ee78927f46e337d56eeebeaebec87b604be

diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index cb872c4..d838226 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -97,8 +97,6 @@ namespace
         {
             if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get()))
             {
-                if (!pBkmk)
-                    return NULL;
                 if (
                     (bCaseSensitive && (pBkmk->GetName() == sNameLc)) ||
                     (!bCaseSensitive && GetAppCharClass().lowercase(pBkmk->GetName()) == sNameLc)
commit 5c578d4f9764890644bf88270273d6d5703e8225
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 15:02:37 2015 +0100

    coverity#1309048 Unchecked return value
    
    Change-Id: If005f622bc76445f3a6becb26280abe40ee77e26

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index ad3cbe4..95d112c 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -748,8 +748,7 @@ void FormulaDlg_Impl::MakeTree(IStructHelper* _pTree,SvTreeListEntry* pParent,Fo
                 {
                     OUString aCellResult;
                     OUString aEquals(" = ");
-                    CalcValue( "=" + aResult, aCellResult);
-                    if (aCellResult != aResult) // cell is a formula, print subformula
+                    if (CalcValue( "=" + aResult, aCellResult) && aCellResult != aResult) // cell is a formula, print subformula
                         _pTree->InsertEntry(aResult + aEquals + aCellResult,pParent,STRUCT_END,0,_pToken);
                     else
                         _pTree->InsertEntry(aResult,pParent,STRUCT_END,0,_pToken);
commit bb870b7e8c009b3379750b990eaff142cec183b8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 15:01:05 2015 +0100

    coverity#1157790 Division or modulo by float zero
    
    Change-Id: I98ada1d4ccae0b804a6a083cdd0ab185c556ad71

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 05fd7ea..7cc9010 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4579,8 +4579,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                                  Size( (sal_Int32)( aLogicRect.GetWidth() * fXScale ), (sal_Int32)( aLogicRect.GetHeight() * fYScale ) ) );
 
                             // creating the text frame -> scaling into (0,0),(21600,21600) destination coordinate system
-                            double fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
-                            double fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
+                            double fTextFrameScaleX = 0.0;
+                            double fTextFrameScaleY = 0.0;
+                            if (aPolyBoundRect.GetWidth())
+                                fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
+                            if (aPolyBoundRect.GetHeight())
+                                fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
+
                             sal_Int32 nLeft  = (sal_Int32)(( aPolyPieRect.Left()  - aPolyBoundRect.Left() ) * fTextFrameScaleX );
                             sal_Int32 nTop   = (sal_Int32)(( aPolyPieRect.Top()   - aPolyBoundRect.Top() )  * fTextFrameScaleY );
                             sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.Right() - aPolyBoundRect.Left() ) * fTextFrameScaleX );


More information about the Libreoffice-commits mailing list