diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-28 16:39:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-07-01 11:43:57 +0200 |
commit | 7a8f720cc0b1e84339341919f9520cb25ce5df34 (patch) | |
tree | dffc5d9f23ae90f19788d56b66567d3e868e27d4 /writerfilter | |
parent | Resolves: fdo#66403 infinite loop, typo i should be it (diff) | |
download | core-7a8f720cc0b1e84339341919f9520cb25ce5df34.tar.gz core-7a8f720cc0b1e84339341919f9520cb25ce5df34.zip |
RTFValue: support storing RTFShape
Change-Id: Ia24fe7556598ad88f3b72a62bef2361a3fd0a712
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfvalue.cxx | 32 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfvalue.hxx | 7 |
2 files changed, 36 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx index a9f31f8740c7..b786b093b9a9 100644 --- a/writerfilter/source/rtftok/rtfvalue.cxx +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -8,6 +8,7 @@ */ #include <rtfreferenceproperties.hxx> +#include <rtfdocumentimpl.hxx> namespace writerfilter { namespace rtftok { @@ -15,7 +16,8 @@ namespace rtftok { RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, RTFSprms rSprms, uno::Reference<drawing::XShape> xShape, - uno::Reference<io::XInputStream> xStream, uno::Reference<embed::XEmbeddedObject> xObject, bool bForceString) + uno::Reference<io::XInputStream> xStream, uno::Reference<embed::XEmbeddedObject> xObject, bool bForceString, + RTFShape aShape) : m_nValue(nValue), m_sValue(sValue), m_xShape(xShape), @@ -25,6 +27,7 @@ RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, { m_pAttributes.reset(new RTFSprms(rAttributes)); m_pSprms.reset(new RTFSprms(rSprms)); + m_pShape.reset(new RTFShape(aShape)); } RTFValue::RTFValue(int nValue) @@ -37,6 +40,7 @@ RTFValue::RTFValue(int nValue) { m_pAttributes.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(OUString sValue, bool bForce) @@ -49,6 +53,7 @@ RTFValue::RTFValue(OUString sValue, bool bForce) { m_pAttributes.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(RTFSprms rAttributes) @@ -61,6 +66,7 @@ RTFValue::RTFValue(RTFSprms rAttributes) { m_pAttributes.reset(new RTFSprms(rAttributes)); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms) @@ -73,6 +79,7 @@ RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms) { m_pAttributes.reset(new RTFSprms(rAttributes)); m_pSprms.reset(new RTFSprms(rSprms)); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape) @@ -85,6 +92,7 @@ RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape) { m_pAttributes.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream) @@ -97,6 +105,7 @@ RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream) { m_pAttributes.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); } RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject) @@ -109,6 +118,20 @@ RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject) { m_pAttributes.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape()); +} + +RTFValue::RTFValue(RTFShape aShape) + : m_nValue(), + m_sValue(), + m_xShape(), + m_xStream(), + m_xObject(), + m_bForceString(false) +{ + m_pAttributes.reset(new RTFSprms()); + m_pSprms.reset(new RTFSprms()); + m_pShape.reset(new RTFShape(aShape)); } RTFValue::~RTFValue() @@ -149,6 +172,11 @@ uno::Any RTFValue::getAny() const return ret; } +RTFShape& RTFValue::getShape() const +{ + return *m_pShape; +} + writerfilter::Reference<Properties>::Pointer_t RTFValue::getProperties() { writerfilter::Reference<Properties>::Pointer_t const pProperties( @@ -177,7 +205,7 @@ std::string RTFValue::toString() const RTFValue* RTFValue::Clone() { - return new RTFValue(m_nValue, m_sValue, *m_pAttributes, *m_pSprms, m_xShape, m_xStream, m_xObject, m_bForceString); + return new RTFValue(m_nValue, m_sValue, *m_pAttributes, *m_pSprms, m_xShape, m_xStream, m_xObject, m_bForceString, *m_pShape); } bool RTFValue::equals(RTFValue& rOther) diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx index 02bf93167b8a..d42be11e73c3 100644 --- a/writerfilter/source/rtftok/rtfvalue.hxx +++ b/writerfilter/source/rtftok/rtfvalue.hxx @@ -17,6 +17,7 @@ namespace writerfilter { namespace rtftok { class RTFSprms; + class RTFShape; /// Value of an RTF keyword class RTFValue : public Value @@ -24,7 +25,8 @@ namespace writerfilter { public: typedef boost::shared_ptr<RTFValue> Pointer_t; RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, RTFSprms rSprms, uno::Reference<drawing::XShape> rShape, - uno::Reference<io::XInputStream> rStream, uno::Reference<embed::XEmbeddedObject> rObject, bool bForceString); + uno::Reference<io::XInputStream> rStream, uno::Reference<embed::XEmbeddedObject> rObject, bool bForceString, + RTFShape aShape); RTFValue(int nValue); RTFValue(OUString sValue, bool bForce = false); RTFValue(RTFSprms rAttributes); @@ -32,6 +34,7 @@ namespace writerfilter { RTFValue(uno::Reference<drawing::XShape> rShape); RTFValue(uno::Reference<io::XInputStream> rStream); RTFValue(uno::Reference<embed::XEmbeddedObject> rObject); + RTFValue(RTFShape aShape); virtual ~RTFValue(); void setString(OUString sValue); virtual int getInt() const; @@ -44,6 +47,7 @@ namespace writerfilter { virtual RTFValue* Clone(); RTFSprms& getAttributes(); RTFSprms& getSprms(); + RTFShape& getShape() const; bool equals(RTFValue& rOther); private: RTFValue& operator=(RTFValue const& rOther); @@ -55,6 +59,7 @@ namespace writerfilter { uno::Reference<io::XInputStream> m_xStream; uno::Reference<embed::XEmbeddedObject> m_xObject; bool m_bForceString; + boost::shared_ptr<RTFShape> m_pShape; }; } // namespace rtftok } // namespace writerfilter |