Kaydet (Commit) 7a8f720c authored tarafından Miklos Vajna's avatar Miklos Vajna

RTFValue: support storing RTFShape

Change-Id: Ia24fe7556598ad88f3b72a62bef2361a3fd0a712
üst e2154413
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <rtfreferenceproperties.hxx> #include <rtfreferenceproperties.hxx>
#include <rtfdocumentimpl.hxx>
namespace writerfilter { namespace writerfilter {
namespace rtftok { namespace rtftok {
...@@ -15,7 +16,8 @@ namespace rtftok { ...@@ -15,7 +16,8 @@ namespace rtftok {
RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes,
RTFSprms rSprms, uno::Reference<drawing::XShape> xShape, 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_nValue(nValue),
m_sValue(sValue), m_sValue(sValue),
m_xShape(xShape), m_xShape(xShape),
...@@ -25,6 +27,7 @@ RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, ...@@ -25,6 +27,7 @@ RTFValue::RTFValue(int nValue, OUString sValue, RTFSprms rAttributes,
{ {
m_pAttributes.reset(new RTFSprms(rAttributes)); m_pAttributes.reset(new RTFSprms(rAttributes));
m_pSprms.reset(new RTFSprms(rSprms)); m_pSprms.reset(new RTFSprms(rSprms));
m_pShape.reset(new RTFShape(aShape));
} }
RTFValue::RTFValue(int nValue) RTFValue::RTFValue(int nValue)
...@@ -37,6 +40,7 @@ RTFValue::RTFValue(int nValue) ...@@ -37,6 +40,7 @@ RTFValue::RTFValue(int nValue)
{ {
m_pAttributes.reset(new RTFSprms()); m_pAttributes.reset(new RTFSprms());
m_pSprms.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms());
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(OUString sValue, bool bForce) RTFValue::RTFValue(OUString sValue, bool bForce)
...@@ -49,6 +53,7 @@ RTFValue::RTFValue(OUString sValue, bool bForce) ...@@ -49,6 +53,7 @@ RTFValue::RTFValue(OUString sValue, bool bForce)
{ {
m_pAttributes.reset(new RTFSprms()); m_pAttributes.reset(new RTFSprms());
m_pSprms.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms());
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(RTFSprms rAttributes) RTFValue::RTFValue(RTFSprms rAttributes)
...@@ -61,6 +66,7 @@ RTFValue::RTFValue(RTFSprms rAttributes) ...@@ -61,6 +66,7 @@ RTFValue::RTFValue(RTFSprms rAttributes)
{ {
m_pAttributes.reset(new RTFSprms(rAttributes)); m_pAttributes.reset(new RTFSprms(rAttributes));
m_pSprms.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms());
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms) RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms)
...@@ -73,6 +79,7 @@ RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms) ...@@ -73,6 +79,7 @@ RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms)
{ {
m_pAttributes.reset(new RTFSprms(rAttributes)); m_pAttributes.reset(new RTFSprms(rAttributes));
m_pSprms.reset(new RTFSprms(rSprms)); m_pSprms.reset(new RTFSprms(rSprms));
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape) RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape)
...@@ -85,6 +92,7 @@ RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape) ...@@ -85,6 +92,7 @@ RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape)
{ {
m_pAttributes.reset(new RTFSprms()); m_pAttributes.reset(new RTFSprms());
m_pSprms.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms());
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream) RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream)
...@@ -97,6 +105,7 @@ RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream) ...@@ -97,6 +105,7 @@ RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream)
{ {
m_pAttributes.reset(new RTFSprms()); m_pAttributes.reset(new RTFSprms());
m_pSprms.reset(new RTFSprms()); m_pSprms.reset(new RTFSprms());
m_pShape.reset(new RTFShape());
} }
RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject) RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject)
...@@ -109,6 +118,20 @@ RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject) ...@@ -109,6 +118,20 @@ RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject)
{ {
m_pAttributes.reset(new RTFSprms()); m_pAttributes.reset(new RTFSprms());
m_pSprms.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() RTFValue::~RTFValue()
...@@ -149,6 +172,11 @@ uno::Any RTFValue::getAny() const ...@@ -149,6 +172,11 @@ uno::Any RTFValue::getAny() const
return ret; return ret;
} }
RTFShape& RTFValue::getShape() const
{
return *m_pShape;
}
writerfilter::Reference<Properties>::Pointer_t RTFValue::getProperties() writerfilter::Reference<Properties>::Pointer_t RTFValue::getProperties()
{ {
writerfilter::Reference<Properties>::Pointer_t const pProperties( writerfilter::Reference<Properties>::Pointer_t const pProperties(
...@@ -177,7 +205,7 @@ std::string RTFValue::toString() const ...@@ -177,7 +205,7 @@ std::string RTFValue::toString() const
RTFValue* RTFValue::Clone() 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) bool RTFValue::equals(RTFValue& rOther)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
namespace writerfilter { namespace writerfilter {
namespace rtftok { namespace rtftok {
class RTFSprms; class RTFSprms;
class RTFShape;
/// Value of an RTF keyword /// Value of an RTF keyword
class RTFValue class RTFValue
: public Value : public Value
...@@ -24,7 +25,8 @@ namespace writerfilter { ...@@ -24,7 +25,8 @@ namespace writerfilter {
public: public:
typedef boost::shared_ptr<RTFValue> Pointer_t; typedef boost::shared_ptr<RTFValue> Pointer_t;
RTFValue(int nValue, OUString sValue, RTFSprms rAttributes, RTFSprms rSprms, uno::Reference<drawing::XShape> rShape, 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(int nValue);
RTFValue(OUString sValue, bool bForce = false); RTFValue(OUString sValue, bool bForce = false);
RTFValue(RTFSprms rAttributes); RTFValue(RTFSprms rAttributes);
...@@ -32,6 +34,7 @@ namespace writerfilter { ...@@ -32,6 +34,7 @@ namespace writerfilter {
RTFValue(uno::Reference<drawing::XShape> rShape); RTFValue(uno::Reference<drawing::XShape> rShape);
RTFValue(uno::Reference<io::XInputStream> rStream); RTFValue(uno::Reference<io::XInputStream> rStream);
RTFValue(uno::Reference<embed::XEmbeddedObject> rObject); RTFValue(uno::Reference<embed::XEmbeddedObject> rObject);
RTFValue(RTFShape aShape);
virtual ~RTFValue(); virtual ~RTFValue();
void setString(OUString sValue); void setString(OUString sValue);
virtual int getInt() const; virtual int getInt() const;
...@@ -44,6 +47,7 @@ namespace writerfilter { ...@@ -44,6 +47,7 @@ namespace writerfilter {
virtual RTFValue* Clone(); virtual RTFValue* Clone();
RTFSprms& getAttributes(); RTFSprms& getAttributes();
RTFSprms& getSprms(); RTFSprms& getSprms();
RTFShape& getShape() const;
bool equals(RTFValue& rOther); bool equals(RTFValue& rOther);
private: private:
RTFValue& operator=(RTFValue const& rOther); RTFValue& operator=(RTFValue const& rOther);
...@@ -55,6 +59,7 @@ namespace writerfilter { ...@@ -55,6 +59,7 @@ namespace writerfilter {
uno::Reference<io::XInputStream> m_xStream; uno::Reference<io::XInputStream> m_xStream;
uno::Reference<embed::XEmbeddedObject> m_xObject; uno::Reference<embed::XEmbeddedObject> m_xObject;
bool m_bForceString; bool m_bForceString;
boost::shared_ptr<RTFShape> m_pShape;
}; };
} // namespace rtftok } // namespace rtftok
} // namespace writerfilter } // namespace writerfilter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment