sc/source/ui/inc/tabview.hxx   |    5 +++++
 sc/source/ui/view/tabview.cxx  |    1 +
 sc/source/ui/view/tabview4.cxx |   26 ++++++++++++++++++++++----
 3 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit 4ad8d5aad67154d112dd69966eaa59bb89609f40
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Feb 20 15:40:31 2017 +0000

    Resolves: tdf#100841 retain popover if it has the same pos, size and 
settings
    
    Change-Id: I102874867020a3c471567cbdc97162c564351635
    Reviewed-on: https://gerrit.libreoffice.org/34480
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 3d7d54a..d333034 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SC_SOURCE_UI_INC_TABVIEW_HXX
 
 #include <vcl/scrbar.hxx>
+#include <vcl/help.hxx>
 
 #include <sfx2/ipclient.hxx>
 
@@ -169,6 +170,10 @@ private:
     ScExtraEditViewManager aExtraEditViewManager;
 
     sal_uLong               nTipVisible;
+    Rectangle               aTipRectangle;
+    QuickHelpFlags          nTipAlign;
+    OUString                sTipString;
+    VclPtr<vcl::Window>     sTopParent;
 
     long                nPrevDragPos;
 
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 39a417f..117ffba 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -213,6 +213,7 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& 
rDocSh, ScTabViewShell*
     pTimerWindow( nullptr ),
     aExtraEditViewManager( pViewShell, pGridWin ),
     nTipVisible( 0 ),
+    nTipAlign( QuickHelpFlags::NONE ),
     nPrevDragPos( 0 ),
     meBlockMode(None),
     nBlockStartX( 0 ),
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 3aaa0d1..89fe6d9 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -39,6 +39,10 @@ void ScTabView::HideTip()
         vcl::Window* pWin = pGridWin[eWhich];
         Help::HidePopover(pWin, nTipVisible);
         nTipVisible = 0;
+        aTipRectangle = Rectangle();
+        nTipAlign = QuickHelpFlags::NONE;
+        sTipString.clear();
+        sTopParent.clear();
     }
 }
 
@@ -89,8 +93,15 @@ void ScTabView::ShowRefTip()
 
                 //! Test, ob geaendert ??
 
-                HideTip();
-                nTipVisible = Help::ShowPopover(pWin, aRect, aHelp, nFlags);
+                if (!nTipVisible || nFlags != nTipAlign || aRect != 
aTipRectangle || sTipString != aHelp || sTopParent != pWin)
+                {
+                    HideTip();
+                    nTipVisible = Help::ShowPopover(pWin, aRect, aHelp, 
nFlags);
+                    aTipRectangle = aRect;
+                    nTipAlign = nFlags;
+                    sTipString = aHelp;
+                    sTopParent = pWin;
+                }
                 bDone = true;
             }
         }
@@ -276,8 +287,15 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
                 aPos = pWin->OutputToScreenPixel( aPos );
                 Rectangle aRect( aPos, aPos );
                 QuickHelpFlags nAlign = 
QuickHelpFlags::Left|QuickHelpFlags::Top;
-                HideTip();
-                nTipVisible = Help::ShowPopover(pWin, aRect, aHelpStr, nAlign);
+                if (!nTipVisible || nAlign != nTipAlign || aRect != 
aTipRectangle || sTipString != aHelpStr || sTopParent != pWin)
+                {
+                    HideTip();
+                    nTipVisible = Help::ShowPopover(pWin, aRect, aHelpStr, 
nAlign);
+                    aTipRectangle = aRect;
+                    nTipAlign = nAlign;
+                    sTipString = aHelpStr;
+                    sTopParent = pWin;
+                }
             }
         }
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to