svx/source/form/fmobj.cxx | 6 ++++++ svx/source/form/fmvwimp.cxx | 9 +++++++++ svx/source/inc/fmvwimp.hxx | 2 ++ 3 files changed, 17 insertions(+)
New commits: commit 211ad259bbc18997f9f070e59e4262885c11e924 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Oct 13 12:02:40 2014 +0200 fdo#82980: Cancel FmXFormView::OnStartControlWizard when breaking creation The problem is that SdrCreateView::EndCreateObj (svx/source/svdraw/svdcrtv.cxx) first calls FmFormObj::EndCreate (svx/source/form/fmobj.cxx) -> FmXFormView::onCreatedFormObject (svx/source/form/fmvwimp.cxx) -> Application::PostUserEvent( LINK( this, FmXFormView, OnStartControlWizard ) ), and only then, upon bPntsEq, calls FmFormObj::BrkCreate (svx/source/form/fmobj.cxx), which does not cancel the posted OnStartControlWizard link. The fix is apparently not perfect, though, as afterwards the text document goes back to text input mode (cursor blinking, mouse pointer has I-beam shape) even though the "List Box" icon is still selected. Change-Id: I3137110a88885b04c8dde5377265b1dee91ed6ac diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 9d92835..e5293b7 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -677,6 +677,12 @@ void FmFormObj::BrkCreate( SdrDragStat& rStat ) { SdrUnoObj::BrkCreate( rStat ); impl_isolateControlModel_nothrow(); + + FmFormView* pView( dynamic_cast< FmFormView* >( rStat.GetView() ) ); + FmXFormView* pViewImpl = pView ? pView->GetImpl() : NULL; + OSL_ENSURE( pViewImpl, "FmFormObj::EndCreate: no view!?" ); + if ( pViewImpl ) + pViewImpl->breakCreateFormObject(); } diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 212c9de..d9ed7a0 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1021,6 +1021,15 @@ void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject ) m_nControlWizardEvent = Application::PostUserEvent( LINK( this, FmXFormView, OnStartControlWizard ) ); } +void FmXFormView::breakCreateFormObject() +{ + if (m_nControlWizardEvent != 0) + { + Application::RemoveUserEvent(m_nControlWizardEvent); + m_nControlWizardEvent = 0; + } + m_xLastCreatedControlModel.clear(); +} IMPL_LINK( FmXFormView, OnStartControlWizard, void*, /**/ ) { diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx index ee224cd..d221873 100644 --- a/svx/source/inc/fmvwimp.hxx +++ b/svx/source/inc/fmvwimp.hxx @@ -238,6 +238,8 @@ public: void onCreatedFormObject( FmFormObj& _rFormObject ); + void breakCreateFormObject(); + static bool isFocusable( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& i_rControl _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits