LibreOffice Module sw (master)  1
xmlitemm.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <editeng/memberids.h>
21 #include <editeng/xmlcnitm.hxx>
22 #include <hintids.hxx>
23 #include <svx/unomid.hxx>
24 #include <xmloff/xmlnmspe.hxx>
25 #include "xmlitmap.hxx"
26 #include <xmloff/xmltoken.hxx>
27 
28 #include <unomid.h>
29 #include <fmtfsize.hxx>
30 
31 using namespace ::xmloff::token;
32 
33 #define MAP_ENTRY( p, l, w, m ) \
34  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), m }
35 #define M_E_SI( p, l, w, m ) \
36  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
37 #define M_E_SE( p, l, w, m ) \
38  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
39 #define M_E_SIE( p, l, w, m ) \
40  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
41 
42 #define M_END { 0, XML_TOKEN_INVALID, 0, 0 }
43 
45 {
46  // RES_FILL_ORDER
47  // not required
48  // RES_FRM_SIZE
51  // RES_PAPER_BIN
52  // not required
53  // TODO: RES_LR_SPACE
54  M_E_SE( FO, MARGIN, 0xFFFF/*invalid*/, MID_SW_FLAG_NO_ITEM_IMPORT),
57  // RES_UL_SPACE
60  // RES_PAGEDESC
62  // RES_BREAK
63  MAP_ENTRY( FO, BREAK_BEFORE, RES_BREAK, MID_BREAK_BEFORE ),
64  MAP_ENTRY( FO, BREAK_AFTER, RES_BREAK, MID_BREAK_AFTER ),
65  // RES_CNTNT
66  // not required
67  // RES_HEADER
68  // not required
69  // RES_FOOTER
70  // not required
71  // RES_PRINT
72  // not required
73  // RES_OPAQUE
74  // not required
75  // RES_PROTECT
76  // not required
77  // RES_SURROUND
78  // not required
79  // RES_VERT_ORIENT
80  // not required
81  // RES_HORI_ORIENT
83  // RES_ANCHOR
84  // not required
85  // RES_BACKGROUND
86  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
88  // RES_BOX
89  // not required
90  // RES_SHADOW
91  MAP_ENTRY( STYLE, SHADOW, RES_SHADOW, 0 ),
92  // RES_FRMMACRO
93  // not required
94  // RES_COL
95  // not required
96  // RES_KEEP
97  MAP_ENTRY( FO, KEEP_WITH_NEXT, RES_KEEP, 0 ),
98  // RES_URL
99  // not required
100  // RES_EDIT_IN_READONLY
101  // not required
102  // RES_LAYOUT_SPLIT
103  MAP_ENTRY( STYLE, MAY_BREAK_BETWEEN_ROWS, RES_LAYOUT_SPLIT, 0 ),
104  // RES_CHAIN
105  // not required
106  // RES_LINENUMBER
107  // not required
108  // RES_FTN_AT_TXTEND
109  // not required
110  // RES_END_AT_TXTEND
111  // not required
112  // RES_UNKNOWNATR_CONTAINER
113  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
114 
115  // RES_FRAMEDIR
116  MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
117 
118  // RES_COLLAPSING_BORDERS
119  MAP_ENTRY( TABLE, BORDER_MODEL, RES_COLLAPSING_BORDERS, 0 ),
120 
121  M_END
122 };
123 
125 {
126  M_E_SI( STYLE, COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_COL_WIDTH ),
127  MAP_ENTRY( STYLE, REL_COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_COL_WIDTH ),
128  M_END
129 };
130 
132 {
133  // RES_FILL_ORDER
134  // not required
135  // RES_FRM_SIZE
137  MAP_ENTRY( STYLE, MIN_ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_MIN_HEIGHT ),
138  // RES_PAPER_BIN
139  // not required
140  // RES_LR_SPACE
141  // not required
142  // RES_UL_SPACE
143  // not required
144  // RES_PAGEDESC
145  // not required
146  // RES_BREAK
147  // not required
148  // RES_CNTNT
149  // not required
150  // RES_HEADER
151  // not required
152  // RES_FOOTER
153  // not required
154  // RES_PRINT
155  // not required
156  // RES_OPAQUE
157  // not required
158  // RES_PROTECT
159  // not required
160  // RES_SURROUND
161  // not required
162  // RES_VERT_ORIENT
163  // not required
164  // RES_HORI_ORIENT
165  // not required
166  // RES_ANCHOR
167  // not required
168  // RES_BACKGROUND
169  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
171  // RES_BOX
172  // not required
173  // RES_ANCHOR
174  // not required
175  // RES_SHADOW
176  // not required
177  // RES_FRMMACRO
178  // not required
179  // RES_COL
180  // not required
181  // RES_KEEP
182  // not required
183  // RES_URL
184  // not required
185  // RES_EDIT_IN_READONLY
186  // not required
187  // RES_LAYOUT_SPLIT
188  M_E_SE( STYLE, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
189  M_E_SE( FO, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
190  // RES_CHAIN
191  // not required
192  // RES_LINENUMBER
193  // not required
194  // RES_FTN_AT_TXTEND
195  // not required
196  // RES_END_AT_TXTEND
197  // not required
198  // RES_UNKNOWNATR_CONTAINER
199  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
200  M_END
201 };
202 
204 {
205  // RES_FILL_ORDER
206  // not required
207  // RES_FRM_SIZE
208  // not required
209  // RES_PAPER_BIN
210  // not required
211  // RES_LR_SPACE
212  // not required
213  // RES_UL_SPACE
214  // not required
215  // RES_PAGEDESC
216  // not required
217  // RES_BREAK
218  // not required
219  // RES_CNTNT
220  // not required
221  // RES_HEADER
222  // not required
223  // RES_FOOTER
224  // not required
225  // RES_PRINT
226  // not required
227  // RES_OPAQUE
228  // not required
229  // RES_PROTECT
230  // not required
231  // RES_SURROUND
232  // not required
233  // RES_VERT_ORIENT
234  MAP_ENTRY( STYLE, VERTICAL_ALIGN, RES_VERT_ORIENT, 0 ),
235  // RES_HORI_ORIENT
236  // not required
237  // RES_ANCHOR
238  // not required
239  // RES_BACKGROUND
240  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
242  // RES_BOX
243  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH, RES_BOX, ALL_BORDER_LINE_WIDTH ),
244  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_LEFT, RES_BOX, LEFT_BORDER_LINE_WIDTH ),
245  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_RIGHT, RES_BOX, RIGHT_BORDER_LINE_WIDTH ),
246  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_TOP, RES_BOX, TOP_BORDER_LINE_WIDTH ),
247  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_BOTTOM, RES_BOX, BOTTOM_BORDER_LINE_WIDTH ),
248  MAP_ENTRY( FO, PADDING, RES_BOX, ALL_BORDER_PADDING ),
249  MAP_ENTRY( FO, PADDING_LEFT, RES_BOX, LEFT_BORDER_PADDING ),
250  MAP_ENTRY( FO, PADDING_RIGHT, RES_BOX, RIGHT_BORDER_PADDING ),
251  MAP_ENTRY( FO, PADDING_TOP, RES_BOX, TOP_BORDER_PADDING ),
252  MAP_ENTRY( FO, PADDING_BOTTOM, RES_BOX, BOTTOM_BORDER_PADDING ),
258  // RES_SHADOW
259  // not required
260  // RES_FRMMACRO
261  // not required
262  // RES_COL
263  // not required
264  // RES_KEEP
265  // not required
266  // RES_URL
267  // not required
268  // RES_EDIT_IN_READONLY
269  // not required
270  // RES_LAYOUT_SPLIT
271  // not required
272  // RES_CHAIN
273  // not required
274  // RES_LINENUMBER
275  // not required
276  // RES_FTN_AT_TXTEND
277  // not required
278  // RES_END_AT_TXTEND
279  // not required
280  // RES_UNKNOWNATR_CONTAINER
281  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
282 
283  // RES_FRAMEDIR
284  MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
285  MAP_ENTRY( LO_EXT, WRITING_MODE, RES_FRAMEDIR, 0 ),
286 
287  M_END
288 };
289 
290 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt8 MARGIN_TOP
#define RES_FRM_SIZE
Definition: hintids.hxx:196
#define M_E_SIE(p, l, w, m)
Definition: xmlitemm.cxx:39
#define RES_HORI_ORIENT
Definition: hintids.hxx:210
SvXMLItemMapEntry const aXMLTableItemMap[]
Definition: xmlitemm.cxx:44
#define MID_FRMSIZE_MIN_HEIGHT
Definition: unomid.h:79
#define RES_SHADOW
Definition: hintids.hxx:214
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
#define MID_SW_FLAG_ELEMENT_ITEM
Definition: xmlitmap.hxx:37
#define RES_FRAMEDIR
Definition: hintids.hxx:227
#define LEFT_BORDER_PADDING
BORDER_BOTTOM
#define MID_PAGEDESC_PAGENUMOFFSET
Definition: unomid.h:27
#define MID_BACK_COLOR
BORDER_LEFT
#define MAP_ENTRY(p, l, w, m)
Definition: xmlitemm.cxx:33
SvXMLItemMapEntry const aXMLTableColItemMap[]
Definition: xmlitemm.cxx:124
#define RES_UNKNOWNATR_CONTAINER
Definition: hintids.hxx:269
#define LEFT_BORDER
const sal_uInt16 ALIGN
#define TOP_BORDER_LINE_WIDTH
#define ALL_BORDER_LINE_WIDTH
#define M_END
Definition: xmlitemm.cxx:42
#define MID_FRMSIZE_REL_COL_WIDTH
Definition: unomid.h:82
#define RES_UL_SPACE
Definition: hintids.hxx:199
#define MID_FRMSIZE_FIX_HEIGHT
Definition: unomid.h:80
const sal_uInt8 MARGIN_BOTTOM
BORDER_TOP
#define RES_ROW_SPLIT
Definition: hintids.hxx:229
#define RES_BACKGROUND
Definition: hintids.hxx:212
#define MID_FRMSIZE_WIDTH
Definition: unomid.h:74
#define BORDER
Definition: drpcps.cxx:173
#define MID_L_MARGIN
#define BOTTOM_BORDER_PADDING
#define RES_VERT_ORIENT
Definition: hintids.hxx:209
#define TOP_BORDER
BORDER_RIGHT
#define RES_LAYOUT_SPLIT
Definition: hintids.hxx:220
#define TOP_BORDER_PADDING
#define MID_R_MARGIN
const sal_uInt8 MARGIN_LEFT
#define RES_LR_SPACE
Definition: hintids.hxx:198
const sal_uInt8 MARGIN_RIGHT
#define ALL_BORDER_PADDING
#define MID_SW_FLAG_NO_ITEM_IMPORT
Definition: xmlitmap.hxx:32
#define LEFT_BORDER_LINE_WIDTH
#define RIGHT_BORDER_LINE_WIDTH
#define M_E_SE(p, l, w, m)
Definition: xmlitemm.cxx:37
#define BOTTOM_BORDER
#define MID_BREAK_AFTER
#define RIGHT_BORDER_PADDING
#define RES_KEEP
Definition: hintids.hxx:217
const sal_uInt16 WIDTH
#define MID_LO_MARGIN
TABLE
SvXMLItemMapEntry const aXMLTableCellItemMap[]
Definition: xmlitemm.cxx:203
#define ALL_BORDER
#define RES_BOX
Definition: hintids.hxx:213
#define RIGHT_BORDER
#define MID_FRMSIZE_COL_WIDTH
Definition: unomid.h:81
#define M_E_SI(p, l, w, m)
Definition: xmlitemm.cxx:35
#define RES_COLLAPSING_BORDERS
Definition: hintids.hxx:231
#define RES_PAGEDESC
Definition: hintids.hxx:200
#define RES_BREAK
Definition: hintids.hxx:201
#define MID_BREAK_BEFORE
SvXMLItemMapEntry const aXMLTableRowItemMap[]
Definition: xmlitemm.cxx:131
#define BOTTOM_BORDER_LINE_WIDTH
TEXT
#define MID_UP_MARGIN