[Libreoffice-commits] .: 2 commits - desktop/win32 sw/source writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 8 00:53:16 PDT 2012


 desktop/win32/source/guistdio/guistdio.inc    |    2 +-
 sw/source/core/layout/flowfrm.cxx             |    4 ++--
 writerfilter/source/ooxml/OOXMLFastHelper.hxx |    9 ++++-----
 3 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit e55414dfc4899b67b8bec82885dde22ddb72faec
Author: jailletc36 <christophe.jaillet at wanadoo.fr>
Date:   Sun Oct 7 12:32:00 2012 +0200

    cppcheck: clarifyCalculation
    
    Use () to clarify the order of the operator + minor formatting
    
    Change-Id: I3dfa6566758d30bd76bed478089a0937ade24f89

diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc
index 25586f0..0c2f097 100644
--- a/desktop/win32/source/guistdio/guistdio.inc
+++ b/desktop/win32/source/guistdio/guistdio.inc
@@ -75,7 +75,7 @@ DWORD passOutputToConsole(HANDLE readPipe, HANDLE console)
             dwRead++;
         //We must make sure that only complete wchar_t|s are written. WriteConsolse takes
         //the number of wchar_t|s as argument. ReadFile, however, reads bytes.
-        bIncompleteWchar = dwRead % 2 ? true : false;
+        bIncompleteWchar = (dwRead % 2) ? true : false;
         if (bIncompleteWchar)
         {
             //To test this case, give aBuffer a small odd size, e.g. aBuffer[3]
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 7281703..a5baf31 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -920,7 +920,7 @@ sal_Bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
     // Does the Cntnt bring a Pagedesc or do we need the
     // virtual page number of the new layout leaf?
     // PageDesc isn't allowed with Follows
-    const sal_Bool bOdd = nTmp ? ( nTmp % 2 ? sal_True : sal_False )
+    const sal_Bool bOdd = nTmp ? ( (nTmp % 2) ? sal_True : sal_False )
                            : pNew->OnRightPage();
     if ( !pDesc )
         pDesc = pNew->FindPageDesc();
@@ -934,7 +934,7 @@ sal_Bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
     if ( pNewFlow && pNewFlow->GetFrm()->IsInTab() )
         pNewFlow = pNewFlow->GetFrm()->FindTabFrm();
     const SwPageDesc *pNewDesc= ( pNewFlow && !pNewFlow->IsFollow() )
-            ? pNewFlow->GetFrm()->GetAttrSet()->GetPageDesc().GetPageDesc():0;
+            ? pNewFlow->GetFrm()->GetAttrSet()->GetPageDesc().GetPageDesc() : 0;
 
     return ( pNew->GetPageDesc() != pDesc ||   //  own desc ?
         pNew->GetFmt() != (bFirst ? pDesc->GetFirstFmt() : (bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt())) ||
commit 1fb40dafbefccf906108efb19f28696cd03d6aed
Author: jailletc36 <christophe.jaillet at wanadoo.fr>
Date:   Sun Oct 7 12:28:47 2012 +0200

    cppcheck: unreadVariable
    
    Defined the aStr within the #ifdef block where it is used.
    
    Change-Id: I2878d2db002411783e814b0ecf02e2a030d2d6d4

diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index cfc21dc..8863bde 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -224,15 +224,14 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
 {
     OOXMLValue::Pointer_t pVal(new T(rValue));
 
+#ifdef DEBUG_HELPER
     string aStr = (*QNameToString::Instance())(nId);
 
-#ifdef DEBUG_HELPER
     debug_logger->startElement("helper.mark");
     debug_logger->attribute("name", aStr);
-    debug_logger->attribute
-    ("value",
-     OUStringToOString
-     (rValue, RTL_TEXTENCODING_ASCII_US).getStr());
+    debug_logger->attribute("value",
+        OUStringToOString
+        (rValue, RTL_TEXTENCODING_ASCII_US).getStr());
 
     if (aStr.empty())
         debug_logger->element("unknown-qname");


More information about the Libreoffice-commits mailing list