[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - include/sfx2 include/vcl sfx2/source vcl/source

Maxim Monastirsky momonasmon at gmail.com
Tue Sep 6 19:40:39 UTC 2016


 include/sfx2/templateabstractview.hxx        |    2 ++
 include/vcl/help.hxx                         |    2 +-
 sfx2/source/control/templateabstractview.cxx |   14 ++++++++++++++
 vcl/source/app/help.cxx                      |    3 ++-
 4 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit abd7dc569ec746f5eef03613ecfbcbf75491e640
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Tue Sep 6 21:23:49 2016 +0300

    tdf#101779 Allow multiline tooltips in template manager
    
    Based on 0c3a9aa403c209e522dc5c32258c33381677c91e
    
    Also includes:
    
    Related: tdf#101779 TipStyleBalloon for ShowQuickHelp too
    
    681294d55b6b4edcdef08982596cb4bcee32e635 converted
    TableDataWindow::RequestHelp to use ShowQuickHelp,
    but it wants to set TipStyleBalloon to be able to use
    line break. Also I want to do the same in the template
    manager dialog, in the following commit.
    
    (cherry picked from commit 331d3a8b23cdbff0e1434aa5a553efdcc2c7c822)
    
    Change-Id: Ie2569a5ab29620a5f4474dafd2309513c08bd7d2
    Reviewed-on: https://gerrit.libreoffice.org/28701
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 7913947..404b982 100644
--- a/include/sfx2/templateabstractview.hxx
+++ b/include/sfx2/templateabstractview.hxx
@@ -85,6 +85,8 @@ public:
 
     virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
 
+    virtual void RequestHelp( const HelpEvent& rHEvt ) override;
+
     virtual void Command( const CommandEvent& rCEvt ) override;
 
     virtual void KeyInput( const KeyEvent& rKEvt ) override;
diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx
index 2070caa..e76bd91 100644
--- a/include/vcl/help.hxx
+++ b/include/vcl/help.hxx
@@ -43,7 +43,7 @@ enum class QuickHelpFlags
     CtrlText          = 0x0040,
 /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
     NoDelay           = 0x0080,
-/// force balloon-style in ShowPopover
+/// force balloon-style in ShowPopover and ShowQuickHelp
     TipStyleBalloon   = 0x0100,
     NoEvadePointer    = 0x0200,
     BiDiRtl           = 0x0400,
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 45f644d..539a207 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -16,6 +16,7 @@
 #include <sfx2/docfac.hxx>
 #include <tools/urlobj.hxx>
 #include <unotools/ucbstreamhelper.hxx>
+#include <vcl/help.hxx>
 #include <vcl/pngread.hxx>
 #include <vcl/layout.hxx>
 #include <unotools/moduleoptions.hxx>
@@ -190,6 +191,19 @@ void TemplateAbstractView::MouseButtonDown( const MouseEvent& rMEvt )
     ThumbnailView::MouseButtonDown(rMEvt);
 }
 
+void TemplateAbstractView::RequestHelp( const HelpEvent& rHEvt )
+{
+    if ( rHEvt.GetMode() & HelpEventMode::QUICK )
+    {
+        Rectangle aRect( OutputToScreenPixel( GetPosPixel() ), GetSizePixel() );
+        Help::ShowQuickHelp( this, aRect, GetQuickHelpText(),
+                             QuickHelpFlags::CtrlText | QuickHelpFlags::TipStyleBalloon );
+        return;
+    }
+
+    ThumbnailView::RequestHelp( rHEvt );
+}
+
 void TemplateAbstractView::Command( const CommandEvent& rCEvt )
 {
     if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 0ebf141..d29806a 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -178,7 +178,8 @@ bool Help::ShowQuickHelp( vcl::Window* pParent,
                           const OUString& rLongHelpText,
                           QuickHelpFlags nStyle )
 {
-    ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle,
+    sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
+    ImplShowHelpWindow( pParent, nHelpWinStyle, nStyle,
                         rHelpText, rLongHelpText,
                         pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
     return true;


More information about the Libreoffice-commits mailing list