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

Caolán McNamara caolanm at redhat.com
Thu Apr 6 16:17:54 UTC 2017


 sw/source/filter/ww8/ww8par6.cxx |  122 ++++++++++++++++++---------------------
 1 file changed, 57 insertions(+), 65 deletions(-)

New commits:
commit 504c993eafe9aba93f034c7672c8530c9d1a85ec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 6 17:16:32 2017 +0100

    Revert "ofz: treat more short properties as run ends"
    
    This reverts commit b4d6590ff572eb6c9f3455c718cc89336cf15c54.
    
    Revert "loplugin:literaltoboolconversion"
    
    This reverts commit 6e372ae1e9401f7a3651c617ece4131c065ec58d.

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 9685818510ee..538486ea91c4 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2683,7 +2683,7 @@ const SfxPoolItem* SwWW8ImplReader::GetFormatAttr( sal_uInt16 nWhich )
 // parameters according to the table in WWScan.cxx.
 void SwWW8ImplReader::Read_Special(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_bSpec = false;
         return;
@@ -2694,7 +2694,7 @@ void SwWW8ImplReader::Read_Special(sal_uInt16, const sal_uInt8* pData, short nLe
 // Read_Obj is used for fObj and for fOle2 !
 void SwWW8ImplReader::Read_Obj(sal_uInt16 , const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)
+    if( nLen < 0 )
         m_bObj = false;
     else
     {
@@ -2717,7 +2717,7 @@ void SwWW8ImplReader::Read_Obj(sal_uInt16 , const sal_uInt8* pData, short nLen)
 
 void SwWW8ImplReader::Read_PicLoc(sal_uInt16 , const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 4)
+    if( nLen < 0 )
     {
         m_nPicLocFc = 0;
         m_bSpec = false;  // Is this always correct?
@@ -2746,7 +2746,7 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLe
         if (pSI != nullptr)
         {
             pSI->mnWW8OutlineLevel =
-                    static_cast< sal_uInt8 >( ( (pData && nLen >= 1) ? *pData : 0 ) );
+                    static_cast< sal_uInt8 >( ( pData ? *pData : 0 ) );
             NewAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL, SwWW8StyInf::WW8OutlineLevelToOutlinelevel( pSI->mnWW8OutlineLevel ) ) );
         }
     }
@@ -2754,7 +2754,7 @@ void SwWW8ImplReader::Read_POutLvl(sal_uInt16, const sal_uInt8* pData, short nLe
     {
         const sal_uInt8 nOutlineLevel
             = SwWW8StyInf::WW8OutlineLevelToOutlinelevel(
-                static_cast<sal_uInt8>(((pData && nLen >= 1) ? *pData : 0)));
+                static_cast<sal_uInt8>((pData ? *pData : 0)));
         NewAttr(SfxUInt16Item(RES_PARATR_OUTLINELEVEL, nOutlineLevel));
     }
 }
@@ -2763,7 +2763,7 @@ void SwWW8ImplReader::Read_Symbol(sal_uInt16, const sal_uInt8* pData, short nLen
 {
     if( !m_bIgnoreText )
     {
-        if (nLen < (m_bVer67 ? 3 : 4))
+        if( nLen < 0 )
         {
             //otherwise disable after we print the char
             if (m_pPlcxMan && m_pPlcxMan->GetDoingDrawTextBox())
@@ -2848,7 +2848,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
 
     sal_uInt16 nMask = 1 << nI;
 
-    if (nLen < 1)
+    if (nLen < 0)
     {
         if (nI < 2)
         {
@@ -2914,7 +2914,7 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
 
 void SwWW8ImplReader::Read_Bidi(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)  //Property end
+    if( nLen < 0 )  //Property end
     {
         m_bBidi = false;
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_BIDIRTL);
@@ -3028,7 +3028,7 @@ void SwWW8ImplReader::Read_BoldBiDiUsw(sal_uInt16 nId, const sal_uInt8* pData,
 
     sal_uInt16 nMask = 1 << nI;
 
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),nEndIds[nI]);
         m_pCtrlStck->SetToggleBiDiAttr(nI, false);
@@ -3196,8 +3196,7 @@ void SwWW8ImplReader::ChkToggleBiDiAttr_( sal_uInt16 nOldStyle81Mask,
 
 void SwWW8ImplReader::Read_SubSuper( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
-    {
+    if( nLen < 0 ){
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
         return;
     }
@@ -3289,7 +3288,7 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
 
 void SwWW8ImplReader::Read_SubSuperProp( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < ww::eWW2 ? 1 : 2)
+    if( nLen < 0 )
     {
         if (!ConvertSubToGraphicPlacement())
             m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ESCAPEMENT );
@@ -3322,7 +3321,7 @@ void SwWW8ImplReader::Read_Underline( sal_uInt16, const sal_uInt8* pData, short
 {
     FontLineStyle eUnderline = LINESTYLE_NONE;
     bool bWordLine = false;
-    if (pData && nLen)
+    if( pData )
     {
         // Parameter:  0 = none,    1 = single,  2 = by Word,
                     // 3 = double,  4 = dotted,  5 = hidden
@@ -3352,7 +3351,7 @@ void SwWW8ImplReader::Read_Underline( sal_uInt16, const sal_uInt8* pData, short
     }
 
     // if necessary, mix up stack and exit!
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE );
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_WORDLINEMODE );
@@ -3376,7 +3375,7 @@ NoBracket   78 CA 06 -  02 00 00 02 34 52
 void SwWW8ImplReader::Read_DoubleLine_Rotate( sal_uInt16, const sal_uInt8* pData,
     short nLen )
 {
-    if (nLen < 0) // close the tag
+    if( nLen < 0 ) // close the tag
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_TWO_LINES );
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_ROTATE );
@@ -3415,7 +3414,7 @@ void SwWW8ImplReader::Read_TextColor( sal_uInt16, const sal_uInt8* pData, short
     if (!m_bVer67 && m_pPlcxMan && m_pPlcxMan->GetChpPLCF()->HasSprm(NS_sprm::sprmCCv))
         return;
 
-    if (nLen < 1)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
     else
     {
@@ -3432,7 +3431,7 @@ void SwWW8ImplReader::Read_TextColor( sal_uInt16, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_TextForeColor(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 4)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_COLOR );
     else
     {
@@ -3445,7 +3444,7 @@ void SwWW8ImplReader::Read_TextForeColor(sal_uInt16, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 0)
+    if( nLen < 0 )
     {
         //because the UnderlineColor is not a standalone attribute in SW, it belongs to the underline attribute.
         //And, the .doc file stores attributes separately, this attribute ends here, the "underline"
@@ -3462,8 +3461,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh
                 const SwAttrSet& aSet = m_pAktColl->GetAttrSet();
                 SvxUnderlineItem *pUnderline
                     = static_cast<SvxUnderlineItem *>(aSet.Get( RES_CHRATR_UNDERLINE, false ).Clone());
-                if (pUnderline && nLen >= 4)
-                {
+                if(pUnderline){
                     pUnderline->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ) );
                     m_pAktColl->SetFormatAttr( *pUnderline );
                     delete pUnderline;
@@ -3476,8 +3474,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh
             {
                 SvxUnderlineItem *pUnderline
                     = static_cast<SvxUnderlineItem *>(m_pAktItemSet->Get( RES_CHRATR_UNDERLINE, false ) .Clone());
-                if (pUnderline && nLen >= 4)
-                {
+                if(pUnderline){
                     pUnderline->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ) );
                     m_pAktItemSet->Put( *pUnderline );
                     delete pUnderline;
@@ -3487,7 +3484,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh
         else
         {
             SvxUnderlineItem* pUnderlineAttr = const_cast<SvxUnderlineItem*>(static_cast<const SvxUnderlineItem*>(m_pCtrlStck->GetOpenStackAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE )));
-            if (pUnderlineAttr && nLen >= 4)
+            if( pUnderlineAttr != nullptr )
                 pUnderlineAttr->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32( pData ))));
         }
     }
@@ -3710,7 +3707,7 @@ void SwWW8ImplReader::Read_FontCode( sal_uInt16 nId, const sal_uInt8* pData, sho
 
         ww::WordVersion eVersion = m_pWwFib->GetFIBVersion();
 
-        if (nLen < 2) // end of attribute
+        if( nLen < 0 ) // end of attribute
         {
             if (eVersion <= ww::eWW6)
             {
@@ -3752,7 +3749,7 @@ void SwWW8ImplReader::Read_FontSize( sal_uInt16 nId, const sal_uInt8* pData, sho
 
     ww::WordVersion eVersion = m_pWwFib->GetFIBVersion();
 
-    if (nLen < (eVersion <= ww::eWW2 ? 1 : 2))          // end of attribute
+    if( nLen < 0 )          // end of attribute
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId  );
         if (eVersion <= ww::eWW6) // reset additionally the CTL size
@@ -3795,14 +3792,14 @@ void SwWW8ImplReader::Read_FontSize( sal_uInt16 nId, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_CharSet(sal_uInt16 , const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)
+    if( nLen < 0 )
     {                   // end of attribute
         m_eHardCharSet = RTL_TEXTENCODING_DONTKNOW;
         return;
     }
     sal_uInt8 nfChsDiff = *pData;
 
-    if (nfChsDiff && nLen >= 2)
+    if( nfChsDiff )
         m_eHardCharSet = rtl_getTextEncodingFromWindowsCharset( *(pData + 1) );
     else
         m_eHardCharSet = RTL_TEXTENCODING_DONTKNOW;
@@ -3844,8 +3841,7 @@ void SwWW8ImplReader::Read_Language( sal_uInt16 nId, const sal_uInt8* pData, sho
 */
 void SwWW8ImplReader::Read_CColl( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 2)    // end of attribute
-    {
+    if( nLen < 0 ){                 // end of attribute
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_TXTATR_CHARFMT );
         m_nCharFormat = -1;
         return;
@@ -3874,8 +3870,7 @@ void SwWW8ImplReader::Read_CColl( sal_uInt16, const sal_uInt8* pData, short nLen
 */
 void SwWW8ImplReader::Read_Kern( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 2)  // end of attribute
-    {
+    if( nLen < 0 ){                 // end of attribute
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_KERNING );
         return;
     }
@@ -3885,7 +3880,7 @@ void SwWW8ImplReader::Read_Kern( sal_uInt16, const sal_uInt8* pData, short nLen
 
 void SwWW8ImplReader::Read_FontKern( sal_uInt16, const sal_uInt8* , short nLen )
 {
-    if (nLen < 0) // end of attribute
+    if( nLen < 0 ) // end of attribute
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_AUTOKERN );
     else
         NewAttr(SvxAutoKernItem(true, RES_CHRATR_AUTOKERN));
@@ -3897,7 +3892,7 @@ void SwWW8ImplReader::Read_CharShadow(  sal_uInt16, const sal_uInt8* pData, shor
     if (!m_bVer67 && m_pPlcxMan && m_pPlcxMan->GetChpPLCF()->HasSprm(0xCA71))
         return;
 
-    if (nLen < 2)
+    if( nLen <= 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
     }
@@ -3919,7 +3914,7 @@ void SwWW8ImplReader::Read_CharShadow(  sal_uInt16, const sal_uInt8* pData, shor
 
 void SwWW8ImplReader::Read_TextBackColor(sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen <= 0)
+    if( nLen <= 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BACKGROUND );
     }
@@ -3941,7 +3936,7 @@ void SwWW8ImplReader::Read_TextBackColor(sal_uInt16, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_CharHighlight(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_HIGHLIGHT );
     }
@@ -3959,7 +3954,7 @@ void SwWW8ImplReader::Read_CharHighlight(sal_uInt16, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 0)  // end of attribute
+    if( nLen < 0 )  // end of attribute
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_LINENUMBER );
         return;
@@ -3971,7 +3966,7 @@ void SwWW8ImplReader::Read_NoLineNumb(sal_uInt16 , const sal_uInt8* pData, short
         aLN.SetStartValue( pLN->GetStartValue() );
     }
 
-    aLN.SetCountLines(pData && nLen >= 1 && (0 == *pData));
+    aLN.SetCountLines( pData && (0 == *pData) );
     NewAttr( aLN );
 }
 
@@ -3987,11 +3982,10 @@ bool lcl_HasExplicitLeft(const WW8PLCFMan *pPlcxMan, bool bVer67)
     }
     return false;
 }
-
 // Sprm 16, 17
 void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 2)  // end of attribute
+    if (nLen < 0)  // end of attribute
     {
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
         return;
@@ -4142,10 +4136,7 @@ void SwWW8ImplReader::Read_LineSpace( sal_uInt16, const sal_uInt8* pData, short
     if (m_bStyNormal && m_bWWBugNormal)
         return;
 
-    ww::WordVersion eVersion = m_pWwFib->GetFIBVersion();
-
-    if (nLen < ((eVersion <= ww::eWW2) ? 3 : 4))
-    {
+    if( nLen < 0 ){
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_LINESPACING );
         if( !( m_nIniFlags & WW8FL_NO_IMPLPASP ) )
             m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
@@ -4153,6 +4144,7 @@ void SwWW8ImplReader::Read_LineSpace( sal_uInt16, const sal_uInt8* pData, short
     }
 
     short nSpace = SVBT16ToShort( pData );
+    ww::WordVersion eVersion = m_pWwFib->GetFIBVersion();
     short nMulti = (eVersion <= ww::eWW2) ? 1 : SVBT16ToShort( pData + 2 );
 
     SvxLineSpaceRule eLnSpc;
@@ -4212,7 +4204,7 @@ sal_uInt16 SwWW8ImplReader::GetParagraphAutoSpace(bool fDontUseHTMLAutoSpacing)
 
 void SwWW8ImplReader::Read_ParaAutoBefore(sal_uInt16, const sal_uInt8 *pData, short nLen)
 {
-    if (nLen < 1)
+    if (nLen < 0)
     {
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
         return;
@@ -4239,7 +4231,7 @@ void SwWW8ImplReader::Read_ParaAutoBefore(sal_uInt16, const sal_uInt8 *pData, sh
 
 void SwWW8ImplReader::Read_ParaAutoAfter(sal_uInt16, const sal_uInt8 *pData, short nLen)
 {
-    if (nLen < 1)
+    if (nLen < 0)
     {
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_UL_SPACE);
         return;
@@ -4278,7 +4270,7 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const sal_uInt8* pData, short nLe
     // then please send this Document to SH.");
     // bWWBugNormal is not a sufficient criterion for this distance being wrong.
 
-    if (nLen < 2)
+    if( nLen < 0 )
     {
         // end of attribute
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
@@ -4311,7 +4303,7 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const sal_uInt8* pData, short nLe
 
 void SwWW8ImplReader::Read_ParaContextualSpacing( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_UL_SPACE );
         return;
@@ -4329,7 +4321,7 @@ void SwWW8ImplReader::Read_IdctHint( sal_uInt16, const sal_uInt8* pData, short n
     // when this value is 0, text properties bias towards non-far east properties.
     // when this value is 1, text properties bias towards far east properties.
     // when this value is 2, text properties bias towards complex properties.
-    if (nLen < 1)  //Property end
+    if( nLen < 0 )  //Property end
     {
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(),RES_CHRATR_IDCTHINT);
     }
@@ -4341,7 +4333,7 @@ void SwWW8ImplReader::Read_IdctHint( sal_uInt16, const sal_uInt8* pData, short n
 
 void SwWW8ImplReader::Read_Justify( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
         return;
@@ -4394,7 +4386,7 @@ bool SwWW8ImplReader::IsRightToLeft()
 
 void SwWW8ImplReader::Read_RTLJustify( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ADJUST );
         return;
@@ -4453,7 +4445,7 @@ void SwWW8ImplReader::Read_BoolItem( sal_uInt16 nId, const sal_uInt8* pData, sho
             return ;
     }
 
-    if (nLen < 1)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), nId );
     else
     {
@@ -4466,7 +4458,7 @@ void SwWW8ImplReader::Read_BoolItem( sal_uInt16 nId, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_EMPHASIS_MARK );
     else
     {
@@ -4523,7 +4515,7 @@ void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short n
 
 void SwWW8ImplReader::Read_ScaleWidth( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 2)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SCALEW );
     else
     {
@@ -4537,7 +4529,7 @@ void SwWW8ImplReader::Read_ScaleWidth( sal_uInt16, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_Relief( sal_uInt16 nId, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen < 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_RELIEF );
     else
     {
@@ -4564,7 +4556,7 @@ void SwWW8ImplReader::Read_Relief( sal_uInt16 nId, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_TextAnim(sal_uInt16 /*nId*/, const sal_uInt8* pData, short nLen)
 {
-    if (nLen < 1)
+    if (nLen < 0)
         m_pCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_BLINK);
     else
     {
@@ -4726,7 +4718,7 @@ void SwWW8ImplReader::Read_Shade( sal_uInt16, const sal_uInt8* pData, short nLen
     if (!m_bVer67 && m_pPlcxMan && m_pPlcxMan->GetPapPLCF()->HasSprm(0xC64D))
         return;
 
-    if (nLen < 2)
+    if (nLen <= 0)
     {
         // end of attribute
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BACKGROUND );
@@ -4802,7 +4794,7 @@ void SwWW8ImplReader::Read_TextVerticalAdjustment( sal_uInt16, const sal_uInt8*
 
 void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8*, short nLen)
 {
-    if (nLen < 0)
+    if( nLen < 0 )
     {
         if( m_bHasBorder )
         {
@@ -4878,7 +4870,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
     //if (!bVer67 && pPlcxMan && pPlcxMan->GetChpPLCF()->HasSprm(0xCA72))
     //    return;
 
-    if (nLen < 0)
+    if( nLen < 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_BOX );
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_SHADOW );
@@ -4918,7 +4910,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
 void SwWW8ImplReader::Read_Hyphenation( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
     // set Hyphenation flag
-    if (nLen < 1)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_HYPHENZONE );
     else
     {
@@ -4940,7 +4932,7 @@ void SwWW8ImplReader::Read_Hyphenation( sal_uInt16, const sal_uInt8* pData, shor
 
 void SwWW8ImplReader::Read_WidowControl( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
     {
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_WIDOWS );
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_ORPHANS );
@@ -4960,7 +4952,7 @@ void SwWW8ImplReader::Read_WidowControl( sal_uInt16, const sal_uInt8* pData, sho
 
 void SwWW8ImplReader::Read_UsePgsuSettings(sal_uInt16,const sal_uInt8* pData,short nLen)
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SNAPTOGRID);
     else
     {
@@ -4973,7 +4965,7 @@ void SwWW8ImplReader::Read_UsePgsuSettings(sal_uInt16,const sal_uInt8* pData,sho
 
 void SwWW8ImplReader::Read_AlignFont( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 2)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_VERTALIGN);
     else
     {
@@ -5007,7 +4999,7 @@ void SwWW8ImplReader::Read_AlignFont( sal_uInt16, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_KeepLines( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_PARATR_SPLIT );
     else
         NewAttr( SvxFormatSplitItem( ( *pData & 1 ) == 0, RES_PARATR_SPLIT ) );
@@ -5015,7 +5007,7 @@ void SwWW8ImplReader::Read_KeepLines( sal_uInt16, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_KeepParas( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_KEEP );
     else
         NewAttr( SvxFormatKeepItem( ( *pData & 1 ) != 0 , RES_KEEP) );
@@ -5023,7 +5015,7 @@ void SwWW8ImplReader::Read_KeepParas( sal_uInt16, const sal_uInt8* pData, short
 
 void SwWW8ImplReader::Read_BreakBefore( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 1)
+    if( nLen <= 0 )
         m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_BREAK );
     else
         NewAttr( SvxFormatBreakItem(


More information about the Libreoffice-commits mailing list