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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 6 15:31:42 UTC 2021


 sc/source/ui/app/inputhdl.cxx |   27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

New commits:
commit d284f3cdbd9833fb32535559bd9c229a88aacbb9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Apr 6 12:14:07 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Apr 6 17:31:06 2021 +0200

    block is protected by pActiveViewSh != nullptr
    
    so pActiveViewSh cannot be null within it
    
    Change-Id: I6db768bc78e0c3f097c6f97b5a7cfbe848ccbb8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113669
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 0d50b77775eb..b95d396b867d 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2955,7 +2955,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
     lcl_RemoveTabs(aPreAutoCorrectString);
 
     // Test if valid (always with simple string)
-    if ( bModified && nValidation && pActiveViewSh )
+    if (bModified && nValidation && pActiveViewSh)
     {
         ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
         const ScValidationData* pData = rDoc.GetValidationEntry( nValidation );
@@ -2977,25 +2977,18 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
 
             if (!bOk)
             {
-                if ( pActiveViewSh )                // If it came from MouseButtonDown
-                {
-                    pActiveViewSh->StopMarking();   // (the InfoBox consumes the MouseButtonUp)
+                pActiveViewSh->StopMarking();   // (the InfoBox consumes the MouseButtonUp)
 
-                    // tdf#125917 Release the grab that a current mouse-down event being handled
-                    // by ScTabView has put on the mouse via its SelectionEngine.
-                    // Otherwise the warning box cannot interact with the mouse
-                    if (ScTabView* pView = pActiveViewSh->GetViewData().GetView())
-                    {
-                        if (ScViewSelectionEngine* pSelEngine = pView->GetSelEngine())
-                            pSelEngine->ReleaseMouse();
-                    }
+                // tdf#125917 Release the grab that a current mouse-down event being handled
+                // by ScTabView has put on the mouse via its SelectionEngine.
+                // Otherwise the warning box cannot interact with the mouse
+                if (ScTabView* pView = pActiveViewSh->GetViewData().GetView())
+                {
+                    if (ScViewSelectionEngine* pSelEngine = pView->GetSelEngine())
+                        pSelEngine->ReleaseMouse();
                 }
 
-                vcl::Window* pParent = nullptr;
-                if (pActiveViewSh)
-                    pParent = &pActiveViewSh->GetViewFrame()->GetWindow();
-                else
-                    pParent = Application::GetDefDialogParent();
+                vcl::Window* pParent = &pActiveViewSh->GetViewFrame()->GetWindow();
 
                 if (pData->DoError(pParent ? pParent->GetFrameWeld() : nullptr, aString, aCursorPos))
                     bForget = true;                 // Do not take over input


More information about the Libreoffice-commits mailing list