summaryrefslogtreecommitdiff
path: root/sc/source/ui/miscdlgs/datafdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-14 16:42:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-15 21:36:27 +0200
commitbf3d1b8e8f89bfdb409c70cfea126f36474d4772 (patch)
tree9d496d04fc1bbd76c15ab215f947ac28587f0e1e /sc/source/ui/miscdlgs/datafdlg.cxx
parent957adc83e67276805c6dcd7be1ea23c142c49306 (diff)
establish that ScViewData::GetDocument can always return ScDocument&
we can only be ctored with a ScDocShell& or ScDocument&, and ScDocShell provides a ScDocument& from its GetDocument() so we can always have a ScDocument& when a public ctor has completed some null checks can then be seen to be redundant and are removed Change-Id: Ifaf39cb06e8dbce363999c05ee0aeb3ec4f00428 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102775 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/miscdlgs/datafdlg.cxx')
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index d6026c8b7937..df21fb4c26b7 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -47,8 +47,8 @@ ScDataFormDlg::ScDataFormDlg(weld::Window* pParent, ScTabViewShell* pTabViewShel
OSL_ENSURE( pTabViewShell, "pTabViewShell is NULL! :-/" );
ScViewData& rViewData = pTabViewShell->GetViewData();
- pDoc = rViewData.GetDocument();
- if (pDoc)
+ pDoc = &rViewData.GetDocument();
+
{
ScRange aRange;
rViewData.GetSimpleArea( aRange );