[Libreoffice-commits] core.git: 3 commits - dbaccess/source sd/source vcl/source

Caolán McNamara caolanm at redhat.com
Mon Mar 9 14:28:34 PDT 2015


 dbaccess/source/ui/misc/HtmlReader.cxx   |    5 +++--
 dbaccess/source/ui/misc/RtfReader.cxx    |    5 +++--
 sd/source/filter/eppt/pptx-epptooxml.cxx |    2 +-
 vcl/source/opengl/OpenGLHelper.cxx       |    3 +--
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit e96a5d4064a6002eb95b2c05f4e68c79bb766b07
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 9 21:06:48 2015 +0000

    coverity#1287398 Logically dead code
    
    and
    
    coverity#1287399 Logically dead code
    
    regression from
    
    commit 5806a7ed44f675f8c2d6aaf16a4347f3e11c9783
    Date:   Mon Mar 2 09:36:39 2015 +0200
        cppcheck: Variable is assigned a value that is never used
    
    Change-Id: Iaee21f8c120a09aaeed2f55da16a7ef83bea2b07

diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 56470b3..436995b 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -422,7 +422,7 @@ bool OHTMLReader::CreateTable(int nToken)
     sal_Int32 nTextColor = 0;
     do
     {
-        switch(nToken)
+        switch (nToken)
         {
             case HTML_TEXTTOKEN:
             case HTML_SINGLECHAR:
@@ -490,8 +490,9 @@ bool OHTMLReader::CreateTable(int nToken)
                 aFont.Strikeout = ::com::sun::star::awt::FontStrikeout::SINGLE;
                 break;
         }
+        nToken = GetNextToken();
     }
-    while( GetNextToken() != HTML_TABLEROW_OFF );
+    while (nToken != HTML_TABLEROW_OFF);
 
     if ( !m_sCurrent.isEmpty() )
         aColumnName = m_sCurrent;
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index 4e89f2a..a4ece11 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -258,7 +258,7 @@ bool ORTFReader::CreateTable(int nToken)
     FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
     do
     {
-        switch(nToken)
+        switch (nToken)
         {
             case RTF_UNKNOWNCONTROL:
             case RTF_UNKNOWNDATA:
@@ -301,8 +301,9 @@ bool ORTFReader::CreateTable(int nToken)
                 aFont.Strikeout = ::com::sun::star::awt::FontStrikeout::SINGLE;
                 break;
         }
+        nToken = GetNextToken();
     }
-    while( GetNextToken() != RTF_TROWD && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED );
+    while(nToken != RTF_TROWD && eState != SVPAR_ERROR && eState != SVPAR_ACCEPTED);
 
     bool bOk = !m_vDestVector.empty();
     if(bOk)
commit 124a3e680fecf0659dfaf283a648a405c070c71c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 9 20:59:47 2015 +0000

    coverity#1268023 Logically dead code
    
    Change-Id: I8fcda18101071db7dddc304c29e4130b04a70f89

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 23b5fcc..499c1ed 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -113,8 +113,7 @@ static void addPreamble(OString& rShaderSource, const OString& rPreamble)
     {
         int nVersionStrEndPos = rShaderSource.indexOf('\n', nVersionStrStartPos);
 
-        // no way this should happen - if this is the case, then it's a syntax error
-        assert(nVersionStrEndPos != -1);
+        SAL_WARN_IF(nVersionStrEndPos == -1, "vcl.opengl", "syntax error in shader");
 
         if (nVersionStrEndPos == -1)
             nVersionStrEndPos = nVersionStrStartPos + 8;
commit ace38b3be1e1de01b8e484a768d5ce961e5eb689
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 9 20:58:19 2015 +0000

    dead_error_begin->dead_error_line
    
    Change-Id: I960392401e1555954ac525059789873165ee42c2

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index e0acfbb..98f80e3 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -634,7 +634,7 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
         nTransition = XML_zoom;
         pDirection = ( nDirection == 1) ? "in" : "out";
         break;
-        // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
+        // coverity[dead_error_line] - following conditions exist to avoid compiler warning
         case PPT_TRANSITION_TYPE_NONE:
         default:
         nTransition = 0;


More information about the Libreoffice-commits mailing list