summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-29 20:50:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-30 09:46:21 +0200
commit55dfe2c12e450a90cbc05f9ec53f1ed6508d8de9 (patch)
tree1a312462989f3a521b3471225443ac229db4e7b6 /sw/source/filter/ww8
parentac94aa6f7d2a8e41e7260ba740813cdbbdd6a2ae (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/ww8')
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx6
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx10
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx2
3 files changed, 5 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index f999656c440e..af79be052618 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -542,13 +542,9 @@ namespace sw
rTextNode.GetActualListLevel());
}
- OSL_ENSURE(rTextNode.GetDoc(), "No document for node?, suspicious");
- if (!rTextNode.GetDoc())
- return nullptr;
-
if (
rTextNode.IsNumbered() && rTextNode.IsCountedInList() &&
- nullptr != (pRule = rTextNode.GetDoc()->GetOutlineNumRule())
+ nullptr != (pRule = rTextNode.GetDoc().GetOutlineNumRule())
)
{
return GetNumFormatFromSwNumRuleLevel(*pRule,
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index b6a22c593969..988890f66fd7 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -519,14 +519,10 @@ namespace sw
const OUString &rText = rTextNd.GetText();
bool bParaIsRTL = false;
- OSL_ENSURE(rTextNd.GetDoc(), "No document for node?, suspicious");
- if (rTextNd.GetDoc())
+ if (SvxFrameDirection::Horizontal_RL_TB ==
+ rTextNd.GetDoc().GetTextDirection(SwPosition(rTextNd)))
{
- if (SvxFrameDirection::Horizontal_RL_TB ==
- rTextNd.GetDoc()->GetTextDirection(SwPosition(rTextNd)))
- {
- bParaIsRTL = true;
- }
+ bParaIsRTL = true;
}
using namespace ::com::sun::star::i18n;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 3e9b52d40516..2b5b66fab0cf 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2149,7 +2149,7 @@ bool MSWordExportBase::NeedTextNodeSplit( const SwTextNode& rNd, SwSoftPageBreak
rNd.fillSoftPageBreakList(tmp);
// hack: move the break behind any field marks; currently we can't hide the
// field mark instruction so the layout position is quite meaningless
- IDocumentMarkAccess const& rIDMA(*rNd.GetDoc()->getIDocumentMarkAccess());
+ IDocumentMarkAccess const& rIDMA(*rNd.GetDoc().getIDocumentMarkAccess());
sal_Int32 pos(-1);
for (auto const& it : tmp)
{