Bug 164685 - Cleanup class SfxItemSetFixed
Summary: Cleanup class SfxItemSetFixed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0 target:26.2.0 target:26...
Keywords: difficultyMedium, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2025-01-13 12:46 UTC by Armin Le Grand (collabora)
Modified: 2026-04-20 15:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Le Grand (collabora) 2025-01-13 12:46:34 UTC
Description:
See comment on it in include/svl/itemset.hxx:

// Was: Allocate the items array inside the object, to reduce allocation cost.
// NOTE: No longer needed with unordered_set, but there are 560+ places to
// replace/adapt, so keep it for now.
// To adapt, there is the static makeFixedSfxItemSet member in SfxItemSet. Did
// that in one place to check functionality (easy hack...?)

Thus: all usages where a SfxItemSetFixed is constructed should be replaced using SfxItemSet::makeFixedSfxItemSet. As an example there is one place where I did that as POC: in sc/source/ui/view/cellsh3.cxx line 478. It is now

SfxItemSet aEmptySet(SfxItemSet::makeFixedSfxItemSet<ATTR_PATTERN_START, ATTR_PATTERN_END>(*pReqArgs->GetPool()));

and it originally was

SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>  aEmptySet( *pReqArgs->GetPool() );

thus it is mainly just a re-arrangement. Maybe someone with skills could do that even using a script or similar...

Actual Results:
class SfxItemSetFixed still exists.

Expected Results:
class SfxItemSetFixed can be completely removed from the code base.


Reproducible: Always


User Profile Reset: No

Additional Info:
This is an easy hack that needs C++ knowledge and maybe some scripting experience.
Comment 1 Armin Le Grand (collabora) 2025-01-13 14:45:05 UTC
Note: This is not complicated, but unfortunately a whole bunch of places - when grepping for SfxItemSetFixed I get 575 results in 278 files. With some in comments and the class definition itself it still is a high number. Maybe doing this i several steps is feasible. Or - as mentioned - someone with scripting/meta language could do it in one run...
Comment 2 Rafael Lima 2025-01-14 19:27:50 UTC
Hi Armin,

I'm looking into this... I created a Python script using regex to make all the substitutions and it works around 90% of the times.

However, I came across a few lines where we have unique pointers such as:

In: sc/source/ui/drawfunc/drawsh.cxx

auto xItemSet = std::make_unique<SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>>( SfxGetpApp()->GetPool() );

What is the best approach to deal with these cases? This is how I'm doing the conversion:

std::unique_ptr<SfxItemSet> xItemSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>(SfxGetpApp()->GetPool()));

Is this correct?
Comment 3 Commit Notification 2025-01-20 11:38:44 UTC
rafaelhlima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7afd95daf2224e80fe57c62f819dfb9ec4c630c9

tdf#164685 Cleanup SfxItemSetFixed

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-01-30 23:58:56 UTC
rafaelhlima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/80c90897657896b94689513119bf05eafc21519b

tdf#164685 Cleanup SfxItemSetFixed - Part 2

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2025-02-11 00:20:09 UTC
rafaelhlima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e2c08c31cf29e53ffc22f18424f108302728cd21

tdf#164685 Cleanup SfxItemSetFixed - Part 3

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2025-05-07 12:43:52 UTC
liadam364@gmail.com committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cc9dd053eefbbd821bbb3da1f8224b481abb1975

tdf#164685 Replace SfxItemSetFixed with makeFixedSfxItemSet

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2025-10-22 19:51:19 UTC
siddhi committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/67c36405f7d090ba68270a811629a0268d52ebaa

tdf#164685 Replace SfxItemSetFixed with makeFixedSfxItemSet in page.cxx

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2025-12-03 06:08:56 UTC
shlok3640 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4b498646142e4d0acb8eb2e50eb503ac6002d82e

tdf#164685 Modernize SfxItemSetFixed usage

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2026-04-17 06:32:03 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7a7a306f295356848664458d3cc3acb04ce5f80d

Related tdf#164685: Cleanup class SfxItemSetFixed (sc)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2026-04-18 14:28:23 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a22ace71744f86ae0bdb1a0a5d7297b6ff0edab4

Related tdf#164685: Cleanup class SfxItemSetFixed (basctl to reportdesign)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2026-04-18 15:41:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/44ff26976af48bdb519c5dd9d0322d01014cce9d

Related tdf#164685: Cleanup class SfxItemSetFixed (remaining cases in sc)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2026-04-18 16:05:35 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7229dfadd03f5bc405915698d5d8094cec9e4405

Related tdf#164685: Cleanup class SfxItemSetFixed (svx)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2026-04-18 16:05:37 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f5a046daf864eb1c8a8234038c6f9811b8e8979f

Related tdf#164685: Cleanup class SfxItemSetFixed (cui)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2026-04-18 19:51:55 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/92645e2fdef1ced948a861f56702ff35f3aa1f7d

Related tdf#164685: Cleanup class SfxItemSetFixed (sd)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2026-04-19 10:30:58 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6d0513e51b2bd15d9950730ba1614dd28a04d196

Related tdf#164685: Cleanup class SfxItemSetFixed (svx remnants)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2026-04-19 10:32:01 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b5c06fde3f4808fbda525459ad892f090e95fe16

Related tdf#164685: Cleanup class SfxItemSetFixed (sfx2)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2026-04-19 10:51:04 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/87b34ae0649e07bc84b0ff6a6598524586e90298

Related tdf#164685: Cleanup class SfxItemSetFixed (starmath)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2026-04-19 11:10:08 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dacbe7bce8c9271217b9aa09b7ddf4c494e19543

Related tdf#164685: Cleanup class SfxItemSetFixed (sw/core)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2026-04-19 13:59:22 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/09c0b45db74a338ced004576a1b3ca938a63f998

Related tdf#164685: Cleanup class SfxItemSetFixed (sw/ui-uibase)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2026-04-19 14:00:25 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/185828ef82d43a3dc290986220b30feb39dafb52

Related tdf#164685: Cleanup class SfxItemSetFixed (sw/qa)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2026-04-19 14:11:29 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e4038f8e39092f1d873d655b72f7e4d240c6a2f

Related tdf#164685: Cleanup class SfxItemSetFixed (sw/filter)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2026-04-19 14:41:33 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/793fd70ad62306ace8048918f954515a3158270e

Related tdf#164685: Cleanup class SfxItemSetFixed (sd remnants)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2026-04-19 19:35:56 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/05f7513a5fec87296cfac298f5fd3bfd0e0fc4bb

Related tdf#164685: Cleanup class SfxItemSetFixed (sw remnants part1)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2026-04-20 10:30:01 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95c28f1faab14a7caf3ce8d90d9df0c5ec373ffd

Related tdf#164685: Cleanup class SfxItemSetFixed (sw remnants)

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2026-04-20 15:19:30 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/30bb2b6954336c9a318fd01ae8a5035d0b5895bf

tdf#164685: Remove SfxItemSetFixed

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.