diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-01 20:52:48 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-02 20:18:00 +0100 |
commit | 3b7d6284e5a2731b93608c71a4a126f120f3c025 (patch) | |
tree | 4e69acdf561532d125fe2020accac5695865e9af /editeng | |
parent | a90760a056056fdf1fc4dbdb6464f2a84b0fc617 (diff) |
Avoid a check and use plain arithmetic
Change-Id: Ie475a6f7d523d5aa6c0ef1952adce56caeac347b
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 78124b853446..9f06e1799b15 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2182,11 +2182,8 @@ sal_uLong EditDoc::GetTextLen() const const EditCharAttrib& rAttr = rAttrs[--nAttr]; if (rAttr.Which() == EE_FEATURE_FIELD) { - sal_Int32 nFieldLen = static_cast<const EditCharAttribField&>(rAttr).GetFieldValue().getLength(); - if ( !nFieldLen ) - nLen--; - else - nLen += nFieldLen-1; + nLen += static_cast<const EditCharAttribField&>(rAttr).GetFieldValue().getLength(); + --nLen; // Standalone, to avoid corner cases when previous getLength() returns 0 } } } |