From 3c367de9893b1e2d352585a42cbbd25052bb7376 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 9 Aug 2019 18:43:36 +0200 Subject: sw: fix ~SwIndexReg asserts on ODF export of ooo83072-1.odt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is now possible that the stupid redline-moving code deletes the first node in the document, and there are 2 SwPaM that point to it, Writer::m_pCurrentPam and local pPam in SwWriter::Write(). So i thought it should be quite trivial to just use SwUnoCursors in these cases, but it required a bit more keyboard bashing than expected. (regression from beec1594587d0bf1ea2268f9a435c948b5580278, which i didn't really intend to push and am not sure if it's really a good idea but whatever...) Change-Id: Ia5c18d67af8760664517a4b7ee62ef3e4a417686 Reviewed-on: https://gerrit.libreoffice.org/77225 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/filter/html/htmlflywriter.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sw/source/filter/html/htmlflywriter.cxx') diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 6eca6c22fb7c..c50f46acaa8d 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -298,7 +298,8 @@ void SwHTMLWriter::CollectFlyFrames() OSL_ENSURE( HTML_CFG_MAX+1 == MAX_BROWSERS, "number of browser configurations has changed" ); - SwPosFlyFrames aFlyPos(m_pDoc->GetAllFlyFormats(m_bWriteAll ? nullptr : m_pCurrentPam, true)); + SwPosFlyFrames aFlyPos( + m_pDoc->GetAllFlyFormats(m_bWriteAll ? nullptr : m_pCurrentPam.get(), true)); for(const auto& rpItem : aFlyPos) { @@ -1639,7 +1640,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, pSttNd->EndOfSectionIndex(), true, &rFrameFormat ); rHTMLWrt.m_bOutFlyFrame = true; - rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam ); + rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() ); } rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; @@ -1726,7 +1727,7 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, pSttNd->EndOfSectionIndex(), true, &rFrameFormat ); rHTMLWrt.m_bOutFlyFrame = true; - rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam ); + rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() ); } rHTMLWrt.DecIndentLevel(); // indent the content of Multicol; @@ -2000,7 +2001,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, else rHTMLWrt.m_bOutFooter = true; - rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam ); + rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() ); } if( bHeader && !aSpacer.isEmpty() ) -- cgit