summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-20 15:40:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-20 17:24:25 +0000
commit4ad8d5aad67154d112dd69966eaa59bb89609f40 (patch)
tree5bbbddacfb57cb5dd9486137a017ebab0bbe5312 /sc
parent917d5b8b26a7428f7b7dd495a8db14a3ce16aa55 (diff)
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 <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-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 3d7d54a3a516..d33303426341 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 39a417fc90bf..117ffbaba80d 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 3aaa0d1b2691..89fe6d9df41b 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;
+ }
}
}
}