Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "scitems.hxx"
22 : #include <comphelper/string.hxx>
23 : #include <i18nutil/unicode.hxx>
24 : #include <tools/shl.hxx>
25 : #include <vcl/outdev.hxx>
26 : #include <vcl/svapp.hxx>
27 : #include <vcl/settings.hxx>
28 : #include <svl/aeitem.hxx>
29 : #include <svl/itemiter.hxx>
30 : #include <svl/stritem.hxx>
31 : #include <svx/algitem.hxx>
32 : #include <editeng/boxitem.hxx>
33 : #include <editeng/lineitem.hxx>
34 : #include <editeng/brushitem.hxx>
35 : #include <editeng/charreliefitem.hxx>
36 : #include <editeng/contouritem.hxx>
37 : #include <editeng/colritem.hxx>
38 : #include <editeng/crossedoutitem.hxx>
39 : #include <svx/dialmgr.hxx>
40 : #include <editeng/emphasismarkitem.hxx>
41 : #include <editeng/fhgtitem.hxx>
42 : #include <editeng/fontitem.hxx>
43 : #include <editeng/forbiddenruleitem.hxx>
44 : #include <editeng/frmdiritem.hxx>
45 : #include <editeng/hngpnctitem.hxx>
46 : #include <editeng/itemtype.hxx>
47 : #include <editeng/langitem.hxx>
48 : #include <editeng/lrspitem.hxx>
49 : #include <svx/pageitem.hxx>
50 : #include <editeng/pbinitem.hxx>
51 : #include <editeng/postitem.hxx>
52 : #include <svx/rotmodit.hxx>
53 : #include <editeng/scriptspaceitem.hxx>
54 : #include <editeng/shaditem.hxx>
55 : #include <editeng/shdditem.hxx>
56 : #include <editeng/sizeitem.hxx>
57 : #include <svx/svxitems.hrc>
58 : #include <editeng/udlnitem.hxx>
59 : #include <editeng/ulspitem.hxx>
60 : #include <editeng/wghtitem.hxx>
61 : #include <editeng/wrlmitem.hxx>
62 : #include <editeng/xmlcnitm.hxx>
63 : #include <editeng/justifyitem.hxx>
64 :
65 : #include "docpool.hxx"
66 : #include "global.hxx"
67 : #include "attrib.hxx"
68 : #include "patattr.hxx"
69 : #include "globstr.hrc"
70 : #include "sc.hrc"
71 :
72 : #define SC_MAX_POOLREF (SFX_ITEMS_OLD_MAXREF - 39)
73 : #define SC_SAFE_POOLREF (SC_MAX_POOLREF + 20)
74 :
75 : // STATIC DATA -----------------------------------------------------------
76 :
77 : sal_uInt16* ScDocumentPool::pVersionMap1 = 0;
78 : sal_uInt16* ScDocumentPool::pVersionMap2 = 0;
79 : sal_uInt16* ScDocumentPool::pVersionMap3 = 0;
80 : sal_uInt16* ScDocumentPool::pVersionMap4 = 0;
81 : sal_uInt16* ScDocumentPool::pVersionMap5 = 0;
82 : sal_uInt16* ScDocumentPool::pVersionMap6 = 0;
83 : sal_uInt16* ScDocumentPool::pVersionMap7 = 0;
84 : sal_uInt16* ScDocumentPool::pVersionMap8 = 0;
85 : sal_uInt16* ScDocumentPool::pVersionMap9 = 0;
86 : sal_uInt16* ScDocumentPool::pVersionMap10 = 0;
87 : sal_uInt16* ScDocumentPool::pVersionMap11 = 0;
88 : sal_uInt16* ScDocumentPool::pVersionMap12 = 0;
89 :
90 : // ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c
91 :
92 : static SfxItemInfo const aItemInfos[] =
93 : {
94 : { SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE }, // ATTR_FONT
95 : { SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_HEIGHT
96 : { SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_WEIGHT
97 : { SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_FONT_POSTURE
98 : { SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_UNDERLINE
99 : { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // ATTR_FONT_OVERLINE
100 : { SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE }, // ATTR_FONT_CROSSEDOUT
101 : { SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE }, // ATTR_FONT_CONTOUR
102 : { SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE }, // ATTR_FONT_SHADOWED
103 : { SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE }, // ATTR_FONT_COLOR
104 : { SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_FONT_LANGUAGE
105 : { SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT from 614
106 : { SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_HEIGHT from 614
107 : { SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_WEIGHT from 614
108 : { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_POSTURE from 614
109 : { SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CJK_FONT_LANGUAGE from 614
110 : { SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT from 614
111 : { SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_HEIGHT from 614
112 : { SID_ATTR_CHAR_CTL_WEIGHT, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_WEIGHT from 614
113 : { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_POSTURE from 614
114 : { SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE }, // ATTR_CTL_FONT_LANGUAGE from 614
115 : { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, // ATTR_FONT_EMPHASISMARK from 614
116 : { 0, SFX_ITEM_POOLABLE }, // ATTR_USERDEF from 614 / 641c
117 : { SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE }, // ATTR_FONT_WORDLINE from 632b
118 : { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, // ATTR_FONT_RELIEF from 632b
119 : { SID_ATTR_ALIGN_HYPHENATION, SFX_ITEM_POOLABLE }, // ATTR_HYPHENATE from 632b
120 : { 0, SFX_ITEM_POOLABLE }, // ATTR_SCRIPTSPACE from 614d
121 : { 0, SFX_ITEM_POOLABLE }, // ATTR_HANGPUNCTUATION from 614d
122 : { SID_ATTR_PARA_FORBIDDEN_RULES,SFX_ITEM_POOLABLE }, // ATTR_FORBIDDEN_RULES from 614d
123 : { SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY
124 : { SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY_METHOD
125 : { SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT ab 350
126 : { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY
127 : { SID_ATTR_ALIGN_VER_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY_METHOD
128 : { SID_ATTR_ALIGN_STACKED, SFX_ITEM_POOLABLE }, // ATTR_STACKED from 680/dr14 (replaces ATTR_ORIENTATION)
129 : { SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_VALUE ab 367
130 : { SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE ab 367
131 : { SID_ATTR_ALIGN_ASIANVERTICAL, SFX_ITEM_POOLABLE }, // ATTR_VERTICAL_ASIAN from 642
132 : { SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // ATTR_WRITINGDIR from 643
133 : { SID_ATTR_ALIGN_LINEBREAK, SFX_ITEM_POOLABLE }, // ATTR_LINEBREAK
134 : { SID_ATTR_ALIGN_SHRINKTOFIT, SFX_ITEM_POOLABLE }, // ATTR_SHRINKTOFIT from 680/dr14
135 : { SID_ATTR_BORDER_DIAG_TLBR, SFX_ITEM_POOLABLE }, // ATTR_BORDER_TLBR from 680/dr14
136 : { SID_ATTR_BORDER_DIAG_BLTR, SFX_ITEM_POOLABLE }, // ATTR_BORDER_BLTR from 680/dr14
137 : { SID_ATTR_ALIGN_MARGIN, SFX_ITEM_POOLABLE }, // ATTR_MARGIN
138 : { 0, SFX_ITEM_POOLABLE }, // ATTR_MERGE
139 : { 0, SFX_ITEM_POOLABLE }, // ATTR_MERGE_FLAG
140 : { SID_ATTR_NUMBERFORMAT_VALUE, SFX_ITEM_POOLABLE }, // ATTR_VALUE_FORMAT
141 : { ATTR_LANGUAGE_FORMAT, SFX_ITEM_POOLABLE }, // ATTR_LANGUAGE_FORMAT ab 329, wird im Dialog mit SID_ATTR_NUMBERFORMAT_VALUE kombiniert
142 : { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE }, // ATTR_BACKGROUND
143 : { SID_SCATTR_PROTECTION, SFX_ITEM_POOLABLE }, // ATTR_PROTECTION
144 : { SID_ATTR_BORDER_OUTER, SFX_ITEM_POOLABLE }, // ATTR_BORDER
145 : { SID_ATTR_BORDER_INNER, SFX_ITEM_POOLABLE }, // ATTR_BORDER_INNER
146 : { SID_ATTR_BORDER_SHADOW, SFX_ITEM_POOLABLE }, // ATTR_SHADOW
147 : { 0, SFX_ITEM_POOLABLE }, // ATTR_VALIDDATA
148 : { 0, SFX_ITEM_POOLABLE }, // ATTR_CONDITIONAL
149 : { 0, SFX_ITEM_POOLABLE }, // ATTR_HYPERLINK
150 : { 0, SFX_ITEM_POOLABLE }, // ATTR_PATTERN
151 : { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // ATTR_LRSPACE
152 : { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE }, // ATTR_ULSPACE
153 : { SID_ATTR_PAGE, SFX_ITEM_POOLABLE }, // ATTR_PAGE
154 : { 0, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PAPERTRAY, seit 303 nur noch dummy
155 : { SID_ATTR_PAGE_PAPERBIN, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PAPERBIN
156 : { SID_ATTR_PAGE_SIZE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SIZE
157 : { SID_ATTR_PAGE_MAXSIZE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_MAXSIZE
158 : { SID_ATTR_PAGE_EXT1, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HORCENTER
159 : { SID_ATTR_PAGE_EXT2, SFX_ITEM_POOLABLE }, // ATTR_PAGE_VERCENTER
160 : { SID_ATTR_PAGE_ON, SFX_ITEM_POOLABLE }, // ATTR_PAGE_ON
161 : { SID_ATTR_PAGE_DYNAMIC, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DYNAMIC
162 : { SID_ATTR_PAGE_SHARED, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SHARED
163 : { SID_SCATTR_PAGE_NOTES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NOTES
164 : { SID_SCATTR_PAGE_GRID, SFX_ITEM_POOLABLE }, // ATTR_PAGE_GRID
165 : { SID_SCATTR_PAGE_HEADERS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERS
166 : { SID_SCATTR_PAGE_CHARTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_CHARTS
167 : { SID_SCATTR_PAGE_OBJECTS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_OBJECTS
168 : { SID_SCATTR_PAGE_DRAWINGS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_DRAWINGS
169 : { SID_SCATTR_PAGE_TOPDOWN, SFX_ITEM_POOLABLE }, // ATTR_PAGE_TOPDOWN
170 : { SID_SCATTR_PAGE_SCALE, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALE
171 : { SID_SCATTR_PAGE_SCALETOPAGES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALETOPAGES
172 : { SID_SCATTR_PAGE_FIRSTPAGENO, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FIRSTPAGENO
173 : { SID_SCATTR_PAGE_PRINTAREA, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTAREA
174 : { SID_SCATTR_PAGE_REPEATROW, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATROW
175 : { SID_SCATTR_PAGE_REPEATCOL, SFX_ITEM_POOLABLE }, // ATTR_PAGE_REPEATCOL
176 : { SID_SCATTR_PAGE_PRINTTABLES, SFX_ITEM_POOLABLE }, // ATTR_PAGE_PRINTTABLES
177 : { SID_SCATTR_PAGE_HEADERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERLEFT
178 : { SID_SCATTR_PAGE_FOOTERLEFT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERLEFT
179 : { SID_SCATTR_PAGE_HEADERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERRIGHT
180 : { SID_SCATTR_PAGE_FOOTERRIGHT, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERRIGHT
181 : { SID_ATTR_PAGE_HEADERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_HEADERSET
182 : { SID_ATTR_PAGE_FOOTERSET, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FOOTERSET
183 : { SID_SCATTR_PAGE_FORMULAS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_FORMULAS
184 : { SID_SCATTR_PAGE_NULLVALS, SFX_ITEM_POOLABLE }, // ATTR_PAGE_NULLVALS
185 : { SID_SCATTR_PAGE_SCALETO, SFX_ITEM_POOLABLE } // ATTR_PAGE_SCALETO
186 : };
187 :
188 0 : ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)
189 :
190 : : SfxItemPool ( OUString("ScDocumentPool"),
191 : ATTR_STARTINDEX, ATTR_ENDINDEX,
192 : aItemInfos, NULL, false/*bLoadRefCounts*/ ),
193 0 : pSecondary ( pSecPool )
194 : {
195 : // latin font from GetDefaultFonts is not used, DEFAULTFONT_LATIN_SPREADSHEET instead
196 : Font aStdFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US,
197 0 : DEFAULTFONT_FLAGS_ONLYONE );
198 : SvxFontItem* pStdFont = new SvxFontItem( aStdFont.GetFamily(),
199 : aStdFont.GetName(), aStdFont.GetStyleName(),
200 0 : aStdFont.GetPitch(), aStdFont.GetCharSet(),
201 0 : ATTR_FONT );
202 :
203 0 : SvxFontItem* pCjkFont = new SvxFontItem( ATTR_CJK_FONT );
204 0 : SvxFontItem* pCtlFont = new SvxFontItem( ATTR_CTL_FONT );
205 0 : SvxFontItem aDummy( ATTR_FONT );
206 0 : GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont );
207 :
208 0 : SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER );
209 0 : SfxItemSet* pSet = new SfxItemSet( *this, ATTR_PATTERN_START, ATTR_PATTERN_END );
210 : SfxItemSet aSetItemItemSet( *this,
211 : ATTR_BACKGROUND, ATTR_BACKGROUND,
212 : ATTR_BORDER, ATTR_SHADOW,
213 : ATTR_LRSPACE, ATTR_ULSPACE,
214 : ATTR_PAGE_SIZE, ATTR_PAGE_SIZE,
215 : ATTR_PAGE_ON, ATTR_PAGE_SHARED,
216 0 : 0 );
217 :
218 0 : pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_HORI);
219 0 : pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_VERT);
220 0 : pGlobalBorderInnerAttr->SetTable(true);
221 0 : pGlobalBorderInnerAttr->SetDist(true);
222 0 : pGlobalBorderInnerAttr->SetMinDist(false);
223 :
224 0 : ppPoolDefaults = new SfxPoolItem*[ATTR_ENDINDEX-ATTR_STARTINDEX+1];
225 :
226 0 : ppPoolDefaults[ ATTR_FONT - ATTR_STARTINDEX ] = pStdFont;
227 0 : ppPoolDefaults[ ATTR_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_FONT_HEIGHT ); // 10 pt;
228 0 : ppPoolDefaults[ ATTR_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_FONT_WEIGHT );
229 0 : ppPoolDefaults[ ATTR_FONT_POSTURE - ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_FONT_POSTURE );
230 0 : ppPoolDefaults[ ATTR_FONT_UNDERLINE - ATTR_STARTINDEX ] = new SvxUnderlineItem( UNDERLINE_NONE, ATTR_FONT_UNDERLINE );
231 0 : ppPoolDefaults[ ATTR_FONT_OVERLINE - ATTR_STARTINDEX ] = new SvxOverlineItem( UNDERLINE_NONE, ATTR_FONT_OVERLINE );
232 0 : ppPoolDefaults[ ATTR_FONT_CROSSEDOUT - ATTR_STARTINDEX ] = new SvxCrossedOutItem( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT );
233 0 : ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( false, ATTR_FONT_CONTOUR );
234 0 : ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( false, ATTR_FONT_SHADOWED );
235 0 : ppPoolDefaults[ ATTR_FONT_COLOR - ATTR_STARTINDEX ] = new SvxColorItem( Color(COL_AUTO), ATTR_FONT_COLOR );
236 0 : ppPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_FONT_LANGUAGE );
237 0 : ppPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont;
238 0 : ppPoolDefaults[ ATTR_CJK_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CJK_FONT_HEIGHT );
239 0 : ppPoolDefaults[ ATTR_CJK_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CJK_FONT_WEIGHT );
240 0 : ppPoolDefaults[ ATTR_CJK_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CJK_FONT_POSTURE );
241 0 : ppPoolDefaults[ ATTR_CJK_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW),
242 0 : ATTR_CJK_FONT_LANGUAGE );
243 0 : ppPoolDefaults[ ATTR_CTL_FONT - ATTR_STARTINDEX ] = pCtlFont;
244 0 : ppPoolDefaults[ ATTR_CTL_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CTL_FONT_HEIGHT );
245 0 : ppPoolDefaults[ ATTR_CTL_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CTL_FONT_WEIGHT );
246 0 : ppPoolDefaults[ ATTR_CTL_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CTL_FONT_POSTURE );
247 0 : ppPoolDefaults[ ATTR_CTL_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW),
248 0 : ATTR_CTL_FONT_LANGUAGE );
249 0 : ppPoolDefaults[ ATTR_FONT_EMPHASISMARK-ATTR_STARTINDEX ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, ATTR_FONT_EMPHASISMARK );
250 0 : ppPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF );
251 0 : ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(false, ATTR_FONT_WORDLINE );
252 0 : ppPoolDefaults[ ATTR_FONT_RELIEF - ATTR_STARTINDEX ] = new SvxCharReliefItem( RELIEF_NONE, ATTR_FONT_RELIEF );
253 0 : ppPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE );
254 0 : ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( false, ATTR_SCRIPTSPACE);
255 0 : ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( false, ATTR_HANGPUNCTUATION);
256 0 : ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES);
257 0 : ppPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY);
258 0 : ppPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_HOR_JUSTIFY_METHOD);
259 0 : ppPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 );
260 0 : ppPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY);
261 0 : ppPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_VER_JUSTIFY_METHOD);
262 0 : ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, false );
263 0 : ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
264 0 : ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
265 0 : ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
266 : // The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT,
267 : // so that value is returned when asking for a default cell's attributes.
268 : // The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
269 0 : ppPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR );
270 0 : ppPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
271 0 : ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT );
272 0 : ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
273 0 : ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR );
274 0 : ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem( ATTR_MARGIN );
275 0 : ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr;
276 0 : ppPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr;
277 0 : ppPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 );
278 0 : ppPoolDefaults[ ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX ] = new SvxLanguageItem( ScGlobal::eLnge, ATTR_LANGUAGE_FORMAT );
279 0 : ppPoolDefaults[ ATTR_BACKGROUND - ATTR_STARTINDEX ] = new SvxBrushItem( Color(COL_TRANSPARENT), ATTR_BACKGROUND );
280 0 : ppPoolDefaults[ ATTR_PROTECTION - ATTR_STARTINDEX ] = new ScProtectionAttr;
281 0 : ppPoolDefaults[ ATTR_BORDER - ATTR_STARTINDEX ] = new SvxBoxItem( ATTR_BORDER );
282 0 : ppPoolDefaults[ ATTR_BORDER_INNER - ATTR_STARTINDEX ] = pGlobalBorderInnerAttr;
283 0 : ppPoolDefaults[ ATTR_SHADOW - ATTR_STARTINDEX ] = new SvxShadowItem( ATTR_SHADOW );
284 0 : ppPoolDefaults[ ATTR_VALIDDATA - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALIDDATA, 0 );
285 0 : ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new ScCondFormatItem;
286 0 : ppPoolDefaults[ ATTR_HYPERLINK - ATTR_STARTINDEX ] = new SfxStringItem( ATTR_HYPERLINK, OUString() ) ;
287 :
288 : // GetRscString funktioniert erst nach ScGlobal::Init, zu erkennen am EmptyBrushItem
289 : //! zusaetzliche Methode ScGlobal::IsInit() oder so...
290 : //! oder erkennen, ob dies der Secondary-Pool fuer einen MessagePool ist
291 0 : if ( ScGlobal::GetEmptyBrushItem() )
292 0 : ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
293 : else
294 0 : ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( pSet,
295 0 : OUString(STRING_STANDARD) ); //! without name?
296 :
297 0 : ppPoolDefaults[ ATTR_LRSPACE - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE );
298 0 : ppPoolDefaults[ ATTR_ULSPACE - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE );
299 0 : ppPoolDefaults[ ATTR_PAGE - ATTR_STARTINDEX ] = new SvxPageItem( ATTR_PAGE );
300 0 : ppPoolDefaults[ ATTR_PAGE_PAPERTRAY - ATTR_STARTINDEX ] = new SfxAllEnumItem( ATTR_PAGE_PAPERTRAY );
301 0 : ppPoolDefaults[ ATTR_PAGE_PAPERBIN - ATTR_STARTINDEX ] = new SvxPaperBinItem( ATTR_PAGE_PAPERBIN );
302 0 : ppPoolDefaults[ ATTR_PAGE_SIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_SIZE );
303 0 : ppPoolDefaults[ ATTR_PAGE_MAXSIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_MAXSIZE );
304 0 : ppPoolDefaults[ ATTR_PAGE_HORCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HORCENTER );
305 0 : ppPoolDefaults[ ATTR_PAGE_VERCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_VERCENTER );
306 0 : ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, true );
307 0 : ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, true );
308 0 : ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, true );
309 0 : ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, false );
310 0 : ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, false );
311 0 : ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, false );
312 0 : ppPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS );
313 0 : ppPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS );
314 0 : ppPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS );
315 0 : ppPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, true );
316 0 : ppPoolDefaults[ ATTR_PAGE_SCALE - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALE, 100 );
317 0 : ppPoolDefaults[ ATTR_PAGE_SCALETOPAGES-ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, 1 );
318 0 : ppPoolDefaults[ ATTR_PAGE_FIRSTPAGENO- ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 1 );
319 0 : ppPoolDefaults[ ATTR_PAGE_PRINTAREA - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_PRINTAREA );
320 0 : ppPoolDefaults[ ATTR_PAGE_REPEATROW - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATROW );
321 0 : ppPoolDefaults[ ATTR_PAGE_REPEATCOL - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATCOL );
322 0 : ppPoolDefaults[ ATTR_PAGE_PRINTTABLES- ATTR_STARTINDEX ] = new ScTableListItem( ATTR_PAGE_PRINTTABLES );
323 0 : ppPoolDefaults[ ATTR_PAGE_HEADERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERLEFT );
324 0 : ppPoolDefaults[ ATTR_PAGE_FOOTERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERLEFT );
325 0 : ppPoolDefaults[ ATTR_PAGE_HEADERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT );
326 0 : ppPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT );
327 0 : ppPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet );
328 0 : ppPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet );
329 0 : ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false );
330 0 : ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, true );
331 0 : ppPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 );
332 0 : ppPoolDefaults[ ATTR_HIDDEN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HIDDEN, false );
333 :
334 0 : SetDefaults( ppPoolDefaults );
335 :
336 0 : if ( pSecondary )
337 0 : SetSecondaryPool( pSecondary );
338 :
339 : // ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt, VersionMap in _ScGlobal__Init
340 0 : SetVersionMap( 1, 100, 157, pVersionMap1 );
341 :
342 : // ATTR_VALIDDATA, ATTR_CONDITIONAL ab 341
343 0 : SetVersionMap( 2, 100, 158, pVersionMap2 );
344 :
345 : // ATTR_INDENT ab 350
346 0 : SetVersionMap( 3, 100, 160, pVersionMap3 );
347 :
348 : // ATTR_ROTATE_VALUE, ATTR_ROTATE_MODE ab 367
349 0 : SetVersionMap( 4, 100, 161, pVersionMap4 );
350 :
351 : // CJK, CTL, EMPHASISMARK, TWOLINES from 614
352 0 : SetVersionMap( 5, 100, 163, pVersionMap5 );
353 :
354 : // ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES from 614d
355 0 : SetVersionMap( 6, 100, 175, pVersionMap6 );
356 :
357 : // ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE from 632b
358 0 : SetVersionMap( 7, 100, 178, pVersionMap7 );
359 :
360 : // ATTR_VERTICAL_ASIAN from 642q
361 0 : SetVersionMap( 8, 100, 181, pVersionMap8 );
362 :
363 : // ATTR_WRITINGDIR from 643y
364 0 : SetVersionMap( 9, 100, 182, pVersionMap9 );
365 :
366 : // ATTR_PAGE_SCALETO added in 680/sab008
367 : // new version map not required
368 :
369 : // ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
370 0 : SetVersionMap( 10, 100, 184, pVersionMap10 );
371 :
372 : // ATTR_FONT_OVERLINE added in DEV300/overline2
373 0 : SetVersionMap( 11, 100, 187, pVersionMap11 );
374 : // ATTR_HYERLINK added
375 0 : SetVersionMap( 12, 100, 192, pVersionMap12 );
376 0 : }
377 :
378 0 : ScDocumentPool::~ScDocumentPool()
379 : {
380 0 : Delete();
381 :
382 0 : for ( sal_uInt16 i=0; i < ATTR_ENDINDEX-ATTR_STARTINDEX+1; i++ )
383 : {
384 0 : SetRefCount( *ppPoolDefaults[i], 0 );
385 0 : delete ppPoolDefaults[i];
386 : }
387 :
388 0 : delete[] ppPoolDefaults;
389 0 : SfxItemPool::Free(pSecondary);
390 0 : }
391 :
392 0 : void ScDocumentPool::InitVersionMaps()
393 : {
394 : OSL_PRECOND( !pVersionMap1 && !pVersionMap2 &&
395 : !pVersionMap3 && !pVersionMap4 &&
396 : !pVersionMap5 && !pVersionMap6 &&
397 : !pVersionMap7 && !pVersionMap8 &&
398 : !pVersionMap9 && !pVersionMap10 &&
399 : !pVersionMap11 && !pVersionMap12 , "InitVersionMaps call multiple times" );
400 :
401 : // alte WhichId's mappen
402 : // nicht mit ATTR_* zaehlen, falls die sich nochmal aendern
403 :
404 : // erste Map: ATTR_LANGUAGE_FORMAT ab sv329 eingefuegt
405 :
406 0 : const sal_uInt16 nMap1Start = 100; // alter ATTR_STARTINDEX
407 0 : const sal_uInt16 nMap1End = 157; // alter ATTR_ENDINDEX
408 0 : const sal_uInt16 nMap1Count = nMap1End - nMap1Start + 1;
409 0 : const sal_uInt16 nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX
410 0 : pVersionMap1 = new sal_uInt16 [ nMap1Count ];
411 : sal_uInt16 i, j;
412 0 : for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ )
413 0 : pVersionMap1[i] = j;
414 : // ein Eintrag eingefuegt...
415 0 : for ( i=nMap1New, j=nMap1Start+nMap1New+1; i < nMap1Count; i++, j++ )
416 0 : pVersionMap1[i] = j;
417 :
418 : // zweite Map: ATTR_VALIDDATA und ATTR_CONDITIONAL ab 341 eingefuegt
419 :
420 0 : const sal_uInt16 nMap2Start = 100; // ATTR_STARTINDEX
421 0 : const sal_uInt16 nMap2End = 158; // ATTR_ENDINDEX
422 0 : const sal_uInt16 nMap2Count = nMap2End - nMap2Start + 1;
423 0 : const sal_uInt16 nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX
424 0 : pVersionMap2 = new sal_uInt16 [ nMap2Count ];
425 0 : for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ )
426 0 : pVersionMap2[i] = j;
427 : // zwei Eintraege eingefuegt...
428 0 : for ( i=nMap2New, j=nMap2Start+nMap2New+2; i < nMap2Count; i++, j++ )
429 0 : pVersionMap2[i] = j;
430 :
431 : // dritte Map: ATTR_INDENT ab 350 eingefuegt
432 :
433 0 : const sal_uInt16 nMap3Start = 100; // ATTR_STARTINDEX
434 0 : const sal_uInt16 nMap3End = 160; // ATTR_ENDINDEX
435 0 : const sal_uInt16 nMap3Count = nMap3End - nMap3Start + 1;
436 0 : const sal_uInt16 nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX
437 0 : pVersionMap3 = new sal_uInt16 [ nMap3Count ];
438 0 : for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ )
439 0 : pVersionMap3[i] = j;
440 : // ein Eintrag eingefuegt...
441 0 : for ( i=nMap3New, j=nMap3Start+nMap3New+1; i < nMap3Count; i++, j++ )
442 0 : pVersionMap3[i] = j;
443 :
444 : // vierte Map: ATTR_ROTATE_VALUE und ATTR_ROTATE_MODE ab 367 eingefuegt
445 :
446 0 : const sal_uInt16 nMap4Start = 100; // ATTR_STARTINDEX
447 0 : const sal_uInt16 nMap4End = 161; // ATTR_ENDINDEX
448 0 : const sal_uInt16 nMap4Count = nMap4End - nMap4Start + 1;
449 0 : const sal_uInt16 nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX
450 0 : pVersionMap4 = new sal_uInt16 [ nMap4Count ];
451 0 : for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ )
452 0 : pVersionMap4[i] = j;
453 : // zwei Eintraege eingefuegt...
454 0 : for ( i=nMap4New, j=nMap4Start+nMap4New+2; i < nMap4Count; i++, j++ )
455 0 : pVersionMap4[i] = j;
456 :
457 : // fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614
458 :
459 0 : const sal_uInt16 nMap5Start = 100; // ATTR_STARTINDEX
460 0 : const sal_uInt16 nMap5End = 163; // ATTR_ENDINDEX
461 0 : const sal_uInt16 nMap5Count = nMap5End - nMap5Start + 1;
462 0 : const sal_uInt16 nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX
463 0 : pVersionMap5 = new sal_uInt16 [ nMap5Count ];
464 0 : for ( i=0, j=nMap5Start; i < nMap5New; i++, j++ )
465 0 : pVersionMap5[i] = j;
466 : // 12 entries inserted
467 0 : for ( i=nMap5New, j=nMap5Start+nMap5New+12; i < nMap5Count; i++, j++ )
468 0 : pVersionMap5[i] = j;
469 :
470 : // sixth map: ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES added in 614d
471 :
472 0 : const sal_uInt16 nMap6Start = 100; // ATTR_STARTINDEX
473 0 : const sal_uInt16 nMap6End = 175; // ATTR_ENDINDEX
474 0 : const sal_uInt16 nMap6Count = nMap6End - nMap6Start + 1;
475 0 : const sal_uInt16 nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX
476 0 : pVersionMap6 = new sal_uInt16 [ nMap6Count ];
477 0 : for ( i=0, j=nMap6Start; i < nMap6New; i++, j++ )
478 0 : pVersionMap6[i] = j;
479 : // 3 entries inserted
480 0 : for ( i=nMap6New, j=nMap6Start+nMap6New+3; i < nMap6Count; i++, j++ )
481 0 : pVersionMap6[i] = j;
482 :
483 : // seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b
484 :
485 0 : const sal_uInt16 nMap7Start = 100; // ATTR_STARTINDEX
486 0 : const sal_uInt16 nMap7End = 178; // ATTR_ENDINDEX
487 0 : const sal_uInt16 nMap7Count = nMap7End - nMap7Start + 1;
488 0 : const sal_uInt16 nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX
489 0 : pVersionMap7 = new sal_uInt16 [ nMap7Count ];
490 0 : for ( i=0, j=nMap7Start; i < nMap7New; i++, j++ )
491 0 : pVersionMap7[i] = j;
492 : // 3 entries inserted
493 0 : for ( i=nMap7New, j=nMap7Start+nMap7New+3; i < nMap7Count; i++, j++ )
494 0 : pVersionMap7[i] = j;
495 :
496 : // eighth map: ATTR_VERTICAL_ASIAN added in 642q
497 :
498 0 : const sal_uInt16 nMap8Start = 100; // ATTR_STARTINDEX
499 0 : const sal_uInt16 nMap8End = 181; // ATTR_ENDINDEX
500 0 : const sal_uInt16 nMap8Count = nMap8End - nMap8Start + 1;
501 0 : const sal_uInt16 nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX
502 0 : pVersionMap8 = new sal_uInt16 [ nMap8Count ];
503 0 : for ( i=0, j=nMap8Start; i < nMap8New; i++, j++ )
504 0 : pVersionMap8[i] = j;
505 : // 1 entry inserted
506 0 : for ( i=nMap8New, j=nMap8Start+nMap8New+1; i < nMap8Count; i++, j++ )
507 0 : pVersionMap8[i] = j;
508 :
509 : // 9th map: ATTR_WRITINGDIR added in 643y
510 :
511 0 : const sal_uInt16 nMap9Start = 100; // ATTR_STARTINDEX
512 0 : const sal_uInt16 nMap9End = 182; // ATTR_ENDINDEX
513 0 : const sal_uInt16 nMap9Count = nMap9End - nMap9Start + 1;
514 0 : const sal_uInt16 nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX
515 0 : pVersionMap9 = new sal_uInt16 [ nMap9Count ];
516 0 : for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ )
517 0 : pVersionMap9[i] = j;
518 : // 1 entry inserted
519 0 : for ( i=nMap9New, j=nMap9Start+nMap9New+1; i < nMap9Count; i++, j++ )
520 0 : pVersionMap9[i] = j;
521 :
522 : // ATTR_PAGE_SCALETO added in 680/sab008
523 :
524 : // 10th map: ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
525 :
526 0 : const sal_uInt16 nMap10Start = 100; // ATTR_STARTINDEX
527 0 : const sal_uInt16 nMap10End = 184; // ATTR_ENDINDEX
528 0 : const sal_uInt16 nMap10Count = nMap10End - nMap10Start + 1;
529 0 : const sal_uInt16 nMap10New = 37; // ATTR_SHRINKTOFIT - ATTR_STARTINDEX
530 0 : pVersionMap10 = new sal_uInt16 [ nMap10Count ];
531 0 : for ( i=0, j=nMap10Start; i < nMap10New; i++, j++ )
532 0 : pVersionMap10[i] = j;
533 : // 3 entries inserted
534 0 : for ( i=nMap10New, j=nMap10Start+nMap10New+3; i < nMap10Count; i++, j++ )
535 0 : pVersionMap10[i] = j;
536 :
537 : // 11th map: ATTR_FONT_OVERLINE added in DEV300/overline2
538 :
539 0 : const sal_uInt16 nMap11Start = 100; // ATTR_STARTINDEX
540 0 : const sal_uInt16 nMap11End = 187; // ATTR_ENDINDEX
541 0 : const sal_uInt16 nMap11Count = nMap11End - nMap11Start + 1;
542 0 : const sal_uInt16 nMap11New = 5; // ATTR_FONT_OVERLINE - ATTR_STARTINDEX
543 0 : pVersionMap11 = new sal_uInt16 [ nMap11Count ];
544 0 : for ( i=0, j=nMap11Start; i < nMap11New; i++, j++ )
545 0 : pVersionMap11[i] = j;
546 : // 1 entry inserted
547 0 : for ( i=nMap11New, j=nMap11Start+nMap11New+1; i < nMap11Count; i++, j++ )
548 0 : pVersionMap11[i] = j;
549 :
550 0 : const sal_uInt16 nMap12Start = 100; // ATTR_STARTINDEX
551 0 : const sal_uInt16 nMap12End = 192; // ATTR_ENDINDEX
552 0 : const sal_uInt16 nMap12Count = nMap12End - nMap12Start + 1;
553 0 : const sal_uInt16 nMap12New = 55; // ATTR_HYPERLINK - ATTR_STARTINDEX
554 0 : pVersionMap12 = new sal_uInt16 [ nMap12Count ];
555 0 : for ( i=0, j=nMap12Start; i < nMap12New; i++, j++ )
556 0 : pVersionMap12[i] = j;
557 : // 1 entry inserted
558 0 : for ( i=nMap12New, j=nMap12Start+nMap12New+1; i < nMap12Count; i++, j++ )
559 0 : pVersionMap12[i] = j;
560 0 : }
561 :
562 0 : void ScDocumentPool::DeleteVersionMaps()
563 : {
564 : OSL_PRECOND( pVersionMap1 && pVersionMap2 &&
565 : pVersionMap3 && pVersionMap4 &&
566 : pVersionMap5 && pVersionMap6 &&
567 : pVersionMap7 && pVersionMap8 &&
568 : pVersionMap9 && pVersionMap10 &&
569 : pVersionMap11 && pVersionMap12 , "DeleteVersionMaps without maps" );
570 :
571 0 : delete[] pVersionMap12;
572 0 : pVersionMap12 = 0;
573 0 : delete[] pVersionMap11;
574 0 : pVersionMap11 = 0;
575 0 : delete[] pVersionMap10;
576 0 : pVersionMap10 = 0;
577 0 : delete[] pVersionMap9;
578 0 : pVersionMap9 = 0;
579 0 : delete[] pVersionMap8;
580 0 : pVersionMap8 = 0;
581 0 : delete[] pVersionMap7;
582 0 : pVersionMap7 = 0;
583 0 : delete[] pVersionMap6;
584 0 : pVersionMap6 = 0;
585 0 : delete[] pVersionMap5;
586 0 : pVersionMap5 = 0;
587 0 : delete[] pVersionMap4;
588 0 : pVersionMap4 = 0;
589 0 : delete[] pVersionMap3;
590 0 : pVersionMap3 = 0;
591 0 : delete[] pVersionMap2;
592 0 : pVersionMap2 = 0;
593 0 : delete[] pVersionMap1;
594 0 : pVersionMap1 = 0;
595 0 : }
596 :
597 : // Fuer die Pattern-Attribute (SetItems) kann der sal_uInt16 RefCount leicht ueberlaufen
598 : // (z.B. 600 ganze Zeilen abwechselnd formatieren).
599 : // Darum wird der RefCount bei SC_MAX_POOLREF festgehalten und nicht mehr hoch- oder
600 : // heruntergezaehlt. Dieser RefCount wird dann erst beim naechsten Laden neu gezaehlt.
601 : // Die Differenz zwischen SC_MAX_POOLREF und SC_SAFE_POOLREF ist ein wenig groesser
602 : // als noetig, um zu erkennen, wenn der RefCount aus Versehen doch "normal" veraendert
603 : // wird (Assertions).
604 :
605 :
606 0 : const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
607 : {
608 0 : if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special
609 0 : return SfxItemPool::Put( rItem, nWhich );
610 :
611 : // das Default-Pattern dieses Pools nicht kopieren
612 0 : if (&rItem == ppPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ])
613 0 : return rItem;
614 :
615 : // ansonsten muss Put immer passieren, weil es ein anderer Pool sein kann
616 0 : const SfxPoolItem& rNew = SfxItemPool::Put( rItem, nWhich );
617 0 : CheckRef( rNew );
618 0 : return rNew;
619 : }
620 :
621 0 : void ScDocumentPool::Remove( const SfxPoolItem& rItem )
622 : {
623 0 : if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special
624 : {
625 0 : sal_uLong nRef = rItem.GetRefCount();
626 0 : if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF )
627 : {
628 0 : if ( nRef != (sal_uLong) SC_SAFE_POOLREF )
629 : {
630 : OSL_FAIL("Who fiddles with my ref counts?");
631 0 : SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF );
632 : }
633 0 : return; // nicht herunterzaehlen
634 : }
635 : }
636 0 : SfxItemPool::Remove( rItem );
637 : }
638 :
639 0 : void ScDocumentPool::CheckRef( const SfxPoolItem& rItem )
640 : {
641 0 : sal_uLong nRef = rItem.GetRefCount();
642 0 : if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF )
643 : {
644 : // beim Apply vom Cache wird evtl. um 2 hochgezaehlt (auf MAX+1 oder SAFE+2),
645 : // heruntergezaehlt wird nur einzeln (in LoadCompleted)
646 : OSL_ENSURE( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2),
647 : "ScDocumentPool::CheckRef" );
648 0 : SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF );
649 : }
650 0 : }
651 :
652 0 : void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle )
653 : {
654 0 : sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN);
655 0 : for (sal_uInt32 i=0; i<nCount; i++)
656 : {
657 0 : ScPatternAttr* pPattern = (ScPatternAttr*)GetItem2(ATTR_PATTERN, i);
658 0 : if ( pPattern && pPattern->GetStyleSheet() == pStyle )
659 0 : pPattern->StyleToName();
660 : }
661 0 : }
662 :
663 0 : void ScDocumentPool::CellStyleCreated( const OUString& rName )
664 : {
665 : // If a style was created, don't keep any pattern with its name string in the pool,
666 : // because it would compare equal to a pattern with a pointer to the new style.
667 : // Calling StyleSheetChanged isn't enough because the pool may still contain items
668 : // for undo or clipboard content.
669 :
670 0 : sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN);
671 0 : for (sal_uInt32 i=0; i<nCount; i++)
672 : {
673 : ScPatternAttr *const pPattern =
674 : const_cast<ScPatternAttr*>(
675 0 : static_cast<ScPatternAttr const*>(GetItem2(ATTR_PATTERN, i)));
676 0 : if ( pPattern && pPattern->GetStyleSheet() == NULL )
677 : {
678 0 : const OUString* pStyleName = pPattern->GetStyleName();
679 0 : if ( pStyleName && *pStyleName == rName )
680 0 : pPattern->UpdateStyleSheet(); // find and store style pointer
681 : }
682 : }
683 0 : }
684 :
685 0 : SfxItemPool* ScDocumentPool::Clone() const
686 : {
687 0 : return new SfxItemPool (*this, true);
688 : }
689 :
690 0 : static SfxItemPresentation lcl_HFPresentation
691 : (
692 : const SfxPoolItem& rItem,
693 : SfxItemPresentation ePresentation,
694 : SfxMapUnit eCoreMetric,
695 : SfxMapUnit ePresentationMetric,
696 : OUString& rText,
697 : const IntlWrapper* pIntl
698 : )
699 : {
700 0 : const SfxItemSet& rSet = ((const SfxSetItem&)rItem).GetItemSet();
701 : const SfxPoolItem* pItem;
702 :
703 0 : if ( SFX_ITEM_SET == rSet.GetItemState(ATTR_PAGE_ON,false,&pItem) )
704 : {
705 0 : if( false == ((const SfxBoolItem*)pItem)->GetValue() )
706 0 : return SFX_ITEM_PRESENTATION_NONE;
707 : }
708 :
709 0 : SfxItemIter aIter( rSet );
710 0 : pItem = aIter.FirstItem();
711 0 : OUString aText;
712 0 : OUString aDel(" + ");
713 :
714 0 : while( pItem )
715 : {
716 0 : sal_uInt16 nWhich = pItem->Which();
717 :
718 0 : aText = "";
719 :
720 0 : switch( nWhich )
721 : {
722 : case ATTR_PAGE_ON:
723 : case ATTR_PAGE_DYNAMIC:
724 : case ATTR_PAGE_SHARED:
725 0 : break;
726 :
727 : case ATTR_LRSPACE:
728 : {
729 0 : SvxLRSpaceItem& rLRItem = (SvxLRSpaceItem&)*pItem;
730 0 : sal_uInt16 nPropLeftMargin = rLRItem.GetPropLeft();
731 0 : sal_uInt16 nPropRightMargin = rLRItem.GetPropRight();
732 : sal_uInt16 nLeftMargin, nRightMargin;
733 : long nTmp;
734 0 : nTmp = rLRItem.GetLeft();
735 0 : nLeftMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
736 0 : nTmp = rLRItem.GetRight();
737 0 : nRightMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
738 :
739 0 : aText = EE_RESSTR(RID_SVXITEMS_LRSPACE_LEFT);
740 0 : if ( 100 != nPropLeftMargin )
741 : {
742 0 : aText = aText + unicode::formatPercent(nPropLeftMargin,
743 0 : Application::GetSettings().GetUILanguageTag());
744 : }
745 : else
746 : {
747 0 : aText += GetMetricText( (long)nLeftMargin,
748 0 : eCoreMetric, ePresentationMetric, pIntl );
749 0 : aText += " " + EE_RESSTR(GetMetricId(ePresentationMetric));
750 : }
751 0 : aText += cpDelim;
752 :
753 : // nPropFirstLineOfst haben wir nicht
754 :
755 0 : aText += EE_RESSTR(RID_SVXITEMS_LRSPACE_RIGHT);
756 0 : if ( 100 != nPropRightMargin )
757 : {
758 0 : aText = aText + unicode::formatPercent(nPropLeftMargin,
759 0 : Application::GetSettings().GetUILanguageTag());
760 : }
761 : else
762 : {
763 0 : aText += GetMetricText( (long)nRightMargin,
764 0 : eCoreMetric, ePresentationMetric, pIntl );
765 0 : aText += " " + EE_RESSTR(GetMetricId(ePresentationMetric));
766 : }
767 : }
768 0 : break;
769 :
770 : default:
771 0 : if ( !pIntl )
772 0 : pIntl = ScGlobal::GetScIntlWrapper();
773 0 : pItem->GetPresentation( ePresentation, eCoreMetric, ePresentationMetric, aText, pIntl );
774 :
775 : }
776 :
777 0 : if ( aText.getLength() )
778 : {
779 0 : rText = rText + aText + aDel;
780 : }
781 :
782 0 : pItem = aIter.NextItem();
783 : }
784 :
785 0 : rText = comphelper::string::stripEnd(rText, ' ');
786 0 : rText = comphelper::string::stripEnd(rText, '+');
787 0 : rText = comphelper::string::stripEnd(rText, ' ');
788 0 : return ePresentation;
789 : }
790 :
791 0 : SfxItemPresentation ScDocumentPool::GetPresentation(
792 : const SfxPoolItem& rItem,
793 : SfxItemPresentation ePresentation,
794 : SfxMapUnit ePresentationMetric,
795 : OUString& rText,
796 : const IntlWrapper* pIntl ) const
797 : {
798 0 : sal_uInt16 nW = rItem.Which();
799 0 : OUString aStrYes ( ScGlobal::GetRscString(STR_YES) );
800 0 : OUString aStrNo ( ScGlobal::GetRscString(STR_NO) );
801 0 : OUString aStrSep(": ");
802 :
803 0 : switch( nW )
804 : {
805 : case ATTR_PAGE_TOPDOWN:
806 0 : switch ( ePresentation )
807 : {
808 : case SFX_ITEM_PRESENTATION_COMPLETE:
809 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_PRINTDIR) + aStrSep;
810 : // break; // DURCHFALLEN!!!
811 : case SFX_ITEM_PRESENTATION_NAMELESS:
812 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ?
813 : ScGlobal::GetRscString(STR_SCATTR_PAGE_TOPDOWN) :
814 0 : ScGlobal::GetRscString(STR_SCATTR_PAGE_LEFTRIGHT) ;
815 0 : break;
816 : default:
817 : {
818 : // added to avoid warnings
819 : }
820 : }
821 0 : break;
822 :
823 : case ATTR_PAGE_HEADERS:
824 0 : switch ( ePresentation )
825 : {
826 : case SFX_ITEM_PRESENTATION_COMPLETE:
827 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_HEADERS) + aStrSep;
828 : // break; // DURCHFALLEN!!!
829 : case SFX_ITEM_PRESENTATION_NAMELESS:
830 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ;
831 0 : break;
832 : default:
833 : {
834 : // added to avoid warnings
835 : }
836 : }
837 0 : break;
838 :
839 : case ATTR_PAGE_NULLVALS:
840 0 : switch ( ePresentation )
841 : {
842 : case SFX_ITEM_PRESENTATION_COMPLETE:
843 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NULLVALS) + aStrSep;
844 : // break; // DURCHFALLEN!!!
845 : case SFX_ITEM_PRESENTATION_NAMELESS:
846 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ;
847 0 : break;
848 : default:
849 : {
850 : // added to avoid warnings
851 : }
852 : }
853 0 : break;
854 :
855 : case ATTR_PAGE_FORMULAS:
856 0 : switch ( ePresentation )
857 : {
858 : case SFX_ITEM_PRESENTATION_COMPLETE:
859 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FORMULAS) + aStrSep;
860 : // break; // DURCHFALLEN!!!
861 : case SFX_ITEM_PRESENTATION_NAMELESS:
862 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ;
863 0 : break;
864 : default:
865 : {
866 : // added to avoid warnings
867 : }
868 : }
869 0 : break;
870 :
871 : case ATTR_PAGE_NOTES:
872 0 : switch ( ePresentation )
873 : {
874 : case SFX_ITEM_PRESENTATION_COMPLETE:
875 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NOTES) + aStrSep;
876 : // break; // DURCHFALLEN!!!
877 : case SFX_ITEM_PRESENTATION_NAMELESS:
878 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ;
879 0 : break;
880 : default:
881 : {
882 : // added to avoid warnings
883 : }
884 : }
885 0 : break;
886 :
887 : case ATTR_PAGE_GRID:
888 0 : switch ( ePresentation )
889 : {
890 : case SFX_ITEM_PRESENTATION_COMPLETE:
891 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_GRID) + aStrSep;
892 : // break; // DURCHFALLEN!!!
893 : case SFX_ITEM_PRESENTATION_NAMELESS:
894 0 : rText += ((const SfxBoolItem&)rItem).GetValue() ? aStrYes : aStrNo ;
895 0 : break;
896 : default:
897 : {
898 : // added to avoid warnings
899 : }
900 : }
901 0 : break;
902 :
903 : case ATTR_PAGE_SCALETOPAGES:
904 : {
905 0 : sal_uInt16 nPagNo = ((const SfxUInt16Item&)rItem).GetValue();
906 :
907 0 : if( nPagNo )
908 : {
909 0 : switch ( ePresentation )
910 : {
911 : case SFX_ITEM_PRESENTATION_COMPLETE:
912 : {
913 0 : rText = ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETOPAGES ) + aStrSep;
914 : }
915 : // break; // DURCHFALLEN!!!
916 : case SFX_ITEM_PRESENTATION_NAMELESS:
917 : {
918 0 : OUString aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) );
919 0 : aPages = aPages.replaceFirst( "%1", OUString::number( nPagNo ) );
920 0 : rText += aPages;
921 : }
922 0 : break;
923 : default:
924 : {
925 : // added to avoid warnings
926 : }
927 : }
928 : }
929 : else
930 : {
931 0 : ePresentation = SFX_ITEM_PRESENTATION_NONE;
932 : }
933 : }
934 0 : break;
935 :
936 : case ATTR_PAGE_FIRSTPAGENO:
937 : {
938 0 : sal_uInt16 nPagNo = ((const SfxUInt16Item&)rItem).GetValue();
939 :
940 0 : if( nPagNo )
941 : {
942 0 : switch ( ePresentation )
943 : {
944 : case SFX_ITEM_PRESENTATION_COMPLETE:
945 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FIRSTPAGENO) + aStrSep;
946 : // break; // DURCHFALLEN!!!
947 : case SFX_ITEM_PRESENTATION_NAMELESS:
948 0 : rText += OUString::number( nPagNo );
949 0 : break;
950 : default:
951 : {
952 : // added to avoid warnings
953 : }
954 : }
955 : }
956 : else
957 : {
958 0 : ePresentation = SFX_ITEM_PRESENTATION_NONE;
959 : }
960 : }
961 0 : break;
962 :
963 : case ATTR_PAGE_SCALE:
964 : {
965 0 : sal_uInt16 nPercent = ((const SfxUInt16Item&)rItem).GetValue();
966 :
967 0 : if( nPercent )
968 : {
969 0 : switch ( ePresentation )
970 : {
971 : case SFX_ITEM_PRESENTATION_COMPLETE:
972 0 : rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_SCALE) + aStrSep;
973 : // break; // DURCHFALLEN!!!
974 : case SFX_ITEM_PRESENTATION_NAMELESS:
975 0 : rText = rText + unicode::formatPercent(nPercent,
976 0 : Application::GetSettings().GetUILanguageTag());
977 0 : break;
978 : default:
979 : {
980 : // added to avoid warnings
981 : }
982 : }
983 : }
984 : else
985 : {
986 0 : ePresentation = SFX_ITEM_PRESENTATION_NONE;
987 : }
988 : }
989 0 : break;
990 :
991 : case ATTR_PAGE_HEADERSET:
992 : {
993 0 : OUString aBuffer;
994 :
995 0 : if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE )
996 : {
997 0 : rText = ScGlobal::GetRscString(STR_HEADER) + " ( " + aBuffer + " ) ";
998 0 : }
999 : }
1000 0 : break;
1001 :
1002 : case ATTR_PAGE_FOOTERSET:
1003 : {
1004 0 : OUString aBuffer;
1005 :
1006 0 : if( lcl_HFPresentation( rItem, ePresentation, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) != SFX_ITEM_PRESENTATION_NONE )
1007 : {
1008 0 : rText = ScGlobal::GetRscString(STR_FOOTER) + " ( " + aBuffer + " ) ";
1009 0 : }
1010 : }
1011 0 : break;
1012 :
1013 : default:
1014 0 : if ( !pIntl )
1015 0 : pIntl = ScGlobal::GetScIntlWrapper();
1016 0 : ePresentation = rItem.GetPresentation( ePresentation, GetMetric( nW ), ePresentationMetric, rText, pIntl );
1017 0 : break;
1018 : }
1019 :
1020 0 : return ePresentation;
1021 : }
1022 :
1023 0 : SfxMapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
1024 : {
1025 : // eigene Attribute: Twips, alles andere 1/100 mm
1026 :
1027 0 : if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
1028 0 : return SFX_MAPUNIT_TWIP;
1029 : else
1030 0 : return SFX_MAPUNIT_100TH_MM;
1031 : }
1032 :
1033 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|