LibreOffice Module xmloff (master) 1
controlpropertymap.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 <rtl/ref.hxx>
22#include <xmloff/xmltoken.hxx>
23#include <xmloff/maptype.hxx>
24#include <xmloff/xmltypes.hxx>
25#include <algorithm>
26#include "strings.hxx"
27#include <xmloff/contextid.hxx>
29#include <xmlprop.hxx>
30
31#include <string.h>
32
33using namespace ::xmloff::token;
34
35namespace xmloff
36{
37
38#define MAP_ASCII( name, prefix, token, type, context ) { name, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFSVER_010, false }
39#define MAP_CONST( name, prefix, token, type, context ) { name, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFSVER_010, false }
40#define MAP_CONST_P( name, prefix, token, type, context ){ name, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFSVER_010, false }
41#define MAP_END() { nullptr }
42
44 {
60
65
73
75
79 MAP_END()
80 };
81
83 {
85 }
86
88 {
89 static bool bSorted = false;
90 if (!bSorted)
91 {
92 XMLPropertyMapEntry const * pEnd;
93 // determine the last element
94 for ( pEnd = aControlStyleProperties; !pEnd->IsEnd(); ++pEnd)
95 ;
96 assert( ::std::is_sorted(aControlStyleProperties, pEnd,
97 [](const XMLPropertyMapEntry& _rLeft, const XMLPropertyMapEntry& _rRight)
98 { return _rLeft.getApiName() < _rRight.getApiName(); }) );
99 bSorted = true;
100 }
101 }
102
103 //= OFormComponentStyleExportMapper
105 :SvXMLExportPropertyMapper( _rMapper )
106 {
107 }
108
110 const SvXMLNamespaceMap& _rNamespaceMap, const ::std::vector< XMLPropertyState >* _pProperties,
111 sal_uInt32 _nIdx ) const
112 {
113 // ignore the number style of grid columns - this is formatted elsewhere
114 if ( CTF_FORMS_DATA_STYLE != getPropertySetMapper()->GetEntryContextId( _rProperty.mnIndex ) )
115 SvXMLExportPropertyMapper::handleSpecialItem( _rAttrList, _rProperty, _rUnitConverter, _rNamespaceMap, _pProperties, _nIdx );
116 }
117
118} // namespace xmloff
119
120/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void handleSpecialItem(comphelper::AttributeList &rAttrList, const XMLPropertyState &rProperty, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
Definition: xmlexppr.cxx:848
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1110
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:83
OFormComponentStyleExportMapper(const rtl::Reference< XMLPropertySetMapper > &_rMapper)
void handleSpecialItem(comphelper::AttributeList &_rAttrList, const XMLPropertyState &_rProperty, const SvXMLUnitConverter &_rUnitConverter, const SvXMLNamespaceMap &_rNamespaceMap, const ::std::vector< XMLPropertyState > *_pProperties, sal_uInt32 _nIdx) const override
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
#define CTF_FORMS_DATA_STYLE
Definition: contextid.hxx:39
#define MAP_END()
#define MAP_ASCII(name, prefix, token, type, context)
#define MAP_CONST(name, prefix, token, type, context)
#define MAP_CONST_P(name, prefix, token, type, context)
Handling of tokens in XML:
@ XML_TEXT_LINE_THROUGH_TEXT
Definition: xmltoken.hxx:2679
@ XML_TEXT_LINE_THROUGH_STYLE
Definition: xmltoken.hxx:2676
@ XML_TEXT_UNDERLINE_TYPE
Definition: xmltoken.hxx:2667
@ XML_FONT_FAMILY_GENERIC
Definition: xmltoken.hxx:865
@ XML_TEXT_UNDERLINE_STYLE
Definition: xmltoken.hxx:2666
@ XML_TEXT_UNDERLINE_COLOR
Definition: xmltoken.hxx:1985
@ XML_TEXT_UNDERLINE_WIDTH
Definition: xmltoken.hxx:2668
@ XML_BACKGROUND_COLOR
Definition: xmltoken.hxx:313
@ XML_TEXT_LINE_THROUGH_TYPE
Definition: xmltoken.hxx:2677
@ XML_TEXT_LINE_THROUGH_WIDTH
Definition: xmltoken.hxx:2678
void initializePropertyMaps()
constexpr OUStringLiteral PROPERTY_BORDER
Definition: strings.hxx:109
XMLPropertyMapEntry const aControlStyleProperties[]
constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR
Definition: strings.hxx:103
const XMLPropertyMapEntry * getControlStylePropertyMap()
constexpr OUStringLiteral PROPERTY_ALIGN
Definition: strings.hxx:108
constexpr OUStringLiteral PROPERTY_FORMATKEY
Definition: strings.hxx:107
Represents a property with its API-name, its XML-name and the type of its value.
Definition: maptype.hxx:33
bool IsEnd() const
Definition: maptype.hxx:132
const OUString & getApiName() const
Definition: maptype.hxx:129
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140
sal_Int32 mnIndex
Definition: maptype.hxx:141
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_FO
constexpr OUStringLiteral PROP_FontOrientation
Definition: xmlprop.hxx:229
constexpr OUStringLiteral PROP_FontFamily
Definition: xmlprop.hxx:224
constexpr OUStringLiteral PROP_FontRelief
Definition: xmlprop.hxx:231
constexpr OUStringLiteral PROP_FontKerning
Definition: xmlprop.hxx:227
constexpr OUStringLiteral PROP_FontWordLineMode
Definition: xmlprop.hxx:238
constexpr OUStringLiteral PROP_FontWidth
Definition: xmlprop.hxx:237
constexpr OUStringLiteral PROP_TextColor
Definition: xmlprop.hxx:615
constexpr OUStringLiteral PROP_BorderColor
Definition: xmlprop.hxx:32
constexpr OUStringLiteral PROP_FontStrikeout
Definition: xmlprop.hxx:233
constexpr OUStringLiteral PROP_FontCharWidth
Definition: xmlprop.hxx:221
constexpr OUStringLiteral PROP_FontUnderline
Definition: xmlprop.hxx:235
constexpr OUStringLiteral PROP_FontStyleName
Definition: xmlprop.hxx:234
constexpr OUStringLiteral PROP_FontPitch
Definition: xmlprop.hxx:230
constexpr OUStringLiteral PROP_FontEmphasisMark
Definition: xmlprop.hxx:223
constexpr OUStringLiteral PROP_FontHeight
Definition: xmlprop.hxx:225
constexpr OUStringLiteral PROP_FontWeight
Definition: xmlprop.hxx:236
constexpr OUStringLiteral PROP_FontSlant
Definition: xmlprop.hxx:232
constexpr OUStringLiteral PROP_TextLineColor
Definition: xmlprop.hxx:621
constexpr OUStringLiteral PROP_FontCharset
Definition: xmlprop.hxx:222
constexpr OUStringLiteral PROP_SymbolColor
Definition: xmlprop.hxx:598
constexpr OUStringLiteral PROP_FontName
Definition: xmlprop.hxx:228
#define XML_TYPE_CONTROL_TEXT_EMPHASIZE
Definition: xmltypes.hxx:247
#define XML_TYPE_TEXT_POSTURE
Definition: xmltypes.hxx:171
#define XML_TYPE_CONTROL_BORDER
Definition: xmltypes.hxx:233
#define XML_TYPE_TEXT_CROSSEDOUT_WIDTH
Definition: xmltypes.hxx:260
#define XML_TYPE_NUMBER16
Definition: xmltypes.hxx:136
#define MID_FLAG_MERGE_PROPERTY
Definition: xmltypes.hxx:61
#define XML_TYPE_ROTATION_ANGLE
Definition: xmltypes.hxx:232
#define XML_TYPE_TEXT_UNDERLINE_STYLE
Definition: xmltypes.hxx:173
#define XML_TYPE_TEXT_WEIGHT
Definition: xmltypes.hxx:174
#define XML_TYPE_TEXT_CROSSEDOUT_TYPE
Definition: xmltypes.hxx:259
#define XML_TYPE_TEXT_CROSSEDOUT_TEXT
Definition: xmltypes.hxx:261
#define XML_TYPE_TEXT_UNDERLINE_COLOR
Definition: xmltypes.hxx:224
#define MID_FLAG_SPECIAL_ITEM
Definition: xmltypes.hxx:87
#define MID_FLAG_MULTI_PROPERTY
Definition: xmltypes.hxx:64
#define XML_TYPE_TEXT_FONTENCODING
Definition: xmltypes.hxx:168
#define XML_TYPE_TEXT_FONTFAMILY
Definition: xmltypes.hxx:167
#define XML_TYPE_FONT_WIDTH
Definition: xmltypes.hxx:231
#define XML_TYPE_TEXT_FONTPITCH
Definition: xmltypes.hxx:169
#define XML_TYPE_NBOOL
Definition: xmltypes.hxx:139
#define XML_TYPE_TEXT_ALIGN
Definition: xmltypes.hxx:230
#define MID_FLAG_NO_PROPERTY_EXPORT
Definition: xmltypes.hxx:73
#define XML_TYPE_STRING
Definition: xmltypes.hxx:132
#define XML_TYPE_TEXT_UNDERLINE_WIDTH
Definition: xmltypes.hxx:258
#define XML_TYPE_CHAR_HEIGHT
Definition: xmltypes.hxx:184
#define XML_TYPE_COLOR
Definition: xmltypes.hxx:133
#define MID_FLAG_MERGE_ATTRIBUTE
Definition: xmltypes.hxx:57
#define XML_TYPE_CONTROL_BORDER_COLOR
Definition: xmltypes.hxx:254
#define XML_TYPE_BOOL
Definition: xmltypes.hxx:125
#define XML_TYPE_TEXT_FONT_RELIEF
Definition: xmltypes.hxx:242
#define XML_TYPE_TEXT_CROSSEDOUT_STYLE
Definition: xmltypes.hxx:164
#define XML_TYPE_TEXT_UNDERLINE_TYPE
Definition: xmltypes.hxx:257