diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-20 15:40:31 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-01 13:46:45 +0100 |
commit | 4d3b4630dd039d942fcef7ab7a3a6d664381f525 (patch) | |
tree | 69e90552876f9f253784f4af33b363250ca45e7d /sc/source | |
parent | 20448ead5b297d5bb527d64d4c9fd34ebfb67c40 (diff) |
Resolves: tdf#105854 retain popover if it has the same pos, size and settings
Change-Id: I102874867020a3c471567cbdc97162c564351635
Reviewed-on: https://gerrit.libreoffice.org/34485
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 0acb7b80667b83ad05782dafa23721d0030c3b16)
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabview4.cxx | 26 |
3 files changed, 28 insertions, 4 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 5afc3d3920eb..76643e101be5 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 080d12b3c7e5..6e32e84aa9ac 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 fdc633dfaa2e..fe2e82dd36ed 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -41,6 +41,10 @@ void ScTabView::HideTip() vcl::Window* pWin = pGridWin[eWhich]; Help::HidePopover(pWin, nTipVisible); nTipVisible = 0; + aTipRectangle = Rectangle(); + nTipAlign = QuickHelpFlags::NONE; + sTipString.clear(); + sTopParent.clear(); } } @@ -91,8 +95,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; } } @@ -278,8 +289,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; + } } } } |