Branch data 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_vml-wordprocessingDrawing.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_vml_wordprocessingDrawing > OOXMLFactory_vml_wordprocessingDrawing_Mutex;
19 : :
20 : 8 : OOXMLFactory_vml_wordprocessingDrawing::OOXMLFactory_vml_wordprocessingDrawing()
21 : : {
22 : : // multi-thread-safe mutex for all platforms
23 : :
24 [ + - ][ + - ]: 8 : osl::MutexGuard aGuard(OOXMLFactory_vml_wordprocessingDrawing_Mutex::get());
[ + - ]
25 : 8 : }
26 : :
27 : 8 : OOXMLFactory_vml_wordprocessingDrawing::~OOXMLFactory_vml_wordprocessingDrawing()
28 : : {
29 [ - + ]: 16 : }
30 : :
31 : 20 : OOXMLFactory_ns::Pointer_t OOXMLFactory_vml_wordprocessingDrawing::m_pInstance;
32 : :
33 : 803 : OOXMLFactory_ns::Pointer_t OOXMLFactory_vml_wordprocessingDrawing::getInstance()
34 : : {
35 [ + + ]: 803 : if (m_pInstance.get() == NULL)
36 [ + - ]: 8 : m_pInstance.reset(new OOXMLFactory_vml_wordprocessingDrawing());
37 : :
38 : 803 : return m_pInstance;
39 : : }
40 : :
41 : 0 : AttributeToResourceMapPointer OOXMLFactory_vml_wordprocessingDrawing::createAttributeToResourceMap(Id nId)
42 : : {
43 [ # # ][ # # ]: 0 : AttributeToResourceMapPointer pMap(new AttributeToResourceMap());
[ # # ]
44 : :
45 [ # # # ]: 0 : switch (nId)
46 : : {
47 : : case NN_vml_wordprocessingDrawing|DEFINE_CT_Border:
48 : : // CT_Border
49 [ # # ][ # # ]: 0 : (*pMap)[OOXML_type] = AttributeInfo(RT_String, 0);
50 : : // empty resource: OOXML_width
51 [ # # ][ # # ]: 0 : (*pMap)[OOXML_shadow] = AttributeInfo(RT_String, 0);
52 : 0 : break;
53 : : case NN_vml_wordprocessingDrawing|DEFINE_CT_Wrap:
54 : : // CT_Wrap
55 [ # # ][ # # ]: 0 : (*pMap)[OOXML_type] = AttributeInfo(RT_List, NN_vml_wordprocessingDrawing|DEFINE_ST_WrapType);
56 [ # # ][ # # ]: 0 : (*pMap)[OOXML_side] = AttributeInfo(RT_List, NN_vml_wordprocessingDrawing|DEFINE_ST_WrapSide);
57 [ # # ][ # # ]: 0 : (*pMap)[OOXML_anchorx] = AttributeInfo(RT_List, NN_vml_wordprocessingDrawing|DEFINE_ST_HorizontalAnchor);
58 [ # # ][ # # ]: 0 : (*pMap)[OOXML_anchory] = AttributeInfo(RT_List, NN_vml_wordprocessingDrawing|DEFINE_ST_VerticalAnchor);
59 : 0 : break;
60 : : default:
61 : 0 : break;
62 : : }
63 : :
64 : 0 : return pMap;
65 : : }
66 : :
67 : 0 : ListValueMapPointer OOXMLFactory_vml_wordprocessingDrawing::createListValueMap(Id nId)
68 : : {
69 [ # # ][ # # ]: 0 : ListValueMapPointer pMap(new ListValueMap());
[ # # ]
70 : :
71 [ # # # # : 0 : switch (nId)
# # # ]
72 : : {
73 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_BorderType:
74 [ # # ]: 0 : (*pMap)[OOXMLValueString_none] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_none;
75 [ # # ]: 0 : (*pMap)[OOXMLValueString_single] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_single;
76 [ # # ]: 0 : (*pMap)[OOXMLValueString_thick] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thick;
77 [ # # ]: 0 : (*pMap)[OOXMLValueString_double] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_double;
78 [ # # ]: 0 : (*pMap)[OOXMLValueString_hairline] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_hairline;
79 [ # # ]: 0 : (*pMap)[OOXMLValueString_dot] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dot;
80 [ # # ]: 0 : (*pMap)[OOXMLValueString_dash] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dash;
81 [ # # ]: 0 : (*pMap)[OOXMLValueString_dotDash] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dotDash;
82 [ # # ]: 0 : (*pMap)[OOXMLValueString_dashDotDot] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dashDotDot;
83 [ # # ]: 0 : (*pMap)[OOXMLValueString_triple] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_triple;
84 [ # # ]: 0 : (*pMap)[OOXMLValueString_thinThickSmall] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thinThickSmall;
85 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickThinSmall] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickThinSmall;
86 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickBetweenThinSmall] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickBetweenThinSmall;
87 [ # # ]: 0 : (*pMap)[OOXMLValueString_thinThick] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thinThick;
88 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickThin] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickThin;
89 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickBetweenThin] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickBetweenThin;
90 [ # # ]: 0 : (*pMap)[OOXMLValueString_thinThickLarge] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thinThickLarge;
91 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickThinLarge] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickThinLarge;
92 [ # # ]: 0 : (*pMap)[OOXMLValueString_thickBetweenThinLarge] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_thickBetweenThinLarge;
93 [ # # ]: 0 : (*pMap)[OOXMLValueString_wave] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_wave;
94 [ # # ]: 0 : (*pMap)[OOXMLValueString_doubleWave] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_doubleWave;
95 [ # # ]: 0 : (*pMap)[OOXMLValueString_dashedSmall] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dashedSmall;
96 [ # # ]: 0 : (*pMap)[OOXMLValueString_dashDotStroked] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_dashDotStroked;
97 [ # # ]: 0 : (*pMap)[OOXMLValueString_threeDEmboss] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_threeDEmboss;
98 [ # # ]: 0 : (*pMap)[OOXMLValueString_threeDEngrave] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_threeDEngrave;
99 [ # # ]: 0 : (*pMap)[OOXMLValueString_HTMLOutset] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_HTMLOutset;
100 [ # # ]: 0 : (*pMap)[OOXMLValueString_HTMLInset] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderType_HTMLInset;
101 : 0 : break;
102 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_BorderShadow:
103 [ # # ]: 0 : (*pMap)[OOXMLValueString_t] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderShadow_t;
104 [ # # ]: 0 : (*pMap)[OOXMLValueString_true] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderShadow_true;
105 [ # # ]: 0 : (*pMap)[OOXMLValueString_f] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderShadow_f;
106 [ # # ]: 0 : (*pMap)[OOXMLValueString_false] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_BorderShadow_false;
107 : 0 : break;
108 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_WrapType:
109 [ # # ]: 0 : (*pMap)[OOXMLValueString_topAndBottom] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_topAndBottom;
110 [ # # ]: 0 : (*pMap)[OOXMLValueString_square] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_square;
111 [ # # ]: 0 : (*pMap)[OOXMLValueString_none] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_none;
112 [ # # ]: 0 : (*pMap)[OOXMLValueString_tight] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_tight;
113 [ # # ]: 0 : (*pMap)[OOXMLValueString_through] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapType_through;
114 : 0 : break;
115 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_WrapSide:
116 [ # # ]: 0 : (*pMap)[OOXMLValueString_both] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_both;
117 [ # # ]: 0 : (*pMap)[OOXMLValueString_left] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_left;
118 [ # # ]: 0 : (*pMap)[OOXMLValueString_right] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_right;
119 [ # # ]: 0 : (*pMap)[OOXMLValueString_largest] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_WrapSide_largest;
120 : 0 : break;
121 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_HorizontalAnchor:
122 [ # # ]: 0 : (*pMap)[OOXMLValueString_margin] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_HorizontalAnchor_margin;
123 [ # # ]: 0 : (*pMap)[OOXMLValueString_page] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_HorizontalAnchor_page;
124 [ # # ]: 0 : (*pMap)[OOXMLValueString_text] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_HorizontalAnchor_text;
125 [ # # ]: 0 : (*pMap)[OOXMLValueString_char] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_HorizontalAnchor_char;
126 : 0 : break;
127 : : case NN_vml_wordprocessingDrawing|DEFINE_ST_VerticalAnchor:
128 [ # # ]: 0 : (*pMap)[OOXMLValueString_margin] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_VerticalAnchor_margin;
129 [ # # ]: 0 : (*pMap)[OOXMLValueString_page] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_VerticalAnchor_page;
130 [ # # ]: 0 : (*pMap)[OOXMLValueString_text] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_VerticalAnchor_text;
131 [ # # ]: 0 : (*pMap)[OOXMLValueString_line] = NS_ooxml::LN_Value_vml_wordprocessingDrawing_ST_VerticalAnchor_line;
132 : 0 : break;
133 : : default:
134 : 0 : break;
135 : : }
136 : :
137 : 0 : return pMap;
138 : : }
139 : 8 : CreateElementMapPointer OOXMLFactory_vml_wordprocessingDrawing::createCreateElementMap(Id nId)
140 : : {
141 [ + - ][ + - ]: 8 : CreateElementMapPointer pMap(new CreateElementMap());
[ + - ]
142 : :
143 [ - - - - : 8 : switch (nId)
- + ]
144 : : {
145 : : case NN_vml_wordprocessingDrawing|DEFINE_bordertop:
146 [ # # ][ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_bordertop] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
147 : 0 : break;
148 : : case NN_vml_wordprocessingDrawing|DEFINE_borderleft:
149 [ # # ][ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderleft] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
150 : 0 : break;
151 : : case NN_vml_wordprocessingDrawing|DEFINE_borderright:
152 [ # # ][ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderright] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
153 : 0 : break;
154 : : case NN_vml_wordprocessingDrawing|DEFINE_borderbottom:
155 [ # # ][ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderbottom] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
156 : 0 : break;
157 : : case NN_vml_wordprocessingDrawing|DEFINE_wrap:
158 [ # # ][ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_wrap] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Wrap);
159 : 0 : break;
160 : : default:
161 : : /* start: bordertop*/
162 [ + - ][ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_bordertop] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
163 : : /* start: borderleft*/
164 [ + - ][ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderleft] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
165 : : /* start: borderright*/
166 [ + - ][ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderright] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
167 : : /* start: borderbottom*/
168 [ + - ][ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_borderbottom] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Border);
169 : : /* start: wrap*/
170 [ + - ][ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_wrap] = CreateElement(RT_Properties, NN_vml_wordprocessingDrawing|DEFINE_CT_Wrap);
171 : : /* start: anchorlock*/
172 : 8 : break;
173 : : }
174 : :
175 : 8 : return pMap;
176 : : }
177 : :
178 : 0 : void OOXMLFactory_vml_wordprocessingDrawing::charactersAction(OOXMLFastContextHandler*, const OUString &)
179 : : {
180 : 0 : }
181 : :
182 : 0 : string OOXMLFactory_vml_wordprocessingDrawing::getDefineName(Id nId) const
183 : : {
184 [ # # ][ # # ]: 0 : static IdToStringMapPointer pMap;
[ # # ][ # # ]
185 : :
186 [ # # ]: 0 : if (pMap.get() == NULL)
187 : : {
188 [ # # ][ # # ]: 0 : pMap = IdToStringMapPointer(new IdToStringMap());
[ # # ][ # # ]
[ # # ]
189 : :
190 : :
191 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_bordertop] = "bordertop";
192 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_borderleft] = "borderleft";
193 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_borderright] = "borderright";
194 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_borderbottom] = "borderbottom";
195 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_CT_Border] = "CT_Border";
196 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_wrap] = "wrap";
197 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_CT_Wrap] = "CT_Wrap";
198 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_anchorlock] = "anchorlock";
199 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_CT_AnchorLock] = "CT_AnchorLock";
200 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_BorderType] = "ST_BorderType";
201 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_BorderShadow] = "ST_BorderShadow";
202 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_WrapType] = "ST_WrapType";
203 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_WrapSide] = "ST_WrapSide";
204 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_HorizontalAnchor] = "ST_HorizontalAnchor";
205 [ # # ][ # # ]: 0 : (*pMap)[NN_vml_wordprocessingDrawing|DEFINE_ST_VerticalAnchor] = "ST_VerticalAnchor";
206 : : }
207 : :
208 : 0 : return (*pMap)[nId];
209 : : }
210 : :
211 : :
212 : 8 : TokenToIdMapPointer OOXMLFactory_vml_wordprocessingDrawing::createTokenToIdMap(Id nId)
213 : : {
214 [ + - ][ + - ]: 8 : TokenToIdMapPointer pMap(new TokenToIdMap());
[ + - ]
215 : :
216 [ - - + ]: 8 : switch (nId)
217 : : {
218 : : case NN_vml_wordprocessingDrawing|DEFINE_wrap:
219 : : // wrap
220 [ # # ]: 0 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_wrap] = NS_ooxml::LN_wrap_wrap;
221 : 0 : break;
222 : : case NN_vml_wordprocessingDrawing|DEFINE_CT_Wrap:
223 : : // CT_Wrap
224 [ # # ]: 0 : (*pMap)[OOXML_type] = NS_ooxml::LN_CT_Wrap_type;
225 [ # # ]: 0 : (*pMap)[OOXML_side] = NS_ooxml::LN_CT_Wrap_side;
226 [ # # ]: 0 : (*pMap)[OOXML_anchorx] = NS_ooxml::LN_CT_Wrap_anchorx;
227 [ # # ]: 0 : (*pMap)[OOXML_anchory] = NS_ooxml::LN_CT_Wrap_anchory;
228 : 0 : break;
229 : : default:
230 : : // bordertop
231 : : // borderleft
232 : : // borderright
233 : : // borderbottom
234 : : // wrap
235 : : // wrap
236 [ + - ]: 8 : (*pMap)[NS_vml_wordprocessingDrawing|OOXML_wrap] = NS_ooxml::LN_wrap_wrap;
237 : : // anchorlock
238 : 8 : break;
239 : : }
240 : :
241 : 8 : return pMap;
242 : : }
243 : :
244 : 0 : void OOXMLFactory_vml_wordprocessingDrawing::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLValue::Pointer_t)
245 : : {
246 : 0 : }
247 : :
248 : : #ifdef DEBUG_FACTORY
249 : : string OOXMLFactory_vml_wordprocessingDrawing::getName() const
250 : : {
251 : : return "vml-wordprocessingDrawing";
252 : : }
253 : : #endif
254 : :
255 : : /// @endcond
256 [ + - ][ + - ]: 60 : }}
|