diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-08-14 18:21:13 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-08-18 10:37:44 +0200 |
commit | c351f920c426542f0d3685bb9df1363d3a6393f8 (patch) | |
tree | 537d3a9bbe3df1a17ca62f0cb05fbc225caaaccb /sw | |
parent | a43a9dd8205f089c92737cb5519ed2a96a8d8ff2 (diff) |
ITEM: preparations for more/easier changes
This change is not about speed improvements but diverse
preparations to make changes/reading/understanding easier.
It does not change speed AFAIK.
Added a global static debug-only counter to allow getting
an overview over number of all allocated SfxPoolItem's
and the still alloated ones at office shutdown. The values
are used in Application::~Application to make a short info
statement. It allows to be able to quickly detect if an
error in future changes may lead to memory losses - these
would show in dramaitically higher numbers then (hopefully)
immediately.
Moved SfxVoidItem to own source/header.
Added container library interface support to SfxItemSet,
adapted already some methods to use it - not all possible,
I will commit & get status from gerrit 1st if all still works
and then continue.
Changed INVALID_POOL_ITEM from -1 to use a global unique
incarnation of an isolated derivation from SfxPoolItem. It
allows to avoid the (-1) pointer hack. Since still just
pointers are compared it's not worse. NOTE: That way, more
'special' SfxPoolItem's may be used for more States - a
candidate is e.g. SfxVoidItem(0) which represents ::DISABLED
state -- unfortunately not only, it is also used (mainly for
UI stuff) with 'real' WhichIDs - hard to sort out, will have
to stay that way for now AFAIK.
Changed INVALID_POOL_ITEM stuff to use a static extern
incarnated item in combination with a inline method
to return it, called GetGlobalStaticInvalidItemInstance().
Isolated create/cleanup of a SfxPoolItem entry in
SfxItemSet to further modularize/simplify that. It is
currently from constructor & destructor but already shows
that PoolDefaults are handled differently - probably an
error. Still, for now, do no change in behaviour (yet).
Got regular 'killed by the Kill-Wrapper' messages from
gerrit, seems to have to do with UITest_sw_findReplace.
That python/c++ scripting stuff is hard to debug, but
finally I identified the problem has to do with
the INVALID_POOL_ITEM change. It was in
SfxItemSet::InvalidateAllItems() where still a (-1)
was used -> chaos in detecting invalid items.
Change-Id: I595e1f25ab660c35c4f2d19c233d1dfadfe25214
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155675
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/app/applab.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/lingu/olmenu.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.cxx | 1 |
7 files changed, 10 insertions, 3 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index a5450d29b673..2e43441958f8 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -38,6 +38,7 @@ #include <svl/srchitem.hxx> #include <svl/slstitm.hxx> #include <svl/stritem.hxx> +#include <svl/voiditem.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index f2a4d974cfa1..3e286b31e80a 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -63,6 +63,7 @@ #include <editeng/postitem.hxx> #include <editeng/rsiditem.hxx> #include <svl/grabbagitem.hxx> +#include <svl/voiditem.hxx> #include <editeng/scriptspaceitem.hxx> #include <editeng/shaditem.hxx> #include <editeng/shdditem.hxx> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 4ad364ea6afc..091da2714e02 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1293,9 +1293,10 @@ namespace //local functions originally from docfmt.cxx aSet.ClearItem( RES_TXTATR_META ); aSet.ClearItem( RES_TXTATR_METAFIELD ); - // After GetParaAttr aSet can contain INVALID_POOL_ITEM items, e.g. RES_TXTATR_CHARFMT - // and (a copy of) this SfxItemSet can be passed to MSWordExportBase::OutputItemSet - // which doesn't handle INVALID_POOL_ITEM items so clear InvalidItems here + // After GetParaAttr aSet can contain invalid/dontcare items (true == IsInvalidItem, + // DONTCARE == SfxItemState), e.g. RES_TXTATR_CHARFMT and (a copy of) this + // SfxItemSet can be passed to MSWordExportBase::OutputItemSet + // which doesn't handle invalid/dontcare items so clear them here aSet.ClearInvalidItems(); xExtra.reset(new SwRedlineExtraData_FormatColl("", USHRT_MAX, &aSet)); diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 9d8dfadbdef6..fd687268eebd 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -30,6 +30,7 @@ #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <svl/stritem.hxx> +#include <svl/voiditem.hxx> #include <sfx2/request.hxx> #include <sfx2/fcontnr.hxx> #include <svl/ctloptions.hxx> diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index c39ec665da71..78436664c3cb 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -23,6 +23,7 @@ #include <hintids.hxx> #include <comphelper/string.hxx> +#include <svl/voiditem.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/printer.hxx> #include <sfx2/request.hxx> diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 80e32a4cdb30..acf06f2e41a7 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -54,6 +54,7 @@ #include <svl/itemset.hxx> #include <svl/languageoptions.hxx> #include <svl/stritem.hxx> +#include <svl/voiditem.hxx> #include <svtools/langtab.hxx> #include <unotools/lingucfg.hxx> #include <unotools/linguprops.hxx> diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index eed488a72c46..03c883dc0155 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -36,6 +36,7 @@ #include <wrtsh.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/supportsservice.hxx> +#include <svl/voiditem.hxx> #include <vcl/event.hxx> #include <vcl/menu.hxx> #include <vcl/settings.hxx> |