summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-03-06 14:40:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-03-09 11:33:43 +0100
commitabe39f7781f59b96c5a8d3dd5b41c60fdf04ad84 (patch)
tree0f72d1968e5f25e3f280688a414398e3f4a7cce8 /editeng
parentbdb1c72198f60fdd91460e26282134d43bc0e2df (diff)
improve loplugin:unusedfields
noticed something that wasn't being picked up, wrote some tests, and found an unhandled case in Plugin::getParentFunctionDecl Change-Id: I52b4ea273be6614e197392dfc4d6053bbc1704de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/uno/unotext2.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 4e1591e60acf..933c95002513 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -40,15 +40,14 @@ using namespace ::com::sun::star;
// SvxUnoTextContentEnumeration
-SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText, const ESelection& rSel ) throw()
-: mrText( _rText )
+SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase& rText, const ESelection& rSel ) throw()
{
- mxParentText = const_cast<SvxUnoTextBase*>(&_rText);
- if( mrText.GetEditSource() )
- mpEditSource = mrText.GetEditSource()->Clone();
+ mxParentText = const_cast<SvxUnoTextBase*>(&rText);
+ if( rText.GetEditSource() )
+ mpEditSource = rText.GetEditSource()->Clone();
mnNextParagraph = 0;
- const SvxTextForwarder* pTextForwarder = mrText.GetEditSource()->GetTextForwarder();
+ const SvxTextForwarder* pTextForwarder = rText.GetEditSource()->GetTextForwarder();
const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, pTextForwarder->GetParagraphCount() );
for( sal_Int32 currentPara = rSel.nStartPara; currentPara < maxParaIndex; currentPara++ )
@@ -79,7 +78,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase
}
if( pContent == nullptr )
{
- pContent = new SvxUnoTextContent( mrText, currentPara );
+ pContent = new SvxUnoTextContent( rText, currentPara );
pContent->SetSelection( aCurrentParaSel );
maContents.emplace_back(pContent );
}
@@ -376,18 +375,17 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames()
-SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rParentText, sal_Int32 nPara, const ESelection& rSel)
+SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rParentText, sal_Int32 nParagraph, const ESelection& rSel)
: mxParentText( const_cast<SvxUnoTextBase*>(&rParentText) ),
- mnParagraph( nPara ),
mnNextPortion( 0 )
{
if (rParentText.GetEditSource())
mpEditSource = rParentText.GetEditSource()->Clone();
- if( mpEditSource && mpEditSource->GetTextForwarder() && (mnParagraph == rSel.nStartPara && mnParagraph == rSel.nEndPara) )
+ if( mpEditSource && mpEditSource->GetTextForwarder() && (nParagraph == rSel.nStartPara && nParagraph == rSel.nEndPara) )
{
std::vector<sal_Int32> aPortions;
- mpEditSource->GetTextForwarder()->GetPortions( nPara, aPortions );
+ mpEditSource->GetTextForwarder()->GetPortions( nParagraph, aPortions );
for( size_t aPortionIndex = 0; aPortionIndex < aPortions.size(); aPortionIndex++ )
{
sal_uInt16 nStartPos = 0;
@@ -401,7 +399,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rPa
nStartPos = std::max<int>(nStartPos, rSel.nStartPos);
nEndPos = std::min<sal_uInt16>(nEndPos, rSel.nEndPos);
- ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos );
+ ESelection aSel( nParagraph, nStartPos, nParagraph, nEndPos );
const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
SvxUnoTextRange* pRange = nullptr;