summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/namedlg
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/namedlg')
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx8
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 3304f4d39b..81139b7766 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -94,8 +94,8 @@ void ScNameDefDlg::CancelPushed()
response(RET_CANCEL);
else
{
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
}
@@ -254,8 +254,8 @@ void ScNameDefDlg::AddPushed()
{
maName = aName;
maScope = aScope;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
}
else
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index a6a182cd82..2501672378 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -306,8 +306,8 @@ void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
void ScNameDlg::AddPushed()
{
mbCloseWithoutUndo = true;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
void ScNameDlg::SetEntry(const OUString& rName, const OUString& rScope)