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