[Libreoffice-commits] core.git: sw/inc sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 22 18:09:40 UTC 2018
sw/inc/viewsh.hxx | 3 +++
sw/source/core/doc/DocumentTimerManager.cxx | 10 +++++++---
sw/source/core/frmedt/feshview.cxx | 4 ++--
sw/source/core/view/viewsh.cxx | 3 +--
sw/source/core/view/vnew.cxx | 5 +++++
sw/source/uibase/uiview/view2.cxx | 2 +-
6 files changed, 19 insertions(+), 8 deletions(-)
New commits:
commit f19dfaf817556ba28d68c000f3561a2752635727
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Nov 22 12:48:17 2018 +0000
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Thu Nov 22 19:09:12 2018 +0100
Avoid busy-loop related to layout when dragging objects.
Change-Id: I4fb437356bc154cfefc5958592ae5888e24d59c3
Reviewed-on: https://gerrit.libreoffice.org/63804
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index bf09c8118590..66382ecc216c 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -467,6 +467,9 @@ public:
bool HasDrawView() const;
void MakeDrawView();
+ // Are we dragging draw shapes around.
+ bool HasDrawViewDrag() const;
+
// DrawView may be used at UI.
SdrView *GetDrawView();
const SdrView *GetDrawView() const { return const_cast<SwViewShell*>(this)->GetDrawView(); }
diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx
index d2be24104920..44984c86e583 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -108,10 +108,14 @@ DocumentTimerManager::IdleJob DocumentTimerManager::GetNextIdleJob() const
return IdleJob::Grammar;
}
- for ( auto pLayout : m_rDoc.GetAllLayouts() )
+ // If we're dragging re-layout doesn't occur so avoid a busy loop.
+ if (!pShell->HasDrawViewDrag())
{
- if( pLayout->IsIdleFormat() )
- return IdleJob::Layout;
+ for ( auto pLayout : m_rDoc.GetAllLayouts() )
+ {
+ if( pLayout->IsIdleFormat() )
+ return IdleJob::Layout;
+ }
}
SwFieldUpdateFlags nFieldUpdFlag = m_rDoc.GetDocumentSettingManager().getFieldUpdateFlags(true);
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 1d00cd578e29..ae1259ce55ca 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -720,7 +720,7 @@ void SwFEShell::BeginDrag( const Point* pPt, bool bIsShift)
void SwFEShell::Drag( const Point *pPt, bool )
{
OSL_ENSURE( Imp()->HasDrawView(), "Drag without DrawView?" );
- if ( Imp()->GetDrawView()->IsDragObj() )
+ if ( HasDrawViewDrag() )
{
ScrollTo( *pPt );
Imp()->GetDrawView()->MovDragObj( *pPt );
@@ -772,7 +772,7 @@ void SwFEShell::EndDrag()
void SwFEShell::BreakDrag()
{
OSL_ENSURE( Imp()->HasDrawView(), "BreakDrag without DrawView?" );
- if ( Imp()->GetDrawView()->IsDragObj() )
+ if( HasDrawViewDrag() )
Imp()->GetDrawView()->BrkDragObj();
SetChainMarker();
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 273692a86aa7..77ccf51f2cd4 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -698,8 +698,7 @@ bool SwViewShell::HasCharts() const
void SwViewShell::LayoutIdle()
{
- if( !mpOpt->IsIdle() || !GetWin() ||
- ( Imp()->HasDrawView() && Imp()->GetDrawView()->IsDragObj() ) )
+ if( !mpOpt->IsIdle() || !GetWin() || HasDrawViewDrag() )
return;
//No idle when printing is going on.
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 2dd39f081668..5b386da0da16 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -367,6 +367,11 @@ void SwViewShell::MakeDrawView()
Imp()->MakeDrawView( );
}
+bool SwViewShell::HasDrawViewDrag() const
+{
+ return Imp()->HasDrawView() && Imp()->GetDrawView()->IsDragObj();
+}
+
SdrView* SwViewShell::GetDrawView()
{
return Imp()->GetDrawView();
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 534beec5cce6..f4222bf07eb4 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -804,7 +804,7 @@ void SwView::Execute(SfxRequest &rReq)
break;
case FN_ESCAPE:
{
- if ( m_pWrtShell->HasDrawView() && m_pWrtShell->GetDrawView()->IsDragObj() )
+ if ( m_pWrtShell->HasDrawViewDrag() )
{
m_pWrtShell->BreakDrag();
m_pWrtShell->EnterSelFrameMode();
More information about the Libreoffice-commits
mailing list