Line data Source code
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 "OOXMLPropertySetImpl.hxx"
21 : #include <stdio.h>
22 : #include <iostream>
23 : #include <resourcemodel/QNameToString.hxx>
24 : #include <resourcemodel/Protocol.hxx>
25 : #include <com/sun/star/drawing/XShape.hpp>
26 : #include <ooxml/OOXMLFastTokens.hxx>
27 : #include "ooxmlLoggers.hxx"
28 :
29 : namespace writerfilter {
30 : namespace ooxml
31 : {
32 : using namespace ::std;
33 :
34 41204 : OOXMLProperty::~OOXMLProperty()
35 : {
36 41204 : }
37 :
38 26651 : OOXMLPropertySet::~OOXMLPropertySet()
39 : {
40 26651 : }
41 :
42 654 : OOXMLTable::~OOXMLTable()
43 : {
44 654 : }
45 :
46 41204 : OOXMLPropertyImpl::OOXMLPropertyImpl(Id id, OOXMLValue::Pointer_t pValue,
47 : OOXMLPropertyImpl::Type_t eType)
48 41204 : : mId(id), mpValue(pValue), meType(eType)
49 : {
50 41204 : }
51 :
52 0 : OOXMLPropertyImpl::OOXMLPropertyImpl(const OOXMLPropertyImpl & rSprm)
53 0 : : OOXMLProperty(), mId(rSprm.mId), mpValue(rSprm.mpValue), meType(rSprm.meType)
54 : {
55 0 : }
56 :
57 82408 : OOXMLPropertyImpl::~OOXMLPropertyImpl()
58 : {
59 82408 : }
60 :
61 77747 : sal_uInt32 OOXMLPropertyImpl::getId() const
62 : {
63 77747 : return mId;
64 : }
65 :
66 38674 : Value::Pointer_t OOXMLPropertyImpl::getValue()
67 : {
68 38674 : Value::Pointer_t pResult;
69 :
70 38674 : if (mpValue.get() != NULL)
71 38674 : pResult = Value::Pointer_t(mpValue->clone());
72 : else
73 0 : pResult = Value::Pointer_t(new OOXMLValue());
74 :
75 38674 : return pResult;
76 : }
77 :
78 0 : writerfilter::Reference<BinaryObj>::Pointer_t OOXMLPropertyImpl::getBinary()
79 : {
80 0 : writerfilter::Reference<BinaryObj>::Pointer_t pResult;
81 :
82 0 : if (mpValue.get() != NULL)
83 0 : pResult = mpValue->getBinary();
84 :
85 0 : return pResult;
86 : }
87 :
88 0 : writerfilter::Reference<Stream>::Pointer_t OOXMLPropertyImpl::getStream()
89 : {
90 0 : writerfilter::Reference<Stream>::Pointer_t pResult;
91 :
92 0 : if (mpValue.get() != NULL)
93 0 : pResult = mpValue->getStream();
94 :
95 0 : return pResult;
96 : }
97 :
98 7441 : writerfilter::Reference<Properties>::Pointer_t OOXMLPropertyImpl::getProps()
99 : {
100 7441 : writerfilter::Reference<Properties>::Pointer_t pResult;
101 :
102 7441 : if (mpValue.get() != NULL)
103 7431 : pResult = mpValue->getProperties();
104 :
105 7441 : return pResult;
106 : }
107 :
108 0 : string OOXMLPropertyImpl::getName() const
109 : {
110 0 : string sResult = (*QNameToString::Instance())(mId);
111 :
112 0 : if (sResult.length() == 0)
113 0 : sResult = (*SprmIdToString::Instance())(mId);
114 :
115 0 : if (sResult.length() == 0)
116 0 : sResult = fastTokenToId(mId);
117 :
118 0 : if (sResult.length() == 0)
119 : {
120 : static char sBuffer[256];
121 :
122 0 : snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32, mId);
123 0 : sResult = sBuffer;
124 : }
125 :
126 0 : return sResult;
127 : }
128 :
129 0 : string OOXMLPropertyImpl::toString() const
130 : {
131 0 : string sResult = "(";
132 :
133 0 : sResult += getName();
134 0 : sResult += ", ";
135 0 : if (mpValue.get() != NULL)
136 0 : sResult += mpValue->toString();
137 : else
138 0 : sResult +="(null)";
139 0 : sResult +=")";
140 :
141 0 : return sResult;
142 : }
143 :
144 0 : Sprm::Kind OOXMLPropertyImpl::getKind()
145 : {
146 0 : return SprmKind(getId());
147 : }
148 :
149 0 : Sprm * OOXMLPropertyImpl::clone()
150 : {
151 0 : return new OOXMLPropertyImpl(*this);
152 : }
153 :
154 32338 : void OOXMLPropertyImpl::resolve(writerfilter::Properties & rProperties)
155 : {
156 32338 : writerfilter::Properties * pProperties = NULL;
157 : #ifdef DEBUG_PROTOCOL
158 : writerfilter::PropertiesProtocol::Pointer_t pProtocol
159 : (new writerfilter::PropertiesProtocol(&rProperties, debug_logger));
160 : pProperties = pProtocol.get();
161 : #else
162 32338 : pProperties = &rProperties;
163 : #endif
164 :
165 32338 : switch (meType)
166 : {
167 : case SPRM:
168 19677 : if (mId != 0x0)
169 19677 : pProperties->sprm(*this);
170 19677 : break;
171 : case ATTRIBUTE:
172 12661 : pProperties->attribute(mId, *getValue());
173 12661 : break;
174 : }
175 32338 : }
176 :
177 : /*
178 : class OOXMLValue
179 : */
180 :
181 70363 : OOXMLValue::OOXMLValue()
182 : {
183 70363 : }
184 :
185 110210 : OOXMLValue::~OOXMLValue()
186 : {
187 110210 : }
188 :
189 0 : bool OOXMLValue::getBool() const
190 : {
191 0 : return false;
192 : }
193 :
194 19572 : int OOXMLValue::getInt() const
195 : {
196 19572 : return 0;
197 : }
198 :
199 12915 : OUString OOXMLValue::getString() const
200 : {
201 12915 : return OUString();
202 : }
203 :
204 0 : uno::Any OOXMLValue::getAny() const
205 : {
206 0 : return uno::Any();
207 : }
208 :
209 398 : writerfilter::Reference<Properties>::Pointer_t OOXMLValue::getProperties()
210 : {
211 398 : return writerfilter::Reference<Properties>::Pointer_t();
212 : }
213 :
214 0 : writerfilter::Reference<Stream>::Pointer_t OOXMLValue::getStream()
215 : {
216 0 : return writerfilter::Reference<Stream>::Pointer_t();
217 : }
218 :
219 0 : writerfilter::Reference<BinaryObj>::Pointer_t OOXMLValue::getBinary()
220 : {
221 0 : return writerfilter::Reference<BinaryObj>::Pointer_t();
222 : }
223 :
224 0 : string OOXMLValue::toString() const
225 : {
226 0 : return "OOXMLValue";
227 : }
228 :
229 0 : OOXMLValue * OOXMLValue::clone() const
230 : {
231 0 : return new OOXMLValue(*this);
232 : }
233 :
234 : /*
235 : class OOXMLBinaryValue
236 : */
237 :
238 0 : OOXMLBinaryValue::OOXMLBinaryValue(OOXMLBinaryObjectReference::Pointer_t
239 : pBinaryObj)
240 0 : : mpBinaryObj(pBinaryObj)
241 : {
242 0 : }
243 :
244 0 : OOXMLBinaryValue::~OOXMLBinaryValue()
245 : {
246 0 : }
247 :
248 0 : writerfilter::Reference<BinaryObj>::Pointer_t OOXMLBinaryValue::getBinary()
249 : {
250 0 : return mpBinaryObj;
251 : }
252 :
253 0 : string OOXMLBinaryValue::toString() const
254 : {
255 0 : return "BinaryObj";
256 : }
257 :
258 0 : OOXMLValue * OOXMLBinaryValue::clone() const
259 : {
260 0 : return new OOXMLBinaryValue(mpBinaryObj);
261 : }
262 :
263 : /*
264 : class OOXMLBooleanValue
265 : */
266 :
267 1669 : OOXMLBooleanValue::OOXMLBooleanValue(bool bValue)
268 1669 : : mbValue(bValue)
269 : {
270 1669 : }
271 :
272 1274 : OOXMLBooleanValue::OOXMLBooleanValue(const OUString & rValue)
273 1274 : : mbValue(false)
274 : {
275 1274 : mbValue = (rValue == "true"
276 1156 : || rValue == "True"
277 1156 : || rValue == "1"
278 504 : || rValue == "on"
279 4090 : || rValue == "On");
280 1274 : }
281 :
282 13832 : OOXMLBooleanValue::~OOXMLBooleanValue()
283 : {
284 13832 : }
285 :
286 0 : bool OOXMLBooleanValue::getBool() const
287 : {
288 0 : return mbValue;
289 : }
290 :
291 3921 : int OOXMLBooleanValue::getInt() const
292 : {
293 3921 : return mbValue ? 1 : 0;
294 : }
295 :
296 0 : uno::Any OOXMLBooleanValue::getAny() const
297 : {
298 0 : uno::Any aResult(mbValue);
299 :
300 0 : return aResult;
301 : }
302 :
303 0 : string OOXMLBooleanValue::toString() const
304 : {
305 0 : return mbValue ? "true" : "false";
306 : }
307 :
308 3973 : OOXMLValue * OOXMLBooleanValue::clone() const
309 : {
310 3973 : return new OOXMLBooleanValue(*this);
311 : }
312 :
313 : /*
314 : class OOXMLStringValue
315 : */
316 :
317 21156 : OOXMLStringValue::OOXMLStringValue(const OUString & rStr)
318 21156 : : mStr(rStr)
319 : {
320 21156 : }
321 :
322 56202 : OOXMLStringValue::~OOXMLStringValue()
323 : {
324 56202 : }
325 :
326 0 : uno::Any OOXMLStringValue::getAny() const
327 : {
328 0 : uno::Any aAny(mStr);
329 :
330 0 : return aAny;
331 : }
332 :
333 5895 : OUString OOXMLStringValue::getString() const
334 : {
335 5895 : return mStr;
336 : }
337 :
338 0 : string OOXMLStringValue::toString() const
339 : {
340 0 : return OUStringToOString(mStr, RTL_TEXTENCODING_ASCII_US).getStr();
341 : }
342 :
343 6945 : OOXMLValue * OOXMLStringValue::clone() const
344 : {
345 6945 : return new OOXMLStringValue(*this);
346 : }
347 :
348 : /*
349 : class OOXMLInputStreamValue
350 : */
351 3 : OOXMLInputStreamValue::OOXMLInputStreamValue(uno::Reference<io::XInputStream> xInputStream)
352 3 : : mxInputStream(xInputStream)
353 : {
354 3 : }
355 :
356 6 : OOXMLInputStreamValue::~OOXMLInputStreamValue()
357 : {
358 6 : }
359 :
360 1 : uno::Any OOXMLInputStreamValue::getAny() const
361 : {
362 1 : uno::Any aAny(mxInputStream);
363 :
364 1 : return aAny;
365 : }
366 :
367 0 : string OOXMLInputStreamValue::toString() const
368 : {
369 0 : return "InputStream";
370 : }
371 :
372 2 : OOXMLValue * OOXMLInputStreamValue::clone() const
373 : {
374 2 : return new OOXMLInputStreamValue(mxInputStream);
375 : }
376 :
377 : /*
378 : struct OOXMLPropertySetImplCompare
379 : */
380 :
381 0 : bool OOXMLPropertySetImplCompare::operator()(const OOXMLProperty::Pointer_t x,
382 : const OOXMLProperty::Pointer_t y) const
383 : {
384 0 : bool bResult = false;
385 :
386 0 : if (x.get() == NULL && y.get() != NULL)
387 0 : bResult = true;
388 0 : else if (x.get() != NULL && y.get() != NULL)
389 0 : bResult = x->getId() < y->getId();
390 :
391 0 : return bResult;
392 : }
393 :
394 : /**
395 : class OOXMLPropertySetImpl
396 : */
397 :
398 17937 : OOXMLPropertySetImpl::OOXMLPropertySetImpl()
399 17937 : : msType("OOXMLPropertySetImpl")
400 : {
401 17937 : }
402 :
403 53302 : OOXMLPropertySetImpl::~OOXMLPropertySetImpl()
404 : {
405 53302 : }
406 :
407 10776 : void OOXMLPropertySetImpl::resolve(Properties & rHandler)
408 : {
409 10776 : size_t nIt = 0;
410 :
411 : // The pProp->resolve(rHandler) call below can cause elements to
412 : // be appended to mProperties. I don't think it can cause elements
413 : // to be deleted. But let's check with < here just to be safe that
414 : // the indexing below works.
415 54369 : while (nIt < mProperties.size())
416 : {
417 32817 : OOXMLProperty::Pointer_t pProp = mProperties[nIt];
418 :
419 32817 : if (pProp.get() != NULL)
420 32338 : pProp->resolve(rHandler);
421 : #ifdef DEBUG_RESOLVE
422 : else
423 : {
424 : debug_logger->startElement("error");
425 : debug_logger->chars(std::string("zero-property"));
426 : debug_logger->endElement();
427 : }
428 : #endif
429 :
430 32817 : ++nIt;
431 32817 : }
432 10776 : }
433 :
434 0 : OOXMLPropertySetImpl::OOXMLProperties_t::iterator OOXMLPropertySetImpl::begin()
435 : {
436 0 : return mProperties.begin();
437 : }
438 :
439 0 : OOXMLPropertySetImpl::OOXMLProperties_t::iterator OOXMLPropertySetImpl::end()
440 : {
441 0 : return mProperties.end();
442 : }
443 :
444 : OOXMLPropertySetImpl::OOXMLProperties_t::const_iterator
445 0 : OOXMLPropertySetImpl::begin() const
446 : {
447 0 : return mProperties.begin();
448 : }
449 :
450 : OOXMLPropertySetImpl::OOXMLProperties_t::const_iterator
451 0 : OOXMLPropertySetImpl::end() const
452 : {
453 0 : return mProperties.end();
454 : }
455 :
456 2035 : string OOXMLPropertySetImpl::getType() const
457 : {
458 2035 : return msType;
459 : }
460 :
461 41683 : void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
462 : {
463 : #ifdef DEBUG_PROPERTY_SET
464 : debug_logger->startElement("propertyset.add");
465 : debug_logger->chars(pProperty->toString());
466 : #endif
467 :
468 41683 : if (pProperty.get() != NULL && pProperty->getId() != 0x0)
469 : {
470 41472 : mProperties.push_back(pProperty);
471 : }
472 : #ifdef DEBUG_PROPERTY_SET
473 : else
474 : {
475 : debug_logger->element("warning.property_not_added");
476 : }
477 :
478 : debug_logger->endElement("propertyset.add");
479 : #endif
480 41683 : }
481 :
482 218 : void OOXMLPropertySetImpl::add(OOXMLPropertySet::Pointer_t pPropertySet)
483 : {
484 218 : if (pPropertySet.get() != NULL)
485 : {
486 : OOXMLPropertySetImpl * pSet =
487 218 : dynamic_cast<OOXMLPropertySetImpl *>(pPropertySet.get());
488 :
489 218 : if (pSet != NULL)
490 : {
491 218 : mProperties.resize(mProperties.size() + pSet->mProperties.size());
492 2091 : for (OOXMLProperties_t::iterator aIt = pSet->mProperties.begin();
493 1394 : aIt != pSet->mProperties.end(); ++aIt)
494 479 : add(*aIt);
495 : }
496 : }
497 218 : }
498 :
499 8714 : OOXMLPropertySet * OOXMLPropertySetImpl::clone() const
500 : {
501 8714 : return new OOXMLPropertySetImpl(*this);
502 : }
503 :
504 0 : void OOXMLPropertySetImpl::setType(const string & rsType)
505 : {
506 0 : msType = rsType;
507 0 : }
508 :
509 0 : string OOXMLPropertySetImpl::toString()
510 : {
511 0 : string sResult = "[";
512 : char sBuffer[256];
513 0 : snprintf(sBuffer, sizeof(sBuffer), "%p", this);
514 0 : sResult += sBuffer;
515 0 : sResult += ":";
516 :
517 0 : OOXMLProperties_t::iterator aItBegin = begin();
518 0 : OOXMLProperties_t::iterator aItEnd = end();
519 :
520 0 : for (OOXMLProperties_t::iterator aIt = aItBegin; aIt != aItEnd; ++aIt)
521 : {
522 0 : if (aIt != aItBegin)
523 0 : sResult += ", ";
524 :
525 0 : if ((*aIt).get() != NULL)
526 0 : sResult += (*aIt)->toString();
527 : else
528 0 : sResult += "0x0";
529 : }
530 :
531 0 : sResult += "]";
532 :
533 0 : return sResult;
534 : }
535 :
536 : /*
537 : class OOXMLPropertySetValue
538 : */
539 :
540 14048 : OOXMLPropertySetValue::OOXMLPropertySetValue
541 : (OOXMLPropertySet::Pointer_t pPropertySet)
542 14048 : : mpPropertySet(pPropertySet)
543 : {
544 14048 : }
545 :
546 57246 : OOXMLPropertySetValue::~OOXMLPropertySetValue()
547 : {
548 57246 : }
549 :
550 8625 : writerfilter::Reference<Properties>::Pointer_t OOXMLPropertySetValue::getProperties()
551 : {
552 : return writerfilter::Reference<Properties>::Pointer_t
553 8625 : (mpPropertySet->clone());
554 : }
555 :
556 0 : string OOXMLPropertySetValue::toString() const
557 : {
558 : char sBuffer[256];
559 :
560 0 : snprintf(sBuffer, sizeof(sBuffer), "t:%p, m:%p", this, mpPropertySet.get());
561 :
562 0 : return "OOXMLPropertySetValue(" + string(sBuffer) + ")";
563 : }
564 :
565 14575 : OOXMLValue * OOXMLPropertySetValue::clone() const
566 : {
567 14575 : return new OOXMLPropertySetValue(*this);
568 : }
569 :
570 : /*
571 : class OOXMLIntegerValue
572 : */
573 :
574 11871 : OOXMLIntegerValue::OOXMLIntegerValue(sal_Int32 nValue)
575 11871 : : mnValue(nValue)
576 : {
577 11871 : }
578 :
579 10944 : OOXMLIntegerValue::OOXMLIntegerValue(const OUString & rValue)
580 10944 : : mnValue(0)
581 : {
582 10944 : mnValue = rValue.toInt32();
583 10944 : }
584 :
585 70998 : OOXMLIntegerValue::~OOXMLIntegerValue()
586 : {
587 70998 : }
588 :
589 12595 : int OOXMLIntegerValue::getInt() const
590 : {
591 12595 : return mnValue;
592 : }
593 :
594 0 : uno::Any OOXMLIntegerValue::getAny() const
595 : {
596 0 : uno::Any aResult(mnValue);
597 :
598 0 : return aResult;
599 : }
600 :
601 12684 : OOXMLValue * OOXMLIntegerValue::clone() const
602 : {
603 12684 : return new OOXMLIntegerValue(*this);
604 : }
605 :
606 0 : string OOXMLIntegerValue::toString() const
607 : {
608 : char buffer[256];
609 0 : snprintf(buffer, sizeof(buffer), "%" SAL_PRIdINT32, mnValue);
610 :
611 0 : return buffer;
612 : }
613 :
614 : /*
615 : class OOXMLHexValue
616 : */
617 :
618 0 : OOXMLHexValue::OOXMLHexValue(sal_uInt32 nValue)
619 0 : : mnValue(nValue)
620 : {
621 0 : }
622 :
623 9146 : OOXMLHexValue::OOXMLHexValue(const OUString & rValue)
624 : {
625 9146 : mnValue = static_cast<sal_uInt32>(rValue.toInt32(16));
626 9146 : }
627 :
628 21632 : OOXMLHexValue::~OOXMLHexValue()
629 : {
630 21632 : }
631 :
632 1670 : int OOXMLHexValue::getInt() const
633 : {
634 1670 : return mnValue;
635 : }
636 :
637 1670 : OOXMLValue * OOXMLHexValue::clone() const
638 : {
639 1670 : return new OOXMLHexValue(*this);
640 : }
641 :
642 0 : string OOXMLHexValue::toString() const
643 : {
644 : char buffer[256];
645 0 : snprintf(buffer, sizeof(buffer), "0x%" SAL_PRIxUINT32, mnValue);
646 :
647 0 : return buffer;
648 : }
649 :
650 : /*
651 : class OOXMLShapeValue
652 : */
653 :
654 :
655 84 : OOXMLShapeValue::OOXMLShapeValue(uno::Reference<XShape> rShape)
656 84 : : mrShape(rShape)
657 : {
658 84 : }
659 :
660 168 : OOXMLShapeValue::~OOXMLShapeValue()
661 : {
662 168 : }
663 :
664 35 : uno::Any OOXMLShapeValue::getAny() const
665 : {
666 35 : return uno::Any(mrShape);
667 : }
668 :
669 0 : string OOXMLShapeValue::toString() const
670 : {
671 0 : return "Shape";
672 : }
673 :
674 49 : OOXMLValue * OOXMLShapeValue::clone() const
675 : {
676 49 : return new OOXMLShapeValue(mrShape);
677 : }
678 :
679 : /*
680 : class OOXMLStarMathValue
681 : */
682 :
683 :
684 168 : OOXMLStarMathValue::OOXMLStarMathValue( uno::Reference< embed::XEmbeddedObject > c )
685 168 : : component(c)
686 : {
687 168 : }
688 :
689 336 : OOXMLStarMathValue::~OOXMLStarMathValue()
690 : {
691 336 : }
692 :
693 168 : uno::Any OOXMLStarMathValue::getAny() const
694 : {
695 168 : return uno::Any(component);
696 : }
697 :
698 0 : string OOXMLStarMathValue::toString() const
699 : {
700 0 : return "StarMath";
701 : }
702 :
703 84 : OOXMLValue * OOXMLStarMathValue::clone() const
704 : {
705 84 : return new OOXMLStarMathValue( component );
706 : }
707 :
708 : /*
709 : class OOXMLTableImpl
710 : */
711 :
712 327 : OOXMLTableImpl::OOXMLTableImpl()
713 : {
714 327 : }
715 :
716 981 : OOXMLTableImpl::~OOXMLTableImpl()
717 : {
718 981 : }
719 :
720 327 : void OOXMLTableImpl::resolve(Table & rTable)
721 : {
722 : #ifdef DEBUG_PROTOCOL
723 : Table::Pointer_t pTable(new TableProtocol(&rTable, debug_logger));
724 : #else
725 327 : Table * pTable = &rTable;
726 : #endif
727 :
728 327 : int nPos = 0;
729 :
730 327 : PropertySets_t::iterator it = mPropertySets.begin();
731 327 : PropertySets_t::iterator itEnd = mPropertySets.end();
732 :
733 2051 : while (it != itEnd)
734 : {
735 : writerfilter::Reference<Properties>::Pointer_t pProperties
736 1397 : ((*it)->getProperties());
737 :
738 1397 : if (pProperties.get() != NULL)
739 1397 : pTable->entry(nPos, pProperties);
740 :
741 1397 : ++nPos;
742 1397 : ++it;
743 1397 : }
744 327 : }
745 :
746 1397 : void OOXMLTableImpl::add(ValuePointer_t pPropertySet)
747 : {
748 1397 : if (pPropertySet.get() != NULL)
749 1397 : mPropertySets.push_back(pPropertySet);
750 1397 : }
751 :
752 0 : string OOXMLTableImpl::getType() const
753 : {
754 0 : return "OOXMLTableImpl";
755 : }
756 :
757 327 : OOXMLTable * OOXMLTableImpl::clone() const
758 : {
759 327 : return new OOXMLTableImpl(*this);
760 : }
761 :
762 : /*
763 : class: OOXMLPropertySetEntryToString
764 : */
765 :
766 0 : OOXMLPropertySetEntryToString::OOXMLPropertySetEntryToString(Id nId)
767 0 : : mnId(nId)
768 : {
769 0 : }
770 :
771 0 : OOXMLPropertySetEntryToString::~OOXMLPropertySetEntryToString()
772 : {
773 0 : }
774 :
775 0 : void OOXMLPropertySetEntryToString::sprm(Sprm & /*rSprm*/)
776 : {
777 0 : }
778 :
779 0 : void OOXMLPropertySetEntryToString::attribute(Id nId, Value & rValue)
780 : {
781 0 : if (nId == mnId)
782 0 : mStr = rValue.getString();
783 0 : }
784 :
785 0 : const OUString & OOXMLPropertySetEntryToString::getString() const
786 : {
787 0 : return mStr;
788 : }
789 :
790 69 : OOXMLPropertySetEntryToInteger::OOXMLPropertySetEntryToInteger(Id nId)
791 69 : : mnId(nId), mnValue(0)
792 : {
793 69 : }
794 :
795 69 : OOXMLPropertySetEntryToInteger::~OOXMLPropertySetEntryToInteger()
796 : {
797 69 : }
798 :
799 0 : void OOXMLPropertySetEntryToInteger::sprm(Sprm & /*rSprm*/)
800 : {
801 0 : }
802 :
803 69 : void OOXMLPropertySetEntryToInteger::attribute(Id nId, Value & rValue)
804 : {
805 69 : if (nId == mnId)
806 69 : mnValue = rValue.getInt();
807 69 : }
808 :
809 69 : int OOXMLPropertySetEntryToInteger::getValue() const
810 : {
811 69 : return mnValue;
812 : }
813 :
814 15 : }}
815 :
816 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|