Line data Source code
1 :
2 : #include "doctok/sprmids.hxx"
3 : #include "doctok/resourceids.hxx"
4 : #include "ooxml/resourceids.hxx"
5 : #include "OOXMLFactory_values.hxx"
6 : #include "OOXMLFactory_dml-shapeLineProperties.hxx"
7 : #include "ooxml/OOXMLFastHelper.hxx"
8 :
9 : #ifdef _MSC_VER
10 : #pragma warning(disable:4065) // switch statement contains 'default' but no 'case' labels
11 : #endif
12 :
13 : namespace writerfilter {
14 : namespace ooxml {
15 :
16 : /// @cond GENERATED
17 :
18 : typedef rtl::Static < osl::Mutex, OOXMLFactory_dml_shapeLineProperties > OOXMLFactory_dml_shapeLineProperties_Mutex;
19 :
20 2 : OOXMLFactory_dml_shapeLineProperties::OOXMLFactory_dml_shapeLineProperties()
21 : {
22 : // multi-thread-safe mutex for all platforms
23 :
24 2 : osl::MutexGuard aGuard(OOXMLFactory_dml_shapeLineProperties_Mutex::get());
25 2 : }
26 :
27 4 : OOXMLFactory_dml_shapeLineProperties::~OOXMLFactory_dml_shapeLineProperties()
28 : {
29 4 : }
30 :
31 5 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_shapeLineProperties::m_pInstance;
32 :
33 1176 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_shapeLineProperties::getInstance()
34 : {
35 1176 : if (m_pInstance.get() == NULL)
36 2 : m_pInstance.reset(new OOXMLFactory_dml_shapeLineProperties());
37 :
38 1176 : return m_pInstance;
39 : }
40 :
41 2 : AttributeToResourceMapPointer OOXMLFactory_dml_shapeLineProperties::createAttributeToResourceMap(Id nId)
42 : {
43 2 : AttributeToResourceMapPointer pMap(new AttributeToResourceMap());
44 :
45 2 : switch (nId)
46 : {
47 : case NN_dml_shapeLineProperties|DEFINE_CT_LineEndProperties:
48 : // CT_LineEndProperties
49 0 : (*pMap)[OOXML_type] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_LineEndType);
50 0 : (*pMap)[OOXML_w] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_LineEndWidth);
51 0 : (*pMap)[OOXML_len] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_LineEndLength);
52 0 : break;
53 : case NN_dml_shapeLineProperties|DEFINE_CT_LineJoinMiterProperties:
54 : // CT_LineJoinMiterProperties
55 : // empty resource: OOXML_lim
56 0 : break;
57 : case NN_dml_shapeLineProperties|DEFINE_CT_PresetLineDashProperties:
58 : // CT_PresetLineDashProperties
59 0 : (*pMap)[OOXML_val] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_PresetLineDashVal);
60 0 : break;
61 : case NN_dml_shapeLineProperties|DEFINE_CT_DashStop:
62 : // CT_DashStop
63 : // empty resource: OOXML_d
64 : // empty resource: OOXML_sp
65 0 : break;
66 : case NN_dml_shapeLineProperties|DEFINE_CT_LineProperties:
67 : // CT_LineProperties
68 : // empty resource: OOXML_w
69 2 : (*pMap)[OOXML_cap] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_LineCap);
70 2 : (*pMap)[OOXML_cmpd] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_CompoundLine);
71 2 : (*pMap)[OOXML_algn] = AttributeInfo(RT_List, NN_dml_shapeLineProperties|DEFINE_ST_PenAlignment);
72 2 : break;
73 : default:
74 0 : break;
75 : }
76 :
77 2 : return pMap;
78 : }
79 :
80 6 : ListValueMapPointer OOXMLFactory_dml_shapeLineProperties::createListValueMap(Id nId)
81 : {
82 6 : ListValueMapPointer pMap(new ListValueMap());
83 :
84 6 : switch (nId)
85 : {
86 : case NN_dml_shapeLineProperties|DEFINE_ST_LineEndType:
87 0 : (*pMap)[OOXMLValueString_none] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_none;
88 0 : (*pMap)[OOXMLValueString_triangle] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_triangle;
89 0 : (*pMap)[OOXMLValueString_stealth] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_stealth;
90 0 : (*pMap)[OOXMLValueString_diamond] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_diamond;
91 0 : (*pMap)[OOXMLValueString_oval] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_oval;
92 0 : (*pMap)[OOXMLValueString_arrow] = NS_ooxml::LN_Value_drawingml_ST_LineEndType_arrow;
93 0 : break;
94 : case NN_dml_shapeLineProperties|DEFINE_ST_LineEndWidth:
95 0 : (*pMap)[OOXMLValueString_sm] = NS_ooxml::LN_Value_drawingml_ST_LineEndWidth_sm;
96 0 : (*pMap)[OOXMLValueString_med] = NS_ooxml::LN_Value_drawingml_ST_LineEndWidth_med;
97 0 : (*pMap)[OOXMLValueString_lg] = NS_ooxml::LN_Value_drawingml_ST_LineEndWidth_lg;
98 0 : break;
99 : case NN_dml_shapeLineProperties|DEFINE_ST_LineEndLength:
100 0 : (*pMap)[OOXMLValueString_sm] = NS_ooxml::LN_Value_drawingml_ST_LineEndLength_sm;
101 0 : (*pMap)[OOXMLValueString_med] = NS_ooxml::LN_Value_drawingml_ST_LineEndLength_med;
102 0 : (*pMap)[OOXMLValueString_lg] = NS_ooxml::LN_Value_drawingml_ST_LineEndLength_lg;
103 0 : break;
104 : case NN_dml_shapeLineProperties|DEFINE_ST_PresetLineDashVal:
105 0 : (*pMap)[OOXMLValueString_solid] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_solid;
106 0 : (*pMap)[OOXMLValueString_dot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_dot;
107 0 : (*pMap)[OOXMLValueString_dash] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_dash;
108 0 : (*pMap)[OOXMLValueString_lgDash] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_lgDash;
109 0 : (*pMap)[OOXMLValueString_dashDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_dashDot;
110 0 : (*pMap)[OOXMLValueString_lgDashDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_lgDashDot;
111 0 : (*pMap)[OOXMLValueString_lgDashDotDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_lgDashDotDot;
112 0 : (*pMap)[OOXMLValueString_sysDash] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_sysDash;
113 0 : (*pMap)[OOXMLValueString_sysDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_sysDot;
114 0 : (*pMap)[OOXMLValueString_sysDashDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_sysDashDot;
115 0 : (*pMap)[OOXMLValueString_sysDashDotDot] = NS_ooxml::LN_Value_drawingml_ST_PresetLineDashVal_sysDashDotDot;
116 0 : break;
117 : case NN_dml_shapeLineProperties|DEFINE_ST_LineCap:
118 2 : (*pMap)[OOXMLValueString_rnd] = NS_ooxml::LN_Value_drawingml_ST_LineCap_rnd;
119 2 : (*pMap)[OOXMLValueString_sq] = NS_ooxml::LN_Value_drawingml_ST_LineCap_sq;
120 2 : (*pMap)[OOXMLValueString_flat] = NS_ooxml::LN_Value_drawingml_ST_LineCap_flat;
121 2 : break;
122 : case NN_dml_shapeLineProperties|DEFINE_ST_PenAlignment:
123 2 : (*pMap)[OOXMLValueString_ctr] = NS_ooxml::LN_Value_drawingml_ST_PenAlignment_ctr;
124 2 : (*pMap)[OOXMLValueString_in] = NS_ooxml::LN_Value_drawingml_ST_PenAlignment_in;
125 2 : break;
126 : case NN_dml_shapeLineProperties|DEFINE_ST_CompoundLine:
127 2 : (*pMap)[OOXMLValueString_sng] = NS_ooxml::LN_Value_drawingml_ST_CompoundLine_sng;
128 2 : (*pMap)[OOXMLValueString_dbl] = NS_ooxml::LN_Value_drawingml_ST_CompoundLine_dbl;
129 2 : (*pMap)[OOXMLValueString_thickThin] = NS_ooxml::LN_Value_drawingml_ST_CompoundLine_thickThin;
130 2 : (*pMap)[OOXMLValueString_thinThick] = NS_ooxml::LN_Value_drawingml_ST_CompoundLine_thinThick;
131 2 : (*pMap)[OOXMLValueString_tri] = NS_ooxml::LN_Value_drawingml_ST_CompoundLine_tri;
132 2 : break;
133 : default:
134 0 : break;
135 : }
136 :
137 6 : return pMap;
138 : }
139 8 : CreateElementMapPointer OOXMLFactory_dml_shapeLineProperties::createCreateElementMap(Id nId)
140 : {
141 8 : CreateElementMapPointer pMap(new CreateElementMap());
142 :
143 8 : switch (nId)
144 : {
145 : case NN_dml_shapeLineProperties|DEFINE_EG_LineFillProperties:
146 0 : (*pMap)[NS_drawingml|OOXML_solidFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_SolidColorFillProperties);
147 0 : break;
148 : case NN_dml_shapeLineProperties|DEFINE_CT_LineProperties:
149 : /* ref: EG_LineFillProperties*/
150 2 : (*pMap)[NS_drawingml|OOXML_solidFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_SolidColorFillProperties);
151 2 : (*pMap)[NS_drawingml|OOXML_headEnd] = CreateElement(RT_Properties, NN_dml_shapeLineProperties|DEFINE_CT_LineEndProperties);
152 2 : (*pMap)[NS_drawingml|OOXML_tailEnd] = CreateElement(RT_Properties, NN_dml_shapeLineProperties|DEFINE_CT_LineEndProperties);
153 2 : break;
154 : default:
155 6 : break;
156 : }
157 :
158 8 : return pMap;
159 : }
160 :
161 0 : void OOXMLFactory_dml_shapeLineProperties::charactersAction(OOXMLFastContextHandler*, const OUString &)
162 : {
163 0 : }
164 :
165 0 : string OOXMLFactory_dml_shapeLineProperties::getDefineName(Id nId) const
166 : {
167 0 : static IdToStringMapPointer pMap;
168 :
169 0 : if (pMap.get() == NULL)
170 : {
171 0 : pMap = IdToStringMapPointer(new IdToStringMap());
172 :
173 :
174 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_LineEndType] = "ST_LineEndType";
175 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_LineEndWidth] = "ST_LineEndWidth";
176 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_LineEndLength] = "ST_LineEndLength";
177 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_LineEndProperties] = "CT_LineEndProperties";
178 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_EG_LineFillProperties] = "EG_LineFillProperties";
179 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_LineJoinBevel] = "CT_LineJoinBevel";
180 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_LineJoinRound] = "CT_LineJoinRound";
181 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_LineJoinMiterProperties] = "CT_LineJoinMiterProperties";
182 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_EG_LineJoinProperties] = "EG_LineJoinProperties";
183 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_PresetLineDashVal] = "ST_PresetLineDashVal";
184 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_PresetLineDashProperties] = "CT_PresetLineDashProperties";
185 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_DashStop] = "CT_DashStop";
186 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_DashStopList] = "CT_DashStopList";
187 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_EG_LineDashProperties] = "EG_LineDashProperties";
188 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_LineCap] = "ST_LineCap";
189 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_LineWidth] = "ST_LineWidth";
190 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_PenAlignment] = "ST_PenAlignment";
191 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_ST_CompoundLine] = "ST_CompoundLine";
192 0 : (*pMap)[NN_dml_shapeLineProperties|DEFINE_CT_LineProperties] = "CT_LineProperties";
193 : }
194 :
195 0 : return (*pMap)[nId];
196 : }
197 :
198 :
199 8 : TokenToIdMapPointer OOXMLFactory_dml_shapeLineProperties::createTokenToIdMap(Id nId)
200 : {
201 8 : TokenToIdMapPointer pMap(new TokenToIdMap());
202 :
203 8 : switch (nId)
204 : {
205 : case NN_dml_shapeLineProperties|DEFINE_CT_LineEndProperties:
206 : // CT_LineEndProperties
207 0 : (*pMap)[OOXML_type] = NS_ooxml::LN_CT_LineEndProperties_type;
208 0 : (*pMap)[OOXML_w] = NS_ooxml::LN_CT_LineEndProperties_w;
209 0 : (*pMap)[OOXML_len] = NS_ooxml::LN_CT_LineEndProperties_len;
210 0 : break;
211 : case NN_dml_shapeLineProperties|DEFINE_EG_LineFillProperties:
212 : // EG_LineFillProperties
213 0 : (*pMap)[NS_drawingml|OOXML_noFill] = NS_ooxml::LN_EG_LineFillProperties_noFill;
214 0 : (*pMap)[NS_drawingml|OOXML_solidFill] = NS_ooxml::LN_EG_LineFillProperties_solidFill;
215 0 : (*pMap)[NS_drawingml|OOXML_gradFill] = NS_ooxml::LN_EG_LineFillProperties_gradFill;
216 0 : (*pMap)[NS_drawingml|OOXML_pattFill] = NS_ooxml::LN_EG_LineFillProperties_pattFill;
217 0 : break;
218 : case NN_dml_shapeLineProperties|DEFINE_CT_LineProperties:
219 : // EG_LineFillProperties
220 2 : (*pMap)[NS_drawingml|OOXML_noFill] = NS_ooxml::LN_EG_LineFillProperties_noFill;
221 2 : (*pMap)[NS_drawingml|OOXML_solidFill] = NS_ooxml::LN_EG_LineFillProperties_solidFill;
222 2 : (*pMap)[NS_drawingml|OOXML_gradFill] = NS_ooxml::LN_EG_LineFillProperties_gradFill;
223 2 : (*pMap)[NS_drawingml|OOXML_pattFill] = NS_ooxml::LN_EG_LineFillProperties_pattFill;
224 : // CT_LineProperties
225 2 : (*pMap)[NS_drawingml|OOXML_headEnd] = NS_ooxml::LN_CT_LineProperties_headEnd;
226 2 : (*pMap)[NS_drawingml|OOXML_tailEnd] = NS_ooxml::LN_CT_LineProperties_tailEnd;
227 2 : (*pMap)[NS_drawingml|OOXML_extLst] = NS_ooxml::LN_CT_LineProperties_extLst;
228 2 : (*pMap)[OOXML_w] = NS_ooxml::LN_CT_LineProperties_w;
229 2 : (*pMap)[OOXML_cap] = NS_ooxml::LN_CT_LineProperties_cap;
230 2 : (*pMap)[OOXML_cmpd] = NS_ooxml::LN_CT_LineProperties_cmpd;
231 2 : (*pMap)[OOXML_algn] = NS_ooxml::LN_CT_LineProperties_algn;
232 2 : break;
233 : default:
234 6 : break;
235 : }
236 :
237 8 : return pMap;
238 : }
239 :
240 450 : void OOXMLFactory_dml_shapeLineProperties::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLValue::Pointer_t)
241 : {
242 450 : }
243 :
244 : #ifdef DEBUG_FACTORY
245 : string OOXMLFactory_dml_shapeLineProperties::getName() const
246 : {
247 : return "dml-shapeLineProperties";
248 : }
249 : #endif
250 :
251 : /// @endcond
252 15 : }}
|