Kaydet (Commit) c8a93253 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

remove unused NOT_POOLABLE enum value

and simplify the resulting SfxItemInfo field down to a single bool

Change-Id: I73e24e83d39afc7660ac85872ba96bc790713cb2
Reviewed-on: https://gerrit.libreoffice.org/23058Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 9885a4f1
......@@ -168,7 +168,7 @@ ChartItemPool::ChartItemPool():
for( sal_uInt16 i = 0; i < nMax; i++ )
{
pItemInfos[i]._nSID = 0;
pItemInfos[i]._nFlags = SfxItemPoolFlags::POOLABLE;
pItemInfos[i]._bPoolable = true;
}
// slot ids differing from which ids
......
......@@ -371,67 +371,67 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
// create the pool
static SfxItemInfo const aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] =
{
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE},
{0,SfxItemPoolFlags::NONE}
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false},
{0,false}
};
OSL_ENSURE(sizeof(aItemInfos)/sizeof(aItemInfos[0]) == DSID_LAST_ITEM_ID,"Invalid Ids!");
......
......@@ -799,11 +799,11 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
// UNO->ItemSet
static SfxItemInfo aItemInfos[] =
{
{ 0, SfxItemPoolFlags::NONE },
{ SID_ATTR_NUMBERFORMAT_VALUE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_ALIGN_HOR_JUSTIFY, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_NUMBERFORMAT_ONE_AREA, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_NUMBERFORMAT_INFO, SfxItemPoolFlags::POOLABLE }
{ 0, false },
{ SID_ATTR_NUMBERFORMAT_VALUE, true },
{ SID_ATTR_ALIGN_HOR_JUSTIFY, true },
{ SID_ATTR_NUMBERFORMAT_ONE_AREA, true },
{ SID_ATTR_NUMBERFORMAT_INFO, true }
};
static const sal_uInt16 aAttrMap[] =
{
......
......@@ -158,61 +158,61 @@ bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType )
}
const SfxItemInfo aItemInfos[EDITITEMCOUNT] = {
{ SID_ATTR_FRAMEDIRECTION, SfxItemPoolFlags::POOLABLE }, // EE_PARA_WRITINGDIR
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_PARA_XMLATTRIBS
{ SID_ATTR_PARA_HANGPUNCTUATION, SfxItemPoolFlags::POOLABLE }, // EE_PARA_HANGINGPUNCTUATION
{ SID_ATTR_PARA_FORBIDDEN_RULES, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_PARA_SCRIPTSPACE, SfxItemPoolFlags::POOLABLE }, // EE_PARA_ASIANCJKSPACING
{ SID_ATTR_NUMBERING_RULE, SfxItemPoolFlags::POOLABLE }, // EE_PARA_NUMBULL
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_PARA_HYPHENATE
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_PARA_BULLETSTATE
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_PARA_OUTLLRSPACE
{ SID_ATTR_PARA_OUTLLEVEL, SfxItemPoolFlags::POOLABLE }, // EE_PARA_OUTLLEVEL
{ SID_ATTR_PARA_BULLET, SfxItemPoolFlags::POOLABLE }, // EE_PARA_BULLET
{ SID_ATTR_LRSPACE, SfxItemPoolFlags::POOLABLE }, // EE_PARA_LRSPACE
{ SID_ATTR_ULSPACE, SfxItemPoolFlags::POOLABLE }, // EE_PARA_ULSPACE
{ SID_ATTR_PARA_LINESPACE, SfxItemPoolFlags::POOLABLE }, // EE_PARA_SBL
{ SID_ATTR_PARA_ADJUST, SfxItemPoolFlags::POOLABLE }, // EE_PARA_JUST
{ SID_ATTR_TABSTOP, SfxItemPoolFlags::POOLABLE }, // EE_PARA_TABS
{ SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SfxItemPoolFlags::POOLABLE }, // EE_PARA_JUST_METHOD
{ SID_ATTR_ALIGN_VER_JUSTIFY, SfxItemPoolFlags::POOLABLE }, // EE_PARA_VER_JUST
{ SID_ATTR_CHAR_COLOR, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_SCALEWIDTH, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_WEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_UNDERLINE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_STRIKEOUT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CONTOUR, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_SHADOWED, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_ESCAPEMENT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_AUTOKERN, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_KERNING, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_WORDLINEMODE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_WEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_WEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_EMPHASISMARK, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_RELIEF, SfxItemPoolFlags::POOLABLE },
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_RUBI_DUMMY
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_XMLATTRIBS
{ SID_ATTR_CHAR_OVERLINE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CASEMAP, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_CASEMAP
{ SID_ATTR_CHAR_GRABBAG, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_GRABBAG
{ SID_ATTR_CHAR_BACK_COLOR, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_BKGCOLOR
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_TAB
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_LINEBR
{ SID_ATTR_CHAR_CHARSETCOLOR, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_NOTCONV
{ SID_FIELD, SfxItemPoolFlags::POOLABLE }
{ SID_ATTR_FRAMEDIRECTION, true }, // EE_PARA_WRITINGDIR
{ 0, true }, // EE_PARA_XMLATTRIBS
{ SID_ATTR_PARA_HANGPUNCTUATION, true }, // EE_PARA_HANGINGPUNCTUATION
{ SID_ATTR_PARA_FORBIDDEN_RULES, true },
{ SID_ATTR_PARA_SCRIPTSPACE, true }, // EE_PARA_ASIANCJKSPACING
{ SID_ATTR_NUMBERING_RULE, true }, // EE_PARA_NUMBULL
{ 0, true }, // EE_PARA_HYPHENATE
{ 0, true }, // EE_PARA_BULLETSTATE
{ 0, true }, // EE_PARA_OUTLLRSPACE
{ SID_ATTR_PARA_OUTLLEVEL, true }, // EE_PARA_OUTLLEVEL
{ SID_ATTR_PARA_BULLET, true }, // EE_PARA_BULLET
{ SID_ATTR_LRSPACE, true }, // EE_PARA_LRSPACE
{ SID_ATTR_ULSPACE, true }, // EE_PARA_ULSPACE
{ SID_ATTR_PARA_LINESPACE, true }, // EE_PARA_SBL
{ SID_ATTR_PARA_ADJUST, true }, // EE_PARA_JUST
{ SID_ATTR_TABSTOP, true }, // EE_PARA_TABS
{ SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, true }, // EE_PARA_JUST_METHOD
{ SID_ATTR_ALIGN_VER_JUSTIFY, true }, // EE_PARA_VER_JUST
{ SID_ATTR_CHAR_COLOR, true },
{ SID_ATTR_CHAR_FONT, true },
{ SID_ATTR_CHAR_FONTHEIGHT, true },
{ SID_ATTR_CHAR_SCALEWIDTH, true },
{ SID_ATTR_CHAR_WEIGHT, true },
{ SID_ATTR_CHAR_UNDERLINE, true },
{ SID_ATTR_CHAR_STRIKEOUT, true },
{ SID_ATTR_CHAR_POSTURE, true },
{ SID_ATTR_CHAR_CONTOUR, true },
{ SID_ATTR_CHAR_SHADOWED, true },
{ SID_ATTR_CHAR_ESCAPEMENT, true },
{ SID_ATTR_CHAR_AUTOKERN, true },
{ SID_ATTR_CHAR_KERNING, true },
{ SID_ATTR_CHAR_WORDLINEMODE, true },
{ SID_ATTR_CHAR_LANGUAGE, true },
{ SID_ATTR_CHAR_CJK_LANGUAGE, true },
{ SID_ATTR_CHAR_CTL_LANGUAGE, true },
{ SID_ATTR_CHAR_CJK_FONT, true },
{ SID_ATTR_CHAR_CTL_FONT, true },
{ SID_ATTR_CHAR_CJK_FONTHEIGHT, true },
{ SID_ATTR_CHAR_CTL_FONTHEIGHT, true },
{ SID_ATTR_CHAR_CJK_WEIGHT, true },
{ SID_ATTR_CHAR_CTL_WEIGHT, true },
{ SID_ATTR_CHAR_CJK_POSTURE, true },
{ SID_ATTR_CHAR_CTL_POSTURE, true },
{ SID_ATTR_CHAR_EMPHASISMARK, true },
{ SID_ATTR_CHAR_RELIEF, true },
{ 0, true }, // EE_CHAR_RUBI_DUMMY
{ 0, true }, // EE_CHAR_XMLATTRIBS
{ SID_ATTR_CHAR_OVERLINE, true },
{ SID_ATTR_CHAR_CASEMAP, true }, // EE_CHAR_CASEMAP
{ SID_ATTR_CHAR_GRABBAG, true }, // EE_CHAR_GRABBAG
{ SID_ATTR_CHAR_BACK_COLOR, true }, // EE_CHAR_BKGCOLOR
{ 0, true }, // EE_FEATURE_TAB
{ 0, true }, // EE_FEATURE_LINEBR
{ SID_ATTR_CHAR_CHARSETCOLOR, true }, // EE_FEATURE_NOTCONV
{ SID_FIELD, true }
};
const sal_uInt16 aV1Map[] = {
......
......@@ -518,26 +518,26 @@ namespace pcr
// create the pool
static SfxItemInfo const aItemInfos[CFID_LAST_ITEM_ID - CFID_FIRST_ITEM_ID + 1] =
{
{ SID_ATTR_CHAR_FONT, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_FONTHEIGHT, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_WEIGHT, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_POSTURE, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_LANGUAGE, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_UNDERLINE, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_STRIKEOUT, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_WORDLINEMODE, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_COLOR, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_RELIEF, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_EMPHASISMARK, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ 0, SfxItemPoolFlags::NONE },
{ SID_ATTR_CHAR_FONTLIST, SfxItemPoolFlags::NONE }
{ SID_ATTR_CHAR_FONT, false },
{ SID_ATTR_CHAR_FONTHEIGHT, false },
{ SID_ATTR_CHAR_WEIGHT, false },
{ SID_ATTR_CHAR_POSTURE, false },
{ SID_ATTR_CHAR_LANGUAGE, false },
{ SID_ATTR_CHAR_UNDERLINE, false },
{ SID_ATTR_CHAR_STRIKEOUT, false },
{ SID_ATTR_CHAR_WORDLINEMODE, false },
{ SID_ATTR_CHAR_COLOR, false },
{ SID_ATTR_CHAR_RELIEF, false },
{ SID_ATTR_CHAR_EMPHASISMARK, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ 0, false },
{ SID_ATTR_CHAR_FONTLIST, false }
};
_rpPool = new SfxItemPool(OUString("PCRControlFontItemPool"), CFID_FIRST_ITEM_ID, CFID_LAST_ITEM_ID,
......
......@@ -24,7 +24,6 @@
#include <svl/poolitem.hxx>
#include <svl/svldllapi.h>
#include <tools/solar.h>
#include <o3tl/typed_flags_set.hxx>
class SvStream;
class SfxBroadcaster;
......@@ -32,21 +31,10 @@ struct SfxItemPool_Impl;
#define SFX_WHICH_MAX 4999
enum class SfxItemPoolFlags
{
NONE = 0x00,
POOLABLE = 0x01,
NOT_POOLABLE = 0x02,
};
namespace o3tl
{
template<> struct typed_flags<SfxItemPoolFlags> : is_typed_flags<SfxItemPoolFlags, 0x03> {};
}
struct SfxItemInfo
{
sal_uInt16 _nSID;
SfxItemPoolFlags _nFlags;
bool _bPoolable;
};
class SfxStyleSheetIterator;
......@@ -84,7 +72,7 @@ private:
sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const;
sal_uInt16 GetSize_Impl() const;
SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, SfxItemPoolFlags nFlag ) const;
SVL_DLLPRIVATE bool IsItemPoolable_Impl( sal_uInt16 nWhich ) const;
public:
// for default SfxItemSet::CTOR, set default WhichRanges
......@@ -197,9 +185,9 @@ public:
void Delete();
bool IsItemFlag( sal_uInt16 nWhich, SfxItemPoolFlags nFlag ) const;
bool IsItemFlag( const SfxPoolItem &rItem, SfxItemPoolFlags nFlag ) const
{ return IsItemFlag( rItem.Which(), nFlag ); }
bool IsItemPoolable( sal_uInt16 nWhich ) const;
bool IsItemPoolable( const SfxPoolItem &rItem ) const
{ return IsItemPoolable( rItem.Which() ); }
void SetItemInfos( const SfxItemInfo *pInfos );
sal_uInt16 GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich, bool bDeep = true ) const;
......
......@@ -603,46 +603,46 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
// UNO->ItemSet
static SfxItemInfo aItemInfos[] =
{
{ SID_ATTR_CHAR_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_WEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_SHADOWED, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_WORDLINEMODE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CONTOUR, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_STRIKEOUT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_UNDERLINE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_COLOR, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_KERNING, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CASEMAP, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_ESCAPEMENT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_FONTLIST, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_AUTOKERN, SfxItemPoolFlags::POOLABLE },
{ SID_COLOR_TABLE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_FLASH, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_EMPHASISMARK, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_TWO_LINES, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_ROTATED, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_SCALEWIDTH, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_RELIEF, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_HIDDEN, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_BRUSH, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_ALIGN_HOR_JUSTIFY, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_ALIGN_VER_JUSTIFY, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_FONT, true },
{ SID_ATTR_CHAR_FONTHEIGHT, true },
{ SID_ATTR_CHAR_LANGUAGE, true },
{ SID_ATTR_CHAR_POSTURE, true },
{ SID_ATTR_CHAR_WEIGHT, true },
{ SID_ATTR_CHAR_SHADOWED, true },
{ SID_ATTR_CHAR_WORDLINEMODE, true },
{ SID_ATTR_CHAR_CONTOUR, true },
{ SID_ATTR_CHAR_STRIKEOUT, true },
{ SID_ATTR_CHAR_UNDERLINE, true },
{ SID_ATTR_CHAR_COLOR, true },
{ SID_ATTR_CHAR_KERNING, true },
{ SID_ATTR_CHAR_CASEMAP, true },
{ SID_ATTR_CHAR_ESCAPEMENT, true },
{ SID_ATTR_CHAR_FONTLIST, true },
{ SID_ATTR_CHAR_AUTOKERN, true },
{ SID_COLOR_TABLE, true },
{ SID_ATTR_FLASH, true },
{ SID_ATTR_CHAR_EMPHASISMARK, true },
{ SID_ATTR_CHAR_TWO_LINES, true },
{ SID_ATTR_CHAR_ROTATED, true },
{ SID_ATTR_CHAR_SCALEWIDTH, true },
{ SID_ATTR_CHAR_RELIEF, true },
{ SID_ATTR_CHAR_HIDDEN, true },
{ SID_ATTR_BRUSH, true },
{ SID_ATTR_ALIGN_HOR_JUSTIFY, true },
{ SID_ATTR_ALIGN_VER_JUSTIFY, true },
// Asian
{ SID_ATTR_CHAR_CJK_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_WEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CJK_FONT, true },
{ SID_ATTR_CHAR_CJK_FONTHEIGHT, true },
{ SID_ATTR_CHAR_CJK_LANGUAGE, true },
{ SID_ATTR_CHAR_CJK_POSTURE, true },
{ SID_ATTR_CHAR_CJK_WEIGHT, true },
// Complex
{ SID_ATTR_CHAR_CTL_FONT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_FONTHEIGHT, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_LANGUAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_POSTURE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CTL_WEIGHT, SfxItemPoolFlags::POOLABLE }
{ SID_ATTR_CHAR_CTL_FONT, true },
{ SID_ATTR_CHAR_CTL_FONTHEIGHT, true },
{ SID_ATTR_CHAR_CTL_LANGUAGE, true },
{ SID_ATTR_CHAR_CTL_POSTURE, true },
{ SID_ATTR_CHAR_CTL_WEIGHT, true }
};
vcl::Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow );
::std::unique_ptr<FontList> pFontList(new FontList( pParent ));
......
......@@ -2352,35 +2352,35 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
// UNO->ItemSet
static SfxItemInfo aItemInfos[] =
{
{ SID_ATTR_LRSPACE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_ULSPACE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_PAGE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_PAGE_SIZE, SfxItemPoolFlags::POOLABLE },
{ SID_ENUM_PAGE_MODE, SfxItemPoolFlags::POOLABLE },
{ SID_PAPER_START, SfxItemPoolFlags::POOLABLE },
{ SID_PAPER_END, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_BRUSH, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLSTYLE, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLCOLOR, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLGRADIENT, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLHATCH, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBITMAP, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLTRANSPARENCE, SfxItemPoolFlags::POOLABLE },
{ XATTR_GRADIENTSTEPCOUNT, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_TILE, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_POS, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_SIZEX, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_SIZEY, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_SIZELOG, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_TILEOFFSETX, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_TILEOFFSETY, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_STRETCH, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_POSOFFSETX, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBMP_POSOFFSETY, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLFLOATTRANSPARENCE, SfxItemPoolFlags::POOLABLE },
{ XATTR_SECONDARYFILLCOLOR, SfxItemPoolFlags::POOLABLE },
{ XATTR_FILLBACKGROUND, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_METRIC, SfxItemPoolFlags::POOLABLE }
{ SID_ATTR_LRSPACE, true },
{ SID_ATTR_ULSPACE, true },
{ SID_ATTR_PAGE, true },
{ SID_ATTR_PAGE_SIZE, true },
{ SID_ENUM_PAGE_MODE, true },
{ SID_PAPER_START, true },
{ SID_PAPER_END, true },
{ SID_ATTR_BRUSH, true },
{ XATTR_FILLSTYLE, true },
{ XATTR_FILLCOLOR, true },
{ XATTR_FILLGRADIENT, true },
{ XATTR_FILLHATCH, true },
{ XATTR_FILLBITMAP, true },
{ XATTR_FILLTRANSPARENCE, true },
{ XATTR_GRADIENTSTEPCOUNT, true },
{ XATTR_FILLBMP_TILE, true },
{ XATTR_FILLBMP_POS, true },
{ XATTR_FILLBMP_SIZEX, true },
{ XATTR_FILLBMP_SIZEY, true },
{ XATTR_FILLBMP_SIZELOG, true },
{ XATTR_FILLBMP_TILEOFFSETX, true },
{ XATTR_FILLBMP_TILEOFFSETY, true },
{ XATTR_FILLBMP_STRETCH, true },
{ XATTR_FILLBMP_POSOFFSETX, true },
{ XATTR_FILLBMP_POSOFFSETY, true },
{ XATTR_FILLFLOATTRANSPARENCE, true },
{ XATTR_SECONDARYFILLCOLOR, true },
{ XATTR_FILLBACKGROUND, true },
{ SID_ATTR_METRIC, true }
};
MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
......@@ -4221,7 +4221,7 @@ void OReportController::openZoomDialog()
{
static SfxItemInfo aItemInfos[] =
{
{ SID_ATTR_ZOOM, SfxItemPoolFlags::POOLABLE }
{ SID_ATTR_ZOOM, true }
};
SfxPoolItem* pDefaults[] =
{
......
This diff is collapsed.
......@@ -26,16 +26,16 @@
static SfxItemInfo const aMsgItemInfos[] =
{
{ 0, SfxItemPoolFlags::POOLABLE }, // SCITEM_STRING
{ 0, SfxItemPoolFlags::POOLABLE }, // SCITEM_SEARCHDATA - stop using this!
{ SID_SORT, SfxItemPoolFlags::POOLABLE }, // SCITEM_SORTDATA
{ SID_QUERY, SfxItemPoolFlags::POOLABLE }, // SCITEM_QUERYDATA
{ SID_SUBTOTALS, SfxItemPoolFlags::POOLABLE }, // SCITEM_SUBTDATA
{ SID_CONSOLIDATE, SfxItemPoolFlags::POOLABLE }, // SCITEM_CONSOLIDATEDATA
{ SID_PIVOT_TABLE, SfxItemPoolFlags::POOLABLE }, // SCITEM_PIVOTDATA
{ SID_SOLVE, SfxItemPoolFlags::POOLABLE }, // SCITEM_SOLVEDATA
{ SID_SCUSERLISTS, SfxItemPoolFlags::POOLABLE }, // SCITEM_USERLIST
{ SID_PRINTER_NOTFOUND_WARN, SfxItemPoolFlags::POOLABLE } // SCITEM_PRINTWARN
{ 0, true }, // SCITEM_STRING
{ 0, true }, // SCITEM_SEARCHDATA - stop using this!
{ SID_SORT, true }, // SCITEM_SORTDATA
{ SID_QUERY, true }, // SCITEM_QUERYDATA
{ SID_SUBTOTALS, true }, // SCITEM_SUBTDATA
{ SID_CONSOLIDATE, true }, // SCITEM_CONSOLIDATEDATA
{ SID_PIVOT_TABLE, true }, // SCITEM_PIVOTDATA
{ SID_SOLVE, true }, // SCITEM_SOLVEDATA
{ SID_SCUSERLISTS, true }, // SCITEM_USERLIST
{ SID_PRINTER_NOTFOUND_WARN, true } // SCITEM_PRINTWARN
};
ScMessagePool::ScMessagePool()
......
......@@ -41,7 +41,7 @@ class CntStaticPoolDefaults_Impl: private boost::noncopyable
SfxItemInfo* m_pItemInfos;
private:
inline void Insert( SfxPoolItem* pItem, sal_uInt16 nSID, SfxItemPoolFlags nFlags );
inline void Insert( SfxPoolItem* pItem, sal_uInt16 nSID, bool bPoolable );
public:
explicit CntStaticPoolDefaults_Impl( CntItemPool* pPool );
......@@ -158,13 +158,13 @@ sal_uInt16 CntItemPool::Release()
inline void CntStaticPoolDefaults_Impl::Insert(
SfxPoolItem* pItem, /* Static Pool Default Item */
sal_uInt16 nSID, SfxItemPoolFlags nFlags /* Item Info */ )
sal_uInt16 nSID, bool bPoolable /* Item Info */ )
{
sal_uInt16 nPos = pItem->Which() - WID_CHAOS_START;
m_ppDefaults[ nPos ] = pItem;
m_pItemInfos[ nPos ]._nSID = nSID;
m_pItemInfos[ nPos ]._nFlags = nFlags;
m_pItemInfos[ nPos ]._bPoolable = bPoolable;
}
......@@ -188,7 +188,7 @@ CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl( CntItemPool* /*pPool*/ )
Insert(
new SfxStringItem( WID_CHAOS_START, OUString() ),
0,
SfxItemPoolFlags::POOLABLE );
true );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,7 @@ A small reference counted piece of data. Many subclasses, each with a
unique integer to identify its type (WhichId). Can be compared for equality
(operator==), Clone()d, and converted to/from uno::Any (QueryValue/PutValue).
A pool item may have value semantics (SfxItemPoolFlags::POOLABLE), meaning that
A pool item may have value semantics ("poolable"), meaning that
there will generally be only one instance that compares equal per item pool,
or not, in which case the item will be Clone()d quite a bit.
......
......@@ -35,10 +35,10 @@ class PoolItemTest : public CppUnit::TestFixture
void PoolItemTest::testPool()
{
SfxItemInfo aItems[] =
{ { 0, SfxItemPoolFlags::POOLABLE },
{ 1, SfxItemPoolFlags::NONE /* not poolable */ },
{ 2, SfxItemPoolFlags::NOT_POOLABLE },
{ 3, SfxItemPoolFlags::NONE /* not poolable */}
{ { 0, true },
{ 1, false /* not poolable */ },
{ 2, false },
{ 3, false /* not poolable */}
};
SfxItemPool *pPool = new SfxItemPool("testpool", 0, 3, aItems);
......@@ -80,17 +80,6 @@ void PoolItemTest::testPool()
CPPUNIT_ASSERT(&rVal2 != &rVal);
}
// not-poolable
SfxVoidItem aItemTwo( 2 );
SfxVoidItem aNotherTwo( 2 );
{
CPPUNIT_ASSERT(pImpl->maPoolItems[2] == nullptr);
const SfxPoolItem &rVal = pPool->Put(aItemTwo);
// those guys just don't go in ...
CPPUNIT_ASSERT(pImpl->maPoolItems[2] == nullptr);
CPPUNIT_ASSERT(rVal == aItemOne);
}
// Test rehash
for (size_t i = 0; i < pImpl->maPoolItems.size(); ++i)
{
......
......@@ -115,18 +115,18 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const
}
bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, SfxItemPoolFlags nFlag ) const
bool SfxItemPool::IsItemPoolable_Impl( sal_uInt16 nPos ) const
{
return bool(pItemInfos[nPos]._nFlags & nFlag);
return pItemInfos[nPos]._bPoolable;
}
bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, SfxItemPoolFlags nFlag ) const
bool SfxItemPool::IsItemPoolable( sal_uInt16 nWhich ) const
{
for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pImp->mpSecondary )
{
if ( pPool->IsInRange(nWhich) )
return pPool->IsItemFlag_Impl( pPool->GetIndex_Impl(nWhich), nFlag);
return pPool->IsItemPoolable_Impl( pPool->GetIndex_Impl(nWhich));
}
DBG_ASSERT( !IsWhich(nWhich), "unknown which-id" );
return false;
......@@ -151,7 +151,7 @@ SfxBroadcaster& SfxItemPool::BC()