summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-20 15:40:31 +0000
committerEike Rathke <erack@redhat.com>2017-02-24 18:07:09 +0000
commit0acb7b80667b83ad05782dafa23721d0030c3b16 (patch)
tree89bf96b024acbce62cbdcbb669fb8197fe8de742
parent8a4f99175b09eec634a9a31e9e2a55e9c97d02ca (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>
-rw-r--r--sc/source/ui/inc/tabview.hxx5
-rw-r--r--sc/source/ui/view/tabview.cxx1
-rw-r--r--sc/source/ui/view/tabview4.cxx26
3 files changed, 28 insertions, 4 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 948f599a30df..0056063ff58d 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 81ae3c778551..e12b89a07c89 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 fbb40fa31e5a..772677c35285 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;
+ }
}
}
}