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 <hintids.hxx>
22 #include <svx/unomid.hxx>
23 #include <xmloff/xmlnamespace.hxx>
24 #include "xmlitmap.hxx"
25 #include <xmloff/xmltoken.hxx>
26 
27 #include <unomid.h>
28 
29 using namespace ::xmloff::token;
30 
31 #define MAP_ENTRY( p, l, w, m ) \
32  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), m }
33 #define M_E_SI( p, l, w, m ) \
34  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
35 #define M_E_SE( p, l, w, m ) \
36  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
37 #define M_E_SIE( p, l, w, m ) \
38  { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
39 
40 #define M_END { 0, XML_TOKEN_INVALID, 0, 0 }
41 
43 {
44  // RES_FILL_ORDER
45  // not required
46  // RES_FRM_SIZE
49  // RES_PAPER_BIN
50  // not required
51  // TODO: RES_LR_SPACE
52  M_E_SE( FO, MARGIN, 0xFFFF/*invalid*/, MID_SW_FLAG_NO_ITEM_IMPORT),
55  // RES_UL_SPACE
58  // RES_PAGEDESC
60  // RES_BREAK
61  MAP_ENTRY( FO, BREAK_BEFORE, RES_BREAK, MID_BREAK_BEFORE ),
62  MAP_ENTRY( FO, BREAK_AFTER, RES_BREAK, MID_BREAK_AFTER ),
63  // RES_CNTNT
64  // not required
65  // RES_HEADER
66  // not required
67  // RES_FOOTER
68  // not required
69  // RES_PRINT
70  // not required
71  // RES_OPAQUE
72  // not required
73  // RES_PROTECT
74  // not required
75  // RES_SURROUND
76  // not required
77  // RES_VERT_ORIENT
78  // not required
79  // RES_HORI_ORIENT
81  // RES_ANCHOR
82  // not required
83  // RES_BACKGROUND
84  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
86  // RES_BOX
87  // not required
88  // RES_SHADOW
89  MAP_ENTRY( STYLE, SHADOW, RES_SHADOW, 0 ),
90  // RES_FRMMACRO
91  // not required
92  // RES_COL
93  // not required
94  // RES_KEEP
95  MAP_ENTRY( FO, KEEP_WITH_NEXT, RES_KEEP, 0 ),
96  // RES_URL
97  // not required
98  // RES_EDIT_IN_READONLY
99  // not required
100  // RES_LAYOUT_SPLIT
101  MAP_ENTRY( STYLE, MAY_BREAK_BETWEEN_ROWS, RES_LAYOUT_SPLIT, 0 ),
102  // RES_CHAIN
103  // not required
104  // RES_LINENUMBER
105  // not required
106  // RES_FTN_AT_TXTEND
107  // not required
108  // RES_END_AT_TXTEND
109  // not required
110  // RES_UNKNOWNATR_CONTAINER
111  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
112 
113  // RES_FRAMEDIR
114  MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
115 
116  // RES_COLLAPSING_BORDERS
117  MAP_ENTRY( TABLE, BORDER_MODEL, RES_COLLAPSING_BORDERS, 0 ),
118 
119  M_END
120 };
121 
123 {
124  M_E_SI( STYLE, COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_COL_WIDTH ),
125  MAP_ENTRY( STYLE, REL_COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_COL_WIDTH ),
126  M_END
127 };
128 
130 {
131  // RES_FILL_ORDER
132  // not required
133  // RES_FRM_SIZE
135  MAP_ENTRY( STYLE, MIN_ROW_HEIGHT, RES_FRM_SIZE, MID_FRMSIZE_MIN_HEIGHT ),
136  // RES_PAPER_BIN
137  // not required
138  // RES_LR_SPACE
139  // not required
140  // RES_UL_SPACE
141  // not required
142  // RES_PAGEDESC
143  // not required
144  // RES_BREAK
145  // not required
146  // RES_CNTNT
147  // not required
148  // RES_HEADER
149  // not required
150  // RES_FOOTER
151  // not required
152  // RES_PRINT
153  // not required
154  // RES_OPAQUE
155  // not required
156  // RES_PROTECT
157  // not required
158  // RES_SURROUND
159  // not required
160  // RES_VERT_ORIENT
161  // not required
162  // RES_HORI_ORIENT
163  // not required
164  // RES_ANCHOR
165  // not required
166  // RES_BACKGROUND
167  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
169  // RES_BOX
170  // not required
171  // RES_ANCHOR
172  // not required
173  // RES_SHADOW
174  // not required
175  // RES_FRMMACRO
176  // not required
177  // RES_COL
178  // not required
179  // RES_KEEP
180  // not required
181  // RES_URL
182  // not required
183  // RES_EDIT_IN_READONLY
184  // not required
185  // RES_LAYOUT_SPLIT
186  M_E_SE( STYLE, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
187  M_E_SE( FO, KEEP_TOGETHER, RES_ROW_SPLIT, 0 ),
188  // RES_CHAIN
189  // not required
190  // RES_LINENUMBER
191  // not required
192  // RES_FTN_AT_TXTEND
193  // not required
194  // RES_END_AT_TXTEND
195  // not required
196  // RES_UNKNOWNATR_CONTAINER
197  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
198  M_END
199 };
200 
202 {
203  // RES_FILL_ORDER
204  // not required
205  // RES_FRM_SIZE
206  // not required
207  // RES_PAPER_BIN
208  // not required
209  // RES_LR_SPACE
210  // not required
211  // RES_UL_SPACE
212  // not required
213  // RES_PAGEDESC
214  // not required
215  // RES_BREAK
216  // not required
217  // RES_CNTNT
218  // not required
219  // RES_HEADER
220  // not required
221  // RES_FOOTER
222  // not required
223  // RES_PRINT
224  // not required
225  // RES_OPAQUE
226  // not required
227  // RES_PROTECT
228  // not required
229  // RES_SURROUND
230  // not required
231  // RES_VERT_ORIENT
232  MAP_ENTRY( STYLE, VERTICAL_ALIGN, RES_VERT_ORIENT, 0 ),
233  // RES_HORI_ORIENT
234  // not required
235  // RES_ANCHOR
236  // not required
237  // RES_BACKGROUND
238  MAP_ENTRY( FO, BACKGROUND_COLOR, RES_BACKGROUND, MID_BACK_COLOR ),
240  // RES_BOX
241  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH, RES_BOX, ALL_BORDER_LINE_WIDTH ),
242  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_LEFT, RES_BOX, LEFT_BORDER_LINE_WIDTH ),
243  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_RIGHT, RES_BOX, RIGHT_BORDER_LINE_WIDTH ),
244  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_TOP, RES_BOX, TOP_BORDER_LINE_WIDTH ),
245  MAP_ENTRY( STYLE, BORDER_LINE_WIDTH_BOTTOM, RES_BOX, BOTTOM_BORDER_LINE_WIDTH ),
246  MAP_ENTRY( FO, PADDING, RES_BOX, ALL_BORDER_PADDING ),
247  MAP_ENTRY( FO, PADDING_LEFT, RES_BOX, LEFT_BORDER_PADDING ),
248  MAP_ENTRY( FO, PADDING_RIGHT, RES_BOX, RIGHT_BORDER_PADDING ),
249  MAP_ENTRY( FO, PADDING_TOP, RES_BOX, TOP_BORDER_PADDING ),
250  MAP_ENTRY( FO, PADDING_BOTTOM, RES_BOX, BOTTOM_BORDER_PADDING ),
256  // RES_SHADOW
257  // not required
258  // RES_FRMMACRO
259  // not required
260  // RES_COL
261  // not required
262  // RES_KEEP
263  // not required
264  // RES_URL
265  // not required
266  // RES_EDIT_IN_READONLY
267  // not required
268  // RES_LAYOUT_SPLIT
269  // not required
270  // RES_CHAIN
271  // not required
272  // RES_LINENUMBER
273  // not required
274  // RES_FTN_AT_TXTEND
275  // not required
276  // RES_END_AT_TXTEND
277  // not required
278  // RES_UNKNOWNATR_CONTAINER
279  M_E_SE( TEXT, XMLNS, RES_UNKNOWNATR_CONTAINER, 0 ),
280 
281  // RES_FRAMEDIR
282  MAP_ENTRY( STYLE, WRITING_MODE, RES_FRAMEDIR, 0 ),
283  MAP_ENTRY( LO_EXT, WRITING_MODE, RES_FRAMEDIR, 0 ),
284 
285  M_END
286 };
287 
288 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt8 MARGIN_TOP
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
#define M_E_SIE(p, l, w, m)
Definition: xmlitemm.cxx:37
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
SvXMLItemMapEntry const aXMLTableItemMap[]
Definition: xmlitemm.cxx:42
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
#define MID_FRMSIZE_MIN_HEIGHT
Definition: unomid.h:79
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
#define MID_SW_FLAG_ELEMENT_ITEM
Definition: xmlitmap.hxx:37
#define LEFT_BORDER_PADDING
BORDER_BOTTOM
#define MID_PAGEDESC_PAGENUMOFFSET
Definition: unomid.h:27
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
#define MID_BACK_COLOR
BORDER_LEFT
#define MAP_ENTRY(p, l, w, m)
Definition: xmlitemm.cxx:31
SvXMLItemMapEntry const aXMLTableColItemMap[]
Definition: xmlitemm.cxx:122
#define LEFT_BORDER
const sal_uInt16 ALIGN
#define TOP_BORDER_LINE_WIDTH
constexpr TypedWhichId< SwFormatLayoutSplit > RES_LAYOUT_SPLIT(113)
#define ALL_BORDER_LINE_WIDTH
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
#define M_END
Definition: xmlitemm.cxx:40
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
#define MID_FRMSIZE_REL_COL_WIDTH
Definition: unomid.h:82
#define MID_FRMSIZE_FIX_HEIGHT
Definition: unomid.h:80
const sal_uInt8 MARGIN_BOTTOM
BORDER_TOP
constexpr TypedWhichId< SwFormatRowSplit > RES_ROW_SPLIT(122)
#define MID_FRMSIZE_WIDTH
Definition: unomid.h:74
#define BORDER
Definition: drpcps.cxx:172
#define MID_L_MARGIN
#define BOTTOM_BORDER_PADDING
#define TOP_BORDER
constexpr TypedWhichId< SfxBoolItem > RES_COLLAPSING_BORDERS(124)
BORDER_RIGHT
#define TOP_BORDER_PADDING
#define MID_R_MARGIN
const sal_uInt8 MARGIN_LEFT
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:35
#define BOTTOM_BORDER
#define MID_BREAK_AFTER
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
#define RIGHT_BORDER_PADDING
const sal_uInt16 WIDTH
#define MID_LO_MARGIN
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
TABLE
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
SvXMLItemMapEntry const aXMLTableCellItemMap[]
Definition: xmlitemm.cxx:201
#define ALL_BORDER
#define RIGHT_BORDER
#define MID_FRMSIZE_COL_WIDTH
Definition: unomid.h:81
#define M_E_SI(p, l, w, m)
Definition: xmlitemm.cxx:33
#define MID_BREAK_BEFORE
SvXMLItemMapEntry const aXMLTableRowItemMap[]
Definition: xmlitemm.cxx:129
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
#define BOTTOM_BORDER_LINE_WIDTH
TEXT
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
#define MID_UP_MARGIN