summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-03 16:06:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-04 08:16:45 +0200
commit86bcedbef057d234be91daeac6d4086efc10ab20 (patch)
tree9f591b720cb29cdab1e3d87a16a4e2ea97d44b76 /vcl
parent6c5208b91ee15c2a501696d1d9a131c51c737741 (diff)
use regular Set methods in TextCharAttrib
instead of returning a mutable ref, which just reads weird Change-Id: Ia2e2a7222f6ccd73e1d7f69dd7c2523f3a05ae24 Reviewed-on: https://gerrit.libreoffice.org/61309 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/edit/textdoc.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index 4a65d2be31d9..b8908f0ee6c7 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -226,7 +226,7 @@ void TextNode::CollapseAttribs( sal_Int32 nIndex, sal_Int32 nDeleted )
// special case: attribute covers the region exactly
// => keep as an empty attribute
if ( ( rAttrib.GetStart() == nIndex ) && ( rAttrib.GetEnd() == nEndChanges ) )
- rAttrib.GetEnd() = nIndex; // empty
+ rAttrib.SetEnd(nIndex); // empty
else
bDelAttr = true;
}
@@ -234,7 +234,7 @@ void TextNode::CollapseAttribs( sal_Int32 nIndex, sal_Int32 nDeleted )
else if ( ( rAttrib.GetStart() <= nIndex ) && ( rAttrib.GetEnd() > nIndex ) )
{
if ( rAttrib.GetEnd() <= nEndChanges ) // ends inside
- rAttrib.GetEnd() = nIndex;
+ rAttrib.SetEnd(nIndex);
else
rAttrib.Collaps( nDeleted ); // ends after
}
@@ -242,7 +242,7 @@ void TextNode::CollapseAttribs( sal_Int32 nIndex, sal_Int32 nDeleted )
else if ( ( rAttrib.GetStart() >= nIndex ) && ( rAttrib.GetEnd() > nEndChanges ) )
{
// features are not allowed to expand!
- rAttrib.GetStart() = nEndChanges;
+ rAttrib.SetStart(nEndChanges);
rAttrib.MoveBackward( nDeleted );
}
}
@@ -306,8 +306,8 @@ std::unique_ptr<TextNode> TextNode::Split( sal_Int32 nPos )
if ( !pNew->maCharAttribs.FindAttrib( rAttrib.Which(), 0 ) )
{
std::unique_ptr<TextCharAttrib> pNewAttrib(new TextCharAttrib( rAttrib ));
- pNewAttrib->GetStart() = 0;
- pNewAttrib->GetEnd() = 0;
+ pNewAttrib->SetStart(0);
+ pNewAttrib->SetEnd(0);
pNew->maCharAttribs.InsertAttrib( std::move(pNewAttrib) );
}
}
@@ -316,11 +316,11 @@ std::unique_ptr<TextNode> TextNode::Split( sal_Int32 nPos )
// If cutting at the very beginning, the attribute has to be
// copied and changed
std::unique_ptr<TextCharAttrib> pNewAttrib(new TextCharAttrib( rAttrib ));
- pNewAttrib->GetStart() = 0;
- pNewAttrib->GetEnd() = rAttrib.GetEnd()-nPos;
+ pNewAttrib->SetStart(0);
+ pNewAttrib->SetEnd(rAttrib.GetEnd()-nPos);
pNew->maCharAttribs.InsertAttrib( std::move(pNewAttrib) );
// trim
- rAttrib.GetEnd() = nPos;
+ rAttrib.SetEnd(nPos);
}
else
{
@@ -328,8 +328,8 @@ std::unique_ptr<TextNode> TextNode::Split( sal_Int32 nPos )
SAL_WARN_IF( rAttrib.GetEnd() < nPos, "vcl", "End < nPos!" );
// move all into the new node (this)
pNew->maCharAttribs.InsertAttrib(maCharAttribs.RemoveAttrib(nAttr));
- rAttrib.GetStart() = rAttrib.GetStart() - nPos;
- rAttrib.GetEnd() = rAttrib.GetEnd() - nPos;
+ rAttrib.SetStart( rAttrib.GetStart() - nPos );
+ rAttrib.SetEnd( rAttrib.GetEnd() - nPos );
nAttr--;
}
}
@@ -360,7 +360,7 @@ void TextNode::Append( const TextNode& rNode )
if ( ( rTmpAttrib.Which() == rAttrib.Which() ) &&
( rTmpAttrib.GetAttr() == rAttrib.GetAttr() ) )
{
- rTmpAttrib.GetEnd() = rTmpAttrib.GetEnd() + rAttrib.GetLen();
+ rTmpAttrib.SetEnd( rTmpAttrib.GetEnd() + rAttrib.GetLen() );
bMelted = true;
break; // there can be only one of this type at this position
}
@@ -371,8 +371,8 @@ void TextNode::Append( const TextNode& rNode )
if ( !bMelted )
{
std::unique_ptr<TextCharAttrib> pNewAttrib(new TextCharAttrib( rAttrib ));
- pNewAttrib->GetStart() = pNewAttrib->GetStart() + nOldLen;
- pNewAttrib->GetEnd() = pNewAttrib->GetEnd() + nOldLen;
+ pNewAttrib->SetStart( pNewAttrib->GetStart() + nOldLen );
+ pNewAttrib->SetEnd( pNewAttrib->GetEnd() + nOldLen );
maCharAttribs.InsertAttrib( std::move(pNewAttrib) );
}
}