Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / form / fmobj.cxx
blob59d8dae0eb92a79b7a8ca64e8cb47273d2285b92
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <fmobj.hxx>
21 #include <fmprop.hxx>
22 #include <fmvwimp.hxx>
23 #include <fmpgeimp.hxx>
24 #include <o3tl/string_view.hxx>
25 #include <svx/fmview.hxx>
26 #include <svx/fmpage.hxx>
27 #include <svx/svdovirt.hxx>
28 #include <svx/fmmodel.hxx>
30 #include <com/sun/star/awt/XDevice.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/form/Forms.hpp>
33 #include <com/sun/star/script/XEventAttacherManager.hpp>
34 #include <svx/fmtools.hxx>
36 #include <comphelper/property.hxx>
37 #include <comphelper/processfactory.hxx>
38 #include <toolkit/awt/vclxdevice.hxx>
39 #include <tools/debug.hxx>
40 #include <comphelper/diagnose_ex.hxx>
42 using namespace ::com::sun::star::io;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::awt;
45 using namespace ::com::sun::star::lang;
46 using namespace ::com::sun::star::util;
47 using namespace ::com::sun::star::form;
48 using namespace ::com::sun::star::beans;
49 using namespace ::com::sun::star::script;
50 using namespace ::com::sun::star::container;
51 using namespace ::svxform;
54 FmFormObj::FmFormObj(
55 SdrModel& rSdrModel,
56 const OUString& rModelName)
57 : SdrUnoObj(rSdrModel, rModelName)
58 ,m_nPos(-1)
59 ,m_pLastKnownRefDevice(nullptr)
61 // normally, this is done in SetUnoControlModel, but if the call happened in the base class ctor,
62 // then our incarnation of it was not called (since we were not constructed at this time).
63 impl_checkRefDevice_nothrow( true );
66 FmFormObj::FmFormObj(SdrModel& rSdrModel)
67 : SdrUnoObj(rSdrModel, "")
68 ,m_nPos(-1)
69 ,m_pLastKnownRefDevice(nullptr)
71 // Stuff that old SetModel also did:
72 impl_checkRefDevice_nothrow();
75 FmFormObj::FmFormObj(SdrModel& rSdrModel, FmFormObj const & rSource)
76 : SdrUnoObj(rSdrModel, rSource)
77 ,m_nPos(-1)
78 ,m_pLastKnownRefDevice(nullptr)
80 // Stuff that old SetModel also did:
81 impl_checkRefDevice_nothrow();
83 // If UnoControlModel is part of an event environment,
84 // events may assigned to it.
85 Reference< XFormComponent > xContent(rSource.xUnoControlModel, UNO_QUERY);
86 if (xContent.is())
88 Reference< XEventAttacherManager > xManager(xContent->getParent(), UNO_QUERY);
89 Reference< XIndexAccess > xManagerAsIndex(xManager, UNO_QUERY);
90 if (xManagerAsIndex.is())
92 sal_Int32 nPos = getElementPos( xManagerAsIndex, xContent );
93 if ( nPos >= 0 )
94 aEvts = xManager->getScriptEvents( nPos );
97 else
98 aEvts = rSource.aEvts;
100 Reference< XChild > xSourceAsChild(rSource.GetUnoControlModel(), UNO_QUERY);
101 if (!xSourceAsChild.is())
102 return;
104 Reference< XInterface > xSourceContainer = xSourceAsChild->getParent();
106 m_xEnvironmentHistory = css::form::Forms::create( comphelper::getProcessComponentContext() );
108 ensureModelEnv(xSourceContainer, m_xEnvironmentHistory);
109 m_aEventsHistory = aEvts;
110 // if we were clone there was a call to operator=, so aEvts are exactly the events we need here...
113 FmFormObj::~FmFormObj()
116 if (m_xEnvironmentHistory.is())
117 m_xEnvironmentHistory->dispose();
119 m_xEnvironmentHistory = nullptr;
120 m_aEventsHistory.realloc(0);
124 void FmFormObj::SetObjEnv(const Reference< XIndexContainer > & xForm, const sal_Int32 nIdx,
125 const Sequence< ScriptEventDescriptor >& rEvts)
127 m_xParent = xForm;
128 aEvts = rEvts;
129 m_nPos = nIdx;
133 void FmFormObj::ClearObjEnv()
135 m_xParent.clear();
136 aEvts.realloc( 0 );
137 m_nPos = -1;
141 void FmFormObj::impl_checkRefDevice_nothrow( bool _force )
143 const FmFormModel* pFormModel = dynamic_cast<FmFormModel*>(&getSdrModelFromSdrObject());
144 if ( !pFormModel || !pFormModel->ControlsUseRefDevice() )
145 return;
147 OutputDevice* pCurrentRefDevice = pFormModel->GetRefDevice();
148 if ( ( m_pLastKnownRefDevice.get() == pCurrentRefDevice ) && !_force )
149 return;
151 Reference< XControlModel > xControlModel( GetUnoControlModel() );
152 if ( !xControlModel.is() )
153 return;
155 m_pLastKnownRefDevice = pCurrentRefDevice;
156 if ( !m_pLastKnownRefDevice )
157 return;
161 Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW );
162 Reference< XPropertySetInfo > xPropertyInfo( xModelProps->getPropertySetInfo(), UNO_SET_THROW );
164 static constexpr OUStringLiteral sRefDevicePropName = u"ReferenceDevice";
165 if ( xPropertyInfo->hasPropertyByName( sRefDevicePropName ) )
167 rtl::Reference<VCLXDevice> pUnoRefDevice = new VCLXDevice;
168 pUnoRefDevice->SetOutputDevice( m_pLastKnownRefDevice );
169 Reference< XDevice > xRefDevice( pUnoRefDevice );
170 xModelProps->setPropertyValue( sRefDevicePropName, Any( xRefDevice ) );
173 catch( const Exception& )
175 DBG_UNHANDLED_EXCEPTION("svx");
180 void FmFormObj::impl_isolateControlModel_nothrow()
184 Reference< XChild > xControlModel( GetUnoControlModel(), UNO_QUERY );
185 if ( xControlModel.is() )
187 Reference< XIndexContainer> xParent( xControlModel->getParent(), UNO_QUERY );
188 if ( xParent.is() )
190 sal_Int32 nPos = getElementPos( xParent, xControlModel );
191 xParent->removeByIndex( nPos );
195 catch( const Exception& )
197 DBG_UNHANDLED_EXCEPTION("svx");
202 void FmFormObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
204 FmFormPage* pOldFormPage(dynamic_cast< FmFormPage* >(getSdrPageFromSdrObject()));
205 if ( pOldFormPage )
206 pOldFormPage->GetImpl().formObjectRemoved( *this );
208 FmFormPage* pNewFormPage = dynamic_cast<FmFormPage*>( pNewPage );
209 if ( !pNewFormPage )
211 // Maybe it makes sense to create an environment history here : if somebody set's our page to NULL, and we have a valid page before,
212 // me may want to remember our place within the old page. For this we could create a new m_xEnvironmentHistory to store it.
213 // So the next SetPage with a valid new page would restore that environment within the new page.
214 // But for the original Bug (#57300#) we don't need that, so I omit it here. Maybe this will be implemented later.
215 impl_isolateControlModel_nothrow();
216 SdrUnoObj::handlePageChange(pOldPage, pNewPage);
217 return;
220 Reference< css::form::XForms > xNewPageForms = pNewFormPage->GetForms();
221 Reference< XIndexContainer > xNewParent;
222 Sequence< ScriptEventDescriptor> aNewEvents;
224 // calc the new parent for my model (within the new page's forms hierarchy)
225 // do we have a history ? (from :Clone)
226 if ( m_xEnvironmentHistory.is() )
228 // the element in m_xEnvironmentHistory which is equivalent to my new parent (which (perhaps) has to be created within pNewPage->GetForms)
229 // is the right-most element in the tree.
230 Reference< XIndexContainer > xRightMostLeaf( m_xEnvironmentHistory, UNO_QUERY_THROW );
233 while ( xRightMostLeaf->getCount() )
235 xRightMostLeaf.set(
236 xRightMostLeaf->getByIndex( xRightMostLeaf->getCount() - 1 ),
237 UNO_QUERY_THROW
241 xNewParent.set( ensureModelEnv( xRightMostLeaf, xNewPageForms ), UNO_QUERY_THROW );
243 // we successfully cloned the environment in m_xEnvironmentHistory, so we can use m_aEventsHistory
244 // (which describes the events of our model at the moment m_xEnvironmentHistory was created)
245 aNewEvents = m_aEventsHistory;
247 catch( const Exception& )
249 DBG_UNHANDLED_EXCEPTION("svx");
253 if ( !xNewParent.is() )
255 // are we a valid part of our current page forms ?
256 Reference< XIndexContainer > xOldForms;
257 if ( pOldFormPage )
258 xOldForms.set( pOldFormPage->GetForms(), UNO_QUERY_THROW );
260 if ( xOldForms.is() )
262 // search (upward from our model) for xOldForms
263 Reference< XChild > xSearch( GetUnoControlModel(), UNO_QUERY );
264 while (xSearch.is())
266 if ( xSearch == xOldForms )
267 break;
268 xSearch.set( xSearch->getParent(), UNO_QUERY );
270 if ( xSearch.is() ) // implies xSearch == xOldForms, which means we're a valid part of our current page forms hierarchy
272 Reference< XChild > xMeAsChild( GetUnoControlModel(), UNO_QUERY );
273 xNewParent.set( ensureModelEnv( xMeAsChild->getParent(), xNewPageForms ), UNO_QUERY );
275 if ( xNewParent.is() )
279 // transfer the events from our (model's) parent to the new (model's) parent, too
280 Reference< XEventAttacherManager > xEventManager(xMeAsChild->getParent(), UNO_QUERY);
281 Reference< XIndexAccess > xManagerAsIndex(xEventManager, UNO_QUERY);
282 if (xManagerAsIndex.is())
284 sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsChild);
285 if (nPos >= 0)
286 aNewEvents = xEventManager->getScriptEvents(nPos);
288 else
289 aNewEvents = aEvts;
291 catch( const Exception& )
293 DBG_UNHANDLED_EXCEPTION("svx");
300 // now set the page
301 SdrUnoObj::handlePageChange(pOldPage, pNewPage);
303 // place my model within the new parent container
304 if (xNewParent.is())
306 Reference< XFormComponent > xMeAsFormComp(GetUnoControlModel(), UNO_QUERY);
307 if (xMeAsFormComp.is())
309 // check if I have another parent (and remove me, if necessary)
310 Reference< XIndexContainer > xOldParent(xMeAsFormComp->getParent(), UNO_QUERY);
311 if (xOldParent.is())
313 sal_Int32 nPos = getElementPos(xOldParent, xMeAsFormComp);
314 if (nPos > -1)
315 xOldParent->removeByIndex(nPos);
318 // and insert into the new container
319 xNewParent->insertByIndex(xNewParent->getCount(), Any(xMeAsFormComp));
321 // transfer the events
322 if (aNewEvents.hasElements())
326 Reference< XEventAttacherManager > xEventManager(xNewParent, UNO_QUERY);
327 Reference< XIndexAccess > xManagerAsIndex(xEventManager, UNO_QUERY);
328 if (xManagerAsIndex.is())
330 sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsFormComp);
331 DBG_ASSERT(nPos >= 0, "FmFormObj::SetPage : inserted but not present ?");
332 xEventManager->registerScriptEvents(nPos, aNewEvents);
335 catch( const Exception& )
337 DBG_UNHANDLED_EXCEPTION("svx");
344 // delete my history
345 if (m_xEnvironmentHistory.is())
346 m_xEnvironmentHistory->dispose();
348 m_xEnvironmentHistory = nullptr;
349 m_aEventsHistory.realloc(0);
351 pNewFormPage->GetImpl().formObjectInserted( *this );
354 SdrInventor FmFormObj::GetObjInventor() const
356 return SdrInventor::FmForm;
359 SdrObjKind FmFormObj::GetObjIdentifier() const
361 return SdrObjKind::UNO;
364 rtl::Reference<SdrObject> FmFormObj::CloneSdrObject(SdrModel& rTargetModel) const
366 return new FmFormObj(rTargetModel, *this);
369 void FmFormObj::NbcReformatText()
371 impl_checkRefDevice_nothrow();
372 SdrUnoObj::NbcReformatText();
376 namespace
378 OUString lcl_getFormComponentAccessPath(const Reference< XInterface >& _xElement, Reference< XInterface >& _rTopLevelElement)
380 Reference< css::form::XFormComponent> xChild(_xElement, UNO_QUERY);
381 Reference< css::container::XIndexAccess> xParent;
382 if (xChild.is())
383 xParent.set(xChild->getParent(), UNO_QUERY);
385 // while the current content is a form
386 OUString sReturn;
387 while (xChild.is())
389 // get the content's relative pos within its parent container
390 sal_Int32 nPos = getElementPos(xParent, xChild);
392 // prepend this current relative pos
393 OUString sCurrentIndex = OUString::number(nPos);
394 if (!sReturn.isEmpty())
396 sCurrentIndex += "\\" + sReturn;
399 sReturn = sCurrentIndex;
401 // travel up
402 xChild.set(xParent, css::uno::UNO_QUERY);
403 if (xChild.is())
404 xParent.set(xChild->getParent(), UNO_QUERY);
407 _rTopLevelElement = xParent;
408 return sReturn;
413 Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > & _rSourceContainer, const Reference<css::form::XForms>& _rTopLevelDestContainer)
415 Reference< XInterface > xTopLevelSource;
416 OUString sAccessPath = lcl_getFormComponentAccessPath(_rSourceContainer, xTopLevelSource);
417 if (!xTopLevelSource.is())
418 // something went wrong, maybe _rSourceContainer isn't part of a valid forms hierarchy
419 return Reference< XInterface > ();
421 Reference< XIndexContainer > xDestContainer(_rTopLevelDestContainer, UNO_QUERY_THROW);
422 Reference< XIndexContainer > xSourceContainer(xTopLevelSource, UNO_QUERY);
423 DBG_ASSERT(xSourceContainer.is(), "FmFormObj::ensureModelEnv : the top level source is invalid !");
425 sal_Int32 nTokIndex = 0;
428 std::u16string_view aToken = o3tl::getToken(sAccessPath, 0, '\\', nTokIndex );
429 sal_uInt16 nIndex = static_cast<sal_uInt16>(o3tl::toInt32(aToken));
431 // get the DSS of the source form (we have to find an equivalent for)
432 DBG_ASSERT(nIndex<xSourceContainer->getCount(), "FmFormObj::ensureModelEnv : invalid access path !");
433 Reference< XPropertySet > xSourceForm;
434 xSourceContainer->getByIndex(nIndex) >>= xSourceForm;
435 DBG_ASSERT(xSourceForm.is(), "FmFormObj::ensureModelEnv : invalid source form !");
437 Any aSrcCursorSource, aSrcCursorSourceType, aSrcDataSource;
438 DBG_ASSERT(::comphelper::hasProperty(FM_PROP_COMMAND, xSourceForm) && ::comphelper::hasProperty(FM_PROP_COMMANDTYPE, xSourceForm)
439 && ::comphelper::hasProperty(FM_PROP_DATASOURCE, xSourceForm), "FmFormObj::ensureModelEnv : invalid access path or invalid form (missing props) !");
440 // the parent access path should refer to a row set
443 aSrcCursorSource = xSourceForm->getPropertyValue(FM_PROP_COMMAND);
444 aSrcCursorSourceType = xSourceForm->getPropertyValue(FM_PROP_COMMANDTYPE);
445 aSrcDataSource = xSourceForm->getPropertyValue(FM_PROP_DATASOURCE);
447 catch(Exception&)
449 OSL_FAIL("FmFormObj::ensureModelEnv : could not retrieve a source DSS !");
453 // calc the number of (source) form siblings with the same DSS
454 Reference< XPropertySet > xCurrentSourceForm, xCurrentDestForm;
455 sal_Int16 nCurrentSourceIndex = 0;
456 sal_Int32 nCurrentDestIndex = 0;
457 while (nCurrentSourceIndex <= nIndex)
459 bool bEqualDSS = false;
460 while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bound by nIndex)
462 xSourceContainer->getByIndex(nCurrentSourceIndex) >>= xCurrentSourceForm;
463 DBG_ASSERT(xCurrentSourceForm.is(), "FmFormObj::ensureModelEnv : invalid form ancestor (2) !");
464 bEqualDSS = false;
465 if (::comphelper::hasProperty(FM_PROP_DATASOURCE, xCurrentSourceForm))
466 { // it is a form
469 if ( xCurrentSourceForm->getPropertyValue(FM_PROP_COMMAND) == aSrcCursorSource
470 && xCurrentSourceForm->getPropertyValue(FM_PROP_COMMANDTYPE) == aSrcCursorSourceType
471 && xCurrentSourceForm->getPropertyValue(FM_PROP_DATASOURCE) == aSrcDataSource
474 bEqualDSS = true;
477 catch(Exception&)
479 TOOLS_WARN_EXCEPTION("svx.form",
480 "exception while getting a sibling's DSS !");
484 ++nCurrentSourceIndex;
487 DBG_ASSERT(bEqualDSS, "FmFormObj::ensureModelEnv : found no source form !");
488 // ??? at least the nIndex-th one should have been found ???
490 // now search the next one with the given DSS (within the destination container)
491 bEqualDSS = false;
492 while (!bEqualDSS && (nCurrentDestIndex < xDestContainer->getCount()))
494 xDestContainer->getByIndex(nCurrentDestIndex) >>= xCurrentDestForm;
495 DBG_ASSERT(xCurrentDestForm.is(), "FmFormObj::ensureModelEnv : invalid destination form !");
496 bEqualDSS = false;
497 if (::comphelper::hasProperty(FM_PROP_DATASOURCE, xCurrentDestForm))
498 { // it is a form
501 if ( xCurrentDestForm->getPropertyValue(FM_PROP_COMMAND) == aSrcCursorSource
502 && xCurrentDestForm->getPropertyValue(FM_PROP_COMMANDTYPE) == aSrcCursorSourceType
503 && xCurrentDestForm->getPropertyValue(FM_PROP_DATASOURCE) == aSrcDataSource
506 bEqualDSS = true;
509 catch(Exception&)
511 TOOLS_WARN_EXCEPTION("svx.form",
512 "exception while getting a destination DSS !");
516 ++nCurrentDestIndex;
519 if (!bEqualDSS)
520 { // There is at least one more source form with the given DSS than destination forms are.
521 // correct this ...
524 // create and insert (into the destination) a copy of the form
525 xCurrentDestForm.set(
526 ::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.form.component.DataForm"),
527 UNO_QUERY_THROW );
528 ::comphelper::copyProperties( xCurrentSourceForm, xCurrentDestForm );
530 DBG_ASSERT(nCurrentDestIndex == xDestContainer->getCount(), "FmFormObj::ensureModelEnv : something went wrong with the numbers !");
531 xDestContainer->insertByIndex(nCurrentDestIndex, Any(xCurrentDestForm));
533 ++nCurrentDestIndex;
534 // like nCurrentSourceIndex, nCurrentDestIndex now points 'behind' the form it actually means
536 catch(Exception&)
538 OSL_FAIL("FmFormObj::ensureModelEnv : something went seriously wrong while creating a new form !");
539 // no more options anymore ...
540 return Reference< XInterface > ();
546 // now xCurrentDestForm is a form equivalent to xSourceForm (which means they have the same DSS and the same number
547 // of left siblings with the same DSS, which counts for all their ancestors, too)
549 // go down
550 xDestContainer.set(xCurrentDestForm, UNO_QUERY);
551 xSourceContainer.set(xSourceForm, UNO_QUERY);
552 DBG_ASSERT(xDestContainer.is() && xSourceContainer.is(), "FmFormObj::ensureModelEnv : invalid container !");
554 while ( nTokIndex >= 0 );
556 return Reference<XInterface>( xDestContainer, UNO_QUERY );
559 FmFormObj* FmFormObj::GetFormObject( SdrObject* _pSdrObject )
561 FmFormObj* pFormObject = dynamic_cast< FmFormObj* >( _pSdrObject );
562 if ( !pFormObject )
564 SdrVirtObj* pVirtualObject = dynamic_cast< SdrVirtObj* >( _pSdrObject );
565 if ( pVirtualObject )
566 pFormObject = dynamic_cast< FmFormObj* >( &pVirtualObject->ReferencedObj() );
568 return pFormObject;
572 const FmFormObj* FmFormObj::GetFormObject( const SdrObject* _pSdrObject )
574 const FmFormObj* pFormObject = dynamic_cast< const FmFormObj* >( _pSdrObject );
575 if ( !pFormObject )
577 const SdrVirtObj* pVirtualObject = dynamic_cast< const SdrVirtObj* >( _pSdrObject );
578 if ( pVirtualObject )
579 pFormObject = dynamic_cast< const FmFormObj* >( &pVirtualObject->GetReferencedObj() );
581 return pFormObject;
585 void FmFormObj::SetUnoControlModel( const Reference< css::awt::XControlModel >& _rxModel )
587 SdrUnoObj::SetUnoControlModel( _rxModel );
589 FmFormPage* pFormPage(dynamic_cast< FmFormPage* >(getSdrPageFromSdrObject()));
590 if ( pFormPage )
591 pFormPage->GetImpl().formModelAssigned( *this );
593 impl_checkRefDevice_nothrow( true );
597 bool FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
599 bool bResult = SdrUnoObj::EndCreate(rStat, eCmd);
600 if ( bResult && SdrCreateCmd::ForceEnd == eCmd && rStat.GetView() )
602 FmFormPage* pFormPage(dynamic_cast< FmFormPage* >(getSdrPageFromSdrObject()));
604 if (nullptr != pFormPage)
608 Reference< XFormComponent > xContent( xUnoControlModel, UNO_QUERY_THROW );
609 Reference< XForm > xParentForm( xContent->getParent(), UNO_QUERY );
611 Reference< XIndexContainer > xFormToInsertInto;
613 if ( !xParentForm.is() )
614 { // model is not yet part of a form component hierarchy
615 xParentForm.set( pFormPage->GetImpl().findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW );
616 xFormToInsertInto.set( xParentForm, UNO_QUERY_THROW );
619 FmFormPageImpl::setUniqueName( xContent, xParentForm );
621 if ( xFormToInsertInto.is() )
622 xFormToInsertInto->insertByIndex( xFormToInsertInto->getCount(), Any( xContent ) );
624 catch( const Exception& )
626 DBG_UNHANDLED_EXCEPTION("svx");
630 FmFormView* pView( dynamic_cast< FmFormView* >( rStat.GetView() ) );
631 FmXFormView* pViewImpl = pView ? pView->GetImpl() : nullptr;
632 OSL_ENSURE( pViewImpl, "FmFormObj::EndCreate: no view!?" );
633 if ( pViewImpl )
634 pViewImpl->onCreatedFormObject( *this );
636 return bResult;
640 void FmFormObj::BrkCreate( SdrDragStat& rStat )
642 SdrUnoObj::BrkCreate( rStat );
643 impl_isolateControlModel_nothrow();
645 FmFormView* pView( dynamic_cast< FmFormView* >( rStat.GetView() ) );
646 FmXFormView* pViewImpl = pView ? pView->GetImpl() : nullptr;
647 OSL_ENSURE( pViewImpl, "FmFormObj::EndCreate: no view!?" );
648 if ( pViewImpl )
649 pViewImpl->breakCreateFormObject();
653 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */