summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-23 13:38:52 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-23 14:53:18 +0200
commite7e2b7daadeb901bee3d644dd0faf701d3ca34a2 (patch)
treeaf6ec10e0373a1ae05c7ca4a7f92d600818ac1a3 /writerfilter
parent02e80d2e431a57ad775a674eb3cfcd6cec53e09f (diff)
RTFValue: extend to be able to store embed::XEmbeddedObject
Change-Id: I6218be1f4afe22665ab85f7d731e1c1567bb2c8e
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfvalue.cxx25
-rw-r--r--writerfilter/source/rtftok/rtfvalue.hxx5
2 files changed, 27 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx
index 13613fa060c7..488252209eea 100644
--- a/writerfilter/source/rtftok/rtfvalue.cxx
+++ b/writerfilter/source/rtftok/rtfvalue.cxx
@@ -35,11 +35,12 @@ using rtl::OUString;
RTFValue::RTFValue(int nValue, rtl::OUString sValue, RTFSprms rAttributes,
RTFSprms rSprms, uno::Reference<drawing::XShape> xShape,
- uno::Reference<io::XInputStream> xStream, bool bForceString)
+ uno::Reference<io::XInputStream> xStream, uno::Reference<embed::XEmbeddedObject> xObject, bool bForceString)
: m_nValue(nValue),
m_sValue(sValue),
m_xShape(xShape),
m_xStream(xStream),
+ m_xObject(xObject),
m_bForceString(bForceString)
{
m_pAttributes.reset(new RTFSprms(rAttributes));
@@ -51,6 +52,7 @@ RTFValue::RTFValue(int nValue)
m_sValue(),
m_xShape(),
m_xStream(),
+ m_xObject(),
m_bForceString(false)
{
m_pAttributes.reset(new RTFSprms());
@@ -62,6 +64,7 @@ RTFValue::RTFValue(OUString sValue, bool bForce)
m_sValue(sValue),
m_xShape(),
m_xStream(),
+ m_xObject(),
m_bForceString(bForce)
{
m_pAttributes.reset(new RTFSprms());
@@ -73,6 +76,7 @@ RTFValue::RTFValue(RTFSprms rAttributes)
m_sValue(),
m_xShape(),
m_xStream(),
+ m_xObject(),
m_bForceString(false)
{
m_pAttributes.reset(new RTFSprms(rAttributes));
@@ -84,6 +88,7 @@ RTFValue::RTFValue(RTFSprms rAttributes, RTFSprms rSprms)
m_sValue(),
m_xShape(),
m_xStream(),
+ m_xObject(),
m_bForceString(false)
{
m_pAttributes.reset(new RTFSprms(rAttributes));
@@ -95,6 +100,7 @@ RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape)
m_sValue(),
m_xShape(rShape),
m_xStream(),
+ m_xObject(),
m_bForceString(false)
{
m_pAttributes.reset(new RTFSprms());
@@ -106,6 +112,19 @@ RTFValue::RTFValue(uno::Reference<io::XInputStream> rStream)
m_sValue(),
m_xShape(),
m_xStream(rStream),
+ m_xObject(),
+ m_bForceString(false)
+{
+ m_pAttributes.reset(new RTFSprms());
+ m_pSprms.reset(new RTFSprms());
+}
+
+RTFValue::RTFValue(uno::Reference<embed::XEmbeddedObject> xObject)
+ : m_nValue(),
+ m_sValue(),
+ m_xShape(),
+ m_xStream(),
+ m_xObject(xObject),
m_bForceString(false)
{
m_pAttributes.reset(new RTFSprms());
@@ -143,6 +162,8 @@ uno::Any RTFValue::getAny() const
ret <<= m_xShape;
else if (m_xStream.is())
ret <<= m_xStream;
+ else if (m_xObject.is())
+ ret <<= m_xObject;
else
ret <<= static_cast<sal_Int32>(m_nValue);
return ret;
@@ -176,7 +197,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_bForceString);
+ return new RTFValue(m_nValue, m_sValue, *m_pAttributes, *m_pSprms, m_xShape, m_xStream, m_xObject, m_bForceString);
}
RTFSprms& RTFValue::getAttributes()
diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx
index 8a14ef5d8d9a..6751126ac3bc 100644
--- a/writerfilter/source/rtftok/rtfvalue.hxx
+++ b/writerfilter/source/rtftok/rtfvalue.hxx
@@ -30,6 +30,7 @@
#include <resourcemodel/WW8ResourceModel.hxx>
#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
namespace writerfilter {
namespace rtftok {
@@ -41,13 +42,14 @@ namespace writerfilter {
public:
typedef boost::shared_ptr<RTFValue> Pointer_t;
RTFValue(int nValue, rtl::OUString sValue, RTFSprms rAttributes, RTFSprms rSprms, uno::Reference<drawing::XShape> rShape,
- uno::Reference<io::XInputStream> rStream, bool bForceString);
+ uno::Reference<io::XInputStream> rStream, uno::Reference<embed::XEmbeddedObject> rObject, bool bForceString);
RTFValue(int nValue);
RTFValue(rtl::OUString sValue, bool bForce = false);
RTFValue(RTFSprms rAttributes);
RTFValue(RTFSprms rAttributes, RTFSprms rSprms);
RTFValue(uno::Reference<drawing::XShape> rShape);
RTFValue(uno::Reference<io::XInputStream> rStream);
+ RTFValue(uno::Reference<embed::XEmbeddedObject> rObject);
virtual ~RTFValue();
void setString(rtl::OUString sValue);
virtual int getInt() const;
@@ -68,6 +70,7 @@ namespace writerfilter {
boost::shared_ptr<RTFSprms> m_pSprms;
uno::Reference<drawing::XShape> m_xShape;
uno::Reference<io::XInputStream> m_xStream;
+ uno::Reference<embed::XEmbeddedObject> m_xObject;
bool m_bForceString;
};
} // namespace rtftok