diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/eerdll.cxx | 123 | ||||
-rw-r--r-- | editeng/source/editeng/eerdll2.hxx | 4 |
3 files changed, 65 insertions, 64 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 126a5dae8f2a..b93aa60e9930 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -3077,7 +3077,7 @@ EditEngineItemPool::EditEngineItemPool( bool bPersistenRefCounts ) SetVersionMap( 5, 3994, 4037, aV5Map ); SetVersionMap( 6, 3994, 4038, aV6Map ); - SfxPoolItem** ppDefItems = EE_DLL().GetGlobalData()->GetDefItems(); + std::vector<SfxPoolItem*>* ppDefItems = EE_DLL().GetGlobalData()->GetDefItems(); SetDefaults( ppDefItems ); } diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index f1bf58cd07c1..08d95aa7402b 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -93,83 +93,84 @@ GlobalEditData::~GlobalEditData() // Destroy DefItems... // Or simply keep them, since at end of execution?! if ( ppDefItems ) - SfxItemPool::ReleaseDefaults( ppDefItems, EDITITEMCOUNT, true ); + SfxItemPool::ReleaseDefaults( ppDefItems, true ); } -SfxPoolItem** GlobalEditData::GetDefItems() +std::vector<SfxPoolItem*>* GlobalEditData::GetDefItems() { if ( !ppDefItems ) { - ppDefItems = new SfxPoolItem*[EDITITEMCOUNT]; + ppDefItems = new std::vector<SfxPoolItem*>(EDITITEMCOUNT); + std::vector<SfxPoolItem*>& rDefItems = *ppDefItems; // Paragraph attributes: SvxNumRule aDefaultNumRule( SvxNumRuleFlags::NONE, 0, false ); - ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); - ppDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS ); - ppDefItems[2] = new SvxHangingPunctuationItem(false, EE_PARA_HANGINGPUNCTUATION); - ppDefItems[3] = new SvxForbiddenRuleItem(true, EE_PARA_FORBIDDENRULES); - ppDefItems[4] = new SvxScriptSpaceItem( true, EE_PARA_ASIANCJKSPACING ); - ppDefItems[5] = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET ); - ppDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, false ); - ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, true ); - ppDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE ); - ppDefItems[9] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 ); - ppDefItems[10] = new SvxBulletItem( EE_PARA_BULLET ); - ppDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE ); - ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE ); - ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL ); - ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ); - ppDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS ); - ppDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD ); - ppDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST ); + rDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); + rDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS ); + rDefItems[2] = new SvxHangingPunctuationItem(false, EE_PARA_HANGINGPUNCTUATION); + rDefItems[3] = new SvxForbiddenRuleItem(true, EE_PARA_FORBIDDENRULES); + rDefItems[4] = new SvxScriptSpaceItem( true, EE_PARA_ASIANCJKSPACING ); + rDefItems[5] = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET ); + rDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, false ); + rDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, true ); + rDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE ); + rDefItems[9] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 ); + rDefItems[10] = new SvxBulletItem( EE_PARA_BULLET ); + rDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE ); + rDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE ); + rDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL ); + rDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ); + rDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS ); + rDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD ); + rDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST ); // Character attributes: - ppDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR ); - ppDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO ); - ppDefItems[20] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ); - ppDefItems[21] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ); - ppDefItems[22] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ); - ppDefItems[23] = new SvxUnderlineItem( LINESTYLE_NONE, EE_CHAR_UNDERLINE ); - ppDefItems[24] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ); - ppDefItems[25] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ); - ppDefItems[26] = new SvxContourItem( false, EE_CHAR_OUTLINE ); - ppDefItems[27] = new SvxShadowedItem( false, EE_CHAR_SHADOW ); - ppDefItems[28] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT ); - ppDefItems[29] = new SvxAutoKernItem( false, EE_CHAR_PAIRKERNING ); - ppDefItems[30] = new SvxKerningItem( 0, EE_CHAR_KERNING ); - ppDefItems[31] = new SvxWordLineModeItem( false, EE_CHAR_WLM ); - ppDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE ); - ppDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK ); - ppDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL ); - ppDefItems[35] = new SvxFontItem( EE_CHAR_FONTINFO_CJK ); - ppDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CTL ); - ppDefItems[37] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK ); - ppDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL ); - ppDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ); - ppDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ); - ppDefItems[41] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ); - ppDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); - ppDefItems[43] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ); - ppDefItems[44] = new SvxCharReliefItem( FontRelief::NONE, EE_CHAR_RELIEF ); - ppDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); - ppDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS ); - ppDefItems[47] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE ); - ppDefItems[48] = new SvxCaseMapItem( SVX_CASEMAP_NOT_MAPPED, EE_CHAR_CASEMAP ); - ppDefItems[49] = new SfxGrabBagItem( EE_CHAR_GRABBAG ); - ppDefItems[50] = new SvxBackgroundColorItem( Color( COL_AUTO ), EE_CHAR_BKGCOLOR ); + rDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR ); + rDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO ); + rDefItems[20] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ); + rDefItems[21] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ); + rDefItems[22] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ); + rDefItems[23] = new SvxUnderlineItem( LINESTYLE_NONE, EE_CHAR_UNDERLINE ); + rDefItems[24] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ); + rDefItems[25] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ); + rDefItems[26] = new SvxContourItem( false, EE_CHAR_OUTLINE ); + rDefItems[27] = new SvxShadowedItem( false, EE_CHAR_SHADOW ); + rDefItems[28] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT ); + rDefItems[29] = new SvxAutoKernItem( false, EE_CHAR_PAIRKERNING ); + rDefItems[30] = new SvxKerningItem( 0, EE_CHAR_KERNING ); + rDefItems[31] = new SvxWordLineModeItem( false, EE_CHAR_WLM ); + rDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE ); + rDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK ); + rDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL ); + rDefItems[35] = new SvxFontItem( EE_CHAR_FONTINFO_CJK ); + rDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CTL ); + rDefItems[37] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK ); + rDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL ); + rDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ); + rDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ); + rDefItems[41] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ); + rDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); + rDefItems[43] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK ); + rDefItems[44] = new SvxCharReliefItem( FontRelief::NONE, EE_CHAR_RELIEF ); + rDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); + rDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS ); + rDefItems[47] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE ); + rDefItems[48] = new SvxCaseMapItem( SVX_CASEMAP_NOT_MAPPED, EE_CHAR_CASEMAP ); + rDefItems[49] = new SfxGrabBagItem( EE_CHAR_GRABBAG ); + rDefItems[50] = new SvxBackgroundColorItem( Color( COL_AUTO ), EE_CHAR_BKGCOLOR ); // Features - ppDefItems[51] = new SfxVoidItem( EE_FEATURE_TAB ); - ppDefItems[52] = new SfxVoidItem( EE_FEATURE_LINEBR ); - ppDefItems[53] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV ); - ppDefItems[54] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD ); + rDefItems[51] = new SfxVoidItem( EE_FEATURE_TAB ); + rDefItems[52] = new SfxVoidItem( EE_FEATURE_LINEBR ); + rDefItems[53] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV ); + rDefItems[54] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD ); assert(EDITITEMCOUNT == 55 && "ITEMCOUNT changed, adjust DefItems!"); // Init DefFonts: - GetDefaultFonts( *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START]), - *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO_CJK - EE_ITEMS_START]), - *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO_CTL - EE_ITEMS_START]) ); + GetDefaultFonts( *static_cast<SvxFontItem*>(rDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START]), + *static_cast<SvxFontItem*>(rDefItems[EE_CHAR_FONTINFO_CJK - EE_ITEMS_START]), + *static_cast<SvxFontItem*>(rDefItems[EE_CHAR_FONTINFO_CTL - EE_ITEMS_START]) ); } return ppDefItems; diff --git a/editeng/source/editeng/eerdll2.hxx b/editeng/source/editeng/eerdll2.hxx index ffb96fe0aa19..136b9cd3fd3d 100644 --- a/editeng/source/editeng/eerdll2.hxx +++ b/editeng/source/editeng/eerdll2.hxx @@ -30,7 +30,7 @@ class GlobalEditData { private: css::uno::Reference< css::linguistic2::XLanguageGuessing > xLanguageGuesser; - SfxPoolItem** ppDefItems; + std::vector<SfxPoolItem*>* ppDefItems; rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; @@ -38,7 +38,7 @@ public: GlobalEditData(); ~GlobalEditData(); - SfxPoolItem** GetDefItems(); + std::vector<SfxPoolItem*>* GetDefItems(); rtl::Reference<SvxForbiddenCharactersTable> const & GetForbiddenCharsTable(); void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> const & xForbiddenChars ) { xForbiddenCharsTable = xForbiddenChars; } |