diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-01-22 19:18:32 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-01-23 10:30:59 +0100 |
commit | 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c (patch) | |
tree | f46f20f947a37013fb0539ff235216bae149d443 /editeng | |
parent | db4cb7cee82615973d1be9fd631c1317f1da5820 (diff) |
ITEM: Solve SfxVoidItem(0) situation
An instance of SfxVoidItem(0) was used to signal
the SfxItemState::DISABLED. This was done not only
using WhichID == 0, but using isVoidItem() at the
SfxPoolItem. Unfortunately this mixes up with usages
of SfxVoidItems, mostly for UI stuff/Slots.
This also means that all the time an SfxVoidItem
had to be cloned/delete when when added/removed
from ItemSet or ItemHolder. Much more action than
e.g. for INVALID_POOL_ITEM which we already use
by havong just a simple ptr to a single static
instance of an Item. Disabled should do the same
thing.
Unfortunately also the functionality was mixed
with non-SfxItemState::DISABLED purposes and these
were very hard to be separated.
But the current solution works now after some
quirks doing that. It even oes no more need the
isVoidItem() flag at the SfxPoolItem.
Change-Id: I99f03db144f541ae4ea35f3775b3b3d58a375a81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162414
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 1 | ||||
-rw-r--r-- | editeng/source/editeng/eerdll.cxx | 21 |
2 files changed, 10 insertions, 12 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 1bd6504b2374..0e26a5802a00 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -207,7 +207,6 @@ const SfxItemInfo aItemInfos[EDITITEMCOUNT] = { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_ITALIC_CTL { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_EMPHASISMARK { SID_ATTR_CHAR_RELIEF, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_RELIEF - { 0, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_RUBI_DUMMY { 0, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, // EE_CHAR_XMLATTRIBS { SID_ATTR_CHAR_OVERLINE, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_OVERLINE { SID_ATTR_CHAR_CASEMAP, SFX_ITEMINFOFLAG_NONE }, // EE_CHAR_CASEMAP diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 9e3e8c4cf8c5..d93eded8cbf7 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -137,19 +137,18 @@ DefItems::DefItems() rDefItems[44] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); rDefItems[45] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ); rDefItems[46] = new SvxCharReliefItem( FontRelief::NONE, EE_CHAR_RELIEF ); - rDefItems[47] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); - rDefItems[48] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS ); - rDefItems[49] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE ); - rDefItems[50] = new SvxCaseMapItem( SvxCaseMap::NotMapped, EE_CHAR_CASEMAP ); - rDefItems[51] = new SfxGrabBagItem( EE_CHAR_GRABBAG ); - rDefItems[52] = new SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ); + rDefItems[47] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS ); + rDefItems[48] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE ); + rDefItems[49] = new SvxCaseMapItem( SvxCaseMap::NotMapped, EE_CHAR_CASEMAP ); + rDefItems[50] = new SfxGrabBagItem( EE_CHAR_GRABBAG ); + rDefItems[51] = new SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ); // Features - rDefItems[53] = new SfxVoidItem( EE_FEATURE_TAB ); - rDefItems[54] = new SfxVoidItem( EE_FEATURE_LINEBR ); - rDefItems[55] = new SvxColorItem( COL_RED, EE_FEATURE_NOTCONV ); - rDefItems[56] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD ); + rDefItems[52] = new SfxVoidItem( EE_FEATURE_TAB ); + rDefItems[53] = new SfxVoidItem( EE_FEATURE_LINEBR ); + rDefItems[54] = new SvxColorItem( COL_RED, EE_FEATURE_NOTCONV ); + rDefItems[55] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD ); - assert(EDITITEMCOUNT == 57 && "ITEMCOUNT changed, adjust DefItems!"); + assert(EDITITEMCOUNT == 56 && "ITEMCOUNT changed, adjust DefItems!"); // Init DefFonts: GetDefaultFonts( *static_cast<SvxFontItem*>(rDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START]), |