summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-09-27 17:11:04 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-18 13:22:14 +0000
commit0ba034f26883c0fd417d99ad410448bce44e33a6 (patch)
tree0435ccbc5f7d8e3c368af2fd8e9f8600e2b72f5e
parentfeb5e13fe524b0a49b31e60762e6bc458c499af6 (diff)
tdf#101827 - mend busy contour dialog.
Previous impl. had an un-necessary timeout to update the screen constantly. Change-Id: I28ba50166530d516d299b9c873cf59577043bf82 Reviewed-on: https://gerrit.libreoffice.org/29392 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 1498c4f631e9c90b11dbdb18e8b094b90e143466) Reviewed-on: https://gerrit.libreoffice.org/29673 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--include/svx/graphctl.hxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx10
-rw-r--r--svx/source/dialog/graphctl.cxx32
-rw-r--r--svx/source/dialog/imapdlg.cxx3
4 files changed, 42 insertions, 5 deletions
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index cf44b1cf63ac..7183439fb062 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -52,6 +52,7 @@ class SVX_DLLPUBLIC GraphCtrl : public Control
bool bEditMode;
bool bSdrMode;
bool bAnim;
+ bool mbInIdleUpdate;
DECL_LINK_TYPED( UpdateHdl, Idle*, void );
@@ -108,6 +109,7 @@ public:
void SetGraphSizeLink( const Link<GraphCtrl*,void>& rLink ) { aGraphSizeLink = rLink; }
void SetUpdateLink( const Link<GraphCtrl*,void>& rLink ) { aUpdateLink = rLink; }
+ void QueueIdleUpdate();
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
};
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 096511471c29..788f8f6fe8bd 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -102,8 +102,8 @@ void SvxContourDlg::SetSuperClass( SvxSuperContourDlg& rSuperClass )
}
tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
- const Rectangle* pRect,
- const sal_uIntPtr nFlags )
+ const Rectangle* pRect,
+ const sal_uIntPtr nFlags )
{
Bitmap aBmp;
XOutFlags nContourFlags = XOutFlags::ContourHorz;
@@ -535,6 +535,8 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx, void )
m_pContourWnd->SetPipetteMode( bPipette );
}
+ Invalidate();
+ m_pContourWnd->QueueIdleUpdate();
}
IMPL_LINK_TYPED( SvxSuperContourDlg, MousePosHdl, GraphCtrl*, pWnd, void )
@@ -589,6 +591,7 @@ IMPL_LINK_NOARG_TYPED(SvxSuperContourDlg, UpdateHdl, Idle *, void)
}
GetBindings().Invalidate( SID_CONTOUR_EXEC );
+ m_pContourWnd->QueueIdleUpdate();
}
IMPL_LINK_NOARG_TYPED(SvxSuperContourDlg, CreateHdl, Idle *, void)
@@ -731,6 +734,9 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, WorkplaceClickHdl, ContourWindow&, rWnd, vo
m_pTbx1->CheckItem(mnWorkSpaceId, false);
m_pTbx1->CheckItem(mnSelectId);
rWnd.SetWorkplaceMode( false );
+
+ m_pContourWnd->QueueIdleUpdate();
+ Invalidate();
}
IMPL_LINK_NOARG_TYPED(SvxSuperContourDlg, MiscHdl, LinkParamNone*, void)
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index 8dca9a941530..0c6c29178ae2 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -52,6 +52,7 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c
default:
break;
}
+ rWin.QueueIdleUpdate();
}
GraphCtrl::GraphCtrl( vcl::Window* pParent, WinBits nStyle ) :
@@ -125,6 +126,8 @@ void GraphCtrl::SetWinStyle( WinBits nWinBits )
if ( bSdrMode )
InitSdrModel();
+
+ QueueIdleUpdate();
}
void GraphCtrl::InitSdrModel()
@@ -204,6 +207,7 @@ void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel )
Resize();
Invalidate();
+ QueueIdleUpdate();
}
void GraphCtrl::Resize()
@@ -283,14 +287,17 @@ void GraphCtrl::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRec
void GraphCtrl::SdrObjChanged( const SdrObject& )
{
+ QueueIdleUpdate();
}
void GraphCtrl::SdrObjCreated( const SdrObject& )
{
+ QueueIdleUpdate();
}
void GraphCtrl::MarkListHasChanged()
{
+ QueueIdleUpdate();
}
void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
@@ -603,6 +610,8 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
else
ReleaseMouse();
+
+ QueueIdleUpdate();
}
void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
@@ -642,6 +651,8 @@ void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
}
else
Control::MouseButtonDown( rMEvt );
+
+ QueueIdleUpdate();
}
void GraphCtrl::MouseMove(const MouseEvent& rMEvt)
@@ -673,6 +684,8 @@ void GraphCtrl::MouseMove(const MouseEvent& rMEvt)
aMousePosLink.Call( this );
}
+
+ QueueIdleUpdate();
}
void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt)
@@ -689,6 +702,8 @@ void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt)
}
else
Control::MouseButtonUp( rMEvt );
+
+ QueueIdleUpdate();
}
SdrObject* GraphCtrl::GetSelectedSdrObject() const
@@ -717,6 +732,8 @@ void GraphCtrl::SetEditMode( const bool _bEditMode )
}
else
bEditMode = false;
+
+ QueueIdleUpdate();
}
void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
@@ -728,6 +745,8 @@ void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
}
else
nPolyEdit = 0;
+
+ QueueIdleUpdate();
}
void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
@@ -741,15 +760,22 @@ void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
}
else
eObjKind = OBJ_NONE;
+
+ QueueIdleUpdate();
}
-IMPL_LINK_TYPED( GraphCtrl, UpdateHdl, Idle*, pTimer, void )
+IMPL_LINK_TYPED( GraphCtrl, UpdateHdl, Idle *, , void )
{
+ mbInIdleUpdate = true;
aUpdateLink.Call( this );
-
- pTimer->Start();
+ mbInIdleUpdate = false;
}
+void GraphCtrl::QueueIdleUpdate()
+{
+ if (!mbInIdleUpdate)
+ aUpdateIdle.Start();
+}
css::uno::Reference< css::accessibility::XAccessible > GraphCtrl::CreateAccessible()
{
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 0c5549f77eb1..506b983a5383 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -756,6 +756,7 @@ IMPL_LINK_NOARG_TYPED(SvxIMapDlg, UpdateHdl, Idle *, void)
pOwnData->aUpdateTargetList.clear();
GetBindings().Invalidate( SID_IMAP_EXEC );
+ pIMapWnd->QueueIdleUpdate();
}
IMPL_LINK_TYPED( SvxIMapDlg, StateHdl, GraphCtrl*, pWnd, void )
@@ -806,6 +807,8 @@ IMPL_LINK_TYPED( SvxIMapDlg, StateHdl, GraphCtrl*, pWnd, void )
m_pTbxIMapDlg1->CheckItem( mnPolyInsertId, false );
pWnd->SetPolyEditMode( 0 );
}
+
+ pIMapWnd->QueueIdleUpdate();
}
IMPL_LINK_NOARG_TYPED(SvxIMapDlg, MiscHdl, LinkParamNone*, void)