summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-30 09:44:52 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-11-03 10:46:29 +0100
commit08c2a967a2986f1b8d7952f653fa4a0ed0def715 (patch)
treec6a77d1fe18023f39767bd6cd31189884967c199 /sd
parent16b9be87a59383ac04319e7d5297fcd63facb49c (diff)
Related: tdf#137871 GetTextEditOutlinerView returns null in a table
Change-Id: Ic27f41e6e2dd7fd65fdae8477ef314f1df83819f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105042 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdwindow.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 1c06ad1762f4..9c5d2d9d53ce 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -216,8 +216,7 @@ void Window::KeyInput(const KeyEvent& rKEvt)
if (getenv("SD_DEBUG") && rKEvt.GetKeyCode().GetCode() == KEY_F12 && mpViewShell)
{
mpViewShell->GetDoc()->dumpAsXml(nullptr);
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- if (pOLV)
+ if (OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView())
pOLV->GetEditView().GetEditEngine()->dumpAsXmlEditDoc(nullptr);
return;
}
@@ -980,8 +979,8 @@ OUString Window::GetSurroundingText() const
return OUString();
else if ( mpViewShell->GetView()->IsTextEdit() )
{
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingText();
+ if (OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView())
+ return pOLV->GetEditView().GetSurroundingText();
}
return OUString();
}
@@ -994,13 +993,10 @@ Selection Window::GetSurroundingTextSelection() const
}
else if ( mpViewShell->GetView()->IsTextEdit() )
{
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingTextSelection();
- }
- else
- {
- return Selection( 0, 0 );
+ if (OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView())
+ return pOLV->GetEditView().GetSurroundingTextSelection();
}
+ return Selection( 0, 0 );
}
void Window::LogicInvalidate(const ::tools::Rectangle* pRectangle)