diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-09-10 20:35:26 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-09-11 12:59:53 +0200 |
commit | 5f7a3126fcad1b490b6e1ef6775b31bac99f3c18 (patch) | |
tree | eb8f01846d98f9e0c22fbeab5223f12204202d62 /sc/source/ui/cctrl | |
parent | dfd890c414352b1abab62d6a38bf45561bb874ab (diff) |
ITEM: Diverse further changes/cleanups/preparation
Added a counter for SfxItemSet usages, similar to the
already added one for SfxPoolItems to allow quick info
about evtl. problems/drawbacks of changes.
Replaced enum SfxItemKind in favour of settable boolean flags
directly at SfxPoolItem. These are organized as bitfield, do
not need more space as the enum and allow to be set separately
and multiple ones at the same time.
Flags for PoolDefault/StaticDefault/DeleteOnIdle use this now
and are quickly accessible booleans. It is not a problem that
theoretically the flags for PoolDefault/StaticDefault could now
both be set - this is internal to SfxItem stuff and not accessible
from normal code, so can be managed.
Added for debug build a bitfield boolean m_bDeleted
that will be set in the SfxPoolItem destructor. Of course
it's usability will depend on the freed space not yet being
re-used, but will hopefully help in the debugger to detect
reasons for failure (would have helped at least me before).
Added for replacement of virtual method IsVoidItem() another
bitfield bool m_bIsVoidItem that is set in the constructors
of SfxVoidItem. Also had to add some constructors to do that
which were defaulted before. This is mainly because the base
class SfxPoolItem does *not* have a copy-constructor that
copies the members (flags/RefCnt/WhichID) and we should keep
that 'indirect reset' when Cloning. isVoidItem() is now a simple
boolean member access - the bitfield does the needed masking.
This spares one entry in the virtual function table of
SfxPoolItem which is derived more than 500 times.
Used the results of the experiment at
https://gerrit.libreoffice.org/c/core/+/156774 to change
some accesses to IsVoidItem() to use SfxItemState instead.
This is for preparation of splitting up the two usages of
SfxVoidItems, see commit text in the experiment.
If this shows problems in the future those six places documented
there may have to be changed back to use the new isVoidItem(),
but should also check the ptr this time to be non-zero.
Removed SFX_ITEMS_SPECIAL that is no more used anywhere.
Change-Id: Ib687ca2362d72a4651c75aee0c67029088f68947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156805
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sc/source/ui/cctrl')
-rw-r--r-- | sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 0168eaf3e93a..4ec776de100c 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -59,7 +59,7 @@ void ScZoomSliderControl::StateChangedAtToolBoxControl( sal_uInt16 /*nSID*/, Sfx ScZoomSliderWnd* pBox = static_cast<ScZoomSliderWnd*>(rTbx.GetItemWindow( nId )); OSL_ENSURE( pBox ,"Control not found!" ); - if ( SfxItemState::DEFAULT != eState || pState->IsVoidItem() ) + if (SfxItemState::DEFAULT != eState || SfxItemState::DISABLED == eState) { SvxZoomSliderItem aZoomSliderItem( 100 ); pBox->Disable(); |