diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-13 12:02:40 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-13 12:09:09 +0200 |
commit | 211ad259bbc18997f9f070e59e4262885c11e924 (patch) | |
tree | b06d52152c3c629378d1088a254df4d75bcfa3b0 /svx | |
parent | e52c070088f23d5ed815bb7132412fe07f47bf7b (diff) |
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
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/fmobj.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 9 | ||||
-rw-r--r-- | svx/source/inc/fmvwimp.hxx | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 9d928352317b..e5293b74e4ae 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 212c9de8123d..d9ed7a042cef 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 ee224cdd232e..d221873862f7 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 |