1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 #include <hintids.hxx>
27 #include <tools/globname.hxx>
28 #include <vcl/mapmod.hxx>
29 #include <editeng/xmlcnitm.hxx>
30 #include <svl/macitem.hxx>
31 #include <editeng/pbinitem.hxx>
32 #include <editeng/keepitem.hxx>
33 #include <editeng/nlbkitem.hxx>
34 #include <editeng/hyznitem.hxx>
35 #include <editeng/protitem.hxx>
36 #include <editeng/ulspitem.hxx>
37 #include <editeng/prszitem.hxx>
38 #include <editeng/opaqitem.hxx>
39 #include <editeng/shaditem.hxx>
40 #include <editeng/prntitem.hxx>
41 #include <editeng/brkitem.hxx>
42 #include <editeng/tstpitem.hxx>
43 #include <editeng/langitem.hxx>
44 #include <editeng/wrlmitem.hxx>
45 #include <editeng/kernitem.hxx>
46 #include <editeng/escpitem.hxx>
47 #include <editeng/cscoitem.hxx>
48 #include <editeng/lrspitem.hxx>
49 #include <editeng/orphitem.hxx>
50 #include <editeng/widwitem.hxx>
51 #include <editeng/nhypitem.hxx>
52 #include <editeng/spltitem.hxx>
53 #include <editeng/lspcitem.hxx>
54 #include <editeng/blnkitem.hxx>
55 #include <editeng/akrnitem.hxx>
56 #include <editeng/emphitem.hxx>
57 #include <editeng/twolinesitem.hxx>
58 #include <editeng/scriptspaceitem.hxx>
59 #include <editeng/hngpnctitem.hxx>
60 #include <editeng/cmapitem.hxx>
61 #include <editeng/charscaleitem.hxx>
62 #include <editeng/charrotateitem.hxx>
63 #include <editeng/charreliefitem.hxx>
64 #include <editeng/frmdiritem.hxx>
65 #ifndef _SVX_DIALOGS_HRC
66 #include <svx/dialogs.hrc>
67 #endif
68 #include <editeng/swafopt.hxx>
69 #include <editeng/svxacorr.hxx>
70 #include <unotools/charclass.hxx>
71 #include <editeng/unolingu.hxx>
72 #include <editeng/forbiddenruleitem.hxx>
73 #include <editeng/paravertalignitem.hxx>
74 #include <editeng/pgrditem.hxx>
75 #include <editeng/charhiddenitem.hxx>
76 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
77 #include <comphelper/processfactory.hxx>
78 #include <unotools/collatorwrapper.hxx>
79 #include <unotools/syslocale.hxx>
80 #include <com/sun/star/i18n/CollatorOptions.hpp>
81 #include <unotools/transliterationwrapper.hxx>
82 #include <editeng/acorrcfg.hxx>
83 #include <vcl/svapp.hxx>
84 #include <fmtanchr.hxx>
85 #include <fmtornt.hxx>
86 #include <fmtsrnd.hxx>
87 #include <fmtfsize.hxx>
88 #include <fmtfld.hxx>
89 #include <fmtrfmrk.hxx>
90 #include <fmtlsplt.hxx>
91 #include <fmtrowsplt.hxx>
92 #include <fmteiro.hxx>
93 #include <fmtclds.hxx>
94 #include <fmturl.hxx>
95 #include <fmtcntnt.hxx>
96 #include <fmthdft.hxx>
97 #include <fmtpdsc.hxx>
98 #include <fmtftn.hxx>
99 #include <fmtfordr.hxx>
100 #include <fmtflcnt.hxx>
101 #include <fchrfmt.hxx>
102 #include <fmtautofmt.hxx>
103 #include <fmtinfmt.hxx>
104 #include <fmtcnct.hxx>
105 #include <fmtline.hxx>
106 #include <fmtftntx.hxx>
107 #include <fmtruby.hxx>
108 #include <fmtautofmt.hxx>
109 #include <tgrditem.hxx>
110 #include <hfspacingitem.hxx>
111 #include <editsh.hxx>
112 #include <pam.hxx>
113 #include <init.hxx>
114 #include <paratr.hxx>
115 #include <grfatr.hxx>
116 #include <tox.hxx>
117 #include <cellatr.hxx>
118 #include <tblafmt.hxx>
119 #include <viscrs.hxx>
120 #include <fntcache.hxx>
121 #include <doc.hxx>
122 #include <acmplwrd.hxx>
123 #include <fmtclbl.hxx>
124 #include <cmdid.h>
125 #include <breakit.hxx>
126 #include <checkit.hxx>
127 #include <swcalwrp.hxx>
128 #include <SwStyleNameMapper.hxx>
129
130 // OD 09.10.2003 #i18732#
131 #include <fmtfollowtextflow.hxx>
132 // OD 2004-05-05 #i28701#
133 #include <fmtwrapinfluenceonobjpos.hxx>
134
135 #include <fmtmeta.hxx>
136
137
138 using namespace ::com::sun::star;
139
140 extern void _FrmFinit();
141 extern void ClearFEShellTabCols();
142
143 /*************************************************************************
144 |* einige Bereiche fuer die Set in Collections / Nodes
145 |*************************************************************************/
146 // AttrSet-Range fuer die 2 Break-Attribute
147 sal_uInt16 __FAR_DATA aBreakSetRange[] = {
148 RES_PAGEDESC, RES_BREAK,
149 0 };
150
151 // AttrSet-Range fuer die TxtFmtColl
152 // OD 2008-02-27 #refactorlists# :
153 // list attributes ( RES_PARATR_LIST_BEGIN - RES_PARATR_LIST_END ) are not
154 // included in the paragraph style's itemset.
155 sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[] = {
156 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
157 RES_CHRATR_BEGIN, RES_CHRATR_END-1,
158 RES_PARATR_BEGIN, RES_PARATR_END-1,
159 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
160 0
161 };
162
163 // AttrSet-Range fuer die GrfFmtColl
164 sal_uInt16 __FAR_DATA aGrfFmtCollSetRange[] = {
165 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
166 RES_GRFATR_BEGIN, RES_GRFATR_END-1,
167 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
168 0
169 };
170
171 // AttrSet-Range fuer die TextNode
172 sal_uInt16 __FAR_DATA aTxtNodeSetRange[] = {
173 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
174 RES_CHRATR_BEGIN, RES_CHRATR_END-1,
175 RES_PARATR_BEGIN, RES_PARATR_END-1,
176 // --> OD 2008-02-25 #refactorlists#
177 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
178 // <--
179 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
180 0
181 };
182
183 // AttrSet-Range fuer die NoTxtNode
184 sal_uInt16 __FAR_DATA aNoTxtNodeSetRange[] = {
185 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
186 RES_GRFATR_BEGIN, RES_GRFATR_END-1,
187 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
188 0
189 };
190
191 sal_uInt16 __FAR_DATA aTableSetRange[] = {
192 RES_FILL_ORDER, RES_FRM_SIZE,
193 RES_LR_SPACE, RES_BREAK,
194 RES_BACKGROUND, RES_SHADOW,
195 RES_HORI_ORIENT, RES_HORI_ORIENT,
196 RES_KEEP, RES_KEEP,
197 RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT,
198 RES_FRAMEDIR, RES_FRAMEDIR,
199 // --> collapsing borders FME 2005-05-27 #i29550#
200 RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
201 // <-- collapsing
202 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
203 0
204 };
205
206 sal_uInt16 __FAR_DATA aTableLineSetRange[] = {
207 RES_FILL_ORDER, RES_FRM_SIZE,
208 RES_LR_SPACE, RES_UL_SPACE,
209 RES_BACKGROUND, RES_SHADOW,
210 RES_ROW_SPLIT, RES_ROW_SPLIT,
211 RES_PROTECT, RES_PROTECT,
212 RES_VERT_ORIENT, RES_VERT_ORIENT,
213 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
214 0
215 };
216
217 sal_uInt16 __FAR_DATA aTableBoxSetRange[] = {
218 RES_FILL_ORDER, RES_FRM_SIZE,
219 RES_LR_SPACE, RES_UL_SPACE,
220 RES_BACKGROUND, RES_SHADOW,
221 RES_PROTECT, RES_PROTECT,
222 RES_VERT_ORIENT, RES_VERT_ORIENT,
223 RES_FRAMEDIR, RES_FRAMEDIR,
224 RES_BOXATR_BEGIN, RES_BOXATR_END-1,
225 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
226 0
227 };
228
229 // AttrSet-Range fuer die SwFrmFmt
230 sal_uInt16 __FAR_DATA aFrmFmtSetRange[] = {
231 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
232 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
233 0
234 };
235
236 // AttrSet-Range fuer die SwCharFmt
237 sal_uInt16 __FAR_DATA aCharFmtSetRange[] = {
238 RES_CHRATR_BEGIN, RES_CHRATR_END-1,
239 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
240 0
241 };
242
243 // AttrSet-Range fuer die character autostyles
244 sal_uInt16 __FAR_DATA aCharAutoFmtSetRange[] = {
245 RES_CHRATR_BEGIN, RES_CHRATR_END-1,
246 RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
247 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
248 0
249 };
250
251 // AttrSet-Range fuer die SwPageDescFmt
252 sal_uInt16 __FAR_DATA aPgFrmFmtSetRange[] = {
253 RES_FRMATR_BEGIN, RES_FRMATR_END-1,
254 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
255 0
256 };
257
258 /******************************************************************************
259 * lege eine Tabelle fuer einen Zugriff auf die
260 * Default-Format-Attribute an
261 ******************************************************************************/
262 SwDfltAttrTab __FAR_DATA aAttrTab;
263
264 SfxItemInfo __FAR_DATA aSlotTab[] =
265 {
266 { SID_ATTR_CHAR_CASEMAP, SFX_ITEM_POOLABLE }, // RES_CHRATR_CASEMAP
267 { SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEM_POOLABLE }, // RES_CHRATR_CHARSETCOLOR
268 { SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE }, // RES_CHRATR_COLOR
269 { SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE }, // RES_CHRATR_CONTOUR
270 { SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE }, // RES_CHRATR_CROSSEDOUT
271 { SID_ATTR_CHAR_ESCAPEMENT, SFX_ITEM_POOLABLE }, // RES_CHRATR_ESCAPEMENT
272 { SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE }, // RES_CHRATR_FONT
273 { SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE }, // RES_CHRATR_FONTSIZE
274 { SID_ATTR_CHAR_KERNING, SFX_ITEM_POOLABLE }, // RES_CHRATR_KERNING
275 { SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE }, // RES_CHRATR_LANGUAGE
276 { SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE }, // RES_CHRATR_POSTURE
277 { SID_ATTR_CHAR_PROPSIZE, SFX_ITEM_POOLABLE }, // RES_CHRATR_PROPORTIONALFONTSIZE
278 { SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE }, // RES_CHRATR_SHADOWED
279 { SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE }, // RES_CHRATR_UNDERLINE
280 { SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE }, // RES_CHRATR_WEIGHT
281 { SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE }, // RES_CHRATR_WORDLINEMODE
282 { SID_ATTR_CHAR_AUTOKERN, SFX_ITEM_POOLABLE }, // RES_CHRATR_AUTOKERN
283 { SID_ATTR_FLASH, SFX_ITEM_POOLABLE }, // RES_CHRATR_BLINK
284 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_NOLINEBREAK
285 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_NOHYPHEN
286 { SID_ATTR_BRUSH_CHAR, SFX_ITEM_POOLABLE }, // RES_CHRATR_BACKGROUND
287 { SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE }, // RES_CHRATR_CJK_FONT
288 { SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE },// RES_CHRATR_CJK_FONTSIZE
289 { SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE }, // RES_CHRATR_CJK_LANGUAGE
290 { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE }, // RES_CHRATR_CJK_POSTURE
291 { SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE }, // RES_CHRATR_CJK_WEIGHT
292 { SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE }, // RES_CHRATR_CTL_FONT
293 { SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE },// RES_CHRATR_CTL_FONTSIZE
294 { SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE }, // RES_CHRATR_CTL_LANGUAGE
295 { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, // RES_CHRATR_CTL_POSTURE
296 { SID_ATTR_CHAR_CTL_WEIGHT, SFX_ITEM_POOLABLE }, // RES_CHRATR_CTL_WEIGHT
297 { SID_ATTR_CHAR_ROTATED, SFX_ITEM_POOLABLE }, // RES_CHRATR_ROTATE
298 { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, // RES_CHRATR_EMPHASIS_MARK
299 { SID_ATTR_CHAR_TWO_LINES, SFX_ITEM_POOLABLE }, // RES_CHRATR_TWO_LINES
300 { SID_ATTR_CHAR_SCALEWIDTH, SFX_ITEM_POOLABLE }, // RES_CHRATR_SCALEW
301 { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, // RES_CHRATR_RELIEF
302 { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE }, // RES_CHRATR_HIDDEN
303 { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // RES_CHRATR_OVERLINE
304 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY1
305 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY2
306 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_BIDIRTL
307 { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_IDCTHINT
308
309 { 0, 0 }, // RES_TXTATR_REFMARK
310 { 0, 0 }, // RES_TXTATR_TOXMARK
311 { 0, 0 }, // RES_TXTATR_META
312 { 0, 0 }, // RES_TXTATR_METAFIELD
313 { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_AUTOFMT
314 { FN_TXTATR_INET, 0 }, // RES_TXTATR_INETFMT
315 { 0, 0 }, // RES_TXTATR_CHARFMT
316 { SID_ATTR_CHAR_CJK_RUBY, 0 }, // RES_TXTATR_CJK_RUBY
317 { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_UNKNOWN_CONTAINER
318 { 0, 0 }, // RES_TXTATR_INPUTFIELD
319
320 { 0, 0 }, // RES_TXTATR_FIELD
321 { 0, 0 }, // RES_TXTATR_FLYCNT
322 { 0, 0 }, // RES_TXTATR_FTN
323 { 0, 0 }, // RES_TXTATR_ANNOTATION
324 { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY3
325 { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY1
326 { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY2
327
328 { SID_ATTR_PARA_LINESPACE, SFX_ITEM_POOLABLE }, // RES_PARATR_LINESPACING
329 { SID_ATTR_PARA_ADJUST, SFX_ITEM_POOLABLE }, // RES_PARATR_ADJUST
330 { SID_ATTR_PARA_SPLIT, SFX_ITEM_POOLABLE }, // RES_PARATR_SPLIT
331 { SID_ATTR_PARA_ORPHANS, SFX_ITEM_POOLABLE }, // RES_PARATR_ORPHANS
332 { SID_ATTR_PARA_WIDOWS, SFX_ITEM_POOLABLE }, // RES_PARATR_WIDOWS
333 { SID_ATTR_TABSTOP, SFX_ITEM_POOLABLE }, // RES_PARATR_TABSTOP
334 { SID_ATTR_PARA_HYPHENZONE, SFX_ITEM_POOLABLE }, // RES_PARATR_HYPHENZONE
335 { FN_FORMAT_DROPCAPS, 0 }, // RES_PARATR_DROP
336 { SID_ATTR_PARA_REGISTER, SFX_ITEM_POOLABLE }, // RES_PARATR_REGISTER
337 { SID_ATTR_PARA_NUMRULE, SFX_ITEM_POOLABLE }, // RES_PARATR_NUMRULE
338 { SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE }, // RES_PARATR_SCRIPTSPACE
339 { SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE },// RES_PARATR_HANGINGPUNCTUATION
340
341 { SID_ATTR_PARA_FORBIDDEN_RULES, SFX_ITEM_POOLABLE },// RES_PARATR_FORBIDDEN_RULES
342 { SID_PARA_VERTALIGN, SFX_ITEM_POOLABLE }, // RES_PARATR_VERTALIGN
343 { SID_ATTR_PARA_SNAPTOGRID, SFX_ITEM_POOLABLE }, // RES_PARATR_SNAPTOGRID
344 { SID_ATTR_BORDER_CONNECT, SFX_ITEM_POOLABLE }, // RES_PARATR_CONNECT_BORDER
345
346 { SID_ATTR_PARA_OUTLINE_LEVEL, SFX_ITEM_POOLABLE }, // RES_PARATR_OUTLINELEVEL //#outline level,zhaojianwei
347
348 { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ID
349 { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_LEVEL
350 { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ISRESTART
351 { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_RESTARTVALUE
352 { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ISCOUNTED
353
354 { 0, SFX_ITEM_POOLABLE }, // RES_FILL_ORDER
355 { 0, SFX_ITEM_POOLABLE }, // RES_FRM_SIZE
356 { SID_ATTR_PAGE_PAPERBIN, SFX_ITEM_POOLABLE }, // RES_PAPER_BIN
357 { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // RES_LR_SPACE
358 { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE }, // RES_UL_SPACE
359 { 0, 0 }, // RES_PAGEDESC
360 { SID_ATTR_PARA_PAGEBREAK, SFX_ITEM_POOLABLE }, // RES_BREAK
361 { 0, 0 }, // RES_CNTNT
362 { 0, SFX_ITEM_POOLABLE }, // RES_HEADER
363 { 0, SFX_ITEM_POOLABLE }, // RES_FOOTER
364 { 0, SFX_ITEM_POOLABLE }, // RES_PRINT
365 { FN_OPAQUE, SFX_ITEM_POOLABLE }, // RES_OPAQUE
366 { FN_SET_PROTECT, SFX_ITEM_POOLABLE }, // RES_PROTECT
367 { FN_SURROUND, SFX_ITEM_POOLABLE }, // RES_SURROUND
368 { FN_VERT_ORIENT, SFX_ITEM_POOLABLE }, // RES_VERT_ORIENT
369 { FN_HORI_ORIENT, SFX_ITEM_POOLABLE }, // RES_HORI_ORIENT
370 { 0, 0 }, // RES_ANCHOR
371 { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE }, // RES_BACKGROUND
372 { SID_ATTR_BORDER_OUTER, SFX_ITEM_POOLABLE }, // RES_BOX
373 { SID_ATTR_BORDER_SHADOW, SFX_ITEM_POOLABLE }, // RES_SHADOW
374 { SID_ATTR_MACROITEM, SFX_ITEM_POOLABLE }, // RES_FRMMACRO
375 { FN_ATTR_COLUMNS, SFX_ITEM_POOLABLE }, // RES_COL
376 { SID_ATTR_PARA_KEEP, SFX_ITEM_POOLABLE }, // RES_KEEP
377 { 0, SFX_ITEM_POOLABLE }, // RES_URL
378 { 0, SFX_ITEM_POOLABLE }, // RES_EDIT_IN_READONLY
379
380 { 0, SFX_ITEM_POOLABLE }, // RES_LAYOUT_SPLIT
381 { 0, 0 }, // RES_CHAIN
382 { 0, SFX_ITEM_POOLABLE }, // RES_TEXTGRID
383 { FN_FORMAT_LINENUMBER, SFX_ITEM_POOLABLE }, // RES_LINENUMBER
384 { 0, SFX_ITEM_POOLABLE }, // RES_FTN_AT_TXTEND
385 { 0, SFX_ITEM_POOLABLE }, // RES_END_AT_TXTEND
386 { 0, SFX_ITEM_POOLABLE }, // RES_COLUMNBALANCE
387
388 { SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // RES_FRAMEDIR
389
390 { SID_ATTR_HDFT_DYNAMIC_SPACING, SFX_ITEM_POOLABLE }, // RES_HEADER_FOOTER_EAT_SPACING
391 { FN_TABLE_ROW_SPLIT, SFX_ITEM_POOLABLE }, // RES_ROW_SPLIT
392 // DVO, OD 18.09.2003 #i18732# - use slot-id define in svx
393 { SID_SW_FOLLOW_TEXT_FLOW, SFX_ITEM_POOLABLE }, // RES_FOLLOW_TEXT_FLOW
394 // --> collapsing borders FME 2005-05-27 #i29550#
395 { SID_SW_COLLAPSING_BORDERS, SFX_ITEM_POOLABLE }, // RES_COLLAPSING_BORDERS
396 // <-- collapsing
397 // OD 2004-05-04 #i28701#
398 { SID_SW_WRAP_INFLUENCE_ON_OBJPOS, SFX_ITEM_POOLABLE }, // RES_WRAP_INFLUENCE_ON_OBJPOS
399 { 0, 0 }, // RES_AUTO_STYLE
400 { 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_STYLE_NAME
401 { 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_CONDITIONAL_STYLE_NAME
402
403 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_MIRRORGRF
404 { SID_ATTR_GRAF_CROP, SFX_ITEM_POOLABLE }, // RES_GRFATR_CROPGRF
405 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_ROTATION,
406 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_LUMINANCE,
407 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_CONTRAST,
408 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_CHANNELR,
409 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_CHANNELG,
410 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_CHANNELB,
411 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_GAMMA,
412 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_INVERT,
413 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_TRANSPARENCY,
414 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY1,
415 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY2,
416 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY3,
417 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY4,
418 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY5,
419 { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_DUMMY6,
420
421 { 0, SFX_ITEM_POOLABLE }, // RES_BOXATR_FORMAT
422 { 0, 0 }, // RES_BOXATR_FORMULA,
423 { 0, SFX_ITEM_POOLABLE }, // RES_BOXATR_VALUE
424
425 { 0, SFX_ITEM_POOLABLE } // RES_UNKNOWNATR_CONTAINER
426 };
427
428
429 sal_uInt16* SwAttrPool::pVersionMap1 = 0;
430 sal_uInt16* SwAttrPool::pVersionMap2 = 0;
431 sal_uInt16* SwAttrPool::pVersionMap3 = 0;
432 sal_uInt16* SwAttrPool::pVersionMap4 = 0;
433 // OD 2004-01-21 #i18732#
434 sal_uInt16* SwAttrPool::pVersionMap5 = 0;
435 sal_uInt16* SwAttrPool::pVersionMap6 = 0;
436 SwIndexReg* SwIndexReg::pEmptyIndexArray = 0;
437
438 const sal_Char* __FAR_DATA pMarkToTable = "table";
439 const sal_Char* __FAR_DATA pMarkToFrame = "frame";
440 const sal_Char* __FAR_DATA pMarkToRegion = "region";
441 const sal_Char* __FAR_DATA pMarkToText = "text";
442 const sal_Char* __FAR_DATA pMarkToOutline = "outline";
443 const sal_Char* __FAR_DATA pMarkToGraphic = "graphic";
444 const sal_Char* __FAR_DATA pMarkToOLE = "ole";
445
446 SvPtrarr *pGlobalOLEExcludeList = 0;
447
448 SwAutoCompleteWord* SwDoc::pACmpltWords = 0;
449
450 SwCheckIt* pCheckIt = 0;
451 CharClass* pAppCharClass = 0;
452
453 CollatorWrapper* pCollator = 0, *pCaseCollator = 0;
454 ::utl::TransliterationWrapper* pTransWrp = 0;
455
456 /******************************************************************************
457 * void _InitCore()
458 ******************************************************************************/
s_getCalendarWrapper()459 salhelper::SingletonRef<SwCalendarWrapper>* s_getCalendarWrapper()
460 {
461 static salhelper::SingletonRef<SwCalendarWrapper> aCalendarWrapper;
462 return &aCalendarWrapper;
463 }
_InitCore()464 void _InitCore()
465 {
466 SfxPoolItem* pItem;
467
468 // erstmal alle Attribut-Pointer auf 0 setzen
469 memset( aAttrTab, 0, (POOLATTR_END - POOLATTR_BEGIN) *
470 sizeof( SfxPoolItem* ) );
471
472 aAttrTab[ RES_CHRATR_CASEMAP- POOLATTR_BEGIN ] = new SvxCaseMapItem( SVX_CASEMAP_NOT_MAPPED, RES_CHRATR_CASEMAP);
473 aAttrTab[ RES_CHRATR_CHARSETCOLOR- POOLATTR_BEGIN ] = new SvxCharSetColorItem(RES_CHRATR_CHARSETCOLOR);
474 aAttrTab[ RES_CHRATR_COLOR- POOLATTR_BEGIN ] = new SvxColorItem(RES_CHRATR_COLOR);
475 aAttrTab[ RES_CHRATR_CONTOUR- POOLATTR_BEGIN ] = new SvxContourItem( sal_False, RES_CHRATR_CONTOUR );
476 aAttrTab[ RES_CHRATR_CROSSEDOUT- POOLATTR_BEGIN ] = new SvxCrossedOutItem( STRIKEOUT_NONE, RES_CHRATR_CROSSEDOUT );
477 aAttrTab[ RES_CHRATR_ESCAPEMENT- POOLATTR_BEGIN ] = new SvxEscapementItem( RES_CHRATR_ESCAPEMENT );
478 aAttrTab[ RES_CHRATR_FONT- POOLATTR_BEGIN ] = new SvxFontItem( RES_CHRATR_FONT );
479
480 aAttrTab[ RES_CHRATR_FONTSIZE- POOLATTR_BEGIN ] = new SvxFontHeightItem( 240, 100, RES_CHRATR_FONTSIZE );
481 aAttrTab[ RES_CHRATR_KERNING- POOLATTR_BEGIN ] = new SvxKerningItem( 0, RES_CHRATR_KERNING );
482 aAttrTab[ RES_CHRATR_LANGUAGE- POOLATTR_BEGIN ] = new SvxLanguageItem(LANGUAGE_DONTKNOW, RES_CHRATR_LANGUAGE );
483 aAttrTab[ RES_CHRATR_POSTURE- POOLATTR_BEGIN ] = new SvxPostureItem( ITALIC_NONE, RES_CHRATR_POSTURE );
484 aAttrTab[ RES_CHRATR_PROPORTIONALFONTSIZE- POOLATTR_BEGIN ] = new SvxPropSizeItem( 100, RES_CHRATR_PROPORTIONALFONTSIZE );
485 aAttrTab[ RES_CHRATR_SHADOWED- POOLATTR_BEGIN ] = new SvxShadowedItem( sal_False, RES_CHRATR_SHADOWED );
486 aAttrTab[ RES_CHRATR_UNDERLINE- POOLATTR_BEGIN ] = new SvxUnderlineItem( UNDERLINE_NONE, RES_CHRATR_UNDERLINE );
487 aAttrTab[ RES_CHRATR_WEIGHT- POOLATTR_BEGIN ] = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT );
488 aAttrTab[ RES_CHRATR_WORDLINEMODE- POOLATTR_BEGIN ] = new SvxWordLineModeItem( sal_False, RES_CHRATR_WORDLINEMODE );
489 aAttrTab[ RES_CHRATR_AUTOKERN- POOLATTR_BEGIN ] = new SvxAutoKernItem( sal_False, RES_CHRATR_AUTOKERN );
490 aAttrTab[ RES_CHRATR_BLINK - POOLATTR_BEGIN ] = new SvxBlinkItem( sal_False, RES_CHRATR_BLINK );
491 aAttrTab[ RES_CHRATR_NOHYPHEN - POOLATTR_BEGIN ] = new SvxNoHyphenItem( sal_True, RES_CHRATR_NOHYPHEN );
492 aAttrTab[ RES_CHRATR_NOLINEBREAK- POOLATTR_BEGIN ] = new SvxNoLinebreakItem( sal_True, RES_CHRATR_NOLINEBREAK );
493 aAttrTab[ RES_CHRATR_BACKGROUND - POOLATTR_BEGIN ] = new SvxBrushItem( RES_CHRATR_BACKGROUND );
494
495 // CJK-Attributes
496 aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ] = new SvxFontItem( RES_CHRATR_CJK_FONT );
497 aAttrTab[ RES_CHRATR_CJK_FONTSIZE - POOLATTR_BEGIN ] = new SvxFontHeightItem( 240, 100, RES_CHRATR_CJK_FONTSIZE );
498 aAttrTab[ RES_CHRATR_CJK_LANGUAGE - POOLATTR_BEGIN ] = new SvxLanguageItem(LANGUAGE_DONTKNOW, RES_CHRATR_CJK_LANGUAGE);
499 aAttrTab[ RES_CHRATR_CJK_POSTURE - POOLATTR_BEGIN ] = new SvxPostureItem(ITALIC_NONE, RES_CHRATR_CJK_POSTURE );
500 aAttrTab[ RES_CHRATR_CJK_WEIGHT - POOLATTR_BEGIN ] = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CJK_WEIGHT );
501
502 // CTL-Attributes
503 aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] = new SvxFontItem( RES_CHRATR_CTL_FONT );
504 aAttrTab[ RES_CHRATR_CTL_FONTSIZE - POOLATTR_BEGIN ] = new SvxFontHeightItem( 240, 100, RES_CHRATR_CTL_FONTSIZE );
505 aAttrTab[ RES_CHRATR_CTL_LANGUAGE - POOLATTR_BEGIN ] = new SvxLanguageItem(LANGUAGE_DONTKNOW, RES_CHRATR_CTL_LANGUAGE);
506 aAttrTab[ RES_CHRATR_CTL_POSTURE - POOLATTR_BEGIN ] = new SvxPostureItem(ITALIC_NONE, RES_CHRATR_CTL_POSTURE );
507 aAttrTab[ RES_CHRATR_CTL_WEIGHT - POOLATTR_BEGIN ] = new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CTL_WEIGHT );
508
509 aAttrTab[ RES_CHRATR_ROTATE - POOLATTR_BEGIN ] = new SvxCharRotateItem( 0, sal_False, RES_CHRATR_ROTATE );
510 aAttrTab[ RES_CHRATR_EMPHASIS_MARK - POOLATTR_BEGIN ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, RES_CHRATR_EMPHASIS_MARK );
511 aAttrTab[ RES_CHRATR_TWO_LINES - POOLATTR_BEGIN ] = new SvxTwoLinesItem( sal_False, 0, 0, RES_CHRATR_TWO_LINES );
512 aAttrTab[ RES_CHRATR_SCALEW - POOLATTR_BEGIN ] = new SvxCharScaleWidthItem( 100, RES_CHRATR_SCALEW );
513 aAttrTab[ RES_CHRATR_RELIEF - POOLATTR_BEGIN ] = new SvxCharReliefItem( RELIEF_NONE, RES_CHRATR_RELIEF );
514 aAttrTab[ RES_CHRATR_HIDDEN - POOLATTR_BEGIN ] = new SvxCharHiddenItem( sal_False, RES_CHRATR_HIDDEN );
515 aAttrTab[ RES_CHRATR_OVERLINE- POOLATTR_BEGIN ] = new SvxOverlineItem( UNDERLINE_NONE, RES_CHRATR_OVERLINE );
516
517 // CharakterAttr - Dummies
518 aAttrTab[ RES_CHRATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY1 );
519 aAttrTab[ RES_CHRATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY2 );
520 // CharakterAttr - Dummies
521
522 aAttrTab[ RES_TXTATR_REFMARK - POOLATTR_BEGIN ] = new SwFmtRefMark( aEmptyStr );
523 aAttrTab[ RES_TXTATR_TOXMARK - POOLATTR_BEGIN ] = new SwTOXMark;
524 aAttrTab[ RES_TXTATR_META - POOLATTR_BEGIN ] = SwFmtMeta::CreatePoolDefault(RES_TXTATR_META);
525 aAttrTab[ RES_TXTATR_METAFIELD - POOLATTR_BEGIN ] = SwFmtMeta::CreatePoolDefault(RES_TXTATR_METAFIELD);
526 aAttrTab[ RES_TXTATR_AUTOFMT- POOLATTR_BEGIN ] = new SwFmtAutoFmt;
527 aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] = new SwFmtINetFmt( aEmptyStr, aEmptyStr );
528 aAttrTab[ RES_TXTATR_CHARFMT- POOLATTR_BEGIN ] = new SwFmtCharFmt( 0 );
529 aAttrTab[ RES_TXTATR_CJK_RUBY - POOLATTR_BEGIN ] = new SwFmtRuby( aEmptyStr );
530 aAttrTab[ RES_TXTATR_UNKNOWN_CONTAINER - POOLATTR_BEGIN ] = new SvXMLAttrContainerItem( RES_TXTATR_UNKNOWN_CONTAINER );
531 aAttrTab[ RES_TXTATR_INPUTFIELD - POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_INPUTFIELD );
532
533 aAttrTab[ RES_TXTATR_FIELD- POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_FIELD );
534 aAttrTab[ RES_TXTATR_FLYCNT - POOLATTR_BEGIN ] = new SwFmtFlyCnt( 0 );
535 aAttrTab[ RES_TXTATR_FTN - POOLATTR_BEGIN ] = new SwFmtFtn;
536 aAttrTab[ RES_TXTATR_ANNOTATION - POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_ANNOTATION );
537
538 // TextAttr - Dummies
539 aAttrTab[ RES_TXTATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY3 );
540 aAttrTab[ RES_TXTATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY1 );
541 aAttrTab[ RES_TXTATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY2 );
542 // TextAttr - Dummies
543
544 aAttrTab[ RES_CHRATR_BIDIRTL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_BIDIRTL, sal_Int16(-1) );
545 aAttrTab[ RES_CHRATR_IDCTHINT - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_IDCTHINT, sal_Int16(-1) );
546
547 aAttrTab[ RES_PARATR_LINESPACING- POOLATTR_BEGIN ] = new SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, RES_PARATR_LINESPACING );
548 aAttrTab[ RES_PARATR_ADJUST- POOLATTR_BEGIN ] = new SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST );
549 aAttrTab[ RES_PARATR_SPLIT- POOLATTR_BEGIN ] = new SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT );
550 aAttrTab[ RES_PARATR_WIDOWS- POOLATTR_BEGIN ] = new SvxWidowsItem( 0, RES_PARATR_WIDOWS );
551 aAttrTab[ RES_PARATR_ORPHANS- POOLATTR_BEGIN ] = new SvxOrphansItem( 0, RES_PARATR_ORPHANS );
552 aAttrTab[ RES_PARATR_TABSTOP- POOLATTR_BEGIN ] = new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
553
554 pItem = new SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE );
555 ((SvxHyphenZoneItem*)pItem)->GetMaxHyphens() = 0; // Default z.Z. auf 0
556 aAttrTab[ RES_PARATR_HYPHENZONE- POOLATTR_BEGIN ] = pItem;
557
558 aAttrTab[ RES_PARATR_DROP- POOLATTR_BEGIN ] = new SwFmtDrop;
559 aAttrTab[ RES_PARATR_REGISTER - POOLATTR_BEGIN ] = new SwRegisterItem( sal_False );
560 aAttrTab[ RES_PARATR_NUMRULE - POOLATTR_BEGIN ] = new SwNumRuleItem( aEmptyStr );
561
562 aAttrTab[ RES_PARATR_SCRIPTSPACE - POOLATTR_BEGIN ] = new SvxScriptSpaceItem( sal_True, RES_PARATR_SCRIPTSPACE );
563 aAttrTab[ RES_PARATR_HANGINGPUNCTUATION - POOLATTR_BEGIN ] = new SvxHangingPunctuationItem( sal_True, RES_PARATR_HANGINGPUNCTUATION );
564 aAttrTab[ RES_PARATR_FORBIDDEN_RULES - POOLATTR_BEGIN ] = new SvxForbiddenRuleItem( sal_True, RES_PARATR_FORBIDDEN_RULES );
565 aAttrTab[ RES_PARATR_VERTALIGN - POOLATTR_BEGIN ] = new SvxParaVertAlignItem( 0, RES_PARATR_VERTALIGN );
566 aAttrTab[ RES_PARATR_SNAPTOGRID - POOLATTR_BEGIN ] = new SvxParaGridItem( sal_True, RES_PARATR_SNAPTOGRID );
567 aAttrTab[ RES_PARATR_CONNECT_BORDER - POOLATTR_BEGIN ] = new SwParaConnectBorderItem;
568
569 aAttrTab[ RES_PARATR_OUTLINELEVEL - POOLATTR_BEGIN ] = new SfxUInt16Item( RES_PARATR_OUTLINELEVEL, 0 );//#outline level,zhaojianwei
570
571 // --> OD 2008-02-19 #refactorlists#
572 aAttrTab[ RES_PARATR_LIST_ID - POOLATTR_BEGIN ] = new SfxStringItem( RES_PARATR_LIST_ID, aEmptyStr );
573 aAttrTab[ RES_PARATR_LIST_LEVEL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_PARATR_LIST_LEVEL, 0 );
574 aAttrTab[ RES_PARATR_LIST_ISRESTART - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISRESTART, sal_False );
575 aAttrTab[ RES_PARATR_LIST_RESTARTVALUE - POOLATTR_BEGIN ] = new SfxInt16Item( RES_PARATR_LIST_RESTARTVALUE, 1 );
576 aAttrTab[ RES_PARATR_LIST_ISCOUNTED - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_True );
577 // <--
578
579 aAttrTab[ RES_FILL_ORDER- POOLATTR_BEGIN ] = new SwFmtFillOrder;
580 aAttrTab[ RES_FRM_SIZE- POOLATTR_BEGIN ] = new SwFmtFrmSize;
581 aAttrTab[ RES_PAPER_BIN- POOLATTR_BEGIN ] = new SvxPaperBinItem( RES_PAPER_BIN );
582 aAttrTab[ RES_LR_SPACE- POOLATTR_BEGIN ] = new SvxLRSpaceItem( RES_LR_SPACE );
583 aAttrTab[ RES_UL_SPACE- POOLATTR_BEGIN ] = new SvxULSpaceItem( RES_UL_SPACE );
584 aAttrTab[ RES_PAGEDESC- POOLATTR_BEGIN ] = new SwFmtPageDesc;
585 aAttrTab[ RES_BREAK- POOLATTR_BEGIN ] = new SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK);
586 aAttrTab[ RES_CNTNT- POOLATTR_BEGIN ] = new SwFmtCntnt;
587 aAttrTab[ RES_HEADER- POOLATTR_BEGIN ] = new SwFmtHeader;
588 aAttrTab[ RES_FOOTER- POOLATTR_BEGIN ] = new SwFmtFooter;
589 aAttrTab[ RES_PRINT- POOLATTR_BEGIN ] = new SvxPrintItem( RES_PRINT );
590 aAttrTab[ RES_OPAQUE- POOLATTR_BEGIN ] = new SvxOpaqueItem( RES_OPAQUE );
591 aAttrTab[ RES_PROTECT- POOLATTR_BEGIN ] = new SvxProtectItem( RES_PROTECT );
592 aAttrTab[ RES_SURROUND- POOLATTR_BEGIN ] = new SwFmtSurround;
593 aAttrTab[ RES_VERT_ORIENT- POOLATTR_BEGIN ] = new SwFmtVertOrient;
594 aAttrTab[ RES_HORI_ORIENT- POOLATTR_BEGIN ] = new SwFmtHoriOrient;
595 aAttrTab[ RES_ANCHOR- POOLATTR_BEGIN ] = new SwFmtAnchor;
596 aAttrTab[ RES_BACKGROUND- POOLATTR_BEGIN ] = new SvxBrushItem( RES_BACKGROUND );
597 aAttrTab[ RES_BOX- POOLATTR_BEGIN ] = new SvxBoxItem( RES_BOX );
598 aAttrTab[ RES_SHADOW- POOLATTR_BEGIN ] = new SvxShadowItem( RES_SHADOW );
599 aAttrTab[ RES_FRMMACRO- POOLATTR_BEGIN ] = new SvxMacroItem( RES_FRMMACRO );
600 aAttrTab[ RES_COL- POOLATTR_BEGIN ] = new SwFmtCol;
601 aAttrTab[ RES_KEEP - POOLATTR_BEGIN ] = new SvxFmtKeepItem( sal_False, RES_KEEP );
602 aAttrTab[ RES_URL - POOLATTR_BEGIN ] = new SwFmtURL();
603 aAttrTab[ RES_EDIT_IN_READONLY - POOLATTR_BEGIN ] = new SwFmtEditInReadonly;
604 aAttrTab[ RES_LAYOUT_SPLIT - POOLATTR_BEGIN ] = new SwFmtLayoutSplit;
605 aAttrTab[ RES_CHAIN - POOLATTR_BEGIN ] = new SwFmtChain;
606 aAttrTab[ RES_TEXTGRID - POOLATTR_BEGIN ] = new SwTextGridItem;
607 aAttrTab[ RES_HEADER_FOOTER_EAT_SPACING - POOLATTR_BEGIN ] = new SwHeaderAndFooterEatSpacingItem;
608 aAttrTab[ RES_LINENUMBER - POOLATTR_BEGIN ] = new SwFmtLineNumber;
609 aAttrTab[ RES_FTN_AT_TXTEND - POOLATTR_BEGIN ] = new SwFmtFtnAtTxtEnd;
610 aAttrTab[ RES_END_AT_TXTEND - POOLATTR_BEGIN ] = new SwFmtEndAtTxtEnd;
611 aAttrTab[ RES_COLUMNBALANCE - POOLATTR_BEGIN ] = new SwFmtNoBalancedColumns;
612 aAttrTab[ RES_FRAMEDIR - POOLATTR_BEGIN ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, RES_FRAMEDIR );
613 aAttrTab[ RES_ROW_SPLIT - POOLATTR_BEGIN ] = new SwFmtRowSplit;
614
615 // OD 18.09.2003 #i18732#
616 aAttrTab[ RES_FOLLOW_TEXT_FLOW - POOLATTR_BEGIN ] = new SwFmtFollowTextFlow( sal_True );
617 // --> collapsing borders FME 2005-05-27 #i29550#
618 aAttrTab[ RES_COLLAPSING_BORDERS - POOLATTR_BEGIN ] = new SfxBoolItem( RES_COLLAPSING_BORDERS, sal_False );
619 // <-- collapsing
620 // OD 2004-05-04 #i28701#
621 // --> OD 2004-10-18 #i35017# - constant name has changed
622 aAttrTab[ RES_WRAP_INFLUENCE_ON_OBJPOS - POOLATTR_BEGIN ] =
623 new SwFmtWrapInfluenceOnObjPos( text::WrapInfluenceOnPosition::ONCE_CONCURRENT );
624 // <--
625 // FrmAttr-Dummies
626 aAttrTab[ RES_AUTO_STYLE - POOLATTR_BEGIN ] = new SwFmtAutoFmt( RES_AUTO_STYLE );
627 aAttrTab[ RES_FRMATR_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_STYLE_NAME, aEmptyStr );
628 aAttrTab[ RES_FRMATR_CONDITIONAL_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_CONDITIONAL_STYLE_NAME, aEmptyStr );
629 // FrmAttr-Dummies
630
631 aAttrTab[ RES_GRFATR_MIRRORGRF- POOLATTR_BEGIN ] = new SwMirrorGrf;
632 aAttrTab[ RES_GRFATR_CROPGRF- POOLATTR_BEGIN ] = new SwCropGrf;
633 aAttrTab[ RES_GRFATR_ROTATION - POOLATTR_BEGIN ] = new SwRotationGrf;
634 aAttrTab[ RES_GRFATR_LUMINANCE - POOLATTR_BEGIN ] = new SwLuminanceGrf;
635 aAttrTab[ RES_GRFATR_CONTRAST - POOLATTR_BEGIN ] = new SwContrastGrf;
636 aAttrTab[ RES_GRFATR_CHANNELR - POOLATTR_BEGIN ] = new SwChannelRGrf;
637 aAttrTab[ RES_GRFATR_CHANNELG - POOLATTR_BEGIN ] = new SwChannelGGrf;
638 aAttrTab[ RES_GRFATR_CHANNELB - POOLATTR_BEGIN ] = new SwChannelBGrf;
639 aAttrTab[ RES_GRFATR_GAMMA - POOLATTR_BEGIN ] = new SwGammaGrf;
640 aAttrTab[ RES_GRFATR_INVERT - POOLATTR_BEGIN ] = new SwInvertGrf;
641 aAttrTab[ RES_GRFATR_TRANSPARENCY - POOLATTR_BEGIN ] = new SwTransparencyGrf;
642 aAttrTab[ RES_GRFATR_DRAWMODE - POOLATTR_BEGIN ] = new SwDrawModeGrf;
643
644 // GraphicAttr - Dummies
645 aAttrTab[ RES_GRFATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_GRFATR_DUMMY1 );
646 aAttrTab[ RES_GRFATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_GRFATR_DUMMY2 );
647 aAttrTab[ RES_GRFATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_GRFATR_DUMMY3 );
648 aAttrTab[ RES_GRFATR_DUMMY4 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_GRFATR_DUMMY4 );
649 aAttrTab[ RES_GRFATR_DUMMY5 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_GRFATR_DUMMY5 );
650 // GraphicAttr - Dummies
651
652 aAttrTab[ RES_BOXATR_FORMAT- POOLATTR_BEGIN ] = new SwTblBoxNumFormat;
653 aAttrTab[ RES_BOXATR_FORMULA- POOLATTR_BEGIN ] = new SwTblBoxFormula( aEmptyStr );
654 aAttrTab[ RES_BOXATR_VALUE- POOLATTR_BEGIN ] = new SwTblBoxValue;
655
656 aAttrTab[ RES_UNKNOWNATR_CONTAINER- POOLATTR_BEGIN ] =
657 new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER );
658
659 // get the correct fonts:
660 ::GetDefaultFonts( *(SvxFontItem*)aAttrTab[ RES_CHRATR_FONT- POOLATTR_BEGIN ],
661 *(SvxFontItem*)aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ],
662 *(SvxFontItem*)aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] );
663
664 // 1. Version - neue Attribute:
665 // - RES_CHRATR_BLINK
666 // - RES_CHRATR_NOHYPHEN
667 // - RES_CHRATR_NOLINEBREAK
668 // - RES_PARATR_REGISTER
669 // + 2 Dummies fuer die einzelnen "Bereiche"
670 SwAttrPool::pVersionMap1 = new sal_uInt16[ 60 ];
671 sal_uInt16 i;
672 for( i = 1; i <= 17; i++ )
673 SwAttrPool::pVersionMap1[ i-1 ] = i;
674 for ( i = 18; i <= 27; ++i )
675 SwAttrPool::pVersionMap1[ i-1 ] = i + 5;
676 for ( i = 28; i <= 35; ++i )
677 SwAttrPool::pVersionMap1[ i-1 ] = i + 7;
678 for ( i = 36; i <= 58; ++i )
679 SwAttrPool::pVersionMap1[ i-1 ] = i + 10;
680 for ( i = 59; i <= 60; ++i )
681 SwAttrPool::pVersionMap1[ i-1 ] = i + 12;
682
683 // 2. Version - neue Attribute:
684 // 10 Dummies fuer den Frame "Bereich"
685 SwAttrPool::pVersionMap2 = new sal_uInt16[ 75 ];
686 for( i = 1; i <= 70; i++ )
687 SwAttrPool::pVersionMap2[ i-1 ] = i;
688 for ( i = 71; i <= 75; ++i )
689 SwAttrPool::pVersionMap2[ i-1 ] = i + 10;
690
691 // 3. Version - neue Attribute:
692 // neue Attribute und Dummies fuer die CJK-Version
693 // und neue Grafik-Attribute
694 SwAttrPool::pVersionMap3 = new sal_uInt16[ 86 ];
695 for( i = 1; i <= 21; i++ )
696 SwAttrPool::pVersionMap3[ i-1 ] = i;
697 for ( i = 22; i <= 27; ++i )
698 SwAttrPool::pVersionMap3[ i-1 ] = i + 15;
699 for ( i = 28; i <= 82; ++i )
700 SwAttrPool::pVersionMap3[ i-1 ] = i + 20;
701 for ( i = 83; i <= 86; ++i )
702 SwAttrPool::pVersionMap3[ i-1 ] = i + 35;
703
704 // 4. Version - neue Paragraph Attribute fuer die CJK-Version
705 SwAttrPool::pVersionMap4 = new sal_uInt16[ 121 ];
706 for( i = 1; i <= 65; i++ )
707 SwAttrPool::pVersionMap4[ i-1 ] = i;
708 for ( i = 66; i <= 121; ++i )
709 SwAttrPool::pVersionMap4[ i-1 ] = i + 9;
710
711 // OD 2004-01-21 #i18732# - setup new version map due to extension of
712 // the frame attributes (RES_FRMATR_*) for binary filters.
713 SwAttrPool::pVersionMap5 = new sal_uInt16[ 130 ];
714 for( i = 1; i <= 109; i++ )
715 SwAttrPool::pVersionMap5[ i-1 ] = i;
716 for ( i = 110; i <= 130; ++i )
717 SwAttrPool::pVersionMap5[ i-1 ] = i + 6;
718
719 // 6. Version - new character attribute for overlining plus 2 dummies
720 SwAttrPool::pVersionMap6 = new sal_uInt16[ 136 ];
721 for( i = 1; i <= 37; i++ )
722 SwAttrPool::pVersionMap6[ i-1 ] = i;
723 for ( i = 38; i <= 136; ++i )
724 SwAttrPool::pVersionMap6[ i-1 ] = i + 3;
725
726 uno::Reference<
727 lang::XMultiServiceFactory > xMSF =
728 ::comphelper::getProcessServiceFactory();
729
730 SwBreakIt::_Create( xMSF );
731 pCheckIt = NULL;
732 /*pAppCharClass = new CharClass(
733 xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));*/
734 //pCalendarWrapper = new SwCalendarWrapper( xMSF );
735
736 _FrmInit();
737 _TextInit();
738
739 SwSelPaintRects::pMapMode = new MapMode;
740 SwFntObj::pPixMap = new MapMode;
741
742 SwIndexReg::pEmptyIndexArray = new SwIndexReg;
743
744 pGlobalOLEExcludeList = new SvPtrarr;
745
746 const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
747 SwDoc::pACmpltWords = new SwAutoCompleteWord( rAFlags.nAutoCmpltListLen,
748 rAFlags.nAutoCmpltWordLen );
749 }
750
751 /******************************************************************************
752 * void _FinitCore()
753 ******************************************************************************/
754
755
756
_FinitCore()757 void _FinitCore()
758 {
759 _FrmFinit();
760 _TextFinit();
761
762 SwBreakIt::_Delete();
763 delete pCheckIt;
764 delete pAppCharClass;
765 delete pCollator;
766 delete pCaseCollator;
767
768 // das default TableAutoFormat zerstoeren
769 delete SwTableAutoFmt::pDfltBoxAutoFmt;
770
771 delete SwSelPaintRects::pMapMode;
772 delete SwFntObj::pPixMap;
773
774 delete SwEditShell::pAutoFmtFlags;
775
776 #ifdef DBG_UTIL
777 //Defaultattribut freigeben lassen um asserts zu vermeiden.
778 if ( aAttrTab[0]->GetRefCount() )
779 SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, sal_False);
780 #endif
781 delete SwDoc::pACmpltWords;
782
783 delete SwStyleNameMapper::pTextUINameArray;
784 delete SwStyleNameMapper::pListsUINameArray;
785 delete SwStyleNameMapper::pExtraUINameArray;
786 delete SwStyleNameMapper::pRegisterUINameArray;
787 delete SwStyleNameMapper::pDocUINameArray;
788 delete SwStyleNameMapper::pHTMLUINameArray;
789 delete SwStyleNameMapper::pFrmFmtUINameArray;
790 delete SwStyleNameMapper::pChrFmtUINameArray;
791 delete SwStyleNameMapper::pHTMLChrFmtUINameArray;
792 delete SwStyleNameMapper::pPageDescUINameArray;
793 delete SwStyleNameMapper::pNumRuleUINameArray;
794
795 // Delete programmatic name arrays also
796 delete SwStyleNameMapper::pTextProgNameArray;
797 delete SwStyleNameMapper::pListsProgNameArray;
798 delete SwStyleNameMapper::pExtraProgNameArray;
799 delete SwStyleNameMapper::pRegisterProgNameArray;
800 delete SwStyleNameMapper::pDocProgNameArray;
801 delete SwStyleNameMapper::pHTMLProgNameArray;
802 delete SwStyleNameMapper::pFrmFmtProgNameArray;
803 delete SwStyleNameMapper::pChrFmtProgNameArray;
804 delete SwStyleNameMapper::pHTMLChrFmtProgNameArray;
805 delete SwStyleNameMapper::pPageDescProgNameArray;
806 delete SwStyleNameMapper::pNumRuleProgNameArray;
807
808 // And finally, any hash tables that we used
809 delete SwStyleNameMapper::pParaUIMap;
810 delete SwStyleNameMapper::pCharUIMap;
811 delete SwStyleNameMapper::pPageUIMap;
812 delete SwStyleNameMapper::pFrameUIMap;
813 delete SwStyleNameMapper::pNumRuleUIMap;
814
815 delete SwStyleNameMapper::pParaProgMap;
816 delete SwStyleNameMapper::pCharProgMap;
817 delete SwStyleNameMapper::pPageProgMap;
818 delete SwStyleNameMapper::pFrameProgMap;
819 delete SwStyleNameMapper::pNumRuleProgMap;
820
821
822 // loesche alle default-Attribute
823 SfxPoolItem* pHt;
824 for( sal_uInt16 n = 0; n < POOLATTR_END - POOLATTR_BEGIN; n++ )
825 if( 0 != ( pHt = aAttrTab[n] ))
826 delete pHt;
827
828 ::ClearFEShellTabCols();
829
830 delete SwIndexReg::pEmptyIndexArray;
831 delete[] SwAttrPool::pVersionMap1;
832 delete[] SwAttrPool::pVersionMap2;
833 delete[] SwAttrPool::pVersionMap3;
834 delete[] SwAttrPool::pVersionMap4;
835 // OD 2004-01-21 #i18732#
836 delete[] SwAttrPool::pVersionMap5;
837 delete[] SwAttrPool::pVersionMap6;
838
839 for ( sal_uInt16 i = 0; i < pGlobalOLEExcludeList->Count(); ++i )
840 delete (SvGlobalName*)(*pGlobalOLEExcludeList)[i];
841 delete pGlobalOLEExcludeList;
842 }
843
844 // returns the APP - CharClass instance - used for all ToUpper/ToLower/...
GetAppCharClass()845 CharClass& GetAppCharClass()
846 {
847 if ( !pAppCharClass )
848 {
849 uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
850 pAppCharClass = new CharClass(
851 xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));
852 }
853 return *pAppCharClass;
854 }
855
LoadDefaultCalendar(sal_uInt16 eLang)856 void SwCalendarWrapper::LoadDefaultCalendar( sal_uInt16 eLang )
857 {
858 sUniqueId.Erase();
859 if( eLang != nLang )
860 loadDefaultCalendar( SvxCreateLocale( nLang = eLang ));
861 }
862
GetAppLanguage()863 LanguageType GetAppLanguage()
864 {
865 return Application::GetSettings().GetLanguage();
866 }
867
GetAppCollator()868 CollatorWrapper& GetAppCollator()
869 {
870 if( !pCollator )
871 {
872 const lang::Locale& rLcl = pBreakIt->GetLocale(
873 (LanguageType)GetAppLanguage() );
874 uno::Reference<
875 lang::XMultiServiceFactory > xMSF =
876 ::comphelper::getProcessServiceFactory();
877
878 pCollator = new CollatorWrapper( xMSF );
879 pCollator->loadDefaultCollator( rLcl, SW_COLLATOR_IGNORES );
880 }
881 return *pCollator;
882 }
GetAppCaseCollator()883 CollatorWrapper& GetAppCaseCollator()
884 {
885 if( !pCaseCollator )
886 {
887 const lang::Locale& rLcl = pBreakIt->GetLocale(
888 (LanguageType)GetAppLanguage() );
889 uno::Reference<
890 lang::XMultiServiceFactory > xMSF =
891 ::comphelper::getProcessServiceFactory();
892
893 pCaseCollator = new CollatorWrapper( xMSF );
894 pCaseCollator->loadDefaultCollator( rLcl, 0 );
895 }
896 return *pCaseCollator;
897 }
898
GetAppCmpStrIgnore()899 const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
900 {
901 if( !pTransWrp )
902 {
903 uno::Reference<
904 lang::XMultiServiceFactory > xMSF =
905 ::comphelper::getProcessServiceFactory();
906
907 pTransWrp = new ::utl::TransliterationWrapper( xMSF,
908 i18n::TransliterationModules_IGNORE_CASE |
909 i18n::TransliterationModules_IGNORE_KANA |
910 i18n::TransliterationModules_IGNORE_WIDTH );
911 pTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
912 }
913 return *pTransWrp;
914 }
915