summaryrefslogtreecommitdiff
path: root/editeng/source/uno
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-16 16:22:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-17 08:40:39 +0200
commit82afd77a00c036f106a3aa5fb3402c92e10e2aa4 (patch)
tree2a07561d945b920c18f9e9b7fb5bde3eaf648945 /editeng/source/uno
parent59f398e934541e05dc9b77c1191227f8c68ea037 (diff)
loplugin:unusedfields in editeng..filter
Change-Id: I42e41ec69667a5560c5f31c85eb05074666a7bab Reviewed-on: https://gerrit.libreoffice.org/54455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno')
-rw-r--r--editeng/source/uno/unotext2.cxx37
1 files changed, 17 insertions, 20 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 09c178e8c434..43d803c3d340 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -40,8 +40,7 @@ using namespace ::com::sun::star;
SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase& _rText, const ESelection& rSel ) throw()
-: mrText( _rText ),
- maSelection( rSel )
+: mrText( _rText )
{
mxParentText = const_cast<SvxUnoTextBase*>(&_rText);
if( mrText.GetEditSource() )
@@ -49,16 +48,16 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase
mnNextParagraph = 0;
for( sal_Int32 currentPara = 0; currentPara < mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
{
- if( currentPara>=maSelection.nStartPara && currentPara<=maSelection.nEndPara )
+ if( currentPara>=rSel.nStartPara && currentPara<=rSel.nEndPara )
{
const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
SvxUnoTextContent* pContent = nullptr;
sal_Int32 nStartPos = 0;
sal_Int32 nEndPos = mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara );
- if( currentPara == maSelection.nStartPara )
- nStartPos = std::max(nStartPos, maSelection.nStartPos);
- if( currentPara == maSelection.nEndPara )
- nEndPos = std::min(nEndPos, maSelection.nEndPos);
+ if( currentPara == rSel.nStartPara )
+ nStartPos = std::max(nStartPos, rSel.nStartPos);
+ if( currentPara == rSel.nEndPara )
+ nEndPos = std::min(nEndPos, rSel.nEndPos);
ESelection aCurrentParaSel = ESelection( currentPara, nStartPos, currentPara, nEndPos );
for (auto const& elemRange : rRanges)
{
@@ -377,17 +376,15 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames()
// class SvxUnoTextRangeEnumeration
-SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rText, sal_Int32 nPara, const ESelection& rSel)
-: mxParentText( const_cast<SvxUnoTextBase*>(&rText) ),
- mrParentText( rText ),
+SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rParentText, sal_Int32 nPara, const ESelection& rSel)
+: mxParentText( const_cast<SvxUnoTextBase*>(&rParentText) ),
mnParagraph( nPara ),
- mnNextPortion( 0 ),
- mnSel( rSel )
+ mnNextPortion( 0 )
{
- if (rText.GetEditSource())
- mpEditSource = rText.GetEditSource()->Clone();
+ if (rParentText.GetEditSource())
+ mpEditSource = rParentText.GetEditSource()->Clone();
- if( mpEditSource && mpEditSource->GetTextForwarder() && (mnParagraph == mnSel.nStartPara && mnParagraph == mnSel.nEndPara) )
+ if( mpEditSource && mpEditSource->GetTextForwarder() && (mnParagraph == rSel.nStartPara && mnParagraph == rSel.nEndPara) )
{
std::vector<sal_Int32> aPortions;
mpEditSource->GetTextForwarder()->GetPortions( nPara, aPortions );
@@ -396,14 +393,14 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe
sal_uInt16 nStartPos = 0;
if ( aPortionIndex > 0 )
nStartPos = aPortions.at( aPortionIndex - 1 );
- if( nStartPos > mnSel.nEndPos )
+ if( nStartPos > rSel.nEndPos )
continue;
sal_uInt16 nEndPos = aPortions.at( aPortionIndex );
- if( nEndPos < mnSel.nStartPos )
+ if( nEndPos < rSel.nStartPos )
continue;
- nStartPos = std::max<int>(nStartPos, mnSel.nStartPos);
- nEndPos = std::min<sal_uInt16>(nEndPos, mnSel.nEndPos);
+ nStartPos = std::max<int>(nStartPos, rSel.nStartPos);
+ nEndPos = std::min<sal_uInt16>(nEndPos, rSel.nEndPos);
ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos );
const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
@@ -418,7 +415,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe
}
if( pRange == nullptr )
{
- pRange = new SvxUnoTextRange( mrParentText, true );
+ pRange = new SvxUnoTextRange( rParentText, true );
pRange->SetSelection( aSel );
}
maPortions.emplace_back(pRange );