[Libreoffice-commits] core.git: 5 commits - editeng/source hwpfilter/source sc/source sw/source

Julien Nabet serval2412 at yahoo.fr
Mon Feb 3 14:05:04 PST 2014


 editeng/source/editeng/impedit3.cxx |    2 +-
 hwpfilter/source/grammar.cxx        |    4 ++--
 sc/source/filter/excel/xerecord.cxx |    2 +-
 sw/source/core/doc/docedt.cxx       |    2 +-
 sw/source/core/layout/pagechg.cxx   |    4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit a40d3f3686eccf604333ad8ed2ac4442d44720de
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 3 23:02:53 2014 +0100

    cppcheck: Clarify calculation precedence for '%' and '?'
    
    Change-Id: Idf3c4f31f9abd974d623d4a1cf08eeb167e1ef25

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index aa9727b..ff80d97 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4307,7 +4307,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara,
         short nScriptType = GetI18NScriptType( EditPaM( pNode, nIndex+1 ) );
         bCTL = nScriptType == i18n::ScriptType::COMPLEX;
         // this change was discussed in issue 37190
-        bR2L = GetRightToLeft( nPara, nIndex + 1) % 2 ? sal_True : sal_False;
+        bR2L = (GetRightToLeft( nPara, nIndex + 1) % 2) ? sal_True : sal_False;
         // it also works for issue 55927
     }
 
commit a45c79da3211bf3b564886097d9441cca2669362
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 3 23:02:04 2014 +0100

    cppcheck: Clarify calculation precedence for '%' and '?'
    
    Change-Id: I59f9763651ba576a5d0dc970283d46a18f806024

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 9508435..59dbaaa 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1287,7 +1287,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
         if ( rDesc.GetNumOffset() )
         {
             ::boost::optional<sal_uInt16> oNumOffset = rDesc.GetNumOffset();
-            bWishedOdd = (oNumOffset ? oNumOffset.get() : 0) % 2 ? true : false;
+            bWishedOdd = ((oNumOffset ? oNumOffset.get() : 0) % 2) ? true : false;
             //Die Gelegenheit nutzen wir um das Flag an der Root zu pflegen.
             pRoot->SetVirtPageNum( sal_True );
         }
@@ -1568,7 +1568,7 @@ void SwRootFrm::AssertFlyPages()
     {
         //Die Seiten werden ausgehend von der letzten Seite konsequent
         //nach den Regeln der PageDescs weitergefuehrt.
-        sal_Bool bOdd = pPage->GetPhyPageNum() % 2 ? sal_True : sal_False;
+        sal_Bool bOdd = (pPage->GetPhyPageNum() % 2) ? sal_True : sal_False;
         SwPageDesc *pDesc = pPage->GetPageDesc();
         SwFrm *pSibling = pPage->GetNext();
         for ( i = pPage->GetPhyPageNum(); i < nMaxPg; ++i  )
commit 43627f2aab112cb9b5666d98c0c9e15bc6124cfb
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 3 22:59:26 2014 +0100

    cppcheck: Clarify calculation precedence for '<<' and '?'
    
    Change-Id: Id02a6ce439862e1bdb33927d26f4c12cf5690d4c

diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx
index 94f0d31..a305afc 100644
--- a/sc/source/filter/excel/xerecord.cxx
+++ b/sc/source/filter/excel/xerecord.cxx
@@ -180,7 +180,7 @@ void XclExpValueRecord<double>::SaveXml( XclExpXmlStream& rStrm )
 
 void XclExpBoolRecord::WriteBody( XclExpStream& rStrm )
 {
-    rStrm << static_cast< sal_uInt16 >( mbValue ? 1 : 0 );
+    rStrm << (static_cast< sal_uInt16 >( mbValue ? 1 : 0 ));
 }
 
 void XclExpBoolRecord::SaveXml( XclExpXmlStream& rStrm )
commit 384a55e188adbdd6b5fc8d03519a44c89a346600
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 3 22:54:41 2014 +0100

    cppcheck: Clarify expression with parentheses
    
    Change-Id: I82cc35fd94ddff433319139d712254138e51daff

diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx
index e10c598..4ff34a5 100644
--- a/hwpfilter/source/grammar.cxx
+++ b/hwpfilter/source/grammar.cxx
@@ -1125,7 +1125,7 @@ yyerrlab:   /* here on detecting error */
 
       count = 0;
       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-      for (x = (yyn < 0 ? -yyn : 0);
+      for (x = ((yyn < 0) ? -yyn : 0);
            x < (sizeof(yytname) / sizeof(char *)); x++)
         if (yycheck[x + yyn] == x)
           size += strlen(yytname[x]) + 15, count++;
@@ -1137,7 +1137,7 @@ yyerrlab:   /* here on detecting error */
           if (count < 5)
         {
           count = 0;
-          for (x = (yyn < 0 ? -yyn : 0);
+          for (x = ((yyn < 0) ? -yyn : 0);
                x < (sizeof(yytname) / sizeof(char *)); x++)
             if (yycheck[x + yyn] == x)
               {
commit 9a09e8174b98bc0f6cf089d87d63f8b137e9ac48
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 3 22:53:19 2014 +0100

    cppcheck: Clarify expression with parentheses
    
    Change-Id: I387df0d3b895148b9f2029898e236cd2caf83fea

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 87d601b..7e414c0 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -264,7 +264,7 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
             }
             else if( ( rSttNdIdx.GetIndex() + nSttOff <= pAPos->nNode.GetIndex()
                     && pAPos->nNode.GetIndex() <= rEndNdIdx.GetIndex() - nOff ) ||
-                        ( bInsPos = rInsPos == pAPos->nNode ))
+                        ( bInsPos = (rInsPos == pAPos->nNode) ))
 
             {
                 _SaveFly aSave( pAPos->nNode.GetIndex() - rSttNdIdx.GetIndex(),


More information about the Libreoffice-commits mailing list