[Libreoffice-commits] core.git: offapi/com officecfg/registry sdext/source sd/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 2 08:25:19 UTC 2021


 offapi/com/sun/star/presentation/XSlideShowController.idl         |    6 +++
 officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu |   12 +++----
 sd/source/ui/slideshow/slideshowimpl.cxx                          |   13 +++++--
 sd/source/ui/slideshow/slideshowimpl.hxx                          |    2 -
 sdext/source/presenter/PresenterController.cxx                    |   17 ++++++++--
 5 files changed, 38 insertions(+), 12 deletions(-)

New commits:
commit 5544c178975d480242151083d6c72d42b88a1db4
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Sun Jan 10 22:01:38 2021 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Feb 2 09:24:31 2021 +0100

    tdf#134281 [API-CHANGE] Add keyboard shortcut for UsePen and EraseInk
    
    As suggested by UX meeting:
    - Remove P and N keys from previous/next slide
    - Assign them to Pen (on=off) and erase ink commands
    Do this for presenter console as well.
    
    Modify help text of the presenter console to reflect these changes.
    
    Change-Id: I28d2178f7391739d4f8f5e8f63ab54714fcc97c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109108
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/offapi/com/sun/star/presentation/XSlideShowController.idl b/offapi/com/sun/star/presentation/XSlideShowController.idl
index 3d8528dbb722..2d93e33c935a 100644
--- a/offapi/com/sun/star/presentation/XSlideShowController.idl
+++ b/offapi/com/sun/star/presentation/XSlideShowController.idl
@@ -245,6 +245,12 @@ interface XSlideShowController
     [attribute] double PenWidth;
 
 
+    /** This method clears ink drawing from the slideshow being played
+
+        @since LibreOffice 7.2
+    */
+    void setEraseAllInk( [in] boolean EraseAllInk );
+
     /** returns the actual XSlideShow instance that runs the
         slide show.
         <br>Normally all navigation should be done using this controller and
diff --git a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
index c60645af20d3..4f99dae763a8 100644
--- a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
@@ -973,7 +973,7 @@
       <node oor:name="HelpStrings">
         <node oor:name="a" oor:op="replace">
           <prop oor:name="Left">
-            <value xml:lang="en-US">Left click, right or down arrow, spacebar, page down, enter, return, 'N'</value>
+            <value xml:lang="en-US">Left click, right or down arrow, spacebar, page down, enter, return</value>
           </prop>
           <prop oor:name="Right">
             <value xml:lang="en-US">Next slide, or next effect</value>
@@ -981,7 +981,7 @@
         </node>
         <node oor:name="b" oor:op="replace">
           <prop oor:name="Left">
-            <value xml:lang="en-US">Right click, left or up arrow, page up, backspace, 'P'</value>
+            <value xml:lang="en-US">Right click, left or up arrow, page up, backspace</value>
           </prop>
           <prop oor:name="Right">
             <value xml:lang="en-US">Previous slide, or previous effect</value>
@@ -989,10 +989,10 @@
         </node>
         <node oor:name="c" oor:op="replace">
           <prop oor:name="Left">
-            <value xml:lang="x-no-translate"> </value>
+            <value xml:lang="en-US">'P'</value>
           </prop>
           <prop oor:name="Right">
-            <value xml:lang="x-no-translate"> </value>
+            <value xml:lang="en-US">Use mouse pointer as pen</value>
           </prop>
         </node>
         <node oor:name="d" oor:op="replace">
@@ -1013,10 +1013,10 @@
         </node>
         <node oor:name="f" oor:op="replace">
           <prop oor:name="Left">
-            <value xml:lang="x-no-translate"> </value>
+            <value xml:lang="en-US">'E'</value>
           </prop>
           <prop oor:name="Right">
-            <value xml:lang="x-no-translate"> </value>
+            <value xml:lang="en-US">Erase all ink on slide</value>
           </prop>
         </node>
         <node oor:name="g" oor:op="replace">
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index b10d116218c4..41c331644ac2 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -1756,7 +1756,6 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt)
             case KEY_SPACE:
             case KEY_RIGHT:
             case KEY_DOWN:
-            case KEY_N:
                 gotoNextEffect();
                 break;
 
@@ -1801,11 +1800,19 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt)
                 [[fallthrough]];
             case KEY_LEFT:
             case KEY_UP:
-            case KEY_P:
             case KEY_BACKSPACE:
                 gotoPreviousEffect();
                 break;
 
+            case KEY_P:
+                setUsePen( !mbUsePen );
+                break;
+
+            case KEY_E:
+                setEraseAllInk( true );
+                updateSlideShow();
+                break;
+
             case KEY_HOME:
                 gotoFirstSlide();
                 break;
@@ -2685,7 +2692,7 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor )
     setUsePen( true ); // enable pen mode, update color
 }
 
-void SlideshowImpl::setEraseAllInk(bool bEraseAllInk)
+void SAL_CALL SlideshowImpl::setEraseAllInk(sal_Bool bEraseAllInk)
 {
     if( !bEraseAllInk )
         return;
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index 8f848a4f1aa9..5fbd564fc00f 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -146,7 +146,7 @@ public:
     virtual double SAL_CALL getPenWidth() override;
     virtual void SAL_CALL setPenWidth( double dStrokeWidth ) override;
     /// @throws css::uno::RuntimeException
-    void setEraseAllInk( bool bEraseAllInk );
+    virtual void SAL_CALL setEraseAllInk( sal_Bool bEraseAllInk ) override;
     virtual sal_Bool SAL_CALL isRunning(  ) override;
     virtual ::sal_Int32 SAL_CALL getSlideCount(  ) override;
     virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) override;
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 050109ff7182..58f423def0aa 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -859,7 +859,6 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
         case awt::Key::RIGHT:
         case awt::Key::SPACE:
         case awt::Key::DOWN:
-        case awt::Key::N:
             if (mxSlideShowController.is())
             {
                 mxSlideShowController->gotoNextEffect();
@@ -878,7 +877,6 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
 
         case awt::Key::LEFT:
         case awt::Key::UP:
-        case awt::Key::P:
         case awt::Key::BACKSPACE:
             if (mxSlideShowController.is())
             {
@@ -886,6 +884,21 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
             }
             break;
 
+        case awt::Key::P:
+            if (mxSlideShowController.is())
+            {
+                bool bPenEnabled = mxSlideShowController->getUsePen();
+                mxSlideShowController->setUsePen( !bPenEnabled );
+            }
+            break;
+
+        case awt::Key::E:
+            if (mxSlideShowController.is())
+            {
+                mxSlideShowController->setEraseAllInk( true );
+            }
+            break;
+
         case awt::Key::HOME:
             if (mxSlideShowController.is())
             {


More information about the Libreoffice-commits mailing list