diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-07 09:54:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-07 13:31:37 +0200 |
commit | 74132131e74813834d2a09ff68e614415fe44747 (patch) | |
tree | bf4e82aecb18967723d959e6b7aada7e2a2ef731 /sw/source | |
parent | 7afb70863f649d40ca889b553815ff2479b89362 (diff) |
ofz#9733 drop bookmarks in deleted range
Change-Id: Ibf6d3cb244ddbfc600e6e91564988b9f814a258b
Reviewed-on: https://gerrit.libreoffice.org/58668
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 2 |
3 files changed, 13 insertions, 9 deletions
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 818f90652f36..606b754d630e 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -200,7 +200,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken ) if (!PendingObjectsInPaM(aDelPam)) { - ClearFootnotesInRange(aDelPam.GetMark()->nNode, aDelPam.GetPoint()->nNode); + ClearFootnotesMarksInRange(aDelPam.GetMark()->nNode, aDelPam.GetPoint()->nNode); m_xDoc->getIDocumentContentOperations().DelFullPara(aDelPam); } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 5048ad6db408..69df8477af5a 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -50,6 +50,7 @@ #include <pam.hxx> #include <doc.hxx> #include <IDocumentLayoutAccess.hxx> +#include <IDocumentMarkAccess.hxx> #include <ndtxt.hxx> #include <shellio.hxx> #include <poolfmt.hxx> @@ -4898,7 +4899,7 @@ namespace }; } -void SwHTMLParser::ClearFootnotesInRange(const SwNodeIndex& rMkNdIdx, const SwNodeIndex& rPtNdIdx) +void SwHTMLParser::ClearFootnotesMarksInRange(const SwNodeIndex& rMkNdIdx, const SwNodeIndex& rPtNdIdx) { //similarly for footnotes if (m_pFootEndNoteImpl) @@ -4912,9 +4913,14 @@ void SwHTMLParser::ClearFootnotesInRange(const SwNodeIndex& rMkNdIdx, const SwNo } //follow DelFlyInRange pattern here - const bool bDelFwrd = rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex(); + assert(rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex()); SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc(); + + //ofz#9733 drop bookmarks in this range + IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + pMarkAccess->deleteMarks(rMkNdIdx, SwNodeIndex(rPtNdIdx, 1), nullptr, nullptr, nullptr); + SwFrameFormats& rTable = *pDoc->GetSpzFrameFormats(); for ( auto i = rTable.size(); i; ) { @@ -4924,9 +4930,7 @@ void SwHTMLParser::ClearFootnotesInRange(const SwNodeIndex& rMkNdIdx, const SwNo if (pAPos && ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) || (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) && - ( bDelFwrd - ? rMkNdIdx < pAPos->nNode && pAPos->nNode <= rPtNdIdx - : rPtNdIdx <= pAPos->nNode && pAPos->nNode < rMkNdIdx )) + ( rMkNdIdx < pAPos->nNode && pAPos->nNode <= rPtNdIdx )) { if( rPtNdIdx != pAPos->nNode ) { @@ -4935,7 +4939,7 @@ void SwHTMLParser::ClearFootnotesInRange(const SwNodeIndex& rMkNdIdx, const SwNo // But only fly formats own their content, not draw formats. if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT) { - ClearFootnotesInRange(*rContent.GetContentIdx(), + ClearFootnotesMarksInRange(*rContent.GetContentIdx(), SwNodeIndex(*rContent.GetContentIdx()->GetNode().EndOfSectionNode())); } } @@ -4952,7 +4956,7 @@ void SwHTMLParser::DeleteSection(SwStartNode* pSttNd) //similarly for footnotes SwNodeIndex aSttIdx(*pSttNd), aEndIdx(*pSttNd->EndOfSectionNode()); - ClearFootnotesInRange(aSttIdx, aEndIdx); + ClearFootnotesMarksInRange(aSttIdx, aEndIdx); m_xDoc->getIDocumentContentOperations().DeleteSection(pSttNd); diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index c8d5d32c3ccc..b3560065c326 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -633,7 +633,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // tags realized via character styles void NewCharFormat( HtmlTokenId nToken ); - void ClearFootnotesInRange(const SwNodeIndex& rSttIdx, const SwNodeIndex& rEndIdx); + void ClearFootnotesMarksInRange(const SwNodeIndex& rSttIdx, const SwNodeIndex& rEndIdx); void DeleteSection(SwStartNode* pSttNd); |