[Libreoffice-commits] core.git: 2 commits - sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Dec 14 01:48:27 PST 2015
sw/source/filter/ww8/wrtww8.cxx | 20 ++++++++++++++++++++
sw/source/filter/ww8/ww8scan.cxx | 6 +++++-
sw/source/filter/ww8/ww8scan.hxx | 6 +++++-
3 files changed, 30 insertions(+), 2 deletions(-)
New commits:
commit f1f92d92ed7467d71db7d94d6e4aa40f65e8ddfc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 14 10:25:38 2015 +0100
DOC export: write SttbfBkmkFactoid structure
This contains the name of the bookmarks, except that factoid bookmarks
don't really have names...
Change-Id: I0fe3b983edf206d51e4d1cf4a66919fce0167738
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 73d6e17..c145fd6 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -351,6 +351,23 @@ void WW8_WrtFactoids::Write(WW8Export& rExport)
SvStream& rStream = *rExport.pTableStrm;
+ rExport.pFib->fcSttbfBkmkFactoid = rStream.Tell();
+ // Write SttbfBkmkFactoid.
+ rStream.WriteUInt16(0xffff); // fExtend
+ rStream.WriteUInt16(m_aStartCPs.size()); // cData
+ rStream.WriteUInt16(0); // cbExtra
+ rStream.WriteUInt16(6); // cchData
+
+ // Write FACTOIDINFO.
+ for (size_t i = 0; i < m_aStartCPs.size(); ++i)
+ {
+ rStream.WriteUInt32(i); // dwId
+ rStream.WriteUInt16(0); // fSubEntry
+ rStream.WriteUInt16(0); // fto
+ rStream.WriteUInt32(0); // pfpb
+ }
+ rExport.pFib->lcbSttbfBkmkFactoid = rStream.Tell() - rExport.pFib->fcSttbfBkmkFactoid;
+
rExport.pFib->fcPlcfBkfFactoid = rStream.Tell();
for (const WW8_CP& rCP : m_aStartCPs)
rStream.WriteInt32(rCP);
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 5de5ae6..326ae80 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6244,7 +6244,9 @@ bool WW8Fib::Write(SvStream& rStrm)
SvtMiscOptions aMiscOptions;
if (aMiscOptions.IsExperimentalMode())
{
- pData += 0x432 - 0x422;
+ pData += 0x42a - 0x422;
+ Set_UInt32(pData, fcSttbfBkmkFactoid);
+ Set_UInt32(pData, lcbSttbfBkmkFactoid);
Set_UInt32(pData, fcPlcfBkfFactoid);
Set_UInt32(pData, lcbPlcfBkfFactoid);
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index bae3b43..0b18076 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1452,8 +1452,12 @@ public:
WW8_FC fcAtrdExtra;
sal_uInt32 lcbAtrdExtra;
- // 0x422 - 0x431 == ignore
+ // 0x422 - 0x429 == ignore
+ /// 0x42a smart-tag bookmark string table offset.
+ WW8_FC fcSttbfBkmkFactoid;
+ /// 0x42e smart-tag bookmark string table length.
+ sal_uInt32 lcbSttbfBkmkFactoid;
/// 0x432 smart-tag bookmark starts offset.
WW8_FC fcPlcfBkfFactoid;
/// 0x436 smart-tag bookmark ends length.
commit e1fa0eab7d73bd1bd57f8f47821430bb6b68af99
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 14 10:14:41 2015 +0100
DOC export: embed factoids when writing factoid bookmarks
Change-Id: Ibefc4b908c752a6256b168b4045afb400ba8b17a
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 0f9ab02..73d6e17 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -346,6 +346,9 @@ void WW8_WrtFactoids::Write(WW8Export& rExport)
if (m_aStartCPs.empty())
return;
+ // Smart tags are otherwise removed by Word on saving.
+ rExport.pDop->fEmbedFactoids = true;
+
SvStream& rStream = *rExport.pTableStrm;
rExport.pFib->fcPlcfBkfFactoid = rStream.Tell();
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 842f557..5de5ae6 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -7720,6 +7720,8 @@ bool WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
pData += 32;
a16Bit = 0;
+ if (fEmbedFactoids)
+ a16Bit |= 0x8;
if (fAcetateShowMarkup)
a16Bit |= 0x1000;
//Word XP at least requires fAcetateShowMarkup to honour fAcetateShowAtn
More information about the Libreoffice-commits
mailing list