diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-07 12:02:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-08 09:23:40 +0200 |
commit | 3cac15856ade9fce161a49212c9d1861741122a5 (patch) | |
tree | 5d87a563073d84a8f39d16ee13d076efbd0e8376 | |
parent | e61b20dc1aeb271fab1f143e336cdc5b886b3d17 (diff) |
loplugin:constantparam in sw
Change-Id: Ifcb05b7fbca7fc6c8ad82bad38a927ba9f9511bf
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlctxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 27 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 3 |
8 files changed, 22 insertions, 31 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 95f16478ecff..499556fa75bf 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -422,8 +422,7 @@ protected: css::uno::Sequence< css::uno::Any > GetPropertyValues_Impl( const css::uno::Sequence< OUString >& aPropertyNames ); public: - SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, SfxStyleFamily eFam, - const OUString& rStyleName); + SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, const OUString& rStyleName); explicit SwXPageStyle(SwDocShell* pDocSh); virtual ~SwXPageStyle(); @@ -750,7 +749,7 @@ uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Frame>(SfxSt template<> uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Page>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) - { return pBasePool ? new SwXPageStyle(*pBasePool, pDocShell, SfxStyleFamily::Page, sStyleName) : new SwXPageStyle(pDocShell); }; + { return pBasePool ? new SwXPageStyle(*pBasePool, pDocShell, sStyleName) : new SwXPageStyle(pDocShell); }; template<> uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Table>(SfxStyleSheetBasePool* /*pBasePool*/, SwDocShell* pDocShell, const OUString& sStyleName) @@ -2806,8 +2805,8 @@ void SwXStyle::Invalidate() m_xStyleFamily.clear(); } -SwXPageStyle::SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rStyleName) - : SwXStyle(&rPool, eFam, pDocSh->GetDoc(), rStyleName) +SwXPageStyle::SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, const OUString& rStyleName) + : SwXStyle(&rPool, SfxStyleFamily::Page, pDocSh->GetDoc(), rStyleName) { } SwXPageStyle::SwXPageStyle(SwDocShell* pDocSh) 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<sal_uInt16*>(&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 <editeng/frmdiritem.hxx> #include <editeng/orphitem.hxx> #include <svtools/svparser.hxx> +#include <swtypes.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <o3tl/make_unique.hxx> @@ -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 ); |