summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-30 09:44:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-10-30 13:37:49 +0100
commit1a4ae360d06ae300a8fd5482b3b3a86dc021750d (patch)
tree7635d05c9cd29980379b190e9a5d3e4bbe2eed66 /sd
parentfd9c47eda58dda5e61850e9b9f6de0f38d221b4a (diff)
Related: tdf#137871 GetTextEditOutlinerView returns null in a table
Change-Id: Ic27f41e6e2dd7fd65fdae8477ef314f1df83819f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdwindow.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 1f99312b51ad..eb1d17fca32a 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 );
}
bool Window::DeleteSurroundingText(const Selection& rSelection)
@@ -1011,13 +1007,10 @@ bool Window::DeleteSurroundingText(const Selection& rSelection)
}
else if ( mpViewShell->GetView()->IsTextEdit() )
{
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().DeleteSurroundingText(rSelection);
- }
- else
- {
- return false;
+ if (OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView())
+ return pOLV->GetEditView().DeleteSurroundingText(rSelection);
}
+ return false;
}
void Window::LogicInvalidate(const ::tools::Rectangle* pRectangle)