[Libreoffice-commits] core.git: 2 commits - include/svx sd/source svx/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 20:55:33 UTC 2019


 include/svx/svdhdl.hxx                   |    3 ++
 include/svx/svdmrkv.hxx                  |    1 
 include/svx/svdpntv.hxx                  |    1 
 include/svx/svdview.hxx                  |    1 
 sd/source/ui/func/fudraw.cxx             |    3 ++
 sd/source/ui/view/viewoverlaymanager.cxx |   39 ++++++++++++++++++++++++++-----
 svx/source/svdraw/svdhdl.cxx             |    4 +++
 svx/source/svdraw/svdmrkv.cxx            |   19 +++++++++++++++
 vcl/unx/gtk3/gtk3gtkinst.cxx             |    1 
 9 files changed, 66 insertions(+), 6 deletions(-)

New commits:
commit 423d70f7e45749fad680b3dfe0ccdaed1c1afb19
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 14 10:56:04 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jan 14 21:55:25 2019 +0100

    Resolves: tdf#122695 Content Type selector tooltip missing
    
    Change-Id: I0ffe6448d865f569fb59d9facbb1582d2152a9ba
    Reviewed-on: https://gerrit.libreoffice.org/66291
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index caf95813973d..5832e33bc2ac 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -242,6 +242,9 @@ public:
         visualisation during mouse over it must override this method and call Touch(). */
     virtual void onMouseEnter(const MouseEvent& rMEvt);
 
+    /** is called when help is requested for the area of this handle */
+    virtual void onHelpRequest(const HelpEvent& rHEvt);
+
     /** is called when the mouse leaves the area of this handle. If the handle changes his
         visualisation during mouse over it must override this method and call Touch(). */
     virtual void onMouseLeave();
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 83eefb9dd54f..a864477fb80b 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -150,6 +150,7 @@ protected:
     void         CheckMarked();                                              // Scan MarkList after Del and Lock Layer ...
     void         AddDragModeHdl(SdrDragMode eMode);
     virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override;
+    virtual bool RequestHelp(const HelpEvent& rHEvt) override;
 
     // add custom handles (used by other apps, e.g. AnchorPos)
     virtual void AddCustomHdl();
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 2913850ed04b..429e9b96f020 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -463,6 +463,7 @@ public:
     virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; }
     virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; }
     virtual bool MouseMove(const MouseEvent& /*rMEvt*/, vcl::Window* /*pWin*/) { return false; }
+    virtual bool RequestHelp(const HelpEvent& /*rHEvt*/) { return false; }
     virtual bool Command(const CommandEvent& /*rCEvt*/, vcl::Window* /*pWin*/) { return false; }
 
     void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index 149bffcb872f..a63618089747 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -187,6 +187,7 @@ public:
     virtual bool MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin) override;
     virtual bool MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin) override;
     virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override;
+    using SdrCreateView::RequestHelp;
     virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override;
 
     virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 6b3872fefdae..2ecc44fe0a20 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -765,6 +765,9 @@ bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
         bReturn = FuPoor::RequestHelp(rHEvt);
     }
 
+    if (!bReturn)
+       bReturn = mpView->RequestHelp(rHEvt);
+
     return bReturn;
 }
 
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
index 5cf0f42fc5f0..1fa0b235ae07 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -146,10 +146,12 @@ public:
     virtual bool isMarkable() const override;
 
     virtual void onMouseEnter(const MouseEvent& rMEvt) override;
+    virtual void onHelpRequest(const HelpEvent& rHEvt) override;
     virtual void onMouseLeave() override;
 
     int getHighlightId() const { return mnHighlightId; }
 
+    void ShowTip();
     static void HideTip();
 
 private:
@@ -177,6 +179,35 @@ void ImageButtonHdl::HideTip()
     Help::HideBalloonAndQuickHelp();
 }
 
+void ImageButtonHdl::ShowTip()
+{
+    if (!pHdlList || !pHdlList->GetView() || mnHighlightId == -1)
+        return;
+
+    OutputDevice* pDev = pHdlList->GetView()->GetFirstOutputDevice();
+    if( pDev == nullptr )
+        pDev = Application::GetDefaultDevice();
+
+    OUString aHelpText(SdResId(gButtonToolTips[mnHighlightId]));
+    Point aHelpPos(pDev->LogicToPixel(GetPos()));
+    if (mnHighlightId == 1)
+        aHelpPos.Move(maImageSize.Width(), 0);
+    else if (mnHighlightId == 2)
+        aHelpPos.Move(0, maImageSize.Height());
+    else if (mnHighlightId == 3)
+        aHelpPos.Move(maImageSize.Width(), maImageSize.Height());
+    ::tools::Rectangle aLogicPix(aHelpPos, maImageSize);
+    vcl::Window* pWindow = static_cast<vcl::Window*>(pHdlList->GetView()->GetFirstOutputDevice());
+    ::tools::Rectangle aScreenRect(pWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
+                                   pWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
+    Help::ShowQuickHelp(pWindow, aScreenRect, aHelpText);
+}
+
+void ImageButtonHdl::onHelpRequest(const HelpEvent& /*rHEvt*/)
+{
+    ShowTip();
+}
+
 void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt)
 {
     if( pHdlList && pHdlList->GetView())
@@ -198,12 +229,8 @@ void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt)
 
             mnHighlightId = nHighlightId;
 
-            if( pHdlList )
-            {
-                OUString aHelpText(SdResId(gButtonToolTips[mnHighlightId]));
-                ::tools::Rectangle aScreenRect( pDev->LogicToPixel( GetPos() ), maImageSize );
-                Help::ShowQuickHelp(static_cast< vcl::Window* >( pHdlList->GetView()->GetFirstOutputDevice() ), aScreenRect, aHelpText);
-            }
+            ShowTip();
+
             Touch();
         }
     }
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index edf120b58ab1..f673dba75a72 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1063,6 +1063,10 @@ void SdrHdl::onMouseEnter(const MouseEvent& /*rMEvt*/)
 {
 }
 
+void SdrHdl::onHelpRequest(const HelpEvent& /*rHEvt*/)
+{
+}
+
 void SdrHdl::onMouseLeave()
 {
 }
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 4c9dfcc6dce7..2b015f98b494 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1224,6 +1224,25 @@ bool SdrMarkView::MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin)
     return SdrSnapView::MouseMove(rMEvt, pWin);
 }
 
+bool SdrMarkView::RequestHelp(const HelpEvent& rHEvt)
+{
+    if (maHdlList.GetHdlCount())
+    {
+        const size_t nHdlCount = maHdlList.GetHdlCount();
+
+        for (size_t nHdl = 0; nHdl < nHdlCount; ++nHdl)
+        {
+            SdrHdl* pCurrentHdl = GetHdl(nHdl);
+            if (pCurrentHdl->mbMouseOver)
+            {
+                pCurrentHdl->onHelpRequest(rHEvt);
+                return true;
+            }
+        }
+    }
+    return SdrSnapView::RequestHelp(rHEvt);
+}
+
 void SdrMarkView::ForceRefToMarked()
 {
     switch(meDragMode)
commit 743463057b39ee93d1fa11dc0bcdf919d47f3223
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 14 15:55:12 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jan 14 21:55:12 2019 +0100

    SolarMutexGuard needed here
    
    assert seen in dbgutil
    
    Change-Id: I09cab9e4fa4ce81d71518d87c4a571a467ead52d
    Reviewed-on: https://gerrit.libreoffice.org/66325
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index c914191e33db..bb9e7a3fa8e9 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3084,6 +3084,7 @@ private:
 
     static gboolean launch_overflow_switch_page(GtkInstanceNotebook* pThis)
     {
+        SolarMutexGuard aGuard;
         pThis->signal_overflow_switch_page();
         return false;
     }


More information about the Libreoffice-commits mailing list