[Libreoffice-commits] core.git: 2 commits - hwpfilter/source sw/source

Caolán McNamara caolanm at redhat.com
Wed Mar 1 20:49:57 UTC 2017


 hwpfilter/source/hwpfile.cxx    |    2 +-
 sw/source/filter/ww8/wrtww8.cxx |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 425572b9d510cee805dc4160d7e81887d8f27577
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 1 20:47:59 2017 +0000

    ofz: ReadBlock has to be HWPIDLen to be useful
    
    Change-Id: Iaa349921972bb19b40bf68c6a3b0c7128cff4b8d

diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 33505c0..2983ef0 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -126,7 +126,7 @@ int HWPFile::Open(HStream * stream)
 
     char idstr[HWPIDLen];
 
-    if (ReadBlock(idstr, HWPIDLen) <= 0
+    if (ReadBlock(idstr, HWPIDLen) < HWPIDLen
         || HWP_V30 != (version = detect_hwp_version(idstr)))
     {
         return SetState(HWP_UNSUPPORTED_VERSION);
commit 6f3e24ad64dd40b3ef8def7d879ba395a16874a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 1 17:24:21 2017 +0000

    Resolves: tdf#106261 throw away old node map for table
    
    when generating a new one, otherwise on exporting the same table
    twice to two consecutive .doc footnotes will think the second
    export of the table is a level lower because it will find it
    in the map and
    
    WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
    
    does pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
    using the cached pNodeInfo depth and not a new fresh pNodeInfo of
    depth 0
    
    Change-Id: I7aa7ac6a19814910c1d19d78f04cfd9886c444c5

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 849f325..e3f5e1e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1824,8 +1824,16 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u
     // clear linked textboxes since old ones can't be linked to frames in this section
     m_aLinkedTextboxesHelper.clear();
 
+    // tdf#106261 Reset table infos, otherwise the depth of the cells will be
+    // incorrect, in case the header/footer had table(s) and we try to export
+    // the same table second time.
+    ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_pTableInfo;
+    m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
+
     WriteText();
 
+    m_pTableInfo = pOldTableInfo;
+
     m_bOutPageDescs = bOldPageDescs;
     delete m_pCurPam;                    // delete Pam
     m_pCurPam = pOldPam;


More information about the Libreoffice-commits mailing list