/src/libreoffice/starmath/source/mathml/attribute.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ |
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 | | |
10 | | #include <mathml/attribute.hxx> |
11 | | |
12 | | void SmMlAttribute::clearPreviousAttributeValue() |
13 | 0 | { |
14 | 0 | switch (m_aSmMlAttributeValueType) |
15 | 0 | { |
16 | 0 | case SmMlAttributeValueType::NMlEmpty: |
17 | 0 | break; |
18 | 0 | case SmMlAttributeValueType::MlHref: |
19 | 0 | if (m_aAttributeValue.m_aHref.m_aLnk) |
20 | 0 | delete m_aAttributeValue.m_aHref.m_aLnk; |
21 | 0 | break; |
22 | 0 | case SmMlAttributeValueType::MlLspace: |
23 | 0 | if (m_aAttributeValue.m_aLspace.m_aLengthValue.m_aOriginalText) |
24 | 0 | delete m_aAttributeValue.m_aLspace.m_aLengthValue.m_aOriginalText; |
25 | 0 | break; |
26 | 0 | case SmMlAttributeValueType::MlMathsize: |
27 | 0 | if (m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aOriginalText) |
28 | 0 | delete m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aOriginalText; |
29 | 0 | break; |
30 | 0 | case SmMlAttributeValueType::MlMaxsize: |
31 | 0 | if (m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aOriginalText) |
32 | 0 | delete m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aOriginalText; |
33 | 0 | break; |
34 | 0 | case SmMlAttributeValueType::MlMinsize: |
35 | 0 | if (m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aOriginalText) |
36 | 0 | delete m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aOriginalText; |
37 | 0 | break; |
38 | 0 | case SmMlAttributeValueType::MlRspace: |
39 | 0 | if (m_aAttributeValue.m_aRspace.m_aLengthValue.m_aOriginalText) |
40 | 0 | delete m_aAttributeValue.m_aRspace.m_aLengthValue.m_aOriginalText; |
41 | 0 | break; |
42 | 0 | default: |
43 | 0 | break; |
44 | 0 | } |
45 | 0 | } |
46 | | |
47 | | void SmMlAttribute::setDefaultAttributeValue() |
48 | 0 | { |
49 | 0 | switch (m_aSmMlAttributeValueType) |
50 | 0 | { |
51 | 0 | case SmMlAttributeValueType::NMlEmpty: |
52 | 0 | break; |
53 | 0 | case SmMlAttributeValueType::MlAccent: |
54 | 0 | m_aAttributeValue.m_aAccent.m_aAccent = SmMlAttributeValueAccent::MlFalse; |
55 | 0 | break; |
56 | 0 | case SmMlAttributeValueType::MlDir: |
57 | 0 | m_aAttributeValue.m_aDir.m_aDir = SmMlAttributeValueDir::MlLtr; |
58 | 0 | break; |
59 | 0 | case SmMlAttributeValueType::MlDisplaystyle: |
60 | 0 | m_aAttributeValue.m_aDisplaystyle.m_aDisplaystyle |
61 | 0 | = SmMlAttributeValueDisplaystyle::MlFalse; |
62 | 0 | break; |
63 | 0 | case SmMlAttributeValueType::MlFence: |
64 | 0 | m_aAttributeValue.m_aFence.m_aFence = SmMlAttributeValueFence::MlFalse; |
65 | 0 | break; |
66 | 0 | case SmMlAttributeValueType::MlForm: |
67 | 0 | m_aAttributeValue.m_aForm.m_aForm = SmMlAttributeValueForm::MlInfix; |
68 | 0 | break; |
69 | 0 | case SmMlAttributeValueType::MlHref: |
70 | 0 | m_aAttributeValue.m_aHref.m_aHref = SmMlAttributeValueHref::NMlEmpty; |
71 | 0 | m_aAttributeValue.m_aHref.m_aLnk = new OUString(u""_ustr); |
72 | 0 | break; |
73 | 0 | case SmMlAttributeValueType::MlLspace: |
74 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aLengthUnit = SmLengthUnit::MlEm; |
75 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aLengthValue = 5.0 / 18; |
76 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aOriginalText |
77 | 0 | = new OUString(u"5/18em"_ustr); |
78 | 0 | break; |
79 | 0 | case SmMlAttributeValueType::MlMathbackground: |
80 | 0 | m_aAttributeValue.m_aMathbackground.m_aMathbackground |
81 | 0 | = SmMlAttributeValueMathbackground::MlTransparent; |
82 | 0 | break; |
83 | 0 | case SmMlAttributeValueType::MlMathcolor: |
84 | 0 | m_aAttributeValue.m_aMathcolor.m_aMathcolor = SmMlAttributeValueMathcolor::MlDefault; |
85 | 0 | break; |
86 | 0 | case SmMlAttributeValueType::MlMathsize: |
87 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aLengthUnit = SmLengthUnit::MlP; |
88 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aLengthValue = 100; |
89 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aOriginalText |
90 | 0 | = new OUString(u"100%"_ustr); |
91 | 0 | break; |
92 | 0 | case SmMlAttributeValueType::MlMathvariant: |
93 | 0 | m_aAttributeValue.m_aMathvariant.m_aMathvariant = SmMlAttributeValueMathvariant::normal; |
94 | 0 | break; |
95 | 0 | case SmMlAttributeValueType::MlMaxsize: |
96 | 0 | m_aAttributeValue.m_aMaxsize.m_aMaxsize = SmMlAttributeValueMaxsize::MlInfinity; |
97 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aLengthUnit = SmLengthUnit::MlP; |
98 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aLengthValue = 10000; |
99 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aOriginalText |
100 | 0 | = new OUString(u"10000%"_ustr); |
101 | 0 | break; |
102 | 0 | case SmMlAttributeValueType::MlMinsize: |
103 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthUnit = SmLengthUnit::MlP; |
104 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthValue = 1; |
105 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aOriginalText = new OUString(u"1%"_ustr); |
106 | 0 | break; |
107 | 0 | case SmMlAttributeValueType::MlMovablelimits: |
108 | 0 | m_aAttributeValue.m_aMovablelimits.m_aMovablelimits |
109 | 0 | = SmMlAttributeValueMovablelimits::MlFalse; |
110 | 0 | break; |
111 | 0 | case SmMlAttributeValueType::MlRspace: |
112 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aLengthUnit = SmLengthUnit::MlEm; |
113 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aLengthValue = 5.0 / 18; |
114 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aOriginalText |
115 | 0 | = new OUString(u"5/18em"_ustr); |
116 | 0 | break; |
117 | 0 | case SmMlAttributeValueType::MlSeparator: |
118 | 0 | m_aAttributeValue.m_aSeparator.m_aSeparator = SmMlAttributeValueSeparator::MlFalse; |
119 | 0 | break; |
120 | 0 | case SmMlAttributeValueType::MlStretchy: |
121 | 0 | m_aAttributeValue.m_aStretchy.m_aStretchy = SmMlAttributeValueStretchy::MlFalse; |
122 | 0 | break; |
123 | 0 | case SmMlAttributeValueType::MlSymmetric: |
124 | 0 | m_aAttributeValue.m_aSymmetric.m_aSymmetric = SmMlAttributeValueSymmetric::MlFalse; |
125 | 0 | break; |
126 | 0 | } |
127 | 0 | } |
128 | | |
129 | | void SmMlAttribute::setAttributeValue(const SmMlAttribute* aAttribute) |
130 | 0 | { |
131 | 0 | switch (aAttribute->getMlAttributeValueType()) |
132 | 0 | { |
133 | 0 | case SmMlAttributeValueType::NMlEmpty: |
134 | 0 | clearPreviousAttributeValue(); |
135 | 0 | m_aSmMlAttributeValueType = SmMlAttributeValueType::NMlEmpty; |
136 | 0 | break; |
137 | 0 | case SmMlAttributeValueType::MlAccent: |
138 | 0 | setMlAccent(aAttribute->getMlAccent()); |
139 | 0 | break; |
140 | 0 | case SmMlAttributeValueType::MlDir: |
141 | 0 | setMlDir(aAttribute->getMlDir()); |
142 | 0 | break; |
143 | 0 | case SmMlAttributeValueType::MlDisplaystyle: |
144 | 0 | setMlDisplaystyle(aAttribute->getMlDisplaystyle()); |
145 | 0 | break; |
146 | 0 | case SmMlAttributeValueType::MlFence: |
147 | 0 | setMlFence(aAttribute->getMlFence()); |
148 | 0 | break; |
149 | 0 | case SmMlAttributeValueType::MlForm: |
150 | 0 | setMlForm(aAttribute->getMlForm()); |
151 | 0 | break; |
152 | 0 | case SmMlAttributeValueType::MlHref: |
153 | 0 | setMlHref(aAttribute->getMlHref()); |
154 | 0 | break; |
155 | 0 | case SmMlAttributeValueType::MlLspace: |
156 | 0 | setMlLspace(aAttribute->getMlLspace()); |
157 | 0 | break; |
158 | 0 | case SmMlAttributeValueType::MlMathbackground: |
159 | 0 | setMlMathbackground(aAttribute->getMlMathbackground()); |
160 | 0 | break; |
161 | 0 | case SmMlAttributeValueType::MlMathcolor: |
162 | 0 | setMlMathcolor(aAttribute->getMlMathcolor()); |
163 | 0 | break; |
164 | 0 | case SmMlAttributeValueType::MlMathsize: |
165 | 0 | setMlMathsize(aAttribute->getMlMathsize()); |
166 | 0 | break; |
167 | 0 | case SmMlAttributeValueType::MlMathvariant: |
168 | 0 | setMlMathvariant(aAttribute->getMlMathvariant()); |
169 | 0 | break; |
170 | 0 | case SmMlAttributeValueType::MlMaxsize: |
171 | 0 | setMlMaxsize(aAttribute->getMlMaxsize()); |
172 | 0 | break; |
173 | 0 | case SmMlAttributeValueType::MlMinsize: |
174 | 0 | setMlMinsize(aAttribute->getMlMinsize()); |
175 | 0 | break; |
176 | 0 | case SmMlAttributeValueType::MlMovablelimits: |
177 | 0 | setMlMovablelimits(aAttribute->getMlMovablelimits()); |
178 | 0 | break; |
179 | 0 | case SmMlAttributeValueType::MlRspace: |
180 | 0 | setMlRspace(aAttribute->getMlRspace()); |
181 | 0 | break; |
182 | 0 | case SmMlAttributeValueType::MlSeparator: |
183 | 0 | setMlSeparator(aAttribute->getMlSeparator()); |
184 | 0 | break; |
185 | 0 | case SmMlAttributeValueType::MlStretchy: |
186 | 0 | setMlStretchy(aAttribute->getMlStretchy()); |
187 | 0 | break; |
188 | 0 | case SmMlAttributeValueType::MlSymmetric: |
189 | 0 | setMlSymmetric(aAttribute->getMlSymmetric()); |
190 | 0 | break; |
191 | 0 | } |
192 | 0 | } |
193 | | |
194 | | /* get values */ |
195 | | /*************************************************************************************************/ |
196 | | |
197 | | const struct SmMlAccent* SmMlAttribute::getMlAccent() const |
198 | 0 | { |
199 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlAccent) |
200 | 0 | return &m_aAttributeValue.m_aAccent; |
201 | 0 | return nullptr; |
202 | 0 | } |
203 | | |
204 | | const struct SmMlDir* SmMlAttribute::getMlDir() const |
205 | 0 | { |
206 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlDir) |
207 | 0 | return &m_aAttributeValue.m_aDir; |
208 | 0 | return nullptr; |
209 | 0 | } |
210 | | |
211 | | const struct SmMlDisplaystyle* SmMlAttribute::getMlDisplaystyle() const |
212 | 0 | { |
213 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlDisplaystyle) |
214 | 0 | return &m_aAttributeValue.m_aDisplaystyle; |
215 | 0 | return nullptr; |
216 | 0 | } |
217 | | |
218 | | const struct SmMlFence* SmMlAttribute::getMlFence() const |
219 | 0 | { |
220 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlFence) |
221 | 0 | return &m_aAttributeValue.m_aFence; |
222 | 0 | return nullptr; |
223 | 0 | } |
224 | | |
225 | | const struct SmMlForm* SmMlAttribute::getMlForm() const |
226 | 0 | { |
227 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlForm) |
228 | 0 | return &m_aAttributeValue.m_aForm; |
229 | 0 | return nullptr; |
230 | 0 | } |
231 | | |
232 | | const struct SmMlHref* SmMlAttribute::getMlHref() const |
233 | 0 | { |
234 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlHref) |
235 | 0 | return &m_aAttributeValue.m_aHref; |
236 | 0 | return nullptr; |
237 | 0 | } |
238 | | |
239 | | const struct SmMlLspace* SmMlAttribute::getMlLspace() const |
240 | 0 | { |
241 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlLspace) |
242 | 0 | return &m_aAttributeValue.m_aLspace; |
243 | 0 | return nullptr; |
244 | 0 | } |
245 | | |
246 | | const struct SmMlMathbackground* SmMlAttribute::getMlMathbackground() const |
247 | 0 | { |
248 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMathbackground) |
249 | 0 | return &m_aAttributeValue.m_aMathbackground; |
250 | 0 | return nullptr; |
251 | 0 | } |
252 | | |
253 | | const struct SmMlMathcolor* SmMlAttribute::getMlMathcolor() const |
254 | 0 | { |
255 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMathcolor) |
256 | 0 | return &m_aAttributeValue.m_aMathcolor; |
257 | 0 | return nullptr; |
258 | 0 | } |
259 | | |
260 | | const struct SmMlMathsize* SmMlAttribute::getMlMathsize() const |
261 | 0 | { |
262 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlAccent) |
263 | 0 | return &m_aAttributeValue.m_aMathsize; |
264 | 0 | return nullptr; |
265 | 0 | } |
266 | | |
267 | | const struct SmMlMathvariant* SmMlAttribute::getMlMathvariant() const |
268 | 0 | { |
269 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMathvariant) |
270 | 0 | return &m_aAttributeValue.m_aMathvariant; |
271 | 0 | return nullptr; |
272 | 0 | } |
273 | | |
274 | | const struct SmMlMaxsize* SmMlAttribute::getMlMaxsize() const |
275 | 0 | { |
276 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMaxsize) |
277 | 0 | return &m_aAttributeValue.m_aMaxsize; |
278 | 0 | return nullptr; |
279 | 0 | } |
280 | | |
281 | | const struct SmMlMinsize* SmMlAttribute::getMlMinsize() const |
282 | 0 | { |
283 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMinsize) |
284 | 0 | return &m_aAttributeValue.m_aMinsize; |
285 | 0 | return nullptr; |
286 | 0 | } |
287 | | |
288 | | const struct SmMlMovablelimits* SmMlAttribute::getMlMovablelimits() const |
289 | 0 | { |
290 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlMovablelimits) |
291 | 0 | return &m_aAttributeValue.m_aMovablelimits; |
292 | 0 | return nullptr; |
293 | 0 | } |
294 | | |
295 | | const struct SmMlRspace* SmMlAttribute::getMlRspace() const |
296 | 0 | { |
297 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlRspace) |
298 | 0 | return &m_aAttributeValue.m_aRspace; |
299 | 0 | return nullptr; |
300 | 0 | } |
301 | | |
302 | | const struct SmMlSeparator* SmMlAttribute::getMlSeparator() const |
303 | 0 | { |
304 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlSeparator) |
305 | 0 | return &m_aAttributeValue.m_aSeparator; |
306 | 0 | return nullptr; |
307 | 0 | } |
308 | | |
309 | | const struct SmMlStretchy* SmMlAttribute::getMlStretchy() const |
310 | 0 | { |
311 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlStretchy) |
312 | 0 | return &m_aAttributeValue.m_aStretchy; |
313 | 0 | return nullptr; |
314 | 0 | } |
315 | | |
316 | | const struct SmMlSymmetric* SmMlAttribute::getMlSymmetric() const |
317 | 0 | { |
318 | 0 | if (m_aSmMlAttributeValueType == SmMlAttributeValueType::MlSymmetric) |
319 | 0 | return &m_aAttributeValue.m_aSymmetric; |
320 | 0 | return nullptr; |
321 | 0 | } |
322 | | |
323 | | /* set values */ |
324 | | /*************************************************************************************************/ |
325 | | |
326 | | void SmMlAttribute::setMlAccent(const SmMlAccent* aAccent) |
327 | 0 | { |
328 | 0 | m_bSet = true; |
329 | 0 | clearPreviousAttributeValue(); |
330 | 0 | m_aAttributeValue.m_aAccent.m_aAccent = aAccent->m_aAccent; |
331 | 0 | } |
332 | | |
333 | | void SmMlAttribute::setMlDir(const SmMlDir* aDir) |
334 | 0 | { |
335 | 0 | m_bSet = true; |
336 | 0 | clearPreviousAttributeValue(); |
337 | 0 | m_aAttributeValue.m_aDir.m_aDir = aDir->m_aDir; |
338 | 0 | } |
339 | | |
340 | | void SmMlAttribute::setMlDisplaystyle(const SmMlDisplaystyle* aDisplaystyle) |
341 | 0 | { |
342 | 0 | m_bSet = true; |
343 | 0 | clearPreviousAttributeValue(); |
344 | 0 | m_aAttributeValue.m_aDisplaystyle.m_aDisplaystyle = aDisplaystyle->m_aDisplaystyle; |
345 | 0 | } |
346 | | |
347 | | void SmMlAttribute::setMlFence(const SmMlFence* aFence) |
348 | 0 | { |
349 | 0 | m_bSet = true; |
350 | 0 | clearPreviousAttributeValue(); |
351 | 0 | m_aAttributeValue.m_aFence.m_aFence = aFence->m_aFence; |
352 | 0 | } |
353 | | |
354 | | void SmMlAttribute::setMlForm(const SmMlForm* aForm) |
355 | 0 | { |
356 | 0 | m_bSet = true; |
357 | 0 | clearPreviousAttributeValue(); |
358 | 0 | m_aAttributeValue.m_aForm.m_aForm = aForm->m_aForm; |
359 | 0 | } |
360 | | |
361 | | void SmMlAttribute::setMlHref(const SmMlHref* aHref) |
362 | 0 | { |
363 | 0 | m_bSet = true; |
364 | 0 | clearPreviousAttributeValue(); |
365 | 0 | m_aAttributeValue.m_aHref.m_aHref = aHref->m_aHref; |
366 | 0 | m_aAttributeValue.m_aHref.m_aLnk = new OUString(*aHref->m_aLnk); |
367 | 0 | } |
368 | | |
369 | | void SmMlAttribute::setMlLspace(const SmMlLspace* aLspace) |
370 | 0 | { |
371 | 0 | m_bSet = true; |
372 | 0 | clearPreviousAttributeValue(); |
373 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aLengthUnit |
374 | 0 | = aLspace->m_aLengthValue.m_aLengthUnit; |
375 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aLengthValue |
376 | 0 | = aLspace->m_aLengthValue.m_aLengthValue; |
377 | 0 | m_aAttributeValue.m_aLspace.m_aLengthValue.m_aOriginalText |
378 | 0 | = new OUString(*aLspace->m_aLengthValue.m_aOriginalText); |
379 | 0 | } |
380 | | |
381 | | void SmMlAttribute::setMlMathbackground(const SmMlMathbackground* aMathbackground) |
382 | 0 | { |
383 | 0 | m_bSet = true; |
384 | 0 | clearPreviousAttributeValue(); |
385 | 0 | m_aAttributeValue.m_aMathbackground.m_aMathbackground = aMathbackground->m_aMathbackground; |
386 | 0 | } |
387 | | |
388 | | void SmMlAttribute::setMlMathcolor(const SmMlMathcolor* aMathcolor) |
389 | 0 | { |
390 | 0 | m_bSet = true; |
391 | 0 | clearPreviousAttributeValue(); |
392 | 0 | m_aAttributeValue.m_aMathcolor.m_aMathcolor = aMathcolor->m_aMathcolor; |
393 | 0 | } |
394 | | |
395 | | void SmMlAttribute::setMlMathsize(const SmMlMathsize* aMathsize) |
396 | 0 | { |
397 | 0 | m_bSet = true; |
398 | 0 | clearPreviousAttributeValue(); |
399 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aLengthUnit |
400 | 0 | = aMathsize->m_aLengthValue.m_aLengthUnit; |
401 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aLengthValue |
402 | 0 | = aMathsize->m_aLengthValue.m_aLengthValue; |
403 | 0 | m_aAttributeValue.m_aMathsize.m_aLengthValue.m_aOriginalText |
404 | 0 | = new OUString(*aMathsize->m_aLengthValue.m_aOriginalText); |
405 | 0 | } |
406 | | |
407 | | void SmMlAttribute::setMlMathvariant(const SmMlMathvariant* aMathvariant) |
408 | 0 | { |
409 | 0 | m_bSet = true; |
410 | 0 | clearPreviousAttributeValue(); |
411 | 0 | m_aAttributeValue.m_aMathvariant.m_aMathvariant = aMathvariant->m_aMathvariant; |
412 | 0 | } |
413 | | |
414 | | void SmMlAttribute::setMlMaxsize(const SmMlMaxsize* aMaxsize) |
415 | 0 | { |
416 | 0 | m_bSet = true; |
417 | 0 | clearPreviousAttributeValue(); |
418 | 0 | m_aAttributeValue.m_aMaxsize.m_aMaxsize = aMaxsize->m_aMaxsize; |
419 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aLengthUnit |
420 | 0 | = aMaxsize->m_aLengthValue.m_aLengthUnit; |
421 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aLengthValue |
422 | 0 | = aMaxsize->m_aLengthValue.m_aLengthValue; |
423 | 0 | m_aAttributeValue.m_aMaxsize.m_aLengthValue.m_aOriginalText |
424 | 0 | = new OUString(*aMaxsize->m_aLengthValue.m_aOriginalText); |
425 | 0 | } |
426 | | |
427 | | void SmMlAttribute::setMlMinsize(const SmMlMinsize* aMinsize) |
428 | 0 | { |
429 | 0 | m_bSet = true; |
430 | 0 | clearPreviousAttributeValue(); |
431 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthUnit |
432 | 0 | = aMinsize->m_aLengthValue.m_aLengthUnit; |
433 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aLengthValue |
434 | 0 | = aMinsize->m_aLengthValue.m_aLengthValue; |
435 | 0 | m_aAttributeValue.m_aMinsize.m_aLengthValue.m_aOriginalText |
436 | 0 | = new OUString(*aMinsize->m_aLengthValue.m_aOriginalText); |
437 | 0 | } |
438 | | |
439 | | void SmMlAttribute::setMlMovablelimits(const SmMlMovablelimits* aMovablelimits) |
440 | 0 | { |
441 | 0 | m_bSet = true; |
442 | 0 | clearPreviousAttributeValue(); |
443 | 0 | m_aAttributeValue.m_aMovablelimits.m_aMovablelimits = aMovablelimits->m_aMovablelimits; |
444 | 0 | } |
445 | | |
446 | | void SmMlAttribute::setMlRspace(const SmMlRspace* aRspace) |
447 | 0 | { |
448 | 0 | m_bSet = true; |
449 | 0 | clearPreviousAttributeValue(); |
450 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aLengthUnit |
451 | 0 | = aRspace->m_aLengthValue.m_aLengthUnit; |
452 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aLengthValue |
453 | 0 | = aRspace->m_aLengthValue.m_aLengthValue; |
454 | 0 | m_aAttributeValue.m_aRspace.m_aLengthValue.m_aOriginalText |
455 | 0 | = new OUString(*aRspace->m_aLengthValue.m_aOriginalText); |
456 | 0 | } |
457 | | |
458 | | void SmMlAttribute::setMlSeparator(const SmMlSeparator* aSeparator) |
459 | 0 | { |
460 | 0 | m_bSet = true; |
461 | 0 | clearPreviousAttributeValue(); |
462 | 0 | m_aAttributeValue.m_aSeparator.m_aSeparator = aSeparator->m_aSeparator; |
463 | 0 | } |
464 | | |
465 | | void SmMlAttribute::setMlStretchy(const SmMlStretchy* aStretchy) |
466 | 0 | { |
467 | 0 | m_bSet = true; |
468 | 0 | clearPreviousAttributeValue(); |
469 | 0 | m_aAttributeValue.m_aStretchy.m_aStretchy = aStretchy->m_aStretchy; |
470 | 0 | } |
471 | | |
472 | | void SmMlAttribute::setMlSymmetric(const SmMlSymmetric* aSymmetric) |
473 | 0 | { |
474 | 0 | m_bSet = true; |
475 | 0 | clearPreviousAttributeValue(); |
476 | 0 | m_aAttributeValue.m_aSymmetric.m_aSymmetric = aSymmetric->m_aSymmetric; |
477 | 0 | } |
478 | | |
479 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |