summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-12-14 14:37:50 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-12-14 14:54:09 +0100
commitfed39aeae06cbd38be1a57e68eb8859df7a9b3f2 (patch)
treedc232ed8f8e74248cc4b841758406995e6ec316c
parent520bb76859d912bfc7a5f60d7dbbbd2e460b4ff7 (diff)
DOC export: write propBags in SmartTagData
Change-Id: I1d1f8aa28438209fbe3258b4b4418fcdfaabf78c
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx13
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx18
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx2
3 files changed, 33 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f75560b54283..8a30c1b8fb44 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -418,6 +418,19 @@ void WW8_WrtFactoids::Write(WW8Export& rExport)
}
}
aSmartTagData.m_aPropBagStore.m_aStringTable.assign(aSet.begin(), aSet.end());
+ for (const std::map<OUString, OUString>& rStatements : m_aStatements)
+ {
+ MSOPropertyBag aPropertyBag;
+ aPropertyBag.m_nId = 1;
+ for (const std::pair<OUString, OUString>& rPair : rStatements)
+ {
+ MSOProperty aProperty;
+ aProperty.m_nKey = std::distance(aSet.begin(), aSet.find(rPair.first));
+ aProperty.m_nValue = std::distance(aSet.begin(), aSet.find(rPair.second));
+ aPropertyBag.m_aProperties.push_back(aProperty);
+ }
+ aSmartTagData.m_aPropBags.push_back(aPropertyBag);
+ }
aSmartTagData.Write(rExport);
rExport.pFib->lcbFactoidData = rStream.Tell() - rExport.pFib->fcFactoidData;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index a460eaac205d..98b4a5a75b3e 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6399,6 +6399,12 @@ void MSOProperty::Read(SvStream& rStream)
rStream.ReadUInt32(m_nValue);
}
+void MSOProperty::Write(SvStream& rStream)
+{
+ rStream.WriteUInt32(m_nKey);
+ rStream.WriteUInt32(m_nValue);
+}
+
MSOPropertyBag::MSOPropertyBag()
: m_nId(0)
{
@@ -6425,6 +6431,16 @@ void MSOPropertyBag::Read(SvStream& rStream)
}
}
+void MSOPropertyBag::Write(WW8Export& rExport)
+{
+ SvStream& rStream = *rExport.pTableStrm;
+ rStream.WriteUInt16(m_nId);
+ rStream.WriteUInt16(m_aProperties.size());
+ rStream.WriteUInt16(0); // cbUnknown
+ for (MSOProperty& rProperty : m_aProperties)
+ rProperty.Write(rStream);
+}
+
void WW8SmartTagData::Read(SvStream& rStream, WW8_FC fcFactoidData, sal_uInt32 lcbFactoidData)
{
sal_uInt64 nOldPosition = rStream.Tell();
@@ -6445,6 +6461,8 @@ void WW8SmartTagData::Read(SvStream& rStream, WW8_FC fcFactoidData, sal_uInt32 l
void WW8SmartTagData::Write(WW8Export& rExport)
{
m_aPropBagStore.Write(rExport);
+ for (MSOPropertyBag& rPropertyBag : m_aPropBags)
+ rPropertyBag.Write(rExport);
}
WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 5aef92a2be1d..fc97b2d9efd3 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -1120,6 +1120,7 @@ class MSOProperty
public:
MSOProperty();
void Read(SvStream& rStream);
+ void Write(SvStream& rStream);
/// Index into MSOPropertyBagStore::m_aStringTable.
sal_uInt32 m_nKey;
@@ -1133,6 +1134,7 @@ class MSOPropertyBag
public:
MSOPropertyBag();
void Read(SvStream& rStream);
+ void Write(WW8Export& rExport);
/// Matches MSOFactoidType::m_nId in MSOPropertyBagStore::m_aFactoidTypes.
sal_uInt16 m_nId;