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