1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlitemm.cxx,v $
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>
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
[] =
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
),
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
),
70 MAP_ENTRY( FO
, MARGIN_TOP
, RES_UL_SPACE
, MID_UP_MARGIN
),
71 MAP_ENTRY( FO
, MARGIN_BOTTOM
, RES_UL_SPACE
, MID_LO_MARGIN
),
73 MAP_ENTRY( STYLE
, PAGE_NUMBER
, RES_PAGEDESC
, MID_PAGEDESC_PAGENUMOFFSET
),
75 MAP_ENTRY( FO
, BREAK_BEFORE
, RES_BREAK
, MID_BREAK_BEFORE
),
76 MAP_ENTRY( FO
, BREAK_AFTER
, RES_BREAK
, MID_BREAK_AFTER
),
94 MAP_ENTRY( TABLE
, ALIGN
, RES_HORI_ORIENT
, 0 ),
98 MAP_ENTRY( FO
, BACKGROUND_COLOR
, RES_BACKGROUND
, MID_BACK_COLOR
),
99 MAP_ENTRY( STYLE
, BACKGROUND_IMAGE
, RES_BACKGROUND
, MID_SW_FLAG_ELEMENT_ITEM
),
103 MAP_ENTRY( STYLE
, SHADOW
, RES_SHADOW
, 0 ),
109 MAP_ENTRY( FO
, KEEP_WITH_NEXT
, RES_KEEP
, 0 ),
112 // RES_EDIT_IN_READONLY
115 MAP_ENTRY( STYLE
, MAY_BREAK_BETWEEN_ROWS
, RES_LAYOUT_SPLIT
, 0 ),
124 // RES_UNKNOWNATR_CONTAINER
125 M_E_SE( TEXT
, XMLNS
, RES_UNKNOWNATR_CONTAINER
, 0 ),
128 MAP_ENTRY( STYLE
, WRITING_MODE
, RES_FRAMEDIR
, 0 ),
130 // RES_COLLAPSING_BORDERS
131 MAP_ENTRY( TABLE
, BORDER_MODEL
, RES_COLLAPSING_BORDERS
, 0 ),
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
),
143 SvXMLItemMapEntry aXMLTableRowItemMap
[] =
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
),
181 MAP_ENTRY( FO
, BACKGROUND_COLOR
, RES_BACKGROUND
, MID_BACK_COLOR
),
182 MAP_ENTRY( STYLE
, BACKGROUND_IMAGE
, RES_BACKGROUND
, MID_SW_FLAG_ELEMENT_ITEM
),
197 // RES_EDIT_IN_READONLY
200 M_E_SE( STYLE
, KEEP_TOGETHER
, RES_ROW_SPLIT
, 0 ),
201 M_E_SE( FO
, KEEP_TOGETHER
, RES_ROW_SPLIT
, 0 ),
210 // RES_UNKNOWNATR_CONTAINER
211 M_E_SE( TEXT
, XMLNS
, RES_UNKNOWNATR_CONTAINER
, 0 ),
215 SvXMLItemMapEntry aXMLTableCellItemMap
[] =
246 MAP_ENTRY( STYLE
, VERTICAL_ALIGN
, RES_VERT_ORIENT
, 0 ),
252 MAP_ENTRY( FO
, BACKGROUND_COLOR
, RES_BACKGROUND
, MID_BACK_COLOR
),
253 MAP_ENTRY( STYLE
, BACKGROUND_IMAGE
, RES_BACKGROUND
, MID_SW_FLAG_ELEMENT_ITEM
),
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
),
280 // RES_EDIT_IN_READONLY
292 // RES_UNKNOWNATR_CONTAINER
293 M_E_SE( TEXT
, XMLNS
, RES_UNKNOWNATR_CONTAINER
, 0 ),
296 MAP_ENTRY( STYLE
, WRITING_MODE
, RES_FRAMEDIR
, 0 ),