[Libreoffice-commits] core.git: 3 commits - sc/source svtools/source

Caolán McNamara caolanm at redhat.com
Tue Apr 1 05:49:20 PDT 2014


 sc/source/filter/oox/drawingmanager.cxx |   14 +++---
 sc/source/ui/view/tabvwsh4.cxx          |    3 -
 svtools/source/svhtml/parhtml.cxx       |   68 ++++++++++++++------------------
 3 files changed, 38 insertions(+), 47 deletions(-)

New commits:
commit 9a0e6204bba686945a1ab249b741d703ed3e84a6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 1 13:38:37 2014 +0100

    coverity#735505 Logically dead code
    
    Change-Id: I7e7abf9192ee34c9f1c2080268751503aae90e55

diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index f54c741..93e8c2d 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -562,59 +562,51 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
                             break;
                         }
 
+                        assert(cChar != 0);
+
                         // 1 == Non Breaking Space
                         // 2 == SoftHyphen
 
-                        if( cChar < 3U )
+                        if (cChar == 1 || cChar == 2)
                         {
                             if( '>' == cBreak )
                             {
                                 // When reading the content of a tag we have
                                 // to change it to ' ' or '-'
-                                switch( cChar )
-                                {
-                                case 1U: cChar = ' '; break;
-                                case 2U: cChar = '-'; break;
-                                default:
-                                    DBG_ASSERT( cChar==1U,
-                            "\0x00 should be handled already!" );
-                                    break;
-                                }
+                                if( 1U == cChar )
+                                    cChar = ' ';
+                                else //2U
+                                    cChar = '-';
                             }
                             else
                             {
                                 // If not scanning a tag return token
                                 aToken += sTmpBuffer.makeStringAndClear();
-                                if( cChar )
+
+                                if( !aToken.isEmpty() )
                                 {
-                                    if( !aToken.isEmpty() )
-                                    {
-                                        // restart with character
-                                        nNextCh = '&';
-                                        DBG_ASSERT( rInput.Tell()-nStreamPos ==
-                                                    (sal_uLong)(nPos+1)*GetCharSize(),
-                                                    "Wrong stream position" );
-                                        DBG_ASSERT( nlLinePos-nLinePos ==
-                                                    (sal_uLong)(nPos+1),
-                                                    "Wrong line position" );
-                                        rInput.Seek( nStreamPos );
-                                        nlLinePos = nLinePos;
-                                        ClearTxtConvContext();
-                                        return HTML_TEXTTOKEN;
-                                    }
-
-                                    // Hack: _GetNextChar shall not read the
-                                    // next character
-                                    if( ';' != nNextCh )
-                                        aToken += " ";
-                                    if( 1U == cChar )
-                                        return HTML_NONBREAKSPACE;
-                                    if( 2U == cChar )
-                                        return HTML_SOFTHYPH;
+                                    // restart with character
+                                    nNextCh = '&';
+                                    DBG_ASSERT( rInput.Tell()-nStreamPos ==
+                                                (sal_uLong)(nPos+1)*GetCharSize(),
+                                                "Wrong stream position" );
+                                    DBG_ASSERT( nlLinePos-nLinePos ==
+                                                (sal_uLong)(nPos+1),
+                                                "Wrong line position" );
+                                    rInput.Seek( nStreamPos );
+                                    nlLinePos = nLinePos;
+                                    ClearTxtConvContext();
+                                    return HTML_TEXTTOKEN;
                                 }
-                                aToken += "&";
-                                aToken += sEntityBuffer.makeStringAndClear();
-                                break;
+
+                                // Hack: _GetNextChar shall not read the
+                                // next character
+                                if( ';' != nNextCh )
+                                    aToken += " ";
+                                if( 1U == cChar )
+                                    return HTML_NONBREAKSPACE;
+                                else //2U
+                                    return HTML_SOFTHYPH;
                             }
                         }
                     }
commit bbaa84d121deeaba2f173fb272feb2b998aaec70
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 1 13:20:34 2014 +0100

    coverity#704284 Logically dead code
    
    since c24ab8def12f8a7a305e35d39c91976e345dd3b0
    
    Change-Id: Ic65f785dd4b1b8c7a56d52bc917ee1da4ad83ebe

diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index a600de0..6d0a6e6 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1295,8 +1295,7 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
         {
             ScRange aDummy;
             ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy );
-            if ( eMarkType != SC_MARK_SIMPLE &&
-                    !(eFunc == KEYFUNC_COPY && eMarkType == SC_MARK_SIMPLE_FILTERED) )
+            if (eMarkType != SC_MARK_SIMPLE)
             {
                 ErrorMessage(STR_NOMULTISELECT);
                 bUsed = true;
commit dc9dcb7063539921aa19d258904eaeca476aabe8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 1 13:15:38 2014 +0100

    coverity#704241 Logically dead code
    
    Change-Id: Iabcc4cc9f68306eb0b0dadb7c9b8a27907ec6953

diff --git a/sc/source/filter/oox/drawingmanager.cxx b/sc/source/filter/oox/drawingmanager.cxx
index 7fe4408..4644d93 100644
--- a/sc/source/filter/oox/drawingmanager.cxx
+++ b/sc/source/filter/oox/drawingmanager.cxx
@@ -266,21 +266,21 @@ void BiffDrawingObjectBase::convertLineProperties( ShapePropertyMap& rPropMap, c
 
         // line ends
         bool bLineStart = false;
-        bool bLineEnd = false;
+        bool bArrow = false;
         bool bFilled = false;
         switch( extractValue< sal_uInt8 >( nArrows, 0, 4 ) )
         {
-            case BIFF_OBJ_ARROW_OPEN:       bLineStart = false; bLineEnd = true;  bFilled = false;  break;
-            case BIFF_OBJ_ARROW_OPENBOTH:   bLineStart = true;  bLineEnd = true;  bFilled = false;  break;
-            case BIFF_OBJ_ARROW_FILLED:     bLineStart = false; bLineEnd = true;  bFilled = true;   break;
-            case BIFF_OBJ_ARROW_FILLEDBOTH: bLineStart = true;  bLineEnd = true;  bFilled = true;   break;
+            case BIFF_OBJ_ARROW_OPEN:       bLineStart = false; bArrow = true;  bFilled = false;  break;
+            case BIFF_OBJ_ARROW_OPENBOTH:   bLineStart = true;  bArrow = true;  bFilled = false;  break;
+            case BIFF_OBJ_ARROW_FILLED:     bLineStart = false; bArrow = true;  bFilled = true;   break;
+            case BIFF_OBJ_ARROW_FILLEDBOTH: bLineStart = true;  bArrow = true;  bFilled = true;   break;
         }
-        if( bLineStart || bLineEnd )
+        if (bArrow)
         {
             // arrow type (open or closed)
             sal_Int32 nArrowType = bFilled ? XML_triangle : XML_arrow;
+            aLineProps.maEndArrow.moArrowType   = nArrowType;
             aLineProps.maStartArrow.moArrowType = bLineStart ? nArrowType : XML_none;
-            aLineProps.maEndArrow.moArrowType   = bLineEnd   ? nArrowType : XML_none;
 
             // arrow width
             sal_Int32 nArrowWidth = XML_med;


More information about the Libreoffice-commits mailing list