update dev300-m58
[ooovba.git] / sw / source / filter / xml / xmlitemm.cxx
blob32c0b1f61218de6e9c0079343fe4c3b877a06b35
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlitemm.cxx,v $
10 * $Revision: 1.19 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
36 #include <hintids.hxx>
37 #include <svx/unomid.hxx>
38 #include <xmloff/xmlnmspe.hxx>
39 #include "xmlitmap.hxx"
40 #include <xmloff/xmltoken.hxx>
42 #ifndef _UNOMID_H
43 #include <unomid.h>
44 #endif
46 using namespace ::xmloff::token;
48 #define MAP_ENTRY( p, l, w, m ) \
49 { XML_NAMESPACE_##p, XML_##l, w, m }
50 #define M_E_SI( p, l, w, m ) \
51 { XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
52 #define M_E_SE( p, l, w, m ) \
53 { XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
55 #define M_END { 0, XML_TOKEN_INVALID, 0, 0 }
57 SvXMLItemMapEntry aXMLTableItemMap[] =
59 // RES_FILL_ORDER
60 // not required
61 // RES_FRM_SIZE
62 M_E_SE( STYLE, WIDTH, RES_FRM_SIZE, MID_FRMSIZE_WIDTH ),
63 M_E_SE( STYLE, REL_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_WIDTH ),
64 // RES_PAPER_BIN
65 // not required
66 // TODO: RES_LR_SPACE
67 M_E_SE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
68 M_E_SE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
69 // RES_UL_SPACE
70 MAP_ENTRY( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
71 MAP_ENTRY( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
72 // RES_PAGEDESC
73 MAP_ENTRY( STYLE, PAGE_NUMBER, RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET),
74 // RES_BREAK
75 MAP_ENTRY( FO, BREAK_BEFORE, RES_BREAK, MID_BREAK_BEFORE ),
76 MAP_ENTRY( FO, BREAK_AFTER, RES_BREAK, MID_BREAK_AFTER ),
77 // RES_CNTNT
78 // not required
79 // RES_HEADER
80 // not required
81 // RES_FOOTER
82 // not required
83 // RES_PRINT
84 // not required
85 // RES_OPAQUE
86 // not required
87 // RES_PROTECT
88 // not required
89 // RES_SURROUND
90 // not required
91 // RES_VERT_ORIENT
92 // not required
93 // RES_HORI_ORIENT
94 MAP_ENTRY( TABLE, ALIGN, RES_HORI_ORIENT, 0 ),
95 // RES_ANCHOR
96 // not required
97 // RES_BACKGROUND
98 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
99 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
100 // RES_BOX
101 // not required
102 // RES_SHADOW
103 MAP_ENTRY( STYLE, SHADOW, RES_SHADOW, 0 ),
104 // RES_FRMMACRO
105 // not required
106 // RES_COL
107 // not required
108 // RES_KEEP
109 MAP_ENTRY( FO, KEEP_WITH_NEXT, RES_KEEP, 0 ),
110 // RES_URL
111 // not required
112 // RES_EDIT_IN_READONLY
113 // not required
114 // RES_LAYOUT_SPLIT
115 MAP_ENTRY( STYLE, MAY_BREAK_BETWEEN_ROWS, RES_LAYOUT_SPLIT, 0 ),
116 // RES_CHAIN
117 // not required
118 // RES_LINENUMBER
119 // not required
120 // RES_FTN_AT_TXTEND
121 // not required
122 // RES_END_AT_TXTEND
123 // not required
124 // RES_UNKNOWNATR_CONTAINER
125 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
127 // RES_FRAMEDIR
128 MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
130 // RES_COLLAPSING_BORDERS
131 MAP_ENTRY( TABLE, BORDER_MODEL, RES_COLLAPSING_BORDERS, 0 ),
133 M_END
136 SvXMLItemMapEntry aXMLTableColItemMap[] =
138 M_E_SI( STYLE, COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_COL_WIDTH ),
139 MAP_ENTRY( STYLE, REL_COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_COL_WIDTH ),
140 M_END
143 SvXMLItemMapEntry aXMLTableRowItemMap[] =
145 // RES_FILL_ORDER
146 // not required
147 // RES_FRM_SIZE
148 MAP_ENTRY( STYLE, ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_FIX_HEIGHT ),
149 MAP_ENTRY( STYLE, MIN_ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_MIN_HEIGHT ),
150 // RES_PAPER_BIN
151 // not required
152 // RES_LR_SPACE
153 // not required
154 // RES_UL_SPACE
155 // not required
156 // RES_PAGEDESC
157 // not required
158 // RES_BREAK
159 // not required
160 // RES_CNTNT
161 // not required
162 // RES_HEADER
163 // not required
164 // RES_FOOTER
165 // not required
166 // RES_PRINT
167 // not required
168 // RES_OPAQUE
169 // not required
170 // RES_PROTECT
171 // not required
172 // RES_SURROUND
173 // not required
174 // RES_VERT_ORIENT
175 // not required
176 // RES_HORI_ORIENT
177 // not required
178 // RES_ANCHOR
179 // not required
180 // RES_BACKGROUND
181 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
182 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
183 // RES_BOX
184 // not required
185 // RES_ANCHOR
186 // not required
187 // RES_SHADOW
188 // not required
189 // RES_FRMMACRO
190 // not required
191 // RES_COL
192 // not required
193 // RES_KEEP
194 // not required
195 // RES_URL
196 // not required
197 // RES_EDIT_IN_READONLY
198 // not required
199 // RES_LAYOUT_SPLIT
200 M_E_SE( STYLE, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
201 M_E_SE( FO, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
202 // RES_CHAIN
203 // not required
204 // RES_LINENUMBER
205 // not required
206 // RES_FTN_AT_TXTEND
207 // not required
208 // RES_END_AT_TXTEND
209 // not required
210 // RES_UNKNOWNATR_CONTAINER
211 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
212 M_END
215 SvXMLItemMapEntry aXMLTableCellItemMap[] =
217 // RES_FILL_ORDER
218 // not required
219 // RES_FRM_SIZE
220 // not required
221 // RES_PAPER_BIN
222 // not required
223 // RES_LR_SPACE
224 // not required
225 // RES_UL_SPACE
226 // not required
227 // RES_PAGEDESC
228 // not required
229 // RES_BREAK
230 // not required
231 // RES_CNTNT
232 // not required
233 // RES_HEADER
234 // not required
235 // RES_FOOTER
236 // not required
237 // RES_PRINT
238 // not required
239 // RES_OPAQUE
240 // not required
241 // RES_PROTECT
242 // not required
243 // RES_SURROUND
244 // not required
245 // RES_VERT_ORIENT
246 MAP_ENTRY( STYLE, VERTICAL_ALIGN, RES_VERT_ORIENT, 0 ),
247 // RES_HORI_ORIENT
248 // not required
249 // RES_ANCHOR
250 // not required
251 // RES_BACKGROUND
252 MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
253 MAP_ENTRY( STYLE, BACKGROUND_IMAGE, RES_BACKGROUND, MID_SW_FLAG_ELEMENT_ITEM ),
254 // RES_BOX
255 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH, RES_BOX, ALL_BORDER_LINE_WIDTH ),
256 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_LEFT, RES_BOX, LEFT_BORDER_LINE_WIDTH ),
257 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_RIGHT, RES_BOX, RIGHT_BORDER_LINE_WIDTH ),
258 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_TOP, RES_BOX, TOP_BORDER_LINE_WIDTH ),
259 MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_BOTTOM, RES_BOX, BOTTOM_BORDER_LINE_WIDTH ),
260 MAP_ENTRY( FO, PADDING, RES_BOX, ALL_BORDER_PADDING ),
261 MAP_ENTRY( FO, PADDING_LEFT, RES_BOX, LEFT_BORDER_PADDING ),
262 MAP_ENTRY( FO, PADDING_RIGHT, RES_BOX, RIGHT_BORDER_PADDING ),
263 MAP_ENTRY( FO, PADDING_TOP, RES_BOX, TOP_BORDER_PADDING ),
264 MAP_ENTRY( FO, PADDING_BOTTOM, RES_BOX, BOTTOM_BORDER_PADDING ),
265 MAP_ENTRY( FO, BORDER, RES_BOX, ALL_BORDER ),
266 MAP_ENTRY( FO, BORDER_LEFT, RES_BOX, LEFT_BORDER ),
267 MAP_ENTRY( FO, BORDER_RIGHT, RES_BOX, RIGHT_BORDER ),
268 MAP_ENTRY( FO, BORDER_TOP, RES_BOX, TOP_BORDER ),
269 MAP_ENTRY( FO, BORDER_BOTTOM, RES_BOX, BOTTOM_BORDER ),
270 // RES_SHADOW
271 // not required
272 // RES_FRMMACRO
273 // not required
274 // RES_COL
275 // not required
276 // RES_KEEP
277 // not required
278 // RES_URL
279 // not required
280 // RES_EDIT_IN_READONLY
281 // not required
282 // RES_LAYOUT_SPLIT
283 // not required
284 // RES_CHAIN
285 // not required
286 // RES_LINENUMBER
287 // not required
288 // RES_FTN_AT_TXTEND
289 // not required
290 // RES_END_AT_TXTEND
291 // not required
292 // RES_UNKNOWNATR_CONTAINER
293 M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
295 // RES_FRAMEDIR
296 MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
298 M_END