Kaydet (Commit) 211ad259 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst e52c0700
......@@ -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();
}
......
......@@ -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*, /**/ )
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment