sw/inc/ndtxt.hxx | 2 +- sw/inc/reffld.hxx | 2 +- sw/qa/extras/uiwriter/uiwriter8.cxx | 6 +++--- sw/source/core/fields/reffld.cxx | 4 ++-- sw/source/core/tox/txmsrt.cxx | 6 +++--- sw/source/core/txtnode/ndtxt.cxx | 8 +------- sw/source/filter/ww8/rtfexport.cxx | 7 +++---- sw/source/filter/ww8/rtfexport.hxx | 2 +- sw/source/uibase/docvw/edtwin2.cxx | 2 +- sw/source/uibase/utlui/content.cxx | 2 +- ucb/source/ucp/webdav-curl/DAVAuthListener.hxx | 3 +-- ucb/source/ucp/webdav-curl/DAVAuthListenerImpl.hxx | 3 +-- ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx | 7 +++---- unotools/source/ucbhelper/ucblockbytes.cxx | 4 ++-- unotools/source/ucbhelper/ucblockbytes.hxx | 3 +-- 15 files changed, 25 insertions(+), 36 deletions(-)
New commits: commit 3e68a5cfa9807ee5e4a83fd5c763d0e2fee3428e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Apr 19 14:04:15 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Apr 20 10:01:33 2024 +0200 loplugin:constantparam in sw Change-Id: Ia3e1b50954354973ffef701821f661cf782687db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 9105b2f73d8d..2350d69edcdb 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -746,7 +746,7 @@ public: bool CopyExpandText( SwTextNode& rDestNd, const SwContentIndex* pDestIdx, sal_Int32 nIdx, sal_Int32 nLen, SwRootFrame const* pLayout, - bool bWithNum = false, bool bWithFootnote = true, + bool bWithFootnote = true, bool bReplaceTabsWithSpaces = false ) const; SW_DLLPUBLIC OUString GetRedlineText() const; diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index 8eb293184c6d..a6d51679f101 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -149,7 +149,7 @@ public: SW_DLLPUBLIC bool IsRefToNumItemCrossRefBookmark() const; SW_DLLPUBLIC const SwTextNode* GetReferencedTextNode(SwTextNode* pTextNode, SwFrame* pFrame) const; // #i85090# - SW_DLLPUBLIC OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const& rLayout, SwTextNode* pTextNode, SwFrame* pFrame) const; + SW_DLLPUBLIC OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const& rLayout) const; /// Get/set SequenceNo (of interest only for REF_SEQUENCEFLD). sal_uInt16 GetSeqNo() const { return m_nSeqNo; } diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 91d4ad34d4f7..73e66f746f06 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2639,9 +2639,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_BOOKMARK), fields[0]->GetField()->GetSubType()); CPPUNIT_ASSERT_EQUAL(OUString("bookmarkchapter1_text"), static_cast<SwGetRefField const*>(fields[0]->GetField())->GetSetRefName()); - CPPUNIT_ASSERT_EQUAL(OUString("Text"), static_cast<SwGetRefField const*>(fields[0]->GetField()) - ->GetExpandedTextOfReferencedTextNode( - *pWrtShell->GetLayout(), nullptr, nullptr)); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), + static_cast<SwGetRefField const*>(fields[0]->GetField()) + ->GetExpandedTextOfReferencedTextNode(*pWrtShell->GetLayout())); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_BOOKMARK), fields[1]->GetField()->GetSubType()); CPPUNIT_ASSERT( static_cast<SwGetRefField const*>(fields[1]->GetField())->IsRefToHeadingCrossRefBookmark()); diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 3f762f6a8ad1..6c91573bec73 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -416,9 +416,9 @@ static OUString lcl_formatStringByCombiningCharacter(std::u16string_view sText, // #i85090# OUString SwGetRefField::GetExpandedTextOfReferencedTextNode( - SwRootFrame const& rLayout, SwTextNode* pTextNode, SwFrame* pFrame) const + SwRootFrame const& rLayout) const { - const SwTextNode* pReferencedTextNode( GetReferencedTextNode(pTextNode, pFrame) ); + const SwTextNode* pReferencedTextNode( GetReferencedTextNode(/*pTextNode*/nullptr, /*pFrame*/nullptr) ); if ( !pReferencedTextNode ) return OUString(); diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 4dcbd49fe70b..95ba1911feed 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -620,7 +620,7 @@ void SwTOXPara::FillText( SwTextNode& rNd, const SwContentIndex& rInsPos, sal_uI { pSrc->CopyExpandText( rNd, &rInsPos, nStartIndex, nEndIndex == -1 ? -1 : nEndIndex - nStartIndex, - pLayout, false, false, true ); + pLayout, false, true ); } else { @@ -628,7 +628,7 @@ void SwTOXPara::FillText( SwTextNode& rNd, const SwContentIndex& rInsPos, sal_uI assert(nEndIndex == -1); // sw_redlinehide: this probably won't HideDeletions pSrc->CopyExpandText( rNd, &rInsPos, 0, -1, - pLayout, false, false, true ); + pLayout, false, true ); if (pLayout && pLayout->HasMergedParas()) { if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(pSrc->getLayoutFrame(pLayout))) @@ -646,7 +646,7 @@ void SwTOXPara::FillText( SwTextNode& rNd, const SwContentIndex& rInsPos, sal_uI pTmp->GetTextNode()->CopyExpandText( rNd, &rInsPos, 0, -1, - pLayout, false, false, false ); + pLayout, false, false ); } } } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index bbb725e5c13c..05269577db3b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3579,7 +3579,7 @@ OUString SwTextNode::GetExpandText(SwRootFrame const*const pLayout, bool SwTextNode::CopyExpandText(SwTextNode& rDestNd, const SwContentIndex* pDestIdx, sal_Int32 nIdx, sal_Int32 nLen, - SwRootFrame const*const pLayout, bool bWithNum, + SwRootFrame const*const pLayout, bool bWithFootnote, bool bReplaceTabsWithSpaces ) const { if( &rDestNd == this ) @@ -3710,12 +3710,6 @@ bool SwTextNode::CopyExpandText(SwTextNode& rDestNd, const SwContentIndex* pDest } } - if( bWithNum ) - { - aDestIdx = nDestStt; - rDestNd.InsertText( GetNumString(true, MAXLEVEL, pLayout), aDestIdx ); - } - aDestIdx = 0; sal_Int32 nStartDelete(-1); while (aDestIdx < rDestNd.GetText().getLength()) diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 7dbe10221ef1..ec2563088dfd 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -899,7 +899,7 @@ ErrCode RtfExport::ExportDocument_Impl() // All sections are unlocked by default Strm().WriteOString(OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED); Strm().WriteOString("1"); - OutPageDescription(rPageDesc, true); // Changed bCheckForFirstPage to true so headers + OutPageDescription(rPageDesc); // Changed bCheckForFirstPage to true so headers // following title page are correctly added - i13107 if (pSttPgDsc) { @@ -1413,14 +1413,13 @@ const OUString* RtfExport::GetRedline(sal_uInt16 nId) return nullptr; } -void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage) +void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc) { SAL_INFO("sw.rtf", __func__ << " start"); const SwPageDesc* pSave = m_pCurrentPageDesc; m_pCurrentPageDesc = &rPgDsc; - if (bCheckForFirstPage && m_pCurrentPageDesc->GetFollow() - && m_pCurrentPageDesc->GetFollow() != m_pCurrentPageDesc) + if (m_pCurrentPageDesc->GetFollow() && m_pCurrentPageDesc->GetFollow() != m_pCurrentPageDesc) m_pCurrentPageDesc = m_pCurrentPageDesc->GetFollow(); if (m_pCurrentPageDesc->GetLandscape()) diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 11f3f0471f23..1a24aaf3e151 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -188,7 +188,7 @@ public: void resetStream(); void OutUnicode(std::string_view pToken, std::u16string_view rContent, bool bUpr = false); void OutDateTime(std::string_view pStr, const css::util::DateTime& rDT); - void OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage); + void OutPageDescription(const SwPageDesc& rPgDsc); sal_uInt16 GetColor(const Color& rColor) const; void InsColor(const Color& rCol); diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 07bf72ff4b99..a0a1016b114d 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -580,7 +580,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if ( pRefField->IsRefToHeadingCrossRefBookmark() || pRefField->IsRefToNumItemCrossRefBookmark() ) { - sText = pRefField->GetExpandedTextOfReferencedTextNode(*rSh.GetLayout(), nullptr, nullptr); + sText = pRefField->GetExpandedTextOfReferencedTextNode(*rSh.GetLayout()); if ( sText.getLength() > 80 ) { sText = OUString::Concat(sText.subView(0, 80)) + "..."; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 9e80e06c3292..eff50a0ea76c 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -735,7 +735,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged) { OUString sExpandedTextOfReferencedTextNode = pRefField->GetExpandedTextOfReferencedTextNode( - *m_pWrtShell->GetLayout(), nullptr, nullptr); + *m_pWrtShell->GetLayout()); if (sExpandedTextOfReferencedTextNode.getLength() > 80) { sExpandedTextOfReferencedTextNode = OUString::Concat( commit c9bf1e18bd80098d5498c831ee4586d04f003053 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Apr 19 12:41:54 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Apr 20 10:01:23 2024 +0200 loplugin:constantparam in ucb,unotools Change-Id: I4161adac7544e7b1a8a7d8e18a3ae6c72ca77062 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/ucb/source/ucp/webdav-curl/DAVAuthListener.hxx b/ucb/source/ucp/webdav-curl/DAVAuthListener.hxx index c3d643bc7d82..f5c2392185c1 100644 --- a/ucb/source/ucp/webdav-curl/DAVAuthListener.hxx +++ b/ucb/source/ucp/webdav-curl/DAVAuthListener.hxx @@ -34,8 +34,7 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - bool bCanUseSystemCredentials, - bool bUsePreviousCredentials = true ) = 0; + bool bCanUseSystemCredentials) = 0; }; } // namespace http_dav_ucp diff --git a/ucb/source/ucp/webdav-curl/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav-curl/DAVAuthListenerImpl.hxx index 700c7c4c61ae..b0e6302bcf6d 100644 --- a/ucb/source/ucp/webdav-curl/DAVAuthListenerImpl.hxx +++ b/ucb/source/ucp/webdav-curl/DAVAuthListenerImpl.hxx @@ -46,8 +46,7 @@ namespace http_dav_ucp const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - bool bCanUseSystemCredentials, - bool bUsePreviousCredentials = true ) override; + bool bCanUseSystemCredentials ) override; private: const css::uno::Reference< css::ucb::XCommandEnvironment > m_xEnv; diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx index c1b775c08f70..dfe78feb2454 100644 --- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx @@ -47,8 +47,7 @@ int DAVAuthListener_Impl::authenticate( const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - bool bCanUseSystemCredentials, - bool bUsePreviousCredentials ) + bool bCanUseSystemCredentials ) { if ( m_xEnv.is() ) { @@ -61,10 +60,10 @@ int DAVAuthListener_Impl::authenticate( // container to reject these. Thus, the credential input dialog will be shown again. // #102871# - Supply username and password from previous try. // Password container service depends on this! - if ( inoutUserName.isEmpty() && bUsePreviousCredentials ) + if ( inoutUserName.isEmpty() ) inoutUserName = m_aPrevUsername; - if ( outPassWord.isEmpty() && bUsePreviousCredentials ) + if ( outPassWord.isEmpty() ) outPassWord = m_aPrevPassword; rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 8cb0e8205d34..cda28879b237 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -998,10 +998,10 @@ void UcbLockBytes::setStream( const Reference<XStream>& aStream ) } } -bool UcbLockBytes::setInputStream( const Reference<XInputStream> &rxInputStream, bool bSetXSeekable ) +bool UcbLockBytes::setInputStream( const Reference<XInputStream> &rxInputStream ) { std::unique_lock aGuard( m_aMutex ); - return setInputStreamImpl(aGuard, rxInputStream, bSetXSeekable); + return setInputStreamImpl(aGuard, rxInputStream, /*bSetXSeekable*/true); } bool UcbLockBytes::setInputStreamImpl( std::unique_lock<std::mutex>& /*rGuard*/, const Reference<XInputStream> &rxInputStream, bool bSetXSeekable ) diff --git a/unotools/source/ucbhelper/ucblockbytes.hxx b/unotools/source/ucbhelper/ucblockbytes.hxx index d866015b250f..efaa66830cc7 100644 --- a/unotools/source/ucbhelper/ucblockbytes.hxx +++ b/unotools/source/ucbhelper/ucblockbytes.hxx @@ -105,8 +105,7 @@ public: // calling this method delegates the responsibility to call closeinput to the caller! css::uno::Reference < css::io::XInputStream > getInputStream(); - bool setInputStream( const css::uno::Reference < css::io::XInputStream > &rxInputStream, - bool bSetXSeekable = true ); + bool setInputStream( const css::uno::Reference < css::io::XInputStream > &rxInputStream ); void setStream( const css::uno::Reference < css::io::XStream > &rxStream ); void terminate();