Assert on valid order of which ids in ranges on SfxItemSet creation

Desktop / LibreOffice - Mike Kaganski [collabora.com] - 13 June 2021 17:23 UTC

This allows to make sure we actually use sorted which ranges, and then it's safe to call SfxItemSet::MergeRange when needed.

Also this change relaxes the previous requirement that ranges must be separated by at least one; this allows to have adjacent ranges, like in

RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1,

where RES_FRMATR_END is equal to RES_GRFATR_BEGIN. Allowing this makes possible to (1) self-document the ranges, so it's clear which ranges are included; and (2) be safe in case when these constants would change, so that the one merged range would not unexpectedly contain everything inserted between RES_FRMATR_END and RES_GRFATR_BEGIN.

Change-Id: Iaad0f099b85059b3aa318a347aa7fbd3f6d455c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116909

8aaa28ed4397 Assert on valid order of which ids in ranges on SfxItemSet creation
.../source/controller/dialogs/dlg_NumberFormat.cxx | 10 +-
.../controller/itemsetwrapper/SchWhichPairs.hxx | 111 +++---
include/svl/itemset.hxx | 39 ++-
sc/source/ui/dbgui/validate.cxx | 2 +-
sd/source/ui/func/fupage.cxx | 22 +-
sfx2/source/control/bindings.cxx | 11 +-
sfx2/source/dialog/tabdlg.cxx | 34 +-
starmath/source/unomodel.cxx | 12 +-
svl/source/inc/items_helper.hxx | 126 +++++++
svl/source/items/itempool.cxx | 20 +-
svl/source/items/itemset.cxx | 371 +++------------------
svx/source/dialog/hdft.cxx | 57 ++--
svx/source/svdraw/svdedxv.cxx | 34 +-
sw/source/core/bastyp/init.cxx | 20 +-
sw/source/core/doc/docnew.cxx | 2 +-
sw/source/core/docnode/ndtbl.cxx | 12 +-
sw/source/core/fields/expfld.cxx | 8 +-
sw/source/core/txtnode/txtedt.cxx | 11 +-
sw/source/core/unocore/unocrsrhelper.cxx | 14 +-
sw/source/uibase/app/docshini.cxx | 2 +-
sw/source/uibase/lingu/hhcwrp.cxx | 7 +-
sw/source/uibase/shells/tabsh.cxx | 28 +-
sw/source/uibase/shells/textsh.cxx | 15 +-
sw/source/uibase/uiview/viewsrch.cxx | 2 +-
sw/source/uibase/uno/SwXDocumentSettings.cxx | 10 +-
25 files changed, 399 insertions(+), 581 deletions(-)

Upstream: cgit.freedesktop.org


  • Share