From 92b505af4b1c0af48583cabbd3352fba7d03be2f Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Thu, 8 Mar 2007 15:34:13 +0000 Subject: [PATCH] OOXMLIntegerValue --- .../source/ooxml/OOXMLPropertySetImpl.cxx | 37 ++++++++++++++++++- .../source/ooxml/OOXMLPropertySetImpl.hxx | 16 +++++++- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index c0fea4a7ac65..ff6dee179085 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: OOXMLPropertySetImpl.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: hbrinkm $ $Date: 2007-03-06 13:42:54 $ + * last change: $Author: hbrinkm $ $Date: 2007-03-08 16:34:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -67,6 +67,8 @@ Value::Pointer_t OOXMLPropertyImpl::getValue() if (mpValue.get() != NULL) pResult = Value::Pointer_t(mpValue->clone()); + else + pResult = Value::Pointer_t(new OOXMLValue()); return pResult; } @@ -335,4 +337,35 @@ OOXMLValue * OOXMLPropertySetValue::clone() const return new OOXMLPropertySetValue(*this); } +/* + class OOXMLIntegerValue +*/ + +OOXMLIntegerValue::OOXMLIntegerValue(sal_Int32 nValue) +: mnValue(nValue) +{ +} + +OOXMLIntegerValue::~OOXMLIntegerValue() +{ +} + +int OOXMLIntegerValue::getInt() const +{ + return mnValue; +} + +OOXMLValue * OOXMLIntegerValue::clone() const +{ + return new OOXMLIntegerValue(*this); +} + +string OOXMLIntegerValue::toString() const +{ + char buffer[256]; + snprintf(buffer, sizeof(buffer), "%ld", mnValue); + + return buffer; +} + } diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx index df1c07cc15c0..a137db2ed2ca 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx @@ -4,9 +4,9 @@ * * $RCSfile: OOXMLPropertySetImpl.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hbrinkm $ $Date: 2007-03-06 09:51:37 $ + * last change: $Author: hbrinkm $ $Date: 2007-03-08 16:34:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -138,6 +138,18 @@ public: virtual OOXMLValue * clone() const; }; +class OOXMLIntegerValue : public OOXMLValue +{ + sal_Int32 mnValue; +public: + OOXMLIntegerValue(sal_Int32 nValue); + virtual ~OOXMLIntegerValue(); + + virtual int getInt() const; + virtual string toString() const; + virtual OOXMLValue * clone() const; +}; + } #endif // INCLUDED_OOXML_PROPERTY_SET_IMPL_HXX