summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/app/seltrans.cxx2
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx2
-rw-r--r--sc/source/ui/inc/hdrcont.hxx6
-rw-r--r--sc/source/ui/view/hdrcont.cxx44
4 files changed, 41 insertions, 13 deletions
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 1757b64749bd..d16f9b7a49fd 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -149,7 +149,7 @@ ScSelectionTransferObj::ScSelectionTransferObj( ScTabView* pSource, ScSelectionT
ScSelectionTransferObj::~ScSelectionTransferObj()
{
ScModule* pScMod = SC_MOD();
- if ( pScMod->GetSelectionTransfer() == this )
+ if (pScMod && pScMod->GetSelectionTransfer() == this)
{
// this is reached when the object wasn't really copied to the selection
// (CopyToSelection has no effect under Windows)
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index addfedbe0f4c..6471149c0765 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -205,7 +205,6 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet )
ScQueryEntry& rEntry = theQueryData.GetEntry(i);
if ( rEntry.bDoQuery )
{
- const ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
nCondPos = static_cast<size_t>(rEntry.eOp);
nFieldSelPos = GetFieldSelPos( static_cast<SCCOL>(rEntry.nField) );
if (rEntry.IsQueryByEmpty())
@@ -220,6 +219,7 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet )
}
else
{
+ const ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
OUString aQueryStr = rItem.maString.getString();
if (aQueryStr.isEmpty())
{
diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 08be7eba5010..d3210062d43f 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
#include <vcl/window.hxx>
+#include <vcl/timer.hxx>
#include <scdllapi.h>
#include <types.hxx>
@@ -36,6 +37,7 @@ class ScHeaderControl : public vcl::Window
{
private:
SelectionEngine* pSelEngine;
+ Timer aShowHelpTimer;
vcl::Font aNormFont;
vcl::Font aBoldFont;
bool bBoldSet;
@@ -67,9 +69,12 @@ private:
SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const;
bool IsSelectionAllowed(SCCOLROW nPos) const;
void ShowDragHelp();
+ void HideDragHelp();
void DoPaint( SCCOLROW nStart, SCCOLROW nEnd );
+ DECL_LINK(ShowDragHelpHdl, Timer*, void);
+
protected:
ScTabView* pTabView;
@@ -105,6 +110,7 @@ protected:
virtual void DrawInvert( long nDragPos );
virtual void Command( const CommandEvent& rCEvt ) override;
+ virtual void dispose() override;
public:
ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelectionEngine,
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index a8aeb47f9f88..0f74b3c0cdb2 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -48,6 +48,7 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelect
SCCOLROW nNewSize, bool bNewVertical, ScTabView* pTab ) :
Window ( pParent ),
pSelEngine ( pSelectionEngine ),
+ aShowHelpTimer("sc HeaderControl Popover Timer"),
bVertical ( bNewVertical ),
nSize ( nNewSize ),
nMarkStart ( 0 ),
@@ -88,9 +89,18 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelect
nWidth = nSmallWidth = aSize.Width();
nBigWidth = LogicToPixel( Size( GetTextWidth("8888888"), 0 ) ).Width() + 5;
+ aShowHelpTimer.SetInvokeHandler(LINK(this, ScHeaderControl, ShowDragHelpHdl));
+ aShowHelpTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
+
SetBackground();
}
+void ScHeaderControl::dispose()
+{
+ aShowHelpTimer.Stop();
+ vcl::Window::dispose();
+}
+
void ScHeaderControl::SetWidth( long nNew )
{
OSL_ENSURE( bVertical, "SetWidth works only on row headers" );
@@ -652,7 +662,11 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
else
nDragStart = rMEvt.GetPosPixel().X();
nDragPos = nDragStart;
- ShowDragHelp();
+ // tdf#140833 launch help tip to show after the double click time has expired
+ // so under gtk the popover isn't active when the double click is processed
+ // by gtk because under load on wayland the double click is getting handled
+ // by something else and getting sent to the the window underneath our window
+ aShowHelpTimer.Start();
DrawInvert( nDragPos );
StartTracking();
@@ -713,11 +727,7 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
{
DrawInvert( nDragPos );
ReleaseMouse();
- if (nTipVisible)
- {
- Help::HidePopover(this, nTipVisible);
- nTipVisible = nullptr;
- }
+ HideDragHelp();
bDragging = false;
long nScrPos = GetScrPos( nDragNo );
@@ -885,11 +895,7 @@ void ScHeaderControl::StopMarking()
if ( bDragging )
{
DrawInvert( nDragPos );
- if (nTipVisible)
- {
- Help::HidePopover(this, nTipVisible);
- nTipVisible = nullptr;
- }
+ HideDragHelp();
bDragging = false;
}
@@ -902,8 +908,14 @@ void ScHeaderControl::StopMarking()
ReleaseMouse();
}
+IMPL_LINK_NOARG(ScHeaderControl, ShowDragHelpHdl, Timer*, void)
+{
+ ShowDragHelp();
+}
+
void ScHeaderControl::ShowDragHelp()
{
+ aShowHelpTimer.Stop();
if (Help::IsQuickHelpEnabled())
{
long nScrPos = GetScrPos( nDragNo );
@@ -943,6 +955,16 @@ void ScHeaderControl::ShowDragHelp()
}
}
+void ScHeaderControl::HideDragHelp()
+{
+ aShowHelpTimer.Stop();
+ if (nTipVisible)
+ {
+ Help::HidePopover(this, nTipVisible);
+ nTipVisible = nullptr;
+ }
+}
+
void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt )
{
// If the own QuickHelp is displayed, don't let RequestHelp remove it