From 2ac1c2f75e5f020fbb8c2c98b00ef32faa4770aa Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 26 Feb 2016 15:25:53 +0200 Subject: loplugin:unuseddefaultparam in sw (part1) Change-Id: I08b57f3b30e2f1892da54965a0f53de00363b8bd --- sw/source/filter/basflt/fltshell.cxx | 5 ++--- sw/source/filter/html/htmlflywriter.cxx | 8 +++----- sw/source/filter/html/wrthtml.hxx | 2 +- sw/source/filter/inc/fltshell.hxx | 2 +- sw/source/filter/inc/msfilter.hxx | 6 +----- sw/source/filter/inc/wrt_fn.hxx | 2 +- sw/source/filter/writer/wrt_fn.cxx | 8 +++----- sw/source/filter/ww8/docxexport.cxx | 2 +- sw/source/filter/ww8/docxexport.hxx | 2 +- sw/source/filter/ww8/rtfexport.cxx | 2 +- sw/source/filter/ww8/rtfexport.hxx | 2 +- sw/source/filter/ww8/writerwordglue.cxx | 5 ++--- sw/source/filter/ww8/wrtww8.cxx | 12 +++++------ sw/source/filter/ww8/wrtww8.hxx | 8 ++++---- sw/source/filter/ww8/ww8scan.hxx | 4 ++-- sw/source/filter/xml/xmlitmap.hxx | 3 +-- sw/source/filter/xml/xmlitmpr.cxx | 7 ++----- sw/source/ui/chrdlg/numpara.cxx | 5 ++--- sw/source/ui/fldui/fldpage.cxx | 11 +++++------ sw/source/ui/fldui/fldpage.hxx | 6 ++---- sw/source/ui/misc/num.cxx | 9 +++------ sw/source/uibase/dbui/mailmergehelper.cxx | 4 ++-- sw/source/uibase/dochdl/swdtflvr.cxx | 29 ++++++--------------------- sw/source/uibase/fldui/fldmgr.cxx | 9 +++------ sw/source/uibase/frmdlg/frmmgr.cxx | 8 ++------ sw/source/uibase/inc/annotsh.hxx | 2 +- sw/source/uibase/inc/fldmgr.hxx | 8 ++++---- sw/source/uibase/inc/frmmgr.hxx | 3 +-- sw/source/uibase/inc/inputwin.hxx | 4 ++-- sw/source/uibase/inc/mailmergehelper.hxx | 2 +- sw/source/uibase/inc/num.hxx | 11 ++++------- sw/source/uibase/inc/numpara.hxx | 3 +-- sw/source/uibase/inc/prcntfld.hxx | 4 ++-- sw/source/uibase/inc/pview.hxx | 4 ++-- sw/source/uibase/inc/swdtflvr.hxx | 2 +- sw/source/uibase/inc/usrpref.hxx | 33 +++++++++++++------------------ sw/source/uibase/shells/annotsh.cxx | 4 ++-- sw/source/uibase/uiview/pview.cxx | 9 ++++----- 38 files changed, 96 insertions(+), 154 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 583fa774f1e9..31823fed0c5a 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -295,7 +295,7 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt) // type. This makes them disappear from the doc structure. Only // attributes from the same paragraph as rPos are removed. Used for // graphic apos -> images. -void SwFltControlStack::StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId) +void SwFltControlStack::StealAttr(const SwNodeIndex& rNode) { size_t nCnt = m_Entries.size(); @@ -303,8 +303,7 @@ void SwFltControlStack::StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId) { nCnt --; SwFltStackEntry& rEntry = *m_Entries[nCnt]; - if (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == rNode.GetIndex() && - (!nAttrId || nAttrId == rEntry.pAttr->Which())) + if (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == rNode.GetIndex()) { DeleteAndDestroy(nCnt); // loesche aus dem Stack } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 9395e49290a3..1eacca53d60a 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -520,10 +520,9 @@ void SwHTMLWriter::OutFrameFormat( sal_uInt8 nMode, const SwFrameFormat& rFrameF OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, const OUString& rAlternateText, - sal_uInt32 nFrameOpts, - const OString &rEndTags ) + sal_uInt32 nFrameOpts ) { - OString sRetEndTags(rEndTags); + OString sRetEndTags; OStringBuffer sOut; const SfxPoolItem* pItem; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); @@ -796,11 +795,10 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, { sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_linebreak). append(' ').append(OOO_STRING_SVTOOLS_HTML_O_clear). - append("=\"").append(pStr).append("\">").append(rEndTags); + append("=\"").append(pStr).append("\">"); sRetEndTags = sOut.makeStringAndClear(); } } - assert(sRetEndTags.endsWith(rEndTags)); // fdo#58286 return sRetEndTags; } diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index bdadc0fea033..2968d9fb80b2 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -464,7 +464,7 @@ public: // Frame-Formats ausgeben und ggf. ein
vorne an // rEndTags anhaengen OString OutFrameFormatOptions( const SwFrameFormat& rFrameFormat, const OUString& rAltText, - sal_uInt32 nFrameOpts, const OString& rEndTags = OString() ); + sal_uInt32 nFrameOpts ); void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAltText, sal_uInt32 nFrameOpts); diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index d4eab5ad3d4a..c83c360c0924 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -174,7 +174,7 @@ public: virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, bool bTstEnde=true, long nHand = LONG_MAX, bool consumedByField=false); - void StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId = 0); + void StealAttr(const SwNodeIndex& rNode); void MarkAllAttrsOld(); void KillUnlockedAttrs(const SwPosition& pPos); SfxPoolItem* GetFormatStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos = nullptr); diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx index a3157b6f7195..951e6e78d27f 100644 --- a/sw/source/filter/inc/msfilter.hxx +++ b/sw/source/filter/inc/msfilter.hxx @@ -440,9 +440,6 @@ namespace sw @param rTextNd The TextNode we want to ranges from - @param nStart - The position in the TextNode to start processing from - @return STL container of CharRuns which describe the shared direction, script and optionally script of the contiguous sequences of characters @@ -452,8 +449,7 @@ namespace sw @see #i22537# for example */ - CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd, - sal_Int32 nStart = 0); + CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd); } } diff --git a/sw/source/filter/inc/wrt_fn.hxx b/sw/source/filter/inc/wrt_fn.hxx index 828c4f99d965..49f4a1922d69 100644 --- a/sw/source/filter/inc/wrt_fn.hxx +++ b/sw/source/filter/inc/wrt_fn.hxx @@ -33,7 +33,7 @@ typedef FnAttrOut SwAttrFnTab[ POOLATTR_END - POOLATTR_BEGIN ]; SW_DLLPUBLIC Writer& Out( const SwAttrFnTab, const SfxPoolItem&, Writer& ); SW_DLLPUBLIC Writer& Out_SfxItemSet( const SwAttrFnTab, Writer&, const SfxItemSet&, - bool bDeep, bool bTstForDefault = true ); + bool bDeep ); /* Funktionspointer auf die Node-Write-Funktionen */ diff --git a/sw/source/filter/writer/wrt_fn.cxx b/sw/source/filter/writer/wrt_fn.cxx index 0339b1eb2c10..6eca856b286e 100644 --- a/sw/source/filter/writer/wrt_fn.cxx +++ b/sw/source/filter/writer/wrt_fn.cxx @@ -40,8 +40,7 @@ Writer& Out( const SwAttrFnTab pTab, const SfxPoolItem& rHt, Writer & rWrt ) } Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt, - const SfxItemSet& rSet, bool bDeep, - bool bTstForDefault ) + const SfxItemSet& rSet, bool bDeep ) { // at first give the own attributes out const SfxItemPool& rPool = *rSet.GetPool(); @@ -89,11 +88,10 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt, while( nWhich ) { if( SfxItemState::SET == pSet->GetItemState( nWhich, bDeep, &pItem ) && - ( !bTstForDefault || ( - *pItem != rPool.GetDefaultItem( nWhich ) + ( *pItem != rPool.GetDefaultItem( nWhich ) || ( pSet->GetParent() && *pItem != pSet->GetParent()->Get( nWhich )) - ))) + )) { if( nullptr != ( pOut = pTab[ nWhich - RES_CHRATR_BEGIN] )) { diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index c0e1e97d8e8b..0ccfe9c375a6 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -160,7 +160,7 @@ void DocxExport::AppendBookmarks( const SwTextNode& rNode, sal_Int32 nAktPos, sa m_pAttrOutput->WriteBookmarks_Impl( aStarts, aEnds ); } -void DocxExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ ) +void DocxExport::AppendBookmark( const OUString& rName ) { std::vector< OUString > aStarts; std::vector< OUString > aEnds; diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 42eaecab2c94..30fe79528a9d 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -131,7 +131,7 @@ public: virtual void AppendBookmarks( const SwTextNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen ) override; - virtual void AppendBookmark( const OUString& rName, bool bSkip = false ) override; + virtual void AppendBookmark( const OUString& rName ) override; virtual void AppendAnnotationMarks( const SwTextNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen ) override; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index fabc821fd46f..8292557304fa 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -128,7 +128,7 @@ void RtfExport::AppendBookmarks(const SwTextNode& rNode, sal_Int32 nAktPos, sal_ m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds); } -void RtfExport::AppendBookmark(const OUString& rName, bool /*bSkip*/) +void RtfExport::AppendBookmark(const OUString& rName) { std::vector aStarts; std::vector aEnds; diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index dae04b55e8de..845dfc7c0e7e 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -83,7 +83,7 @@ public: virtual void AppendBookmarks(const SwTextNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen) override; - virtual void AppendBookmark(const OUString& rName, bool bSkip = false) override; + virtual void AppendBookmark(const OUString& rName) override; virtual void AppendAnnotationMarks(const SwTextNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen) override; diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index aeeced99907d..c25dbf93f789 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -516,8 +516,7 @@ namespace sw return nA < nB; } - CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd, - sal_Int32 nTextStart) + CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd) { const OUString &rText = rTextNd.GetText(); @@ -657,7 +656,7 @@ namespace sw } aRunChanges.erase(std::remove_if(aRunChanges.begin(), - aRunChanges.end(), myImplHelpers::IfBeforeStart(nTextStart)), aRunChanges.end()); + aRunChanges.end(), myImplHelpers::IfBeforeStart(0/*nTextStart*/)), aRunChanges.end()); return aRunChanges; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c6e6d1818793..f621e9c52957 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1503,9 +1503,9 @@ void WW8Export::MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo) m_pBkmks->MoveFieldMarks(nFrom, nTo); } -void WW8Export::AppendBookmark( const OUString& rName, bool bSkip ) +void WW8Export::AppendBookmark( const OUString& rName ) { - sal_uLong nSttCP = Fc2Cp( Strm().Tell() ) + ( bSkip? 1: 0 ); + sal_uLong nSttCP = Fc2Cp( Strm().Tell() ); m_pBkmks->Append( nSttCP, rName ); } @@ -1680,7 +1680,7 @@ sal_uInt16 WW8Export::AddRedlineAuthor( sal_uInt16 nId ) } void WW8Export::WriteAsStringTable(const std::vector& rStrings, - sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf, sal_uInt16 nExtraLen) + sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf) { sal_uInt16 n, nCount = static_cast< sal_uInt16 >(rStrings.size()); if( nCount ) @@ -1696,8 +1696,6 @@ void WW8Export::WriteAsStringTable(const std::vector& rStrings, const OUString& rNm = rStrings[n]; SwWW8Writer::WriteShort( rStrm, rNm.getLength() ); SwWW8Writer::WriteString16(rStrm, rNm, false); - if( nExtraLen ) - SwWW8Writer::FillCount(rStrm, nExtraLen); } rlcbSttbf = rStrm.Tell() - rfcSttbf; } @@ -1793,14 +1791,14 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr, rStrm.Write(&aBytes[0], aBytes.size()); } -void WW8Export::WriteStringAsPara( const OUString& rText, sal_uInt16 nStyleId ) +void WW8Export::WriteStringAsPara( const OUString& rText ) { if( !rText.isEmpty() ) OutSwString(rText, 0, rText.getLength()); WriteCR(); // CR thereafter ww::bytes aArr; - SwWW8Writer::InsUInt16( aArr, nStyleId ); + SwWW8Writer::InsUInt16( aArr, 0/*nStyleId*/ ); if( m_bOutTable ) { // Tab-Attr // sprmPFInTable diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 10e639b82f17..ee140b57d95b 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -677,7 +677,7 @@ public: virtual void AppendBookmarks( const SwTextNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen ) = 0; - virtual void AppendBookmark( const OUString& rName, bool bSkip = false ) = 0; + virtual void AppendBookmark( const OUString& rName ) = 0; virtual void AppendAnnotationMarks( const SwTextNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen ) = 0; @@ -1037,7 +1037,7 @@ public: tools::SvRef xObjStg, OUString &rStorageName, SwOLENode *pOLENd); virtual void AppendBookmarks( const SwTextNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen ) override; - virtual void AppendBookmark( const OUString& rName, bool bSkip = false ) override; + virtual void AppendBookmark( const OUString& rName ) override; virtual void AppendAnnotationMarks( const SwTextNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen ) override; @@ -1049,7 +1049,7 @@ public: void MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo); void WriteAsStringTable(const ::std::vector&, sal_Int32& rfcSttbf, - sal_Int32& rlcbSttbf, sal_uInt16 nExtraLen = 0); + sal_Int32& rlcbSttbf); virtual sal_uLong ReplaceCr( sal_uInt8 nChar ) override; @@ -1107,7 +1107,7 @@ public: void InsUInt16( sal_uInt16 n ) { SwWW8Writer::InsUInt16( *pO, n ); } void InsUInt32( sal_uInt32 n ) { SwWW8Writer::InsUInt32( *pO, n ); } - void WriteStringAsPara( const OUString& rText, sal_uInt16 nStyleId = 0 ); + void WriteStringAsPara( const OUString& rText ); /// Setup the exporter. WW8Export( SwWW8Writer *pWriter, diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index effdf1a255c5..fc39df1e895f 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -683,9 +683,9 @@ public: virtual WW8_FC Where() override; // returns reference descriptors - const void* GetData( long nIdx = -1 ) const + const void* GetData() const { - return pRef ? pRef->GetData( -1L == nIdx ? pRef->GetIdx() : nIdx ) : nullptr; + return pRef ? pRef->GetData( pRef->GetIdx() ) : nullptr; } virtual void GetSprms(WW8PLCFxDesc* p) override; diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx index 3fffd7743c9a..53f48c566a9d 100644 --- a/sw/source/filter/xml/xmlitmap.hxx +++ b/sw/source/filter/xml/xmlitmap.hxx @@ -66,8 +66,7 @@ public: virtual ~SvXMLItemMapEntries(); SvXMLItemMapEntry* getByName( sal_uInt16 nNameSpace, - const OUString& rString, - SvXMLItemMapEntry* pStartAt = nullptr ) const; + const OUString& rString ) const; SvXMLItemMapEntry& getByIndex( sal_uInt16 nIndex ) const; sal_uInt16 getCount() const; diff --git a/sw/source/filter/xml/xmlitmpr.cxx b/sw/source/filter/xml/xmlitmpr.cxx index 87f3b4da4383..bd4f10922c1b 100644 --- a/sw/source/filter/xml/xmlitmpr.cxx +++ b/sw/source/filter/xml/xmlitmpr.cxx @@ -49,12 +49,9 @@ SvXMLItemMapEntries::~SvXMLItemMapEntries() } SvXMLItemMapEntry* SvXMLItemMapEntries::getByName( sal_uInt16 nNameSpace, - const OUString& rString, - SvXMLItemMapEntry* pStartAt /* = NULL */ ) const + const OUString& rString ) const { - SvXMLItemMapEntry* pMap = - (pStartAt && (pStartAt->eLocalName!=XML_TOKEN_INVALID)) ? - &(pStartAt[1]) : mpImpl->mpEntries; + SvXMLItemMapEntry* pMap = mpImpl->mpEntries; while( pMap && (pMap->eLocalName != XML_TOKEN_INVALID) ) { if( pMap->nNameSpace == nNameSpace && diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index e7786598734d..80326edc2faa 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -345,7 +345,7 @@ IMPL_LINK_NOARG_TYPED(SwParagraphNumTabPage, EditNumStyleHdl_Impl, Button*, void // Internal: Perform functions through the Dispatcher bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl( sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily, - sal_uInt16 nMask, const sal_uInt16* pModifier) + sal_uInt16 nMask) { SfxDispatcher &rDispatcher = *SfxViewShell::Current()->GetDispatcher(); @@ -366,10 +366,9 @@ bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl( pItems[ nCount++ ] = nullptr; - sal_uInt16 nModi = pModifier ? *pModifier : 0; const SfxPoolItem* mpItem = rDispatcher.Execute( nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD | SfxCallMode::MODAL, - pItems, nModi ); + pItems ); if ( !mpItem ) return false; diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index fddd1572db2c..4edd8f205572 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -278,10 +278,9 @@ void SwFieldPage::InsertField(sal_uInt16 nTypeId, sal_uInt16 nSubType, const OUS } } -void SwFieldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2, - const ListBox* pLst3 ) +void SwFieldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2 ) { - const ListBox* aLBArr [ coLBCount ] = { pLst1, pLst2, pLst3 }; + const ListBox* aLBArr [ coLBCount ] = { pLst1, pLst2, nullptr }; const ListBox** ppLB = aLBArr; for( int i = 0; i < coLBCount; ++i, ++ppLB ) @@ -291,12 +290,12 @@ void SwFieldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2, m_aLstStrArr[ i ].clear(); } -void SwFieldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3) +void SwFieldPage::RestorePos(ListBox* pLst1, ListBox* pLst2) { sal_Int32 nPos = 0; - ListBox* aLBArr [ coLBCount ] = { pLst1, pLst2, pLst3 }; + ListBox* aLBArr [ 2 ] = { pLst1, pLst2 }; ListBox** ppLB = aLBArr; - for( int i = 0; i < coLBCount; ++i, ++ppLB ) + for( int i = 0; i < 2; ++i, ++ppLB ) if( (*ppLB) && (*ppLB)->GetEntryCount() && !m_aLstStrArr[ i ].isEmpty() && LISTBOX_ENTRY_NOTFOUND != ( nPos = (*ppLB)->GetEntryPos(m_aLstStrArr[ i ] ) ) ) diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index 273d9d1b3873..ac0a15521ca4 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -61,10 +61,8 @@ protected: void Init(); void SavePos( const ListBox* pLst1, - const ListBox* pLst2 = nullptr, - const ListBox* pLst3 = nullptr); - void RestorePos( ListBox* pLst1, ListBox* pLst2 = nullptr, - ListBox* pLst3 = nullptr ); + const ListBox* pLst2 = nullptr); + void RestorePos( ListBox* pLst1, ListBox* pLst2 = nullptr ); void EnableInsert(bool bEnable = true); inline bool IsFieldEdit() const { return m_bFieldEdit; } diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 272e789afc9f..cee23c321728 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -926,14 +926,11 @@ IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, StandardHdl, Button*, void) } #ifdef DBG_UTIL -void SwNumPositionTabPage::SetModified(bool bRepaint) +void SwNumPositionTabPage::SetModified() { bModified = true; - if(bRepaint) - { - m_pPreviewWIN->SetLevel(nActNumLvl); - m_pPreviewWIN->Invalidate(); - } + m_pPreviewWIN->SetLevel(nActNumLvl); + m_pPreviewWIN->Invalidate(); } #endif diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 9fd1325cd093..97f59f5a9601 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -290,9 +290,9 @@ void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns) UpdateScrollBar(); } -void SwAddressPreview::EnableScrollBar(bool bEnable) +void SwAddressPreview::EnableScrollBar() { - pImpl->bEnableScrollBar = bEnable; + pImpl->bEnableScrollBar = true; } void SwAddressPreview::UpdateScrollBar() diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 6dbd5eadcb61..3976cbf425b9 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1554,38 +1554,21 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData, return bRet; } -SotExchangeDest SwTransferable::GetSotDestination( const SwWrtShell& rSh, - const Point* pPt ) +SotExchangeDest SwTransferable::GetSotDestination( const SwWrtShell& rSh ) { SotExchangeDest nRet = SotExchangeDest::NONE; - ObjCntType eOType; - if( pPt ) - { - SdrObject *pObj = nullptr; - eOType = rSh.GetObjCntType( *pPt, pObj ); - } - else - eOType = rSh.GetObjCntTypeOfSelection(); + ObjCntType eOType = rSh.GetObjCntTypeOfSelection(); switch( eOType ) { case OBJCNT_GRF: { bool bIMap, bLink; - if( pPt ) - { - bIMap = nullptr != rSh.GetFormatFromObj( *pPt )->GetURL().GetMap(); - OUString aDummy; - rSh.GetGrfAtPos( *pPt, aDummy, bLink ); - } - else - { - bIMap = nullptr != rSh.GetFlyFrameFormat()->GetURL().GetMap(); - OUString aDummy; - rSh.GetGrfNms( &aDummy, nullptr ); - bLink = !aDummy.isEmpty(); - } + bIMap = nullptr != rSh.GetFlyFrameFormat()->GetURL().GetMap(); + OUString aDummy; + rSh.GetGrfNms( &aDummy, nullptr ); + bLink = !aDummy.isEmpty(); if( bLink && bIMap ) nRet = SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP; diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index beab06be0f12..b8aed6cec604 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -257,11 +257,11 @@ void SwFieldMgr::RemoveFieldType(sal_uInt16 nResId, const OUString& rName ) pSh->RemoveFieldType(nResId, rName); } -size_t SwFieldMgr::GetFieldTypeCount(sal_uInt16 nResId) const +size_t SwFieldMgr::GetFieldTypeCount() const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); OSL_ENSURE(pSh, "no SwWrtShell found"); - return pSh ? pSh->GetFieldTypeCount(nResId) : 0; + return pSh ? pSh->GetFieldTypeCount() : 0; } SwFieldType* SwFieldMgr::GetFieldType(sal_uInt16 nResId, size_t nField) const @@ -1651,7 +1651,7 @@ void SwFieldMgr::SetMacroPath(const OUString& rPath) } } -sal_uLong SwFieldMgr::GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumberFormatter* pFormatter, double* pVal) +sal_uLong SwFieldMgr::GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumberFormatter* pFormatter) { double fValue; short nDefFormat; @@ -1691,9 +1691,6 @@ sal_uLong SwFieldMgr::GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumbe break; } - if (pVal) - *pVal = fValue; - return pFormatter->GetStandardFormat(nDefFormat, GetCurrLanguage()); } diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 87e8a3fef1d8..ba0c9add56c1 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -180,8 +180,7 @@ void SwFlyFrameAttrMgr::InsertFlyFrame() // Not-allowed values of the enumeration type get corrected. void SwFlyFrameAttrMgr::InsertFlyFrame(RndStdIds eAnchorType, const Point &rPos, - const Size &rSize, - bool bAbs ) + const Size &rSize ) { OSL_ENSURE( eAnchorType == FLY_AT_PAGE || eAnchorType == FLY_AT_PARA || @@ -189,10 +188,7 @@ void SwFlyFrameAttrMgr::InsertFlyFrame(RndStdIds eAnchorType, eAnchorType == FLY_AT_FLY || eAnchorType == FLY_AS_CHAR, "invalid frame type" ); - if ( bAbs ) - SetAbsPos( rPos ); - else - SetPos( rPos ); + SetPos( rPos ); SetSize( rSize ); SetAnchor( eAnchorType ); diff --git a/sw/source/uibase/inc/annotsh.hxx b/sw/source/uibase/inc/annotsh.hxx index c9bfb4601770..389a3bcf0943 100644 --- a/sw/source/uibase/inc/annotsh.hxx +++ b/sw/source/uibase/inc/annotsh.hxx @@ -66,7 +66,7 @@ public: void InsertSymbol(SfxRequest& rReq); - void ExecSearch(SfxRequest&, bool bNoMessage = false); + void ExecSearch(SfxRequest&); void StateSearch(SfxItemSet &); virtual ::svl::IUndoManager* diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx index d73c78d5be94..d80a0348e927 100644 --- a/sw/source/uibase/inc/fldmgr.hxx +++ b/sw/source/uibase/inc/fldmgr.hxx @@ -148,8 +148,8 @@ public: // previous and next of the same type bool GoNextPrev( bool bNext = true, SwFieldType* pTyp = nullptr ); - bool GoNext( SwFieldType* pTyp = nullptr ) { return GoNextPrev( true, pTyp ); } - bool GoPrev( SwFieldType* pTyp = nullptr ) { return GoNextPrev( false, pTyp ); } + bool GoNext() { return GoNextPrev(); } + bool GoPrev() { return GoNextPrev( false ); } bool IsDBNumeric(const OUString& rDBName, const OUString& rTableQryName, bool bIsTable, const OUString& rFieldName); @@ -158,7 +158,7 @@ public: bool CanInsertRefMark( const OUString& rStr ); // access to field types via ResId - size_t GetFieldTypeCount(sal_uInt16 nResId = USHRT_MAX) const; + size_t GetFieldTypeCount() const; SwFieldType* GetFieldType(sal_uInt16 nResId, size_t nField = 0) const; SwFieldType* GetFieldType(sal_uInt16 nResId, const OUString& rName) const; @@ -187,7 +187,7 @@ public: sal_uInt16 GetFormatCount(sal_uInt16 nTypeId, bool bIsText, bool bHtmlMode = false) const; OUString GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const; sal_uInt16 GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const; - sal_uLong GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumberFormatter* pFormatter, double* pVal = nullptr); + sal_uLong GetDefaultFormat(sal_uInt16 nTypeId, bool bIsText, SvNumberFormatter* pFormatter); // turn off evaluation of expression fields for insertation // of many expression fields (see labels) diff --git a/sw/source/uibase/inc/frmmgr.hxx b/sw/source/uibase/inc/frmmgr.hxx index c37c3bdec34c..676449fe4c77 100644 --- a/sw/source/uibase/inc/frmmgr.hxx +++ b/sw/source/uibase/inc/frmmgr.hxx @@ -108,8 +108,7 @@ public: void InsertFlyFrame(); void InsertFlyFrame(RndStdIds eAnchorType, const Point &rPos, - const Size &rSize, - bool bAbsPos = false); + const Size &rSize); // check and change metrics void ValidateMetrics(SvxSwFrameValidation& rVal, diff --git a/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx index 97fc2594903c..cc2f3f6e1934 100644 --- a/sw/source/uibase/inc/inputwin.hxx +++ b/sw/source/uibase/inc/inputwin.hxx @@ -103,8 +103,8 @@ public: SfxChildWinInfo* ); virtual ~SwInputChild(); SFX_DECL_CHILDWINDOW_WITHID( SwInputChild ); - void SetFormula( const OUString& rFormula, bool bDelSel = true ) - { static_cast(GetWindow())->SetFormula( rFormula, bDelSel ); } + void SetFormula( const OUString& rFormula ) + { static_cast(GetWindow())->SetFormula( rFormula ); } const SwView* GetView() const { return static_cast(GetWindow())->GetView();} diff --git a/sw/source/uibase/inc/mailmergehelper.hxx b/sw/source/uibase/inc/mailmergehelper.hxx index b8613a78a153..36012db504f1 100644 --- a/sw/source/uibase/inc/mailmergehelper.hxx +++ b/sw/source/uibase/inc/mailmergehelper.hxx @@ -103,7 +103,7 @@ public: // set the number of rows and columns of addresses void SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns); - void EnableScrollBar(bool bEnable = true); + void EnableScrollBar(); // fill the actual data into a string (address block or greeting) static OUString FillData(const OUString& rAddress, SwMailMergeConfigItem& rConfigItem, diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx index fb5880bd7c36..9ec51ae1b88c 100644 --- a/sw/source/uibase/inc/num.hxx +++ b/sw/source/uibase/inc/num.hxx @@ -120,15 +120,12 @@ public: void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;} void SetWrtShell(SwWrtShell* pSh); #ifdef DBG_UTIL - void SetModified(bool bRepaint = true); + void SetModified(); #else - void SetModified(bool bRepaint = true) + void SetModified() { bModified = true; - if(bRepaint) - { - m_pPreviewWIN->SetLevel(nActNumLvl); - m_pPreviewWIN->Invalidate(); - } + m_pPreviewWIN->SetLevel(nActNumLvl); + m_pPreviewWIN->Invalidate(); } #endif }; diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index 6b794a724d13..daa0b8917c11 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -63,8 +63,7 @@ class SwParagraphNumTabPage : public SfxTabPage protected: static bool ExecuteEditNumStyle_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr, - sal_uInt16 nFamily, sal_uInt16 nMask = 0, - const sal_uInt16* pModifier = nullptr ); + sal_uInt16 nFamily, sal_uInt16 nMask = 0 ); public: SwParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet ); diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx index 6e69899810a4..b0355555337b 100644 --- a/sw/source/uibase/inc/prcntfld.hxx +++ b/sw/source/uibase/inc/prcntfld.hxx @@ -54,7 +54,7 @@ public: void SetLoseFocusHdl(const Link& rLink) { m_pField->SetLoseFocusHdl(rLink); } void SetMetric(FieldUnit eUnit) { ::SetMetric(*m_pField, eUnit); } void Enable(bool bEnable = true, bool bChild = true) { m_pField->Enable(bEnable, bChild); } - void Disable(bool bChild = true) { m_pField->Disable(bChild); } + void Disable() { m_pField->Disable(); } bool HasFocus() const { return m_pField->HasFocus(); } void SetAccessibleName(const OUString& rName) { m_pField->SetAccessibleName(rName); } void SetText(const OUString& rStr) { m_pField->SetText(rStr); } @@ -65,7 +65,7 @@ public: void SetMetricFieldMin(sal_Int64 nNewMin) { m_pField->SetMin(nNewMin); } void SetMetricFieldMax(sal_Int64 nNewMax) { m_pField->SetMax(nNewMax); } - void SetValue(sal_Int64 nNewValue, FieldUnit eInUnit = FUNIT_NONE) { m_pField->SetValue(nNewValue, eInUnit); } + void SetValue(sal_Int64 nNewValue) { m_pField->SetValue(nNewValue, FUNIT_NONE); } void SetLast(sal_Int64 nNewLast) { m_pField->SetLast(nNewLast); } diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index 4537551e87b4..9a92d4bb01a7 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -190,7 +190,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell bool mbResetFormDesignMode:1; bool mbFormDesignModeToReset:1; - SAL_DLLPRIVATE void Init(const SwViewOption* = nullptr); + SAL_DLLPRIVATE void Init(); SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const; SAL_DLLPRIVATE void _CreateScrollbar( bool bHori); @@ -239,7 +239,7 @@ public: void DocSzChgd(const Size& rNewSize); - void SetVisArea( const Rectangle&, bool bUpdateScrollbar = true); + void SetVisArea( const Rectangle& ); void ScrollViewSzChg(); void ScrollDocSzChg(); diff --git a/sw/source/uibase/inc/swdtflvr.hxx b/sw/source/uibase/inc/swdtflvr.hxx index 852fbe6c0c35..804311f52570 100644 --- a/sw/source/uibase/inc/swdtflvr.hxx +++ b/sw/source/uibase/inc/swdtflvr.hxx @@ -149,7 +149,7 @@ public: SwTransferable( SwWrtShell& ); virtual ~SwTransferable(); - static SotExchangeDest GetSotDestination( const SwWrtShell& rSh, const Point* = nullptr ); + static SotExchangeDest GetSotDestination( const SwWrtShell& rSh ); // set properties on the document, like PageMargin, VisArea. // And set real Size diff --git a/sw/source/uibase/inc/usrpref.hxx b/sw/source/uibase/inc/usrpref.hxx index 299dbb0777f9..636a4d495fb9 100644 --- a/sw/source/uibase/inc/usrpref.hxx +++ b/sw/source/uibase/inc/usrpref.hxx @@ -189,11 +189,10 @@ public: bool IsUpdateFields()const {return eFieldUpdateFlags != AUTOUPD_OFF; } SwFieldUpdateFlags GetFieldUpdateFlags()const {return eFieldUpdateFlags;} - void SetFieldUpdateFlags(SwFieldUpdateFlags eSet, bool bNoModify = false) + void SetFieldUpdateFlags(SwFieldUpdateFlags eSet) { eFieldUpdateFlags = eSet; - if(!bNoModify) - aContentConfig.SetModified(); + aContentConfig.SetModified(); } void SetUpdateCharts(bool bSet, bool bNoModify = false) @@ -221,33 +220,30 @@ public: aLayoutConfig.SetModified(); } - bool IsHScrollMetric()const {return bIsHScrollMetricSet;} + bool IsHScrollMetric()const {return bIsHScrollMetricSet;} FieldUnit GetHScrollMetric() const { return bIsHScrollMetricSet ? eHScrollMetric : eUserMetric;} - void SetHScrollMetric(FieldUnit eSet, bool bNoModify = false) + void SetHScrollMetric(FieldUnit eSet) { eHScrollMetric = eSet; bIsHScrollMetricSet = true; - if(!bNoModify) - aLayoutConfig.SetModified(); + aLayoutConfig.SetModified(); } - bool IsVScrollMetric()const {return bIsVScrollMetricSet;} + bool IsVScrollMetric()const {return bIsVScrollMetricSet;} FieldUnit GetVScrollMetric() const { return bIsVScrollMetricSet ? eVScrollMetric : eUserMetric;} - void SetVScrollMetric(FieldUnit eSet, bool bNoModify = false) + void SetVScrollMetric(FieldUnit eSet) { eVScrollMetric = eSet; bIsVScrollMetricSet = true; - if(!bNoModify) - aLayoutConfig.SetModified(); + aLayoutConfig.SetModified(); } bool IsApplyCharUnit() const { return bApplyCharUnit; } - void SetApplyCharUnit(bool bSet, bool bNoModify = false) + void SetApplyCharUnit(bool bSet) { bApplyCharUnit = bSet; - if(!bNoModify) - aLayoutConfig.SetModified(); + aLayoutConfig.SetModified(); } sal_Int32 GetDefTab() const { return nDefTab;} @@ -259,7 +255,7 @@ public: } //default page mode for text grid - bool IsSquaredPageMode() const {return bIsSquaredPageMode;} + bool IsSquaredPageMode() const {return bIsSquaredPageMode;} void SetDefaultPageMode( bool bVal, bool bNoModify = false ) { bIsSquaredPageMode = bVal; @@ -267,12 +263,11 @@ public: aLayoutConfig.SetModified(); } - bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; } - void SetAlignMathObjectsToBaseline( bool bVal, bool bNoModify = false ) + bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; } + void SetAlignMathObjectsToBaseline( bool bVal ) { bIsAlignMathObjectsToBaseline = bVal; - if(!bNoModify) - aLayoutConfig.SetModified(); + aLayoutConfig.SetModified(); } }; diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index e6c07755c8fe..73715d1aca41 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -878,9 +878,9 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) } } -void SwAnnotationShell::ExecSearch(SfxRequest& rReq, bool bNoMessage) +void SwAnnotationShell::ExecSearch(SfxRequest& rReq) { - rView.ExecSearch(rReq,bNoMessage); + rView.ExecSearch(rReq); } void SwAnnotationShell::StateSearch(SfxItemSet &rSet) diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index dde7d2b0b656..782b1274dca8 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1117,7 +1117,7 @@ void SwPagePreview::StateUndo(SfxItemSet& rSet) } } -void SwPagePreview::Init(const SwViewOption * pPrefs) +void SwPagePreview::Init() { if ( GetViewShell()->HasDrawView() ) GetViewShell()->GetDrawView()->SetAnimationEnabled( false ); @@ -1128,8 +1128,7 @@ void SwPagePreview::Init(const SwViewOption * pPrefs) // the handler, because the shell is unknown to the SFX management // within the CTOR phase. - if( !pPrefs ) - pPrefs = SW_MOD()->GetUsrPref(false); + const SwViewOption * pPrefs = SW_MOD()->GetUsrPref(false); mbHScrollbarEnabled = pPrefs->IsViewHScrollBar(); mbVScrollbarEnabled = pPrefs->IsViewVScrollBar(); @@ -1371,7 +1370,7 @@ void SwPagePreview::OuterResizePixel( const Point &rOfst, const Size &rSize ) *pVScrollbar, *pHScrollbar, *pScrollFill ); } -void SwPagePreview::SetVisArea( const Rectangle &rRect, bool bUpdateScrollbar ) +void SwPagePreview::SetVisArea( const Rectangle &rRect ) { const Point aTopLeft(AlignToPixel(rRect.TopLeft())); const Point aBottomRight(AlignToPixel(rRect.BottomRight())); @@ -1414,7 +1413,7 @@ void SwPagePreview::SetVisArea( const Rectangle &rRect, bool bUpdateScrollbar ) // Set at View-Win the current size aVisArea = aLR; pViewWin->SetWinSize( aLR.GetSize() ); - ChgPage( SwPagePreviewWin::MV_NEWWINSIZE, bUpdateScrollbar ); + ChgPage( SwPagePreviewWin::MV_NEWWINSIZE ); pViewWin->Invalidate(); } -- cgit