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 0acb7b80667b83ad05782dafa23721d0030c3b16 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Feb 20 15:40:31 2017 +0000 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 <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 948f599..0056063 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 81ae3c7..e12b89a 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -210,6 +210,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 fbb40fa..772677c 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; + } } } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits