[Libreoffice-commits] core.git: editeng/source include/svl
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 19 18:53:54 UTC 2021
editeng/source/rtf/svxrtf.cxx | 4 ++--
include/svl/whichranges.hxx | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 17c626e347377c586eccb8b007a1edc35b5a7824
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jul 19 20:40:14 2021 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Jul 19 20:53:19 2021 +0200
Fix updating WhichRangesContainer using MergeRange
I forgot that MergeRange is not modifying its object, but returns
a modified copy. Added SAL_WARN_UNUSED_RESULT to it (but it seems
to not have effect on Windows).
Change-Id: I919146fc25a0992d543890464ccac75737647ee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119230
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index ac1e91e2cdde..7bbf46a6026c 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -922,7 +922,7 @@ void SvxRTFParser::BuildWhichTable()
{
sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
aPardMap[nWid] = nTrueWid;
- aWhichMap.MergeRange(nTrueWid, nTrueWid);
+ aWhichMap = aWhichMap.MergeRange(nTrueWid, nTrueWid);
}
// Here are the IDs for all character attributes, which can be detected by
@@ -944,7 +944,7 @@ void SvxRTFParser::BuildWhichTable()
{
sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
aPlainMap[nWid] = nTrueWid;
- aWhichMap.MergeRange(nTrueWid, nTrueWid);
+ aWhichMap = aWhichMap.MergeRange(nTrueWid, nTrueWid);
}
}
diff --git a/include/svl/whichranges.hxx b/include/svl/whichranges.hxx
index 76403968d2d7..744a0f2edaf5 100644
--- a/include/svl/whichranges.hxx
+++ b/include/svl/whichranges.hxx
@@ -122,7 +122,7 @@ struct SVL_DLLPUBLIC WhichRangesContainer
void reset();
// Adds a range to which ranges, keeping the ranges in valid state (sorted, non-overlapping)
- WhichRangesContainer MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo) const;
+ SAL_WARN_UNUSED_RESULT WhichRangesContainer MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo) const;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
More information about the Libreoffice-commits
mailing list