3cf8bb7
From 62f5fbd95c70c57356bcb3d616c06c0bb3ba6edc Mon Sep 17 00:00:00 2001
3cf8bb7
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
3cf8bb7
Date: Wed, 1 Mar 2017 17:24:21 +0000
3cf8bb7
Subject: [PATCH] Resolves: tdf#106261 throw away old node map for table
3cf8bb7
3cf8bb7
when generating a new one, otherwise on exporting the same table
3cf8bb7
twice to two consecutive .doc footnotes will think the second
3cf8bb7
export of the table is a level lower because it will find it
3cf8bb7
in the map and
3cf8bb7
3cf8bb7
WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
3cf8bb7
3cf8bb7
does pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
3cf8bb7
using the cached pNodeInfo depth and not a new fresh pNodeInfo of
3cf8bb7
depth 0
3cf8bb7
3cf8bb7
Change-Id: I7aa7ac6a19814910c1d19d78f04cfd9886c444c5
3cf8bb7
(cherry picked from commit 6f3e24ad64dd40b3ef8def7d879ba395a16874a1)
3cf8bb7
---
3cf8bb7
 sw/source/filter/ww8/wrtww8.cxx | 8 ++++++++
3cf8bb7
 1 file changed, 8 insertions(+)
3cf8bb7
3cf8bb7
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
3cf8bb7
index 262ee5c..85bf4ea 100644
3cf8bb7
--- a/sw/source/filter/ww8/wrtww8.cxx
3cf8bb7
+++ b/sw/source/filter/ww8/wrtww8.cxx
3cf8bb7
@@ -1832,8 +1832,16 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u
3cf8bb7
     // clear linked textboxes since old ones can't be linked to frames in this section
3cf8bb7
     m_aLinkedTextboxesHelper.clear();
3cf8bb7
 
3cf8bb7
+    // tdf#106261 Reset table infos, otherwise the depth of the cells will be
3cf8bb7
+    // incorrect, in case the header/footer had table(s) and we try to export
3cf8bb7
+    // the same table second time.
3cf8bb7
+    ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_pTableInfo;
3cf8bb7
+    m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
3cf8bb7
+
3cf8bb7
     WriteText();
3cf8bb7
 
3cf8bb7
+    m_pTableInfo = pOldTableInfo;
3cf8bb7
+
3cf8bb7
     m_bOutPageDescs = bOldPageDescs;
3cf8bb7
     delete m_pCurPam;                    // delete Pam
3cf8bb7
     m_pCurPam = pOldPam;
3cf8bb7
-- 
3cf8bb7
2.9.3
3cf8bb7