diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-29 20:50:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-30 09:46:21 +0200 |
commit | 55dfe2c12e450a90cbc05f9ec53f1ed6508d8de9 (patch) | |
tree | 1a312462989f3a521b3471225443ac229db4e7b6 /sw/source/filter/html | |
parent | ac94aa6f7d2a8e41e7260ba740813cdbbdd6a2ae (diff) |
SwNode::GetDoc can return a reference instead
and remove discovered redundant null checks
Change-Id: I6b8bc9593434f38947e399a48888a8fa0d4f7e77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103640
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index dd55897b2d8d..9a96233407b4 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2240,7 +2240,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) // export numbering string as plain text only for the outline numbering, // because the outline numbering isn't exported as a numbering - see <SwHTMLNumRuleInfo::Set(..)> if ( pNd->IsOutline() && - pNd->GetNumRule() == pNd->GetDoc()->GetOutlineNumRule() ) + pNd->GetNumRule() == pNd->GetDoc().GetOutlineNumRule() ) { aOutlineText = pNd->GetNumString(); nOffset = nOffset + aOutlineText.getLength(); diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index 840fd61e88bd..9d5ed50d57e7 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -25,7 +25,7 @@ void SwHTMLNumRuleInfo::Set( const SwTextNode& rTextNd ) { const SwNumRule* pTextNdNumRule( rTextNd.GetNumRule() ); if ( pTextNdNumRule && - pTextNdNumRule != rTextNd.GetDoc()->GetOutlineNumRule() ) + pTextNdNumRule != rTextNd.GetDoc().GetOutlineNumRule() ) { pNumRule = const_cast<SwNumRule*>(pTextNdNumRule); nDeep = static_cast< sal_uInt16 >(pNumRule ? rTextNd.GetActualListLevel() + 1 : 0); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 265deafe963f..645ecbd1b358 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -514,7 +514,7 @@ bool SwHTMLParser::InsertEmbed() Size aTwipSize(pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapTwip))); SwFormatFrameSize aFrameSize(SwFrameSize::Fixed, aTwipSize.Width(), aTwipSize.Height()); aAttrSet.Put(aFrameSize); - pOLENode->GetDoc()->SetFlyFrameAttr(*pFormat, aAttrSet); + pOLENode->GetDoc().SetFlyFrameAttr(*pFormat, aAttrSet); return true; } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 65cdc272d118..6207967f3677 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -4945,13 +4945,13 @@ void SwHTMLParser::ClearFootnotesMarksInRange(const SwNodeIndex& rMkNdIdx, const //follow DelFlyInRange pattern here assert(rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex()); - SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc(); + SwDoc& rDoc = rMkNdIdx.GetNode().GetDoc(); //ofz#9733 drop bookmarks in this range - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); pMarkAccess->deleteMarks(rMkNdIdx, SwNodeIndex(rPtNdIdx, 1), nullptr, nullptr, nullptr); - SwFrameFormats& rTable = *pDoc->GetSpzFrameFormats(); + SwFrameFormats& rTable = *rDoc.GetSpzFrameFormats(); for ( auto i = rTable.size(); i; ) { SwFrameFormat *pFormat = rTable[--i]; |