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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 10 13:09:37 UTC 2018


 sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx |   15 +---------
 sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx |    2 -
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx  |   10 ++----
 3 files changed, 7 insertions(+), 20 deletions(-)

New commits:
commit 21795eb3d3eca8e3c2eadc1e80dfc2d032a3c861
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Nov 7 09:05:07 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Nov 10 14:09:17 2018 +0100

    tdf#120703 PVS: drop dead code.
    
    V547 Expression 'mpTargetSlideSorter != nullptr' is always false.
    
    The code wasn't used since commit 4b83a7fe5714eb9a1d208502a18e33da35772ece
    (initially, mpTargetSlideSorter pointer was compared to a pSlideSorter
    parameter, which was always nullptr since commit above; then commit
    f946e905c6c6bb041ae580b14b711c6964af97bd removed the const parameter).
    
    Change-Id: I70047ae3e7ef39419be0012e375856d8a50d5793
    Reviewed-on: https://gerrit.libreoffice.org/63229
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index 9990d9182746..770fb1ba6cf5 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -66,7 +66,7 @@ DragAndDropContext::DragAndDropContext (SlideSorter& rSlideSorter)
 
 DragAndDropContext::~DragAndDropContext() COVERITY_NOEXCEPT_FALSE
 {
-    SetTargetSlideSorter (Point(0,0));
+    SetTargetSlideSorter();
 }
 
 void DragAndDropContext::Dispose()
@@ -111,8 +111,7 @@ void DragAndDropContext::UpdatePosition (
     }
 }
 
-void DragAndDropContext::SetTargetSlideSorter(
-    const Point& rMousePosition)
+void DragAndDropContext::SetTargetSlideSorter()
 {
     if (mpTargetSlideSorter != nullptr)
     {
@@ -122,16 +121,6 @@ void DragAndDropContext::SetTargetSlideSorter(
     }
 
     mpTargetSlideSorter = nullptr;
-
-    if (mpTargetSlideSorter != nullptr)
-    {
-        mpTargetSlideSorter->GetController().GetInsertionIndicatorHandler()->Start(
-            false/*bIsOverSourceView*/);
-        mpTargetSlideSorter->GetController().GetInsertionIndicatorHandler()->UpdatePosition(
-            rMousePosition,
-            InsertionIndicatorHandler::UnknownMode);
-
-    }
 }
 
 } } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx
index 1b36791d2ff5..3a2ed06f9fb4 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx
@@ -60,7 +60,7 @@ public:
         const InsertionIndicatorHandler::Mode eMode,
         const bool bAllowAutoScroll);
 
-    void SetTargetSlideSorter(const Point& rMousePosition);
+    void SetTargetSlideSorter();
 
 private:
     SlideSorter* mpTargetSlideSorter;
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 002c924916fe..4a3b066665b1 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -1162,11 +1162,9 @@ bool NormalModeHandler::ProcessMotionEvent (
         {
             if (maButtonDownLocation)
             {
-                const sal_Int32 nDistance (maButtonDownLocation
-                    ? ::std::max (
-                        std::abs(maButtonDownLocation->X() - rDescriptor.maMousePosition.X()),
-                        std::abs(maButtonDownLocation->Y() - rDescriptor.maMousePosition.Y()))
-                    : 0);
+                const sal_Int32 nDistance(std::max(
+                    std::abs(maButtonDownLocation->X() - rDescriptor.maMousePosition.X()),
+                    std::abs(maButtonDownLocation->Y() - rDescriptor.maMousePosition.Y())));
                 if (nDistance > 3)
                     StartDrag(rDescriptor.maMousePosition);
             }
@@ -1499,7 +1497,7 @@ DragAndDropModeHandler::~DragAndDropModeHandler()
     if (mpDragAndDropContext)
     {
         // Disconnect the substitution handler from this selection function.
-        mpDragAndDropContext->SetTargetSlideSorter(Point(0,0));
+        mpDragAndDropContext->SetTargetSlideSorter();
         mpDragAndDropContext.reset();
     }
     mrSlideSorter.GetController().GetInsertionIndicatorHandler()->End(Animator::AM_Animated);


More information about the Libreoffice-commits mailing list