From 3cac15856ade9fce161a49212c9d1861741122a5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 7 Sep 2016 12:02:33 +0200 Subject: loplugin:constantparam in sw Change-Id: Ifcb05b7fbca7fc6c8ad82bad38a927ba9f9511bf --- sw/source/filter/html/htmlcss1.cxx | 4 ++-- sw/source/filter/html/htmlctxt.cxx | 2 +- sw/source/filter/html/htmlgrin.cxx | 2 +- sw/source/filter/html/svxcss1.cxx | 5 +++-- sw/source/filter/html/svxcss1.hxx | 1 - sw/source/filter/html/swhtml.cxx | 27 ++++++++++----------------- sw/source/filter/html/swhtml.hxx | 3 +-- 7 files changed, 18 insertions(+), 26 deletions(-) (limited to 'sw/source/filter') diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index d502957d051d..c1f0fcdc93d0 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -97,7 +97,7 @@ void SwCSS1Parser::ChgPageDesc( const SwPageDesc *pPageDesc, } SwCSS1Parser::SwCSS1Parser( SwDoc *pD, sal_uInt32 aFHeights[7], const OUString& rBaseURL, bool bNewDoc ) : - SvxCSS1Parser( pD->GetAttrPool(), rBaseURL, MM50/2, + SvxCSS1Parser( pD->GetAttrPool(), rBaseURL, reinterpret_cast(&aItemIds), sizeof(aItemIds) / sizeof(sal_uInt16) ), pDoc( pD ), nDropCapCnt( 0 ), @@ -2275,7 +2275,7 @@ void SwHTMLParser::InsertParaAttrs( const SfxItemSet& rItemSet ) if( RES_PARATR_BEGIN > nWhich ) (*ppAttr)->SetLikePara(); m_aParaAttrs.push_back( *ppAttr ); - bool bSuccess = EndAttr( *ppAttr, nullptr, false ); + bool bSuccess = EndAttr( *ppAttr, false ); if (!bSuccess) m_aParaAttrs.pop_back(); } diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index feb49388cf3d..bca76fb844c4 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -589,7 +589,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, aLRItem.SetTextLeft( nLeft ); aLRItem.SetRight( nRight ); NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); - EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); + EndAttr( m_aAttrTab.pLRSpace, false ); } break; diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 3b1a5f0b60f5..401415ad1fd2 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -236,7 +236,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, { NewAttr( &m_aAttrTab.pULSpace, SvxULSpaceItem( 0, nLower, RES_UL_SPACE ) ); m_aParaAttrs.push_back( m_aAttrTab.pULSpace ); - EndAttr( m_aAttrTab.pULSpace, nullptr, false ); + EndAttr( m_aAttrTab.pULSpace, false ); } } diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 5f5f9aa3e880..556b8db75c4a 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -685,7 +686,7 @@ bool SvxCSS1Parser::DeclarationParsed( const OUString& rProperty, return true; // die Deklaration brauchen wir nicht mehr. Loeschen! } -SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, sal_uInt16 nMinFixLineSp, +SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, sal_uInt16 *pWhichIds, sal_uInt16 nWhichIds ) : CSS1Parser(), sBaseURL( rBaseURL ), @@ -693,7 +694,7 @@ SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, sal_ pItemSet(nullptr), pSearchEntry( nullptr ), pPropInfo( nullptr ), - nMinFixLineSpace( nMinFixLineSp ), + nMinFixLineSpace( MM50/2 ), eDfltEnc( RTL_TEXTENCODING_DONTKNOW ), nScriptFlags( CSS1_SCRIPT_ALL ), bIgnoreFontFamily( false ) diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index 6c9e57668dcf..3088bbfd0f36 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -240,7 +240,6 @@ public: SvxCSS1Parser( SfxItemPool& rPool, const OUString& rBaseURL, - sal_uInt16 nMinFixLineSp, sal_uInt16 *pWhichIds=nullptr, sal_uInt16 nWhichIds=0 ); virtual ~SvxCSS1Parser(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 84eccfbfb236..4375df835e30 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1441,7 +1441,7 @@ void SwHTMLParser::NextToken( int nToken ) if( !m_pTable && !m_pDoc->IsInHeaderFooter( m_pPam->GetPoint()->nNode ) ) { NewAttr( &m_aAttrTab.pBreak, SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK) ); - EndAttr( m_aAttrTab.pBreak, nullptr, false ); + EndAttr( m_aAttrTab.pBreak, false ); } break; @@ -2994,12 +2994,10 @@ void SwHTMLParser::NewAttr( HTMLAttr **ppAttr, const SfxPoolItem& rItem ) (*ppAttr) = new HTMLAttr( *m_pPam->GetPoint(), rItem, ppAttr ); } -bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, HTMLAttr **ppDepAttr, - bool bChkEmpty ) +bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty ) { bool bRet = true; - OSL_ENSURE( !ppDepAttr, "SwHTMLParser::EndAttr: ppDepAttr-Feature ungetestet?" ); // Der Listenkopf ist im Attribut gespeichert HTMLAttr **ppHead = pAttr->ppHead; @@ -3108,15 +3106,10 @@ bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, HTMLAttr **ppDepAttr, // dann koennen alle gesetzt werden, es sei denn // sie haengen noch von einem anderen Attribut ab, // dann werden sie dort angehaengt - if( ppDepAttr && *ppDepAttr ) - (*ppDepAttr)->InsertPrev( pAttr ); + if (pAttr->bInsAtStart) + m_aSetAttrTab.push_front( pAttr ); else - { - if (pAttr->bInsAtStart) - m_aSetAttrTab.push_front( pAttr ); - else - m_aSetAttrTab.push_back( pAttr ); - } + m_aSetAttrTab.push_back( pAttr ); } else { @@ -4730,7 +4723,7 @@ void SwHTMLParser::SetTextCollAttrs( HTMLAttrContext *pContext ) NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); m_aAttrTab.pLRSpace->SetLikePara(); m_aParaAttrs.push_back( m_aAttrTab.pLRSpace ); - EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); + EndAttr( m_aAttrTab.pLRSpace, false ); } } @@ -4931,7 +4924,7 @@ void SwHTMLParser::InsertSpacer() else { NewAttr( &m_aAttrTab.pULSpace, SvxULSpaceItem( 0, (sal_uInt16)nSize, RES_UL_SPACE ) ); - EndAttr( m_aAttrTab.pULSpace, nullptr, false ); + EndAttr( m_aAttrTab.pULSpace, false ); AppendTextNode(); // nicht am Abstand drehen! } @@ -4964,7 +4957,7 @@ void SwHTMLParser::InsertSpacer() aLRItem.SetTextFirstLineOfst( nIndent ); NewAttr( &m_aAttrTab.pLRSpace, aLRItem ); - EndAttr( m_aAttrTab.pLRSpace, nullptr, false ); + EndAttr( m_aAttrTab.pLRSpace, false ); } else { @@ -5161,7 +5154,7 @@ void SwHTMLParser::InsertLineBreak() if( bBreakItem && SvxBreak::PageAfter==aBreakItem.GetBreak() ) { NewAttr( &m_aAttrTab.pBreak, aBreakItem ); - EndAttr( m_aAttrTab.pBreak, nullptr, false ); + EndAttr( m_aAttrTab.pBreak, false ); } if( !bCleared && !bBreakItem ) @@ -5183,7 +5176,7 @@ void SwHTMLParser::InsertLineBreak() if( bBreakItem && SvxBreak::PageBefore==aBreakItem.GetBreak() ) { NewAttr( &m_aAttrTab.pBreak, aBreakItem ); - EndAttr( m_aAttrTab.pBreak, nullptr, false ); + EndAttr( m_aAttrTab.pBreak, false ); } } diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 9d7704bbc21b..6c85c945dbc4 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -515,8 +515,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // ppDepAttr gibt einen Attribut-Tabellen-Eintrag an, dessen Attribute // gesetzt sein muessen, bevor das Attribut beendet werden darf void NewAttr( HTMLAttr **ppAttr, const SfxPoolItem& rItem ); - bool EndAttr( HTMLAttr *pAttr, HTMLAttr **ppDepAttr=nullptr, - bool bChkEmpty=true ); + bool EndAttr( HTMLAttr *pAttr, bool bChkEmpty=true ); void DeleteAttr( HTMLAttr* pAttr ); void EndContextAttrs( HTMLAttrContext *pContext ); -- cgit v1.2.3