[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 8 19:58:00 UTC 2020


 sw/source/uibase/docvw/SidebarTxtControl.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 96f91c9fac816c8d10eac5db38b3b8ccb9eb8b64
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 8 15:37:00 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Dec 8 20:57:04 2020 +0100

    just call GetTextView once
    
    Change-Id: I016fd9ae9a7b11010ed997003dbbb5db97bbd27a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107429
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index fde45169248d..26c45868bd89 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -417,17 +417,16 @@ void SidebarTextControl::Command( const CommandEvent& rCEvt )
 
 OUString SidebarTextControl::GetSurroundingText() const
 {
-    if (GetTextView())
-        return GetTextView()->GetSurroundingText();
+    if (OutlinerView* pTextView = GetTextView())
+        return pTextView->GetSurroundingText();
     return OUString();
 }
 
 Selection SidebarTextControl::GetSurroundingTextSelection() const
 {
-    if( GetTextView() )
-        return GetTextView()->GetSurroundingTextSelection();
-    else
-        return Selection( 0, 0 );
+    if (OutlinerView* pTextView = GetTextView())
+        return pTextView->GetSurroundingTextSelection();
+    return Selection( 0, 0 );
 }
 
 bool SidebarTextControl::DeleteSurroundingText(const Selection& rSelection)


More information about the Libreoffice-commits mailing list