[PATCH] fdo#57422 fixing the Listener for the buttons and scrollbar

Faisal al-otaibi (via Code Review) gerrit at gerrit.libreoffice.org
Sun Feb 10 23:05:54 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2094

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/2094/1

fdo#57422 fixing the Listener for the buttons and scrollbar

this patch will fix the listener for all buttons and
scrollbars that in presenter console.

Change-Id: Ic30487fc1f4eeef447c9676b94fe6b9e93de8378
---
M sdext/source/presenter/PresenterSlideSorter.cxx
M sdext/source/presenter/PresenterToolBar.cxx
M vcl/unx/gtk/window/gtkframe.cxx
M vcl/win/source/window/salframe.cxx
4 files changed, 23 insertions(+), 36 deletions(-)



diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index bdffca4..ffe60c5 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -511,26 +511,14 @@
 void SAL_CALL PresenterSlideSorter::mousePressed (const css::awt::MouseEvent& rEvent)
     throw(css::uno::RuntimeException)
 {
-    css::awt::MouseEvent rTemp =rEvent;
-    /// check whether RTL interface or not
-    if(Application::GetSettings().GetLayoutRTL()){
-        awt::Rectangle aBox = mxWindow->getPosSize();
-        rTemp.X=aBox.Width-rEvent.X;
-    }
-    const geometry::RealPoint2D aPosition(rTemp.X, rEvent.Y);
+    const geometry::RealPoint2D aPosition(rEvent.X, rEvent.Y);
     mnSlideIndexMousePressed = mpLayout->GetSlideIndexForPosition(aPosition);
 }
 
 void SAL_CALL PresenterSlideSorter::mouseReleased (const css::awt::MouseEvent& rEvent)
     throw(css::uno::RuntimeException)
 {
-    css::awt::MouseEvent rTemp =rEvent;
-    /// check whether RTL interface or not
-    if(Application::GetSettings().GetLayoutRTL()){
-        awt::Rectangle aBox = mxWindow->getPosSize();
-        rTemp.X=aBox.Width-rEvent.X;
-    }
-    const geometry::RealPoint2D aPosition(rTemp.X, rEvent.Y);
+    const geometry::RealPoint2D aPosition(rEvent.X, rEvent.Y);
     const sal_Int32 nSlideIndex (mpLayout->GetSlideIndexForPosition(aPosition));
 
     if (nSlideIndex == mnSlideIndexMousePressed && mnSlideIndexMousePressed >= 0)
@@ -574,13 +562,7 @@
 {
     if (mpMouseOverManager.get() != NULL)
     {
-        css::awt::MouseEvent rTemp =rEvent;
-        /// check whether RTL interface or not
-        if(Application::GetSettings().GetLayoutRTL()){
-            awt::Rectangle aBox = mxWindow->getPosSize();
-            rTemp.X=aBox.Width-rEvent.X;
-        }
-        const geometry::RealPoint2D aPosition(rTemp.X, rEvent.Y);
+        geometry::RealPoint2D aPosition(rEvent.X, rEvent.Y);
         sal_Int32 nSlideIndex (mpLayout->GetSlideIndexForPosition(aPosition));
 
         if (nSlideIndex < 0)
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index 76aaa7c..20200f9 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -1020,11 +1020,6 @@
     const bool bOverWindow,
     const bool bMouseDown)
 {
-    css::awt::MouseEvent rTemp =rEvent;
-    if(Application::GetSettings().GetLayoutRTL()){
-        awt::Rectangle aWindowBox = mxWindow->getPosSize();
-        rTemp.X=aWindowBox.Width-rTemp.X;
-    }
     ElementContainer::iterator iPart;
     ElementContainer::const_iterator iEnd (maElementContainer.end());
     for (iPart=maElementContainer.begin(); iPart!=iEnd; ++iPart)
@@ -1038,13 +1033,13 @@
 
             awt::Rectangle aBox ((*iElement)->GetBoundingBox());
             const bool bIsOver = bOverWindow
-                && aBox.X <= rTemp.X
-                && aBox.Width+aBox.X-1 >= rTemp.X
-                && aBox.Y <= rTemp.Y
-                && aBox.Height+aBox.Y-1 >= rTemp.Y;
+                && aBox.X <= rEvent.X
+                && aBox.Width+aBox.X-1 >= rEvent.X
+                && aBox.Y <= rEvent.Y
+                && aBox.Height+aBox.Y-1 >= rEvent.Y;
             (*iElement)->SetState(
                 bIsOver,
-                bIsOver && rTemp.Buttons!=0 && bMouseDown && rTemp.ClickCount>0);
+                bIsOver && rEvent.Buttons!=0 && bMouseDown && rEvent.ClickCount>0);
         }
     }
 }
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 6343f5b..21bc119 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2967,7 +2967,9 @@
 
     // --- RTL --- (mirror mouse pos)
     if( Application::GetSettings().GetLayoutRTL() )
-        aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
+        // Disable mirroring for presenter console
+        if(!(pThis->m_aTitle !="" && pThis->m_bFullscreen))
+            aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
 
     vcl::DeletionListener aDel( pThis );
 
@@ -3031,7 +3033,9 @@
 
     // --- RTL --- (mirror mouse pos)
     if( Application::GetSettings().GetLayoutRTL() )
-        aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
+        // Disable mirroring for presenter console
+        if(!(pThis->m_aTitle !="" && pThis->m_bFullscreen))
+            aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
 
     pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
 
@@ -3054,7 +3058,9 @@
 
     // --- RTL --- (mirror mouse pos)
     if( Application::GetSettings().GetLayoutRTL() )
-        aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
+        // Disable mirroring for presenter console
+        if(!(pThis->m_aTitle !="" && pThis->m_bFullscreen))
+            aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
 
     vcl::DeletionListener aDel( pThis );
 
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 235436f..41c3ae9 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -3259,7 +3259,9 @@
 
         // --- RTL --- (mirror mouse pos)
         if( Application::GetSettings().GetLayoutRTL() )
-            aMouseEvt.mnX = pFrame->maGeometry.nWidth-1-aMouseEvt.mnX;
+            // this is for disable the mirroring in Presenter console
+            if(!(pFrame->mbFullScreen && !pFrame->mbPresentation))
+                aMouseEvt.mnX = pFrame->maGeometry.nWidth-1-aMouseEvt.mnX;
 
         nRet = pFrame->CallCallback( nEvent, &aMouseEvt );
         if ( nMsg == WM_MOUSEMOVE )
@@ -3353,7 +3355,9 @@
 
         // --- RTL --- (mirror mouse pos)
         if( Application::GetSettings().GetLayoutRTL() )
-            aWheelEvt.mnX = pFrame->maGeometry.nWidth-1-aWheelEvt.mnX;
+            // this is for disable the mirroring in Presenter console
+            if(!(pFrame->mbFullScreen && !pFrame->mbPresentation))
+                aWheelEvt.mnX = pFrame->maGeometry.nWidth-1-aWheelEvt.mnX;
 
         nRet = pFrame->CallCallback( SALEVENT_WHEELMOUSE, &aWheelEvt );
     }

-- 
To view, visit https://gerrit.libreoffice.org/2094
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic30487fc1f4eeef447c9676b94fe6b9e93de8378
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Faisal al-otaibi <fmalotaibi at kacst.edu.sa>


More information about the LibreOffice mailing list