38#include <svx/strings.hrc>
48#include <svx/svxids.hrc>
49#include <bitmaps.hlst>
50#include <formnavi.hrc>
52#include <com/sun/star/awt/XWindow2.hpp>
53#include <com/sun/star/awt/XCheckBox.hpp>
54#include <com/sun/star/awt/XListBox.hpp>
55#include <com/sun/star/awt/XTextComponent.hpp>
56#include <com/sun/star/beans/theIntrospection.hpp>
57#include <com/sun/star/beans/PropertyAttribute.hpp>
58#include <com/sun/star/beans/XPropertyState.hpp>
59#include <com/sun/star/container/XContainer.hpp>
60#include <com/sun/star/container/XIndexAccess.hpp>
61#include <com/sun/star/container/XNamed.hpp>
62#include <com/sun/star/form/ListSourceType.hpp>
63#include <com/sun/star/form/TabOrderDialog.hpp>
64#include <com/sun/star/form/XGrid.hpp>
65#include <com/sun/star/form/XGridPeer.hpp>
66#include <com/sun/star/form/XLoadable.hpp>
67#include <com/sun/star/form/XReset.hpp>
68#include <com/sun/star/form/binding/XBindableValue.hpp>
69#include <com/sun/star/form/binding/XListEntrySink.hpp>
70#include <com/sun/star/frame/FrameSearchFlag.hpp>
71#include <com/sun/star/lang/XServiceInfo.hpp>
72#include <com/sun/star/script/XEventAttacherManager.hpp>
73#include <com/sun/star/sdbc/SQLException.hpp>
74#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
75#include <com/sun/star/util/XModeSelector.hpp>
76#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
77#include <com/sun/star/view/XSelectionSupplier.hpp>
104#include <string_view>
115 SID_FM_RECORD_DELETE,
116 SID_FM_RECORD_ABSOLUTE,
120 SID_FM_REMOVE_FILTER_SORT,
125 SID_FM_FORM_FILTERED,
127 SID_FM_REFRESH_FORM_CONTROL,
138 SID_FM_CTL_PROPERTIES,
142 SID_FM_SHOW_FMEXPLORER,
143 SID_FM_FIELDS_CONTROL,
144 SID_FM_SHOW_PROPERTIES,
145 SID_FM_PROPERTY_CONTROL,
146 SID_FM_FMEXPLORER_CONTROL,
147 SID_FM_SHOW_DATANAVIGATOR,
148 SID_FM_DATANAVIGATOR_CONTROL,
154 SID_FM_CONVERTTO_EDIT,
155 SID_FM_CONVERTTO_BUTTON,
156 SID_FM_CONVERTTO_FIXEDTEXT,
157 SID_FM_CONVERTTO_LISTBOX,
158 SID_FM_CONVERTTO_CHECKBOX,
159 SID_FM_CONVERTTO_RADIOBUTTON,
160 SID_FM_CONVERTTO_GROUPBOX,
161 SID_FM_CONVERTTO_COMBOBOX,
162 SID_FM_CONVERTTO_IMAGEBUTTON,
163 SID_FM_CONVERTTO_FILECONTROL,
164 SID_FM_CONVERTTO_DATE,
165 SID_FM_CONVERTTO_TIME,
166 SID_FM_CONVERTTO_NUMERIC,
167 SID_FM_CONVERTTO_CURRENCY,
168 SID_FM_CONVERTTO_PATTERN,
169 SID_FM_CONVERTTO_IMAGECONTROL,
170 SID_FM_CONVERTTO_FORMATTED,
171 SID_FM_CONVERTTO_SCROLLBAR,
172 SID_FM_CONVERTTO_SPINBUTTON,
173 SID_FM_CONVERTTO_NAVIGATIONBAR,
175 SID_FM_FMEXPLORER_CONTROL,
176 SID_FM_DATANAVIGATOR_CONTROL,
189 u"ConvertToCheckBox",
193 u"ConvertToImageBtn",
194 u"ConvertToFileControl",
198 u"ConvertToCurrency",
200 u"ConvertToImageControl",
201 u"ConvertToFormatted",
202 u"ConvertToScrollBar",
203 u"ConvertToSpinButton",
204 u"ConvertToNavigationBar"
211 RID_SVXBMP_FIXEDTEXT,
214 RID_SVXBMP_RADIOBUTTON,
217 RID_SVXBMP_IMAGEBUTTON,
218 RID_SVXBMP_FILECONTROL,
219 RID_SVXBMP_DATEFIELD,
220 RID_SVXBMP_TIMEFIELD,
221 RID_SVXBMP_NUMERICFIELD,
222 RID_SVXBMP_CURRENCYFIELD,
223 RID_SVXBMP_PATTERNFIELD,
224 RID_SVXBMP_IMAGECONTROL,
225 RID_SVXBMP_FORMATTEDFIELD,
226 RID_SVXBMP_SCROLLBAR,
227 RID_SVXBMP_SPINBUTTON,
228 RID_SVXBMP_NAVIGATIONBAR
264using namespace ::com::sun::star::form::binding;
271using namespace ::
svx;
282 _rInterfaces.
clear();
285 for (
size_t i = 0;
i < nMarkCount; ++
i)
289 std::optional<SdrObjListIter> oGroupIterator;
292 oGroupIterator.emplace( pCurrent->
GetSubList() );
293 pCurrent = oGroupIterator->IsMore() ? oGroupIterator->Next() :
nullptr;
298 FmFormObj* pAsFormObject = FmFormObj::GetFormObject( pCurrent );
302 Reference< XInterface > xControlModel( pAsFormObject->GetUnoControlModel(), UNO_QUERY );
304 if ( xControlModel.is() )
305 _rInterfaces.
insert( xControlModel );
309 pCurrent = oGroupIterator && oGroupIterator->IsMore() ? oGroupIterator->Next() :
nullptr;
315 sal_Int32 GridView2ModelPos(
const Reference< XIndexAccess>& rColumns, sal_Int16 nViewPos)
323 Reference< XPropertySet> xCur;
324 for (i=0;
i<rColumns->getCount(); ++
i)
326 rColumns->getByIndex(i) >>= xCur;
327 if (!::comphelper::getBOOL(xCur->getPropertyValue(
FM_PROP_HIDDEN)))
337 if (i<rColumns->getCount())
341 catch(
const Exception&)
349 void TransferEventScripts(
const Reference< XControlModel>& xModel,
const Reference< XControl>& xControl,
350 const Sequence< ScriptEventDescriptor>& rTransferIfAvailable)
353 Reference< XChild> xModelChild(xModel, UNO_QUERY);
354 if (!xModelChild.is())
357 Reference< XEventAttacherManager> xEventManager(xModelChild->getParent(), UNO_QUERY);
358 if (!xEventManager.is())
361 if (!rTransferIfAvailable.hasElements())
365 Reference< XIndexAccess> xParentIndex(xModelChild->getParent(), UNO_QUERY);
366 if (!xParentIndex.is())
369 if (nIndex<0 || nIndex>=xParentIndex->getCount())
373 Sequence< Type> aModelListeners;
374 Sequence< Type> aControlListeners;
376 Reference< XIntrospection>
xIntrospection = theIntrospection::get(::comphelper::getProcessComponentContext());
381 aModelListeners =
xIntrospection->inspect(aModel)->getSupportedListeners();
386 Any aControl(xControl);
387 aControlListeners =
xIntrospection->inspect(aControl)->getSupportedListeners();
390 sal_Int32 nMaxNewLen = aModelListeners.getLength() + aControlListeners.getLength();
394 Sequence< ScriptEventDescriptor> aTransferable(nMaxNewLen);
395 ScriptEventDescriptor* pTransferable = aTransferable.getArray();
397 for (
const ScriptEventDescriptor& rCurrent : rTransferIfAvailable)
400 for (
const Sequence< Type>* pCurrentArray : { &aModelListeners, &aControlListeners })
402 for (
const Type& rCurrentListener : *pCurrentArray)
404 OUString aListener = rCurrentListener.getTypeName();
405 if (!aListener.isEmpty())
406 aListener = aListener.copy(aListener.lastIndexOf(
'.')+1);
408 if (aListener == rCurrent.ListenerType)
413 Sequence< OUString> aMethodsNames = ::comphelper::getEventMethodsForType(rCurrentListener);
418 *pTransferable = rCurrent;
426 sal_Int32 nRealNewLen = pTransferable - aTransferable.getArray();
427 aTransferable.realloc(nRealNewLen);
429 xEventManager->registerScriptEvents(nIndex, aTransferable);
433 OUString getServiceNameByControlType(
SdrObjKind nType)
470 OUString* _pCurrentText )
472 if ( !_rxControl.is() )
475 Reference< XTextComponent > xAsText( _rxControl, UNO_QUERY );
479 *_pCurrentText = xAsText->getText();
483 Reference< XListBox > xListBox( _rxControl, UNO_QUERY );
487 *_pCurrentText = xListBox->getSelectedItem();
491 Reference< XCheckBox > xCheckBox( _rxControl, UNO_QUERY );
492 if ( xCheckBox.is() )
496 switch (
static_cast<::
TriState>(xCheckBox->getState()) )
500 default: _pCurrentText->clear();
break;
516 return Reference< XControlModel>(_rContainer, UNO_QUERY).is();
526 if (Reference< XForm>(_rElement, UNO_QUERY).is() || Reference< XGrid>(_rElement, UNO_QUERY).is())
530 Reference< XPropertySet> xSet(_rElement, UNO_QUERY);
536 if (aVal.getValueTypeClass() != TypeClass_INTERFACE)
540 return aVal.hasValue();
548 bool bControlList = nMarkCount != 0;
550 bool bHadAnyLeafs =
false;
552 for (
size_t i = 0;
i < nMarkCount && bControlList; ++
i)
569 while (aIter.
IsMore() && bControlList)
583 return bControlList && bHadAnyLeafs;
587static Reference< XForm >
GetForm(
const Reference< XInterface>& _rxElement)
589 Reference< XForm > xForm( _rxElement, UNO_QUERY );
593 Reference< XChild > xChild( _rxElement, UNO_QUERY );
595 return GetForm( xChild->getParent() );
597 return Reference< XForm >();
608 ,m_aMarkTimer(
"svx::FmXFormShell m_aMarkTimer")
609 ,m_eNavigate( NavigationBarMode_NONE )
610 ,m_nInvalidationEvent( nullptr )
611 ,m_nActivationEvent( nullptr )
613 ,m_pTextShell( new
svx::FmTextControlShell( _pViewFrame ) )
614 ,m_aActiveControllerFeatures( this )
615 ,m_aNavControllerFeatures( this )
617 ,m_nLockSlotInvalidation( 0 )
618 ,m_bHadPropertyBrowserInDesignMode( false )
619 ,m_bTrackProperties( true )
620 ,m_bUseWizards( true )
621 ,m_bDatabaseBar( false )
622 ,m_bInActivate( false )
623 ,m_bSetFocus( false )
624 ,m_bFilterMode( false )
625 ,m_bChangingDesignMode( false )
626 ,m_bPreparedClose( false )
627 ,m_bFirstActivation( true )
629 m_aMarkTimer.SetTimeout(100);
630 m_aMarkTimer.SetInvokeHandler(
LINK(
this, FmXFormShell, OnTimeOut_Lock));
635 osl_atomic_increment(&m_refCount);
638 osl_atomic_decrement(&m_refCount);
641 implAdjustConfigCache_Lock();
643 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
644 EnableNotification(aNames);
648FmXFormShell::~FmXFormShell()
653Reference< css::frame::XModel > FmXFormShell::getContextDocument_Lock()
const
655 Reference< css::frame::XModel >
xModel;
661 if ( m_xAttachedFrame.is() )
666 catch(
const Exception& )
674bool FmXFormShell::isEnhancedForm_Lock()
const
680bool FmXFormShell::impl_checkDisposed_Lock()
const
685 OSL_FAIL(
"FmXFormShell::impl_checkDisposed: already disposed!" );
695 return m_eDocumentType;
698 Reference<css::frame::XModel>
xModel = getContextDocument_Lock();
700 m_eDocumentType = DocumentClassification::classifyDocument( xModel );
703 OSL_FAIL(
"FmXFormShell::getDocumentType: can't determine the document type!" );
708 return m_eDocumentType;
712bool FmXFormShell::IsReadonlyDoc_Lock()
const
714 if (impl_checkDisposed_Lock())
725void SAL_CALL FmXFormShell::disposing(
const lang::EventObject& e)
729 if (m_xActiveController == e.Source)
732 stopListening_Lock();
733 m_xActiveForm =
nullptr;
734 m_xActiveController =
nullptr;
735 m_xNavigationController =
nullptr;
737 m_aActiveControllerFeatures.dispose();
738 m_aNavControllerFeatures.dispose();
741 m_pShell->GetViewShell()->GetViewFrame().GetBindings().InvalidateShell(*m_pShell);
744 if (e.Source != m_xExternalViewController)
747 Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY );
748 OSL_ENSURE( xFormController.is(),
"FmXFormShell::disposing: invalid external view controller!" );
749 if (xFormController.is())
750 xFormController->removeActivateListener(
static_cast<XFormControllerListener*
>(
this));
752 if (m_xExternalViewController.is())
753 m_xExternalViewController->removeEventListener(
static_cast<XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
755 m_xExternalViewController =
nullptr;
756 m_xExternalDisplayedForm =
nullptr;
757 m_xExtViewTriggerController =
nullptr;
759 InvalidateSlot_Lock( SID_FM_VIEW_AS_GRID,
false );
763void SAL_CALL FmXFormShell::propertyChange(
const PropertyChangeEvent& evt)
767 if (impl_checkDisposed_Lock())
783 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Invalidate(SID_FM_RECORD_TOTAL,
true);
784 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Update(SID_FM_RECORD_TOTAL);
790 LockSlotInvalidation_Lock(
true);
791 InvalidateSlot_Lock(SID_FM_RECORD_TOTAL,
false);
792 LockSlotInvalidation_Lock(
false);
797 LockSlotInvalidation_Lock(
true);
798 InvalidateSlot_Lock(0,
false);
799 LockSlotInvalidation_Lock(
false);
803void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatures )
807 if (impl_checkDisposed_Lock())
810 OSL_ENSURE( !_rFeatures.empty(),
"FmXFormShell::invalidateFeatures: invalid arguments!" );
816 ::std::vector< sal_uInt16 > aSlotIds( _rFeatures.begin(), _rFeatures.end() );
819 aSlotIds.push_back( 0 );
822 ::std::sort( aSlotIds.begin(), aSlotIds.end() - 1 );
824 sal_uInt16 *pSlotIds = aSlotIds.data();
825 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Invalidate( pSlotIds );
829void SAL_CALL FmXFormShell::formActivated(
const lang::EventObject& rEvent)
833 if (impl_checkDisposed_Lock())
836 Reference< runtime::XFormController >
xController( rEvent.Source, UNO_QUERY_THROW );
837 m_pTextShell->formActivated( xController );
838 setActiveController_Lock(xController);
842void SAL_CALL FmXFormShell::formDeactivated(
const lang::EventObject& rEvent)
846 if (impl_checkDisposed_Lock())
849 Reference< runtime::XFormController >
xController( rEvent.Source, UNO_QUERY_THROW );
850 m_pTextShell->formDeactivated( xController );
854void FmXFormShell::disposing()
858 FmXFormShell_BASE::disposing();
860 if ( m_pShell && !
m_pShell->IsDesignMode() )
861 setActiveController_Lock(
nullptr,
true);
867 m_pTextShell->dispose();
869 m_xAttachedFrame =
nullptr;
871 CloseExternalFormViewer_Lock();
873 while ( !m_aLoadingPages.empty() )
876 m_aLoadingPages.pop();
880 if (m_nInvalidationEvent)
883 m_nInvalidationEvent =
nullptr;
885 if ( m_nActivationEvent )
888 m_nActivationEvent =
nullptr;
893 DBG_ASSERT(!m_nInvalidationEvent,
"FmXFormShell::~FmXFormShell : still have an invalidation event !");
899 DisableNotification();
901 RemoveElement_Lock(m_xForms);
904 impl_switchActiveControllerListening_Lock(
false);
905 m_xActiveController =
nullptr;
906 m_xActiveForm =
nullptr;
909 m_xNavigationController =
nullptr;
910 m_xCurrentForm =
nullptr;
911 m_xLastGridFound =
nullptr;
912 m_xAttachedFrame =
nullptr;
913 m_xExternalViewController =
nullptr;
914 m_xExtViewTriggerController =
nullptr;
915 m_xExternalDisplayedForm =
nullptr;
919 m_aActiveControllerFeatures.dispose();
920 m_aNavControllerFeatures.dispose();
924void FmXFormShell::UpdateSlot_Lock(sal_Int16 _nId)
926 if (impl_checkDisposed_Lock())
929 if ( m_nLockSlotInvalidation )
931 OSL_FAIL(
"FmXFormShell::UpdateSlot: cannot update if invalidation is currently locked!" );
932 InvalidateSlot_Lock(_nId,
false);
936 OSL_ENSURE( _nId,
"FmXFormShell::UpdateSlot: can't update the complete shell!" );
937 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Invalidate( _nId,
true,
true );
938 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Update( _nId );
942void FmXFormShell::InvalidateSlot_Lock(sal_Int16 nId,
bool bWithId)
944 if (impl_checkDisposed_Lock())
947 if (m_nLockSlotInvalidation)
949 sal_uInt8 nFlags = ( bWithId ? 0x01 : 0 );
950 m_arrInvalidSlots.emplace_back(nId, nFlags );
954 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Invalidate(nId,
true, bWithId);
956 m_pShell->GetViewShell()->GetViewFrame().GetBindings().InvalidateShell(*m_pShell);
959void FmXFormShell::LockSlotInvalidation_Lock(
bool bLock)
961 if (impl_checkDisposed_Lock())
964 DBG_ASSERT(bLock || m_nLockSlotInvalidation>0,
"FmXFormShell::LockSlotInvalidation : invalid call !");
967 ++m_nLockSlotInvalidation;
968 else if (!--m_nLockSlotInvalidation)
971 if (!m_nInvalidationEvent)
978 if (impl_checkDisposed_Lock())
981 m_nInvalidationEvent =
nullptr;
983 for (
const auto& rInvalidSlot : m_arrInvalidSlots)
986 m_pShell->GetViewShell()->GetViewFrame().GetBindings().Invalidate(rInvalidSlot.id,
true, (rInvalidSlot.flags & 0x01));
988 m_pShell->GetViewShell()->GetViewFrame().GetBindings().InvalidateShell(*
m_pShell);
990 m_arrInvalidSlots.clear();
993void FmXFormShell::ForceUpdateSelection_Lock()
995 if (impl_checkDisposed_Lock())
998 if (IsSelectionUpdatePending_Lock())
1000 m_aMarkTimer.Stop();
1003 LockSlotInvalidation_Lock(
true);
1005 SetSelection_Lock(
m_pShell->GetFormView()->GetMarkedObjectList());
1007 LockSlotInvalidation_Lock(
false);
1011void FmXFormShell::GetConversionMenu_Lock(
weld::Menu& rNewMenu)
1020OUString FmXFormShell::SlotToIdent(sal_uInt16 nSlot)
1033bool FmXFormShell::isControlConversionSlot(std::u16string_view rIdent)
1036 if (rIdent == rConvertSlot)
1041void FmXFormShell::executeControlConversionSlot_Lock(std::u16string_view rIdent)
1043 OSL_PRECOND( canConvertCurrentSelectionToControl_Lock(rIdent),
"FmXFormShell::executeControlConversionSlot: illegal call!" );
1045 if ( aSelectedElement == m_aCurrentSelection.end() )
1048 executeControlConversionSlot_Lock(Reference<XFormComponent>(*aSelectedElement, UNO_QUERY), rIdent);
1051bool FmXFormShell::executeControlConversionSlot_Lock(
const Reference<XFormComponent>& _rxObject, std::u16string_view rIdent)
1053 if (impl_checkDisposed_Lock())
1056 OSL_ENSURE( _rxObject.is(),
"FmXFormShell::executeControlConversionSlot: invalid object!" );
1057 if ( !_rxObject.is() )
1062 OSL_ENSURE( pFormPage,
"FmXFormShell::executeControlConversionSlot: no current (form) page!" );
1066 OSL_ENSURE( isSolelySelected_Lock(_rxObject),
1067 "FmXFormShell::executeControlConversionSlot: hmm ... shouldn't this parameter be redundant?" );
1073 Reference< XInterface > xNormalizedObject( _rxObject, UNO_QUERY );
1075 FmFormObj* pFormObject =
nullptr;
1077 while ( aPageIter.IsMore() )
1080 pFormObject = FmFormObj::GetFormObject( pCurrent );
1084 Reference< XInterface > xCurrentNormalized( pFormObject->GetUnoControlModel(), UNO_QUERY );
1085 if ( xCurrentNormalized.get() == xNormalizedObject.get() )
1088 pFormObject =
nullptr;
1094 OUString sNewName( getServiceNameByControlType(
nObjectTypes[ lookupSlot ] ) );
1096 Reference< XControlModel> xNewModel( xContext->getServiceManager()->createInstanceWithContext(sNewName, xContext), UNO_QUERY );
1097 if (!xNewModel.is())
1100 Reference< XControlModel> xOldModel( pFormObject->GetUnoControlModel() );
1103 Reference< XPropertySet> xOldSet(xOldModel, UNO_QUERY);
1104 Reference< XPropertySet> xNewSet(xNewModel, UNO_QUERY);
1110 Sequence< css::script::ScriptEventDescriptor> aOldScripts;
1111 Reference< XChild> xChild(xOldModel, UNO_QUERY);
1114 Reference< XIndexAccess> xParent(xChild->getParent(), UNO_QUERY);
1117 Reference< css::script::XEventAttacherManager> xEvManager(xChild->getParent(), UNO_QUERY);
1118 if (xParent.is() && xEvManager.is())
1121 if (nIndex>=0 && nIndex<xParent->getCount())
1122 aOldScripts = xEvManager->getScriptEvents(nIndex);
1126 Reference< XIndexContainer> xIndexParent(xChild->getParent(), UNO_QUERY);
1127 if (xIndexParent.is())
1130 Reference< XFormComponent> xComponent(xNewModel, UNO_QUERY);
1131 DBG_ASSERT(xComponent.is(),
"FmXFormShell::executeControlConversionSlot: the new model is no form component !");
1132 Any aNewModel(xComponent);
1137 if (nIndex>=0 && nIndex<xParent->getCount())
1138 xIndexParent->replaceByIndex(nIndex, aNewModel);
1141 OSL_FAIL(
"FmXFormShell::executeControlConversionSlot: could not replace the model !");
1142 Reference< css::lang::XComponent> xNewComponent(xNewModel, UNO_QUERY);
1143 if (xNewComponent.is())
1144 xNewComponent->dispose();
1150 OSL_FAIL(
"FmXFormShell::executeControlConversionSlot: could not replace the model !");
1151 Reference< css::lang::XComponent> xNewComponent(xNewModel, UNO_QUERY);
1152 if (xNewComponent.is())
1153 xNewComponent->dispose();
1175 pFormObject->SetChanged();
1176 pFormObject->SetUnoControlModel(xNewModel);
1180 if (aOldScripts.hasElements())
1183 Reference<XControlContainer> xControlContainer(getControlContainerForView_Lock());
1185 const Sequence< Reference< XControl> > aControls( xControlContainer->getControls() );
1187 Reference< XControl> xControl;
1188 auto pControl = std::find_if(aControls.begin(), aControls.end(),
1189 [&xNewModel](
const Reference< XControl>& rControl) { return rControl->getModel() == xNewModel; });
1190 if (pControl != aControls.end())
1191 xControl = *pControl;
1192 TransferEventScripts(xNewModel, xControl, aOldScripts);
1197 Reference< XBindableValue > xOldBindable( xOldModel, UNO_QUERY );
1198 Reference< XBindableValue > xNewBindable( xNewModel, UNO_QUERY );
1199 if ( xOldBindable.is() )
1203 if ( xNewBindable.is() )
1204 xNewBindable->setValueBinding( xOldBindable->getValueBinding() );
1205 xOldBindable->setValueBinding(
nullptr );
1207 catch(
const Exception&)
1215 Reference< XListEntrySink > xOldSink( xOldModel, UNO_QUERY );
1216 Reference< XListEntrySink > xNewSink( xNewModel, UNO_QUERY );
1217 if ( xOldSink.is() )
1221 if ( xNewSink.is() )
1222 xNewSink->setListEntrySource( xOldSink->getListEntrySource() );
1223 xOldSink->setListEntrySource(
nullptr );
1225 catch(
const Exception&)
1234 DBG_ASSERT(pModel !=
nullptr,
"FmXFormShell::executeControlConversionSlot: my shell has no model !");
1237 pModel->
AddUndo(std::make_unique<FmUndoModelReplaceAction>(*pModel, pFormObject, xOldModel));
1250bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(std::u16string_view rIdent)
1252 if ( m_aCurrentSelection.empty() )
1256 Reference< lang::XServiceInfo > xElementInfo( *aCheck, UNO_QUERY );
1257 if ( !xElementInfo.is() )
1261 if ( ++aCheck != m_aCurrentSelection.end() )
1265 if ( Reference< XForm >::query( xElementInfo ).is() )
1278 "FmXFormShell::canConvertCurrentSelectionToControl: aConvertSlots & nObjectTypes must have the same size !");
1287void FmXFormShell::checkControlConversionSlotsForCurrentSelection_Lock(
weld::Menu& rMenu)
1289 for (
int i = 0, nCount = rMenu.
n_children(); i < nCount; ++i)
1293 rMenu.
set_sensitive(sIdent, canConvertCurrentSelectionToControl_Lock(sIdent));
1299 if (impl_checkDisposed_Lock())
1302 Reference< XIndexContainer> xControlModels(m_xActiveForm, UNO_QUERY);
1303 if (!xControlModels.is())
1306 for (sal_Int32 i=0;
i<xControlModels->getCount(); ++
i)
1308 Reference< XPropertySet> xModelSet;
1309 xControlModels->getByIndex(i) >>= xModelSet;
1310 if (!xModelSet.is())
1315 sal_Int16 nClassId = ::comphelper::getINT16(xModelSet->getPropertyValue(
FM_PROP_CLASSID));
1316 if (FormComponentType::GRIDCONTROL != nClassId)
1346 Reference< XPropertyState> xModelPropState(xModelSet, UNO_QUERY);
1347 if (xModelPropState.is())
1356Reference< XControlContainer > FmXFormShell::getControlContainerForView_Lock()
const
1358 if (impl_checkDisposed_Lock())
1362 if ( m_pShell &&
m_pShell->GetFormView() )
1363 pPageView =
m_pShell->GetFormView()->GetSdrPageView();
1365 Reference< XControlContainer> xControlContainer;
1369 return xControlContainer;
1373void FmXFormShell::ExecuteTabOrderDialog_Lock(
const Reference<XTabControllerModel>& _rxForForm)
1375 if (impl_checkDisposed_Lock())
1378 OSL_PRECOND( _rxForForm.is(),
"FmXFormShell::ExecuteTabOrderDialog: invalid tabbing model!" );
1379 if ( !_rxForForm.is() )
1384 Reference< XWindow > xParentWindow;
1388 Reference< dialogs::XExecutableDialog > xDialog = form::TabOrderDialog::createWithModel(
1390 _rxForForm, getControlContainerForView_Lock(), xParentWindow
1395 catch(
const Exception& )
1402void FmXFormShell::ExecuteSearch_Lock()
1404 if (impl_checkDisposed_Lock())
1409 ::std::vector< OUString > aContextNames;
1410 impl_collectFormSearchContexts_nothrow_Lock(
1411 m_pShell->GetCurPage()->GetForms(), u
"",
1412 m_aSearchForms, aContextNames);
1414 if ( m_aSearchForms.size() != aContextNames.size() )
1416 SAL_WARN (
"svx.form",
"FmXFormShell::ExecuteSearch: nonsense!" );
1423 ::std::vector< OUString > aValidContexts;
1424 FmFormArray::const_iterator form = m_aSearchForms.begin();
1425 ::std::vector< OUString >::const_iterator contextName = aContextNames.begin();
1426 for ( ; form != m_aSearchForms.end(); ++form, ++contextName )
1429 aTestContext.
nContext =
static_cast< sal_Int16
>( form - m_aSearchForms.begin() );
1430 sal_uInt32 nValidControls = OnSearchContextRequest_Lock(aTestContext);
1431 if ( nValidControls > 0 )
1433 aValidForms.push_back( *form );
1434 aValidContexts.push_back( *contextName );
1438 m_aSearchForms.swap( aValidForms );
1439 aContextNames.swap( aValidContexts );
1442 if (m_aSearchForms.empty() )
1446 VclMessageType::Warning, VclButtonsType::Ok,
1447 SvxResId(RID_STR_NODATACONTROLS)));
1453 sal_Int16 nInitialContext = 0;
1454 Reference<XForm> xActiveForm(getActiveForm_Lock());
1455 for (
size_t i=0;
i<m_aSearchForms.size(); ++
i )
1457 if (m_aSearchForms.at(i) == xActiveForm)
1459 nInitialContext =
static_cast<sal_Int16
>(
i);
1467 OUString strActiveField;
1468 OUString strInitialText;
1470 DBG_ASSERT(m_xActiveController.is(),
"FmXFormShell::ExecuteSearch : no active controller !");
1471 Reference< XControl> xActiveControl( m_xActiveController->getCurrentControl());
1472 if (xActiveControl.is())
1475 Reference< XControlModel> xActiveModel( xActiveControl->getModel());
1476 DBG_ASSERT(xActiveModel.is(),
"FmXFormShell::ExecuteSearch : active control has no model !");
1479 Reference< XPropertySet> xProperties(xActiveControl->getModel(), UNO_QUERY);
1482 Reference< XPropertySet> xField;
1487 Reference< XTextComponent> xText(xActiveControl, UNO_QUERY);
1491 strInitialText = xText->getText();
1498 Reference< XGrid> xGrid(xActiveControl, UNO_QUERY);
1503 Reference< XGridPeer> xGridPeer(xActiveControl->getPeer(), UNO_QUERY);
1504 Reference< XIndexAccess> xColumns;
1506 xColumns = xGridPeer->getColumns();
1508 sal_Int16 nViewCol = xGrid->getCurrentColumnPosition();
1509 sal_Int32 nModelCol = GridView2ModelPos(xColumns, nViewCol);
1510 Reference< XPropertySet> xCurrentCol;
1512 xColumns->getByIndex(nModelCol) >>= xCurrentCol;
1513 if (xCurrentCol.is())
1514 strActiveField = ::comphelper::getString(xCurrentCol->getPropertyValue(
FM_PROP_LABEL));
1517 Reference< XIndexAccess> xColControls(xGridPeer, UNO_QUERY);
1518 Reference< XInterface> xCurControl;
1519 xColControls->getByIndex(nViewCol) >>= xCurControl;
1520 OUString sInitialText;
1522 strInitialText = sInitialText;
1539 m_pShell->GetViewShell()->GetViewFrame().GetFrameWeld(),
1540 strInitialText, aContextNames, nInitialContext,
1541 LINK(
this, FmXFormShell, OnSearchContextRequest_Lock) ));
1542 pDialog->SetActiveField( strActiveField );
1543 pDialog->SetFoundHandler(
LINK(
this, FmXFormShell, OnFoundData_Lock));
1544 pDialog->SetCanceledNotFoundHdl(
LINK(
this, FmXFormShell, OnCanceledNotFound_Lock));
1546 pDialog.disposeAndClear();
1551 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
1556bool FmXFormShell::GetY2KState_Lock(sal_uInt16& n)
1558 if (impl_checkDisposed_Lock())
1565 Reference<XForm> xForm(getActiveForm_Lock());
1570 Reference< XRowSet> xDB(xForm, UNO_QUERY);
1571 DBG_ASSERT(xDB.is(),
"FmXFormShell::GetY2KState : current form has no dbform-interface !");
1576 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1581 Any aVal( xSet->getPropertyValue(
"TwoDigitDateStart") );
1595void FmXFormShell::SetY2KState_Lock(sal_uInt16 n)
1597 if (impl_checkDisposed_Lock())
1600 Reference<XForm> xActiveForm(getActiveForm_Lock());
1601 Reference< XRowSet > xActiveRowSet( xActiveForm, UNO_QUERY );
1602 if ( xActiveRowSet.is() )
1607 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1612 xSet->setPropertyValue(
"TwoDigitDateStart",
Any(sal_uInt16(n)));
1625 Reference< XIndexAccess> xCurrentForms( m_xForms);
1626 if (!xCurrentForms.is())
1629 xCurrentForms =
m_pShell->GetCurPage()->GetForms(
false );
1631 if (!xCurrentForms.is())
1635 Reference< XInterface> xCurrentElement( aIter.Next());
1636 while (xCurrentElement.is())
1639 Reference< XRowSet> xElementAsRowSet( xCurrentElement, UNO_QUERY );
1640 if ( xElementAsRowSet.is() )
1643 if (!xSupplier.is())
1646 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1651 xSet->setPropertyValue(
"TwoDigitDateStart",
Any(sal_uInt16(n)));
1660 xCurrentElement = aIter.Next();
1665void FmXFormShell::CloseExternalFormViewer_Lock()
1667 if (impl_checkDisposed_Lock())
1670 if (!m_xExternalViewController.is())
1673 Reference< css::frame::XFrame> xExternalViewFrame( m_xExternalViewController->getFrame());
1674 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
1675 if (!xCommLink.is())
1678 xExternalViewFrame->setComponent(
nullptr,
nullptr);
1679 ::comphelper::disposeComponent(xExternalViewFrame);
1680 m_xExternalViewController =
nullptr;
1681 m_xExtViewTriggerController =
nullptr;
1682 m_xExternalDisplayedForm =
nullptr;
1686Reference<XResultSet> FmXFormShell::getInternalForm_Lock(
const Reference<XResultSet>& _xForm)
const
1688 if (impl_checkDisposed_Lock())
1691 Reference< runtime::XFormController> xExternalCtrlr(m_xExternalViewController, UNO_QUERY);
1692 if (xExternalCtrlr.is() && (_xForm == xExternalCtrlr->getModel()))
1694 DBG_ASSERT(m_xExternalDisplayedForm.is(),
"FmXFormShell::getInternalForm : invalid external form !");
1695 return m_xExternalDisplayedForm;
1701Reference<XForm> FmXFormShell::getInternalForm_Lock(
const Reference<XForm>& _xForm)
const
1703 if (impl_checkDisposed_Lock())
1706 Reference< runtime::XFormController > xExternalCtrlr(m_xExternalViewController, UNO_QUERY);
1707 if (xExternalCtrlr.is() && (_xForm == xExternalCtrlr->getModel()))
1709 DBG_ASSERT(m_xExternalDisplayedForm.is(),
"FmXFormShell::getInternalForm : invalid external form !");
1710 return Reference< XForm>(m_xExternalDisplayedForm, UNO_QUERY);
1718 bool lcl_isNavigationRelevant( sal_Int32 _nWhich )
1720 return ( _nWhich == SID_FM_RECORD_FIRST )
1721 || ( _nWhich == SID_FM_RECORD_PREV )
1722 || ( _nWhich == SID_FM_RECORD_NEXT )
1723 || ( _nWhich == SID_FM_RECORD_LAST )
1724 || ( _nWhich == SID_FM_RECORD_NEW );
1729bool FmXFormShell::IsFormSlotEnabled( sal_Int32 _nSlot, FeatureState* _pCompleteState )
const
1732 lcl_isNavigationRelevant( _nSlot )
1733 ? getNavControllerFeatures_Lock()
1734 : getActiveControllerFeatures_Lock();
1736 if ( !_pCompleteState )
1737 return rController->
isEnabled( _nSlot );
1739 rController->
getState( _nSlot, *_pCompleteState );
1740 return _pCompleteState->Enabled;
1744void FmXFormShell::ExecuteFormSlot_Lock( sal_Int32 _nSlot )
1747 lcl_isNavigationRelevant( _nSlot )
1748 ? getNavControllerFeatures_Lock()
1749 : getActiveControllerFeatures_Lock();
1751 rController->
execute( _nSlot );
1753 if ( _nSlot != SID_FM_RECORD_UNDO )
1758 if (getInternalForm_Lock(getActiveForm_Lock()) != m_xExternalDisplayedForm)
1761 Reference< XIndexAccess > xContainer( m_xExternalDisplayedForm, UNO_QUERY );
1762 if ( !xContainer.is() )
1765 Reference< XReset > xReset;
1766 for ( sal_Int32 i = 0;
i < xContainer->getCount(); ++
i )
1768 if ( ( xContainer->getByIndex( i ) >>= xReset ) && xReset.is() )
1771 Reference< XForm > xAsForm( xReset, UNO_QUERY );
1772 if ( !xAsForm.is() )
1778void FmXFormShell::impl_switchActiveControllerListening_Lock(
const bool _bListen)
1780 if ( !m_xActiveController.is() )
1784 m_xActiveController->addEventListener(
static_cast<XFormControllerListener*
>(
this) );
1786 m_xActiveController->removeEventListener(
static_cast<XFormControllerListener*
>(
this) );
1789void FmXFormShell::setActiveController_Lock(
const Reference<runtime::XFormController>& xController,
bool _bNoSaveOldContent)
1791 if (impl_checkDisposed_Lock())
1794 if (m_bChangingDesignMode)
1806 if (xController == m_xActiveController)
1810 Reference< XResultSet> xNavigationForm;
1811 if (m_xNavigationController.is())
1812 xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY);
1814 m_bInActivate =
true;
1817 Reference< XResultSet> xOldForm;
1818 if (m_xActiveController.is())
1819 xOldForm.set(m_xActiveController->getModel(), UNO_QUERY);
1820 Reference< XResultSet> xNewForm;
1822 xNewForm = Reference< XResultSet>(
xController->getModel(), UNO_QUERY);
1823 xOldForm = getInternalForm_Lock(xOldForm);
1824 xNewForm = getInternalForm_Lock(xNewForm);
1826 bool bDifferentForm = ( xOldForm.get() != xNewForm.get() );
1827 bool bNeedSave = bDifferentForm && !_bNoSaveOldContent;
1830 if ( m_xActiveController.is() && bNeedSave )
1833 if ( m_aActiveControllerFeatures->commitCurrentControl() )
1836 if ( m_aActiveControllerFeatures->isModifiedRow() )
1838 bool bIsNew = m_aActiveControllerFeatures->isInsertionRow();
1839 bool bResult = m_aActiveControllerFeatures->commitCurrentRecord();
1840 if ( !bResult && m_bSetFocus )
1844 Reference< XWindow > xWindow( m_xActiveController->getCurrentControl(), UNO_QUERY );
1846 xWindow->setFocus();
1847 m_bInActivate =
false;
1850 else if ( bResult && bIsNew )
1852 Reference< XResultSet > xCursor( m_aActiveControllerFeatures->getCursor() );
1862 stopListening_Lock();
1864 impl_switchActiveControllerListening_Lock(
false);
1866 m_aActiveControllerFeatures.dispose();
1868 if ( m_xActiveController.is() )
1869 m_aActiveControllerFeatures.assign( m_xActiveController );
1871 impl_switchActiveControllerListening_Lock(
true);
1873 if ( m_xActiveController.is() )
1874 m_xActiveForm = getInternalForm_Lock(Reference<XForm>(m_xActiveController->getModel(), UNO_QUERY));
1876 m_xActiveForm =
nullptr;
1878 startListening_Lock();
1881 xNavigationForm =
nullptr;
1882 if (m_xNavigationController.is())
1883 xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY);
1885 m_bInActivate =
false;
1888 m_pShell->GetViewShell()->GetViewFrame().GetBindings().InvalidateShell(*m_pShell);
1890 InvalidateSlot_Lock(SID_FM_FILTER_NAVIGATOR_CONTROL,
true);
1893void FmXFormShell::getCurrentSelection_Lock(
InterfaceBag& _rSelection)
const
1895 _rSelection = m_aCurrentSelection;
1898bool FmXFormShell::setCurrentSelectionFromMark_Lock(
const SdrMarkList& _rMarkList)
1900 m_aLastKnownMarkedControls.
clear();
1903 collectInterfacesFromMarkList( _rMarkList, m_aLastKnownMarkedControls );
1909bool FmXFormShell::selectLastMarkedControls_Lock()
1915bool FmXFormShell::setCurrentSelection_Lock(
InterfaceBag&& _rSelection )
1917 if (impl_checkDisposed_Lock())
1920 DBG_ASSERT(
m_pShell->IsDesignMode(),
"FmXFormShell::setCurrentSelection: only to be used in design mode!" );
1922 if ( _rSelection.empty() && m_aCurrentSelection.empty() )
1926 if ( _rSelection.size() == m_aCurrentSelection.size() )
1930 for ( ; aNew != _rSelection.end(); ++aNew, ++aOld )
1932 OSL_ENSURE( Reference< XInterface >( *aNew, UNO_QUERY ).
get() == aNew->get(),
"FmXFormShell::setCurrentSelection: new interface not normalized!" );
1933 OSL_ENSURE( Reference< XInterface >( *aOld, UNO_QUERY ).
get() == aOld->get(),
"FmXFormShell::setCurrentSelection: old interface not normalized!" );
1935 if ( aNew->get() != aOld->get() )
1939 if ( aNew == _rSelection.end() )
1947 if ( !m_aCurrentSelection.empty() )
1949 Reference< XChild > xCur;
if ( m_aCurrentSelection.size() == 1 ) xCur.set(*m_aCurrentSelection.begin(), css::uno::UNO_QUERY);
1950 Reference< XChild > xNew;
if ( _rSelection.size() == 1 ) xNew.set(*_rSelection.begin(), css::uno::UNO_QUERY);
1954 if ( xCur.is() && ( !xNew.is() || ( xCur->getParent() != xNew->getParent() ) ) )
1956 Reference< XSelectionSupplier > xSel( xCur->getParent(), UNO_QUERY );
1958 xSel->select(
Any() );
1962 m_aCurrentSelection = _rSelection;
1965 Reference< XForm > xNewCurrentForm;
1966 for (
const auto& rpSelection : m_aCurrentSelection)
1968 Reference< XForm > xThisRoundsForm(
GetForm( rpSelection ) );
1969 OSL_ENSURE( xThisRoundsForm.is(),
"FmXFormShell::setCurrentSelection: *everything* should belong to a form!" );
1971 if ( !xNewCurrentForm.is() )
1973 xNewCurrentForm = xThisRoundsForm;
1975 else if ( xNewCurrentForm != xThisRoundsForm )
1977 xNewCurrentForm.clear();
1982 if ( !m_aCurrentSelection.empty() )
1983 impl_updateCurrentForm_Lock(xNewCurrentForm);
1987 InvalidateSlot_Lock(i,
false);
1993bool FmXFormShell::isSolelySelected_Lock(
const Reference<XInterface>& _rxObject)
1995 return ( m_aCurrentSelection.size() == 1 ) && ( *m_aCurrentSelection.begin() == _rxObject );
1999void FmXFormShell::forgetCurrentForm_Lock()
2001 if ( !m_xCurrentForm.is() )
2005 impl_updateCurrentForm_Lock(
nullptr);
2009 impl_defaultCurrentForm_nothrow_Lock();
2013void FmXFormShell::impl_updateCurrentForm_Lock(
const Reference<XForm>& _rxNewCurForm)
2015 if (impl_checkDisposed_Lock())
2018 m_xCurrentForm = _rxNewCurForm;
2027 InvalidateSlot_Lock(i,
false);
2031void FmXFormShell::startListening_Lock()
2033 if (impl_checkDisposed_Lock())
2036 Reference< XRowSet> xDatabaseForm(m_xActiveForm, UNO_QUERY);
2037 if (xDatabaseForm.is() &&
getConnection(xDatabaseForm).is())
2039 Reference< XPropertySet> xActiveFormSet(m_xActiveForm, UNO_QUERY);
2040 if (xActiveFormSet.is())
2046 OUString aSource = ::comphelper::getString(xActiveFormSet->getPropertyValue(
FM_PROP_COMMAND));
2047 if (!aSource.isEmpty())
2049 m_bDatabaseBar =
true;
2053 switch (m_eNavigate)
2055 case NavigationBarMode_PARENT:
2058 Reference< XChild> xChild = m_xActiveController;
2059 Reference< runtime::XFormController > xParent;
2062 xChild.set(xChild->getParent(), UNO_QUERY);
2063 xParent.set(xChild, UNO_QUERY);
2064 Reference< XPropertySet> xParentSet;
2066 xParentSet.set(xParent->getModel(), UNO_QUERY);
2067 if (xParentSet.is())
2070 if (m_eNavigate == NavigationBarMode_CURRENT)
2074 m_xNavigationController = xParent;
2078 case NavigationBarMode_CURRENT:
2079 m_xNavigationController = m_xActiveController;
2083 m_xNavigationController =
nullptr;
2084 m_bDatabaseBar =
false;
2087 m_aNavControllerFeatures.dispose();
2088 if ( m_xNavigationController.is() && ( m_xNavigationController != m_xActiveController ) )
2089 m_aNavControllerFeatures.assign( m_xNavigationController );
2092 Reference< XPropertySet> xNavigationSet;
2093 if (m_xNavigationController.is())
2095 xNavigationSet.set(m_xNavigationController->getModel(), UNO_QUERY);
2096 if (xNavigationSet.is())
2104 m_eNavigate = NavigationBarMode_NONE;
2105 m_bDatabaseBar =
false;
2106 m_xNavigationController =
nullptr;
2110void FmXFormShell::stopListening_Lock()
2112 if (impl_checkDisposed_Lock())
2115 Reference< XRowSet> xDatabaseForm(m_xActiveForm, UNO_QUERY);
2116 if ( xDatabaseForm.is() )
2118 if (m_xNavigationController.is())
2120 Reference< XPropertySet> xSet(m_xNavigationController->getModel(), UNO_QUERY);
2127 m_bDatabaseBar =
false;
2128 m_eNavigate = NavigationBarMode_NONE;
2129 m_xNavigationController =
nullptr;
2132void FmXFormShell::ShowSelectionProperties_Lock(
bool bShow)
2134 if (impl_checkDisposed_Lock())
2138 bool bHasChild =
m_pShell->GetViewShell()->GetViewFrame().HasChildWindow( SID_FM_SHOW_PROPERTIES );
2139 if ( bHasChild && bShow )
2140 UpdateSlot_Lock(SID_FM_PROPERTY_CONTROL);
2144 m_pShell->GetViewShell()->GetViewFrame().ToggleChildWindow(SID_FM_SHOW_PROPERTIES);
2146 InvalidateSlot_Lock(SID_FM_PROPERTIES,
false);
2147 InvalidateSlot_Lock(SID_FM_CTL_PROPERTIES,
false);
2152 if (impl_checkDisposed_Lock())
2156 "FmXFormShell::OnFoundData : invalid context!");
2157 Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
2158 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnFoundData : invalid form!");
2160 Reference< XRowLocate> xCursor(xForm, UNO_QUERY);
2167 xCursor->moveToBookmark(rfriWhere.aPosition);
2169 catch(
const SQLException&)
2171 OSL_FAIL(
"Can position on bookmark!");
2178 m_arrSearchedControls.size(),
2179 "svx.form",
"FmXFormShell::OnFoundData : invalid index!");
2182 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
2185 FmFormObj* pFormObject = FmFormObj::GetFormObject(
pObject );
2186 Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
2187 DBG_ASSERT( xControlModel.is(),
"FmXFormShell::OnFoundData: invalid control!" );
2188 if ( !xControlModel.is() )
2192 if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel))
2194 Reference< XPropertySet> xOldSet(m_xLastGridFound, UNO_QUERY);
2196 Reference< XPropertyState> xOldSetState(xOldSet, UNO_QUERY);
2197 if (xOldSetState.is())
2204 sal_Int32 nGridColumn = m_arrRelativeGridColumn[rfriWhere.nFieldPos];
2205 if (nGridColumn != -1)
2207 Reference<XControl> xControl(pFormObject ? impl_getControl_Lock(xControlModel, *pFormObject) : Reference<XControl>());
2208 Reference< XGrid> xGrid(xControl, UNO_QUERY);
2209 DBG_ASSERT(xGrid.is(),
"FmXFormShell::OnFoundData : invalid control!");
2213 Reference< XPropertySet> xModelSet(xControlModel, UNO_QUERY);
2214 DBG_ASSERT(xModelSet.is(),
"FmXFormShell::OnFoundData : invalid control model (no property set) !");
2217 m_xLastGridFound = xControlModel;
2220 xGrid->setCurrentColumnPosition(
static_cast<sal_Int16
>(nGridColumn));
2226 sal_uInt16
nPos = 0;
2234 if (impl_checkDisposed_Lock())
2238 "FmXFormShell::OnCanceledNotFound : invalid context!");
2239 Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
2240 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnCanceledNotFound : invalid form!");
2242 Reference< XRowLocate> xCursor(xForm, UNO_QUERY);
2249 xCursor->moveToBookmark(rfriWhere.aPosition);
2251 catch(
const SQLException&)
2253 OSL_FAIL(
"Can position on bookmark!");
2257 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
2263 if (impl_checkDisposed_Lock())
2266 DBG_ASSERT(rfmscContextInfo.nContext <
static_cast<sal_Int16
>(m_aSearchForms.size()),
"FmXFormShell::OnSearchContextRequest : invalid parameter !");
2267 Reference< XForm> xForm( m_aSearchForms.at(rfmscContextInfo.nContext));
2268 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnSearchContextRequest : unexpected : invalid context !");
2270 Reference< XResultSet> xIter(xForm, UNO_QUERY);
2271 DBG_ASSERT(xIter.is(),
"FmXFormShell::OnSearchContextRequest : unexpected : context has no iterator !");
2275 OUString strFieldList, sFieldDisplayNames;
2276 m_arrSearchedControls.clear();
2277 m_arrRelativeGridColumn.clear();
2292 Reference< XNameAccess> xValidFormFields;
2293 Reference< XColumnsSupplier> xSupplyCols(xIter, UNO_QUERY);
2294 DBG_ASSERT(xSupplyCols.is(),
"FmXFormShell::OnSearchContextRequest : invalid cursor : no columns supplier !");
2295 if (xSupplyCols.is())
2296 xValidFormFields = xSupplyCols->getColumns();
2297 DBG_ASSERT(xValidFormFields.is(),
"FmXFormShell::OnSearchContextRequest : form has no fields !");
2301 assert(pCurrentPage &&
"FmXFormShell::OnSearchContextRequest : no page !");
2303 OUString sControlSource,
aName;
2306 while ( aPageIter.
IsMore() )
2309 FmFormObj* pFormObject = FmFormObj::GetFormObject( pCurrent );
2316 Reference< XControlModel> xControlModel( pFormObject->GetUnoControlModel() );
2317 Reference< XFormComponent > xCurrentFormComponent( xControlModel, UNO_QUERY );
2318 DBG_ASSERT( xCurrentFormComponent.is(),
"FmXFormShell::OnSearchContextRequest: invalid objects!" );
2319 if ( !xCurrentFormComponent.is() )
2323 if ( xCurrentFormComponent->getParent() != xForm )
2328 Reference< XControl> xControl;
2333 Reference< XInterface > xSearchable( iter.
Next() );
2334 while ( xSearchable.is() )
2337 if ( sControlSource.isEmpty() )
2341 xControl = impl_getControl_Lock(xControlModel, *pFormObject);
2342 DBG_ASSERT(xControl.is(),
"FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
2344 Reference< XGridPeer> xGridPeer;
2345 if ( xControl.is() )
2346 xGridPeer.set( xControl->getPeer(), UNO_QUERY );
2349 if (!xGridPeer.is())
2352 Reference< XIndexAccess> xPeerContainer(xGridPeer, UNO_QUERY);
2353 if (!xPeerContainer.is())
2356 Reference< XIndexAccess> xModelColumns = xGridPeer->getColumns();
2357 DBG_ASSERT(xModelColumns.is(),
"FmXFormShell::OnSearchContextRequest : there is a grid control without columns !");
2359 DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(),
"FmXFormShell::OnSearchContextRequest : impossible : have more view than model columns !");
2361 Reference< XInterface> xCurrentColumn;
2362 for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos)
2364 xPeerContainer->getByIndex(nViewPos) >>= xCurrentColumn;
2365 if (!xCurrentColumn.is())
2372 sal_Int32 nModelPos = GridView2ModelPos(xModelColumns, nViewPos);
2373 Reference< XPropertySet> xCurrentColModel;
2374 xModelColumns->getByIndex(nModelPos) >>= xCurrentColModel;
2377 if (xValidFormFields->hasByName(
aName))
2379 strFieldList +=
aName +
";";
2381 sFieldDisplayNames +=
2382 ::comphelper::getString(xCurrentColModel->getPropertyValue(
FM_PROP_LABEL)) +
2385 rfmscContextInfo.arrFields.push_back(xCurrentColumn);
2388 m_arrSearchedControls.push_back(pCurrent);
2390 m_arrRelativeGridColumn.push_back(nViewPos);
2397 if (!sControlSource.isEmpty() && xValidFormFields->hasByName(sControlSource))
2402 xControl = impl_getControl_Lock(xControlModel, *pFormObject);
2403 DBG_ASSERT(xControl.is(),
"FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
2409 strFieldList += sControlSource +
";";
2412 sFieldDisplayNames +=
2413 getLabelName(Reference< XPropertySet>(xControlModel, UNO_QUERY)) +
2417 m_arrSearchedControls.push_back(pCurrent);
2420 m_arrRelativeGridColumn.push_back(-1);
2423 rfmscContextInfo.arrFields.emplace_back( xControl, UNO_QUERY );
2428 xSearchable = iter.
Next();
2435 if (rfmscContextInfo.arrFields.empty())
2437 rfmscContextInfo.arrFields.clear();
2438 rfmscContextInfo.xCursor =
nullptr;
2439 rfmscContextInfo.strUsedFields.clear();
2443 rfmscContextInfo.xCursor = xIter;
2444 rfmscContextInfo.strUsedFields = strFieldList;
2445 rfmscContextInfo.sFieldDisplayNames = sFieldDisplayNames;
2449 Reference< XPropertySet> xCursorSet(rfmscContextInfo.xCursor, UNO_QUERY);
2450 Reference< XResultSetUpdate> xUpdateCursor(rfmscContextInfo.xCursor, UNO_QUERY);
2451 if (xUpdateCursor.is() && xCursorSet.is())
2453 if (::comphelper::getBOOL(xCursorSet->getPropertyValue(
FM_PROP_ISNEW)))
2454 xUpdateCursor->moveToCurrentRow();
2456 xUpdateCursor->cancelRowUpdates();
2459 return rfmscContextInfo.arrFields.size();
2464void SAL_CALL FmXFormShell::elementInserted(
const ContainerEvent& evt)
2468 if (impl_checkDisposed_Lock())
2472 Reference< XInterface> xTemp;
2473 evt.Element >>= xTemp;
2474 AddElement_Lock(xTemp);
2480void SAL_CALL FmXFormShell::elementReplaced(
const ContainerEvent& evt)
2484 if (impl_checkDisposed_Lock() )
2487 Reference< XInterface> xTemp;
2488 evt.ReplacedElement >>= xTemp;
2489 RemoveElement_Lock(xTemp);
2490 evt.Element >>= xTemp;
2491 AddElement_Lock(xTemp);
2495void SAL_CALL FmXFormShell::elementRemoved(
const ContainerEvent& evt)
2499 if (impl_checkDisposed_Lock())
2502 Reference< XInterface> xTemp;
2503 evt.Element >>= xTemp;
2504 RemoveElement_Lock(xTemp);
2510void FmXFormShell::UpdateForms_Lock(
bool _bInvalidate)
2512 if (impl_checkDisposed_Lock())
2515 Reference< XIndexAccess > xForms;
2518 if ( pPage &&
m_pShell->m_bDesignMode )
2521 if ( m_xForms != xForms )
2523 RemoveElement_Lock( m_xForms );
2525 AddElement_Lock(m_xForms);
2529 m_pShell->DetermineForms( _bInvalidate );
2533void FmXFormShell::AddElement_Lock(
const Reference<XInterface>& _xElement)
2535 if (impl_checkDisposed_Lock())
2537 impl_AddElement_nothrow(_xElement);
2540void FmXFormShell::impl_AddElement_nothrow(
const Reference< XInterface>& Element)
2543 const Reference< XIndexContainer> xContainer(Element, UNO_QUERY);
2544 if (xContainer.is())
2546 const sal_uInt32
nCount = xContainer->getCount();
2547 Reference< XInterface> xElement;
2548 for (sal_uInt32 i = 0;
i <
nCount; ++
i)
2550 xElement.set(xContainer->getByIndex(i),UNO_QUERY);
2551 impl_AddElement_nothrow(xElement);
2554 const Reference< XContainer> xCont(Element, UNO_QUERY);
2556 xCont->addContainerListener(
this);
2559 const Reference< css::view::XSelectionSupplier> xSelSupplier(Element, UNO_QUERY);
2560 if (xSelSupplier.is())
2561 xSelSupplier->addSelectionChangeListener(
this);
2565void FmXFormShell::RemoveElement_Lock(
const Reference<XInterface>& Element)
2567 if (impl_checkDisposed_Lock())
2569 impl_RemoveElement_nothrow_Lock(Element);
2572void FmXFormShell::impl_RemoveElement_nothrow_Lock(
const Reference<XInterface>& Element)
2574 const Reference< css::view::XSelectionSupplier> xSelSupplier(Element, UNO_QUERY);
2575 if (xSelSupplier.is())
2576 xSelSupplier->removeSelectionChangeListener(
this);
2579 const Reference< XIndexContainer> xContainer(Element, UNO_QUERY);
2580 if (xContainer.is())
2582 const Reference< XContainer> xCont(Element, UNO_QUERY);
2584 xCont->removeContainerListener(
this);
2586 const sal_uInt32
nCount = xContainer->getCount();
2587 Reference< XInterface> xElement;
2588 for (sal_uInt32 i = 0;
i <
nCount;
i++)
2590 xElement.set(xContainer->getByIndex(i),UNO_QUERY);
2591 impl_RemoveElement_nothrow_Lock(xElement);
2595 auto wasSelectedPos = m_aCurrentSelection.find( Element );
2596 if ( wasSelectedPos != m_aCurrentSelection.end() )
2597 m_aCurrentSelection.erase( wasSelectedPos );
2601void SAL_CALL FmXFormShell::selectionChanged(
const lang::EventObject& rEvent)
2605 if (impl_checkDisposed_Lock())
2608 Reference< XSelectionSupplier > xSupplier( rEvent.Source, UNO_QUERY );
2609 Reference< XInterface > xSelObj( xSupplier->getSelection(), UNO_QUERY );
2611 if ( !xSelObj.is() )
2614 EnableTrackProperties_Lock(
false);
2616 bool bMarkChanged =
m_pShell->GetFormView()->checkUnMarkAll(rEvent.Source);
2619 aNewSelection.insert( Reference<XInterface>( xSelObj, UNO_QUERY ) );
2621 if (setCurrentSelection_Lock(std::move(aNewSelection)) && IsPropBrwOpen_Lock())
2622 ShowSelectionProperties_Lock(
true);
2624 EnableTrackProperties_Lock(
true);
2633 if (impl_checkDisposed_Lock())
2637 SetSelection_Lock(
m_pShell->GetFormView()->GetMarkedObjectList());
2641void FmXFormShell::SetSelectionDelayed_Lock()
2643 if (impl_checkDisposed_Lock())
2646 if (
m_pShell->IsDesignMode() && IsTrackPropertiesEnabled_Lock() && !m_aMarkTimer.IsActive())
2647 m_aMarkTimer.Start();
2651void FmXFormShell::SetSelection_Lock(
const SdrMarkList& rMarkList)
2653 if (impl_checkDisposed_Lock())
2656 DetermineSelection_Lock(rMarkList);
2660void FmXFormShell::DetermineSelection_Lock(
const SdrMarkList& rMarkList)
2662 if (setCurrentSelectionFromMark_Lock(rMarkList) && IsPropBrwOpen_Lock())
2663 ShowSelectionProperties_Lock(
true);
2666bool FmXFormShell::IsPropBrwOpen_Lock()
const
2668 if (impl_checkDisposed_Lock())
2672 m_pShell->GetViewShell()->GetViewFrame().HasChildWindow(SID_FM_SHOW_PROPERTIES);
2686 if (
m_rShell.IsTrackPropertiesEnabled_Lock())
2688 m_rShell.EnableTrackProperties_Lock(
false);
2696 m_rShell.EnableTrackProperties_Lock(
true);
2700void FmXFormShell::SetDesignMode_Lock(
bool bDesign)
2702 if (impl_checkDisposed_Lock())
2705 DBG_ASSERT(
m_pShell->GetFormView(),
"FmXFormShell::SetDesignMode : invalid call (have no shell or no view) !");
2706 m_bChangingDesignMode =
true;
2713 m_bHadPropertyBrowserInDesignMode =
m_pShell->GetViewShell()->GetViewFrame().HasChildWindow(SID_FM_SHOW_PROPERTIES);
2714 if (m_bHadPropertyBrowserInDesignMode)
2715 m_pShell->GetViewShell()->GetViewFrame().ToggleChildWindow(SID_FM_SHOW_PROPERTIES);
2723 stopFiltering_Lock(
false);
2730 m_aMarkTimer.Stop();
2732 SuspendPropertyTracking aSuspend( *
this );
2736 if (bDesign && m_xExternalViewController.is())
2737 CloseExternalFormViewer_Lock();
2746 UpdateForms_Lock(
false);
2748 m_pTextShell->designModeChanged();
2755 SuspendPropertyTracking aSuspend( *
this );
2762 SetSelection_Lock(aList);
2774 if (bDesign && m_bHadPropertyBrowserInDesignMode)
2780 m_pShell->GetViewShell()->GetViewFrame().GetDispatcher()->Execute( SID_FM_SHOW_PROPERTY_BROWSER, SfxCallMode::ASYNCHRON );
2782 m_bChangingDesignMode =
false;
2785Reference< XControl> FmXFormShell::impl_getControl_Lock(
const Reference<XControlModel>& i_rxModel,
const FmFormObj& i_rKnownFormObj)
2787 if (impl_checkDisposed_Lock())
2790 Reference< XControl > xControl;
2793 Reference< XControlContainer> xControlContainer(getControlContainerForView_Lock(), UNO_SET_THROW);
2795 const Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
2797 for (Reference< XControl >
const & control : seqControls)
2799 xControl.set( control, UNO_SET_THROW );
2800 Reference< XControlModel > xCurrentModel( xControl->getModel() );
2801 if ( xCurrentModel == i_rxModel )
2806 if ( !xControl.is() )
2809 Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW );
2811 ENSURE_OR_THROW( pContainerWindow,
"unexpected control container implementation" );
2816 xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow->
GetOutDev() ), UNO_SET_THROW );
2819 catch(
const Exception& )
2824 OSL_ENSURE( xControl.is(),
"FmXFormShell::impl_getControl: no control found!" );
2829void FmXFormShell::impl_collectFormSearchContexts_nothrow_Lock(
const Reference<XInterface>& _rxStartingPoint,
2830 std::u16string_view _rCurrentLevelPrefix,
FmFormArray& _out_rForms, ::std::vector< OUString >& _out_rNames )
2834 Reference< XIndexAccess> xContainer( _rxStartingPoint, UNO_QUERY );
2835 if ( !xContainer.is() )
2838 sal_Int32
nCount( xContainer->getCount() );
2842 OUString sCurrentFormName;
2843 OUStringBuffer aNextLevelPrefix;
2844 for ( sal_Int32 i=0;
i<
nCount; ++
i )
2847 Reference< XForm > xCurrentAsForm( xContainer->getByIndex(i), UNO_QUERY );
2848 if ( !xCurrentAsForm.is() )
2851 Reference< XNamed > xNamed( xCurrentAsForm, UNO_QUERY_THROW );
2852 sCurrentFormName = xNamed->getName();
2855 OUString sCompleteCurrentName( sCurrentFormName );
2856 if ( !_rCurrentLevelPrefix.empty() )
2858 sCompleteCurrentName += OUString::Concat(
" (") + _rCurrentLevelPrefix +
")";
2862 aNextLevelPrefix = _rCurrentLevelPrefix;
2863 if ( !_rCurrentLevelPrefix.empty() )
2864 aNextLevelPrefix.append(
'/' );
2865 aNextLevelPrefix.append( sCurrentFormName );
2868 _out_rForms.push_back( xCurrentAsForm );
2869 _out_rNames.push_back( sCompleteCurrentName );
2872 impl_collectFormSearchContexts_nothrow_Lock(
2873 xCurrentAsForm, aNextLevelPrefix,
2874 _out_rForms, _out_rNames);
2875 aNextLevelPrefix.setLength(0);
2878 catch(
const Exception& )
2884void FmXFormShell::startFiltering_Lock()
2886 if (impl_checkDisposed_Lock())
2893 Reference< XControlContainer> xContainer;
2894 if (getActiveController_Lock() == m_xExternalViewController)
2896 DBG_ASSERT(m_xExtViewTriggerController.is(),
"FmXFormShell::startFiltering : inconsistent : active external controller, but no one triggered this !");
2897 xContainer = m_xExtViewTriggerController->getContainer();
2900 xContainer = getActiveController_Lock()->getContainer();
2903 if ( pAdapter.is() )
2905 const ::std::vector< Reference< runtime::XFormController> >& rControllerList = pAdapter->GetList();
2906 for (
const auto& rpController : rControllerList)
2908 Reference< XModeSelector> xModeSelector(rpController, UNO_QUERY);
2909 if (xModeSelector.is())
2910 xModeSelector->setMode(
"FilterMode" );
2914 m_bFilterMode =
true;
2928static void saveFilter(
const Reference< runtime::XFormController >& _rxController)
2930 Reference< XPropertySet> xFormAsSet(_rxController->getModel(), UNO_QUERY);
2931 Reference< XPropertySet> xControllerAsSet(_rxController, UNO_QUERY);
2934 Reference< runtime::XFormController >
xController;
2935 for (sal_Int32
i = 0,
nCount = _rxController->getCount();
i <
nCount; ++
i)
2955void FmXFormShell::stopFiltering_Lock(
bool bSave)
2957 if (impl_checkDisposed_Lock())
2960 m_bFilterMode =
false;
2965 Reference< XControlContainer> xContainer;
2966 if (getActiveController_Lock() == m_xExternalViewController)
2968 DBG_ASSERT(m_xExtViewTriggerController.is(),
"FmXFormShell::stopFiltering : inconsistent : active external controller, but no one triggered this !");
2969 xContainer = m_xExtViewTriggerController->getContainer();
2972 xContainer = getActiveController_Lock()->getContainer();
2975 if ( pAdapter.is() )
2977 const ::std::vector< Reference< runtime::XFormController > >& rControllerList = pAdapter->GetList();
2978 ::std::vector < OUString > aOriginalFilters;
2979 ::std::vector < bool > aOriginalApplyFlags;
2983 for (
const auto& rpController : rControllerList)
2988 Reference< XPropertySet > xFormAsSet(rpController->getModel(), UNO_QUERY);
2989 aOriginalFilters.push_back(::comphelper::getString(xFormAsSet->getPropertyValue(
FM_PROP_FILTER)));
2990 aOriginalApplyFlags.push_back(::comphelper::getBOOL(xFormAsSet->getPropertyValue(
FM_PROP_APPLYFILTER)));
2994 OSL_FAIL(
"FmXFormShell::stopFiltering : could not get the original filter !");
2997 if (aOriginalFilters.size() == aOriginalApplyFlags.size())
2999 aOriginalFilters.emplace_back( );
3000 aOriginalApplyFlags.push_back(
false );
3005 for (
const auto& rController : rControllerList)
3008 Reference< XModeSelector> xModeSelector(rController, UNO_QUERY);
3009 if (xModeSelector.is())
3010 xModeSelector->setMode(
"DataMode" );
3014 const ::std::vector< Reference< runtime::XFormController > > & rControllers = pAdapter->GetList();
3015 for (::std::vector< Reference< runtime::XFormController > > ::const_iterator j = rControllers.begin();
3016 j != rControllers.end(); ++j)
3018 Reference< XLoadable> xReload((*j)->getModel(), UNO_QUERY);
3021 Reference< XPropertySet > xFormSet(xReload, UNO_QUERY);
3034 OUString sOriginalFilter = aOriginalFilters[ j - rControllers.begin() ];
3035 bool bOriginalApplyFlag = aOriginalApplyFlags[ j - rControllers.begin() ];
3042 catch(
const Exception&)
3052 m_pShell->GetViewShell()->GetViewFrame().GetBindings().InvalidateShell(*m_pShell);
3056void FmXFormShell::CreateExternalView_Lock()
3058 if (impl_checkDisposed_Lock())
3061 DBG_ASSERT(m_xAttachedFrame.is(),
"FmXFormShell::CreateExternalView : no frame !");
3064 bool bAlreadyExistent = m_xExternalViewController.is();
3065 Reference< css::frame::XFrame> xExternalViewFrame;
3067 Reference<runtime::XFormController> xCurrentNavController(getNavController_Lock());
3074 bool bHaveUsableControls =
false;
3077 Reference< XPropertySet> xCurrentModelSet(aModelIterator.Next(), UNO_QUERY);
3078 if (!xCurrentModelSet.is())
3082 sal_Int16 nClassId = ::comphelper::getINT16(xCurrentModelSet->getPropertyValue(
FM_PROP_CLASSID));
3085 case FormComponentType::IMAGECONTROL:
3086 case FormComponentType::CONTROL:
3089 bHaveUsableControls =
true;
3093 if (!bHaveUsableControls)
3096 VclMessageType::Warning, VclButtonsType::Ok,
3097 SvxResId(RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY)));
3104 if (!bAlreadyExistent)
3107 URL aWantToDispatch;
3110 Reference< css::frame::XDispatchProvider> xProv(m_xAttachedFrame, UNO_QUERY);
3111 Reference< css::frame::XDispatch> xDisp;
3113 xDisp = xProv->queryDispatch(aWantToDispatch, sFrameName,
3114 css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::CREATE);
3117 xDisp->dispatch(aWantToDispatch, Sequence< PropertyValue>());
3121 xExternalViewFrame = m_xAttachedFrame->findFrame(sFrameName, css::frame::FrameSearchFlag::CHILDREN);
3122 if (xExternalViewFrame.is())
3124 m_xExternalViewController = xExternalViewFrame->getController();
3125 if (m_xExternalViewController.is())
3126 m_xExternalViewController->addEventListener(
static_cast<XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
3131 xExternalViewFrame = m_xExternalViewController->getFrame();
3132 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
3135 Reference< XForm> xCurrentModel(xCurrentNavController->getModel(), UNO_QUERY);
3136 if ((xCurrentModel == m_xExternalDisplayedForm) || (getInternalForm_Lock(xCurrentModel) == m_xExternalDisplayedForm))
3138 if (m_xExternalViewController == getActiveController_Lock())
3140 Reference< runtime::XFormController > xAsFormController( m_xExternalViewController, UNO_QUERY );
3141 ControllerFeatures
aHelper( xAsFormController );
3142 (void)
aHelper->commitCurrentControl();
3145 Reference< runtime::XFormController > xNewController(m_xExtViewTriggerController);
3146 CloseExternalFormViewer_Lock();
3147 setActiveController_Lock(xNewController);
3154 Reference< css::frame::XDispatch> xClear( xCommLink->queryDispatch(aClearURL, OUString(), 0));
3156 xClear->dispatch(aClearURL, Sequence< PropertyValue>());
3163 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
3165 if (m_xExternalViewController.is())
3167 DBG_ASSERT(xCommLink.is(),
"FmXFormShell::CreateExternalView : the component doesn't have the necessary interfaces !");
3171 Reference< css::frame::XDispatch> xAddColumnDispatch( xCommLink->queryDispatch(aAddColumnURL, OUString(), 0));
3174 Reference< css::frame::XDispatch> xAttachDispatch( xCommLink->queryDispatch(aAttachURL, OUString(), 0));
3176 if (xAddColumnDispatch.is() && xAttachDispatch.is())
3178 DBG_ASSERT(xCurrentNavController.is(),
"FmXFormShell::CreateExternalView : invalid call : have no nav controller !");
3180 sal_Int16 nAddedColumns = 0;
3183 typedef std::map< OUString, Sequence< OUString> > MapUString2UstringSeq;
3184 typedef std::map< OUString, OUString > FmMapUString2UString;
3185 typedef std::map< OUString, sal_Int16 > FmMapUString2Int16;
3187 MapUString2UstringSeq aRadioValueLists;
3188 MapUString2UstringSeq aRadioListSources;
3189 FmMapUString2UString aRadioControlSources;
3190 FmMapUString2Int16 aRadioPositions;
3193 OUString sColumnType,aGroupName,sControlSource;
3194 Sequence< Property> aProps;
3197 Reference< XPropertySet> xCurrentModelSet(aModelIterator.Next(), UNO_QUERY);
3198 if (!xCurrentModelSet.is())
3200 OSL_ENSURE(xCurrentModelSet.is(),
"xCurrentModelSet is null!");
3204 sal_Int16 nClassId = ::comphelper::getINT16(xCurrentModelSet->getPropertyValue(
FM_PROP_CLASSID));
3207 case FormComponentType::RADIOBUTTON:
3213 Sequence< OUString>& aThisGroupLabels = aRadioListSources[aGroupName];
3214 sal_Int32 nNewSizeL = aThisGroupLabels.getLength() + 1;
3215 aThisGroupLabels.realloc(nNewSizeL);
3216 aThisGroupLabels.getArray()[nNewSizeL - 1] = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_REFVALUE));
3219 Sequence< OUString>& aThisGroupControlSources = aRadioValueLists[aGroupName];
3220 sal_Int32 nNewSizeC = aThisGroupControlSources.getLength() + 1;
3221 aThisGroupControlSources.realloc(nNewSizeC);
3222 aThisGroupControlSources.getArray()[nNewSizeC - 1] = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_LABEL));
3225 sControlSource = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_CONTROLSOURCE));
3226 if (aRadioControlSources.find(aGroupName) == aRadioControlSources.end())
3227 aRadioControlSources[aGroupName] = sControlSource;
3230 DBG_ASSERT(aRadioControlSources[aGroupName] == sControlSource,
3231 "FmXFormShell::CreateExternalView : inconsistent radio buttons detected !");
3235 if (aRadioPositions.find(aGroupName) == aRadioPositions.end())
3236 aRadioPositions[aGroupName] = nAddedColumns;
3242 case FormComponentType::IMAGECONTROL:
3243 case FormComponentType::CONTROL:
3246 case FormComponentType::CHECKBOX:
3248 case FormComponentType::LISTBOX:
3250 case FormComponentType::COMBOBOX:
3252 case FormComponentType::DATEFIELD:
3254 case FormComponentType::TIMEFIELD:
3256 case FormComponentType::NUMERICFIELD:
3258 case FormComponentType::CURRENCYFIELD:
3260 case FormComponentType::PATTERNFIELD:
3263 case FormComponentType::TEXTFIELD:
3268 Reference< lang::XServiceInfo> xInfo(xCurrentModelSet, UNO_QUERY);
3281 const sal_Int16 nDispatchArgs = 3;
3282 Sequence< PropertyValue> aDispatchArgs(nDispatchArgs);
3283 PropertyValue* pDispatchArgs = aDispatchArgs.getArray();
3288 pDispatchArgs->Value <<= sColumnType;
3293 pDispatchArgs->Value <<= nAddedColumns;
3297 Sequence< PropertyValue> aColumnProps(1);
3298 PropertyValue* pColumnProps = aColumnProps.getArray();
3302 pColumnProps->Value <<=
getLabelName(xCurrentModelSet);
3306 Reference< XPropertySetInfo> xControlModelInfo( xCurrentModelSet->getPropertySetInfo());
3307 DBG_ASSERT(xControlModelInfo.is(),
"FmXFormShell::CreateExternalView : the control model has no property info ! This will crash !");
3308 aProps = xControlModelInfo->getProperties();
3311 sal_Int32 nExistentDescs = pColumnProps - aColumnProps.getArray();
3312 aColumnProps.realloc(nExistentDescs + aProps.getLength());
3313 pColumnProps = aColumnProps.getArray() + nExistentDescs;
3315 for (
const Property& rProp : std::as_const(aProps))
3323 if (rProp.Attributes & PropertyAttribute::READONLY)
3327 pColumnProps->Name = rProp.Name;
3328 pColumnProps->Value = xCurrentModelSet->getPropertyValue(rProp.Name);
3331 aColumnProps.realloc(pColumnProps - aColumnProps.getArray());
3334 pDispatchArgs->Name =
"ColumnProperties";
3335 pDispatchArgs->Value <<= aColumnProps;
3337 DBG_ASSERT(nDispatchArgs == (pDispatchArgs - aDispatchArgs.getConstArray()),
3338 "FmXFormShell::CreateExternalView : forgot to adjust nDispatchArgs ?");
3341 xAddColumnDispatch->dispatch(aAddColumnURL, aDispatchArgs);
3346 sal_Int16 nOffset(0);
3348 const sal_Int16 nListBoxDescription = 6;
3349 Sequence< PropertyValue> aListBoxDescription(nListBoxDescription);
3350 for (
const auto& rCtrlSource : aRadioControlSources)
3352 PropertyValue* pListBoxDescription = aListBoxDescription.getArray();
3355 pListBoxDescription->Value <<= rCtrlSource.first;
3356 ++pListBoxDescription;
3360 pListBoxDescription->Value <<= rCtrlSource.second;
3361 ++pListBoxDescription;
3365 pListBoxDescription->Value <<= sal_Int16(1);
3366 ++pListBoxDescription;
3370 pListBoxDescription->Value <<= ListSourceType_VALUELIST;
3371 ++pListBoxDescription;
3374 MapUString2UstringSeq::const_iterator aCurrentListSource = aRadioListSources.find(rCtrlSource.first);
3375 DBG_ASSERT(aCurrentListSource != aRadioListSources.end(),
3376 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3378 pListBoxDescription->Value <<= (*aCurrentListSource).second;
3379 ++pListBoxDescription;
3382 MapUString2UstringSeq::const_iterator aCurrentValueList = aRadioValueLists.find(rCtrlSource.first);
3383 DBG_ASSERT(aCurrentValueList != aRadioValueLists.end(),
3384 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3386 pListBoxDescription->Value <<= (*aCurrentValueList).second;
3387 ++pListBoxDescription;
3389 DBG_ASSERT(nListBoxDescription == (pListBoxDescription - aListBoxDescription.getConstArray()),
3390 "FmXFormShell::CreateExternalView : forgot to adjust nListBoxDescription ?");
3393 const sal_Int16 nDispatchArgs = 3;
3394 Sequence< PropertyValue> aDispatchArgs(nDispatchArgs);
3395 PropertyValue* pDispatchArgs = aDispatchArgs.getArray();
3405 FmMapUString2Int16::const_iterator aOffset = aRadioPositions.find(rCtrlSource.first);
3407 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3408 sal_Int16 nPosition = (*aOffset).second;
3409 nPosition = nPosition + nOffset;
3411 pDispatchArgs->Value <<= nPosition;
3415 pDispatchArgs->Name =
"ColumnProperties";
3416 pDispatchArgs->Value <<= aListBoxDescription;
3418 DBG_ASSERT(nDispatchArgs == (pDispatchArgs - aDispatchArgs.getConstArray()),
3419 "FmXFormShell::CreateExternalView : forgot to adjust nDispatchArgs ?");
3422 xAddColumnDispatch->dispatch(aAddColumnURL, aDispatchArgs);
3428 DBG_ASSERT(nAddedColumns > 0,
"FmXFormShell::CreateExternalView : no controls (inconsistent) !");
3434 Reference< XResultSet> xForm(xCurrentNavController->getModel(), UNO_QUERY);
3435 aArg.Value <<= xForm;
3437 m_xExternalDisplayedForm = xForm;
3441 xAttachDispatch->dispatch(aAttachURL, Sequence< PropertyValue>(&aArg, 1));
3443 m_xExtViewTriggerController = xCurrentNavController;
3447 Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY );
3448 OSL_ENSURE( xFormController.is(),
"FmXFormShell::CreateExternalView:: invalid external view controller!" );
3449 if (xFormController.is())
3450 xFormController->addActivateListener(
static_cast<XFormControllerListener*
>(
this));
3456 OSL_FAIL(
"FmXFormShell::CreateExternalView : could not create the external form view !");
3459 InvalidateSlot_Lock(SID_FM_VIEW_AS_GRID,
false);
3463void FmXFormShell::implAdjustConfigCache_Lock()
3470 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
3471 Sequence< Any > aFlags = GetProperties(aNames);
3472 if (1 == aFlags.getLength())
3473 m_bUseWizards = ::cppu::any2bool(aFlags[0]);
3477void FmXFormShell::Notify(
const css::uno::Sequence< OUString >& _rPropertyNames)
3480 if (impl_checkDisposed_Lock())
3483 for (
const OUString& rName : _rPropertyNames)
3484 if (rName ==
"FormControlPilotsEnabled")
3486 implAdjustConfigCache_Lock();
3487 InvalidateSlot_Lock(SID_FM_USE_WIZARDS,
true);
3491void FmXFormShell::ImplCommit()
3496void FmXFormShell::SetWizardUsing_Lock(
bool _bUseThem)
3498 m_bUseWizards = _bUseThem;
3500 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
3501 Sequence< Any > aValues{
Any(m_bUseWizards) };
3502 PutProperties(aNames, aValues);
3506void FmXFormShell::viewDeactivated_Lock(
FmFormView& _rCurrentView,
bool _bDeactivateController)
3520 ::std::queue< FmLoadAction > aNewEvents;
3521 while ( !m_aLoadingPages.empty() )
3524 m_aLoadingPages.pop();
3525 if ( pPage != aAction.
pPage )
3527 aNewEvents.push( aAction );
3534 m_aLoadingPages = aNewEvents;
3539 UpdateForms_Lock(
true);
3545 if (impl_checkDisposed_Lock())
3548 m_nActivationEvent =
nullptr;
3551 if ( pDocument && !pDocument->
HasName() )
3553 if (isEnhancedForm_Lock())
3556 if ( !
m_pShell->GetViewShell()->GetViewFrame().HasChildWindow( SID_FM_SHOW_DATANAVIGATOR ) )
3557 m_pShell->GetViewShell()->GetViewFrame().ToggleChildWindow( SID_FM_SHOW_DATANAVIGATOR );
3565 UpdateForms_Lock(
true);
3569void FmXFormShell::viewActivated_Lock(
FmFormView& _rCurrentView,
bool _bSyncAction)
3605 UpdateForms_Lock(
true);
3607 if ( m_bFirstActivation )
3610 m_bFirstActivation =
false;
3615 impl_defaultCurrentForm_nothrow_Lock();
3619void FmXFormShell::impl_defaultCurrentForm_nothrow_Lock()
3621 if (impl_checkDisposed_Lock())
3624 if ( m_xCurrentForm.is() )
3635 Reference< XIndexAccess > xForms = pPage->
GetForms(
false );
3636 if ( !xForms.is() || !xForms->hasElements() )
3639 Reference< XForm > xNewCurrentForm( xForms->getByIndex(0), UNO_QUERY_THROW );
3640 impl_updateCurrentForm_Lock(xNewCurrentForm);
3642 catch(
const Exception& )
3649void FmXFormShell::smartControlReset(
const Reference< XIndexAccess >& _rxModels )
3651 if (!_rxModels.is())
3653 OSL_FAIL(
"FmXFormShell::smartControlReset: invalid container!");
3657 sal_Int32
nCount = _rxModels->getCount();
3658 Reference< XPropertySet > xCurrent;
3659 Reference< XPropertySetInfo > xCurrentInfo;
3660 Reference< XPropertySet > xBoundField;
3664 _rxModels->getByIndex(i) >>= xCurrent;
3666 xCurrentInfo = xCurrent->getPropertySetInfo();
3668 xCurrentInfo.clear();
3669 if (!xCurrentInfo.is())
3679 xBoundField.clear();
3682 bool bReset = !xBoundField.is();
3685 Reference< XBindableValue > xBindable( xCurrent, UNO_QUERY );
3686 if ( xBindable.is() && xBindable->getValueBinding().is() )
3691 Reference< XReset > xControlReset( xCurrent, UNO_QUERY );
3692 if ( xControlReset.is() )
3693 xControlReset->reset();
3698 Reference< XIndexAccess > xContainer(xCurrent, UNO_QUERY);
3699 if (xContainer.is())
3700 smartControlReset(xContainer);
3709 m_aLoadingPages.pop();
3717 bool lcl_isLoadable(
const Reference< XInterface >& _rxLoadable )
3721 Reference< XPropertySet > xSet( _rxLoadable, UNO_QUERY );
3726 Reference< XConnection > xConn;
3735 OUString sPropertyValue;
3737 if ( !sPropertyValue.isEmpty() )
3740 OSL_VERIFY( xSet->getPropertyValue(
FM_PROP_URL ) >>= sPropertyValue );
3741 if ( !sPropertyValue.isEmpty() )
3744 catch(
const Exception&)
3756 "FmXFormShell::loadForms: async loading not supported - this will heavily fail!" );
3768 DBG_ASSERT( _pPage,
"FmXFormShell::loadForms: invalid page!" );
3775 rFmFormModel.GetUndoEnv().Lock();
3778 Reference< XIndexAccess > xForms = _pPage->
GetForms(
false );
3782 Reference< XLoadable > xForm;
3783 for ( sal_Int32 j = 0, nCount = xForms->getCount(); j < nCount; ++j )
3785 xForms->getByIndex( j ) >>= xForm;
3786 bool bFormWasLoaded =
false;
3792 if ( lcl_isLoadable( xForm ) && !xForm->isLoaded() )
3797 if ( xForm->isLoaded() )
3799 bFormWasLoaded =
true;
3804 catch(
const Exception& )
3810 if ( bFormWasLoaded )
3812 Reference< XIndexAccess > xContainer( xForm, UNO_QUERY );
3813 DBG_ASSERT( xContainer.is(),
"FmXFormShell::loadForms: the form is no container!" );
3814 if ( xContainer.is() )
3815 smartControlReset( xContainer );
3821 rFmFormModel.GetUndoEnv().UnLock();
3825void FmXFormShell::ExecuteTextAttribute_Lock(
SfxRequest& _rReq)
3828 m_pTextShell->ExecuteTextAttribute( _rReq );
3832void FmXFormShell::GetTextAttributeState_Lock(
SfxItemSet& _rSet)
3835 m_pTextShell->GetTextAttributeState( _rSet );
3839bool FmXFormShell::IsActiveControl_Lock(
bool _bCountRichTextOnly )
const
3842 return m_pTextShell->IsActiveControl( _bCountRichTextOnly );
3846void FmXFormShell::ForgetActiveControl_Lock()
3849 m_pTextShell->ForgetActiveControl();
3856 m_pTextShell->SetControlActivationHandler( _rHdl );
3859void FmXFormShell::handleShowPropertiesRequest_Lock()
3861 if (onlyControlsAreMarked_Lock())
3862 ShowSelectionProperties_Lock(
true );
3866void FmXFormShell::handleMouseButtonDown_Lock(
const SdrViewEvent& _rViewEvent)
3873 if (onlyControlsAreMarked_Lock())
3874 ShowSelectionProperties_Lock(
true );
3880bool FmXFormShell::HasControlFocus_Lock()
const
3882 bool bHasControlFocus =
false;
3886 Reference<runtime::XFormController>
xController(getActiveController_Lock());
3887 Reference< XControl > xCurrentControl;
3889 xCurrentControl.set(
xController->getCurrentControl() );
3890 if ( xCurrentControl.is() )
3892 Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW );
3893 bHasControlFocus = xPeerWindow->hasFocus();
3896 catch(
const Exception& )
3901 return bHasControlFocus;
3906 :IndexAccessIterator(xStartingPoint)
3914 Reference< XPropertySet> xProperties(xElement, UNO_QUERY);
3918 Reference< XPropertySet> xField;
3932 if (::comphelper::getINT16(aClassId) == FormComponentType::GRIDCONTROL)
constexpr OUStringLiteral sFrameName
const LanguageTag & GetUILanguageTag() const
static const AllSettings & GetSettings()
static comphelper::SolarMutex & GetSolarMutex()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
bool hasEverBeenActivated() const
void setCurForm(const css::uno::Reference< css::form::XForm > &xForm)
void setHasBeenActivated()
void SetFormsCreationHdl(const Link< FmFormPageImpl &, void > &_rFormsCreationHdl)
const css::uno::Reference< css::form::XForms > & GetForms(bool _bForceCreate=true) const
FmFormPageImpl & GetImpl() const
static void DisposeElement(const css::uno::Reference< css::awt::XControlModel > &xReplaced)
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
bool IsDesignMode() const
SdrObject * GetMarkedSdrObj() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
virtual SdrInventor GetObjInventor() const
virtual SdrObjList * GetSubList() const
bool IsGroupObject() const
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
css::uno::Reference< css::awt::XControlContainer > const & GetControlContainer(bool _bCreateIfNecessary=true) const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrModel & getSdrModelFromSdrPage() const
SdrModel & GetModel() const
virtual bool ShouldHandleElement(const css::uno::Reference< css::uno::XInterface > &rElement) override
const OUString & getCurrentValue() const
virtual bool ShouldStepInto(const css::uno::Reference< css::uno::XInterface > &xContainer) const override
SearchableControlIterator(css::uno::Reference< css::uno::XInterface > const &xStartingPoint)
void InvalidateShell(const SfxShell &rSh, bool bDeep=false)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
bool IsReadOnlyUI() const
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
bool HasChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
bool KnowsChildWindow(sal_uInt16)
static SvxAbstractDialogFactory * Create()
virtual VclPtr< AbstractFmSearchDialog > CreateFmSearchDialog(weld::Window *pParent, const OUString &strInitialText, const ::std::vector< OUString > &_rContexts, sal_Int16 nInitialContext, const Link< FmSearchContext &, sal_uInt32 > &lnkContextSupplier)=0
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
css::uno::Reference< css::uno::XInterface > m_xStartingPoint
css::uno::Reference< css::uno::XInterface > const & Next()
sal_uInt32 release(bool bUnlockAll=false)
virtual bool tryToAcquire()
void swap(sorted_vector &other)
std::vector< Value >::const_iterator const_iterator
std::pair< const_iterator, bool > insert(Value &&x)
easier access to a FormControllerHelper instance
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
#define DBG_TESTSOLARMUTEX()
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
OUString SvxResId(TranslateId aId)
ESelection aNewSelection(GetSelection())
EmbeddedObjectRef * pObject
constexpr OUStringLiteral FM_PROP_ROWCOUNT
constexpr OUStringLiteral FM_PROP_DEFAULTCONTROL
constexpr OUStringLiteral FM_PROP_CURSORCOLOR
constexpr OUStringLiteral FM_PROP_ACTIVE_CONNECTION
constexpr OUStringLiteral FM_PROP_COMMAND
constexpr OUStringLiteral FM_PROP_DISPLAYSYNCHRON
constexpr OUStringLiteral FM_PROP_CLASSID
constexpr OUStringLiteral FM_PROP_CONTROLLABEL
constexpr OUStringLiteral FM_PROP_BOUNDFIELD
constexpr OUStringLiteral FM_PROP_STRINGITEMLIST
constexpr OUStringLiteral FM_PROP_ISNEW
constexpr OUStringLiteral FM_PROP_LABEL
constexpr OUStringLiteral FM_PROP_LISTSOURCE
constexpr OUStringLiteral FM_PROP_HIDDEN
constexpr OUStringLiteral FM_PROP_CONTROLSOURCE
constexpr OUStringLiteral FM_PROP_LISTSOURCETYPE
constexpr OUStringLiteral FM_PROP_URL
constexpr OUStringLiteral FM_PROP_NAVIGATION
constexpr OUStringLiteral FM_PROP_APPLYFILTER
constexpr OUStringLiteral FM_PROP_FILTER
constexpr OUStringLiteral FM_PROP_ALWAYSSHOWCURSOR
constexpr OUStringLiteral FM_PROP_BOUNDCOLUMN
constexpr OUStringLiteral FM_PROP_REFVALUE
constexpr OUStringLiteral FM_PROP_ISMODIFIED
constexpr OUStringLiteral FM_PROP_DATASOURCE
constexpr OUStringLiteral FM_COMPONENT_CURRENCYFIELD
constexpr OUStringLiteral FM_COMPONENT_FILECONTROL
constexpr OUStringLiteral FM_SUN_COMPONENT_NAVIGATIONBAR
constexpr OUStringLiteral FM_COMPONENT_LISTBOX
constexpr OUStringLiteral FM_COMPONENT_TEXTFIELD
constexpr OUStringLiteral FM_COMPONENT_GRIDCONTROL
constexpr OUStringLiteral FM_COMPONENT_RADIOBUTTON
constexpr OUStringLiteral FM_SUN_COMPONENT_SCROLLBAR
constexpr OUStringLiteral FM_COMPONENT_NUMERICFIELD
constexpr OUStringLiteral FM_COMPONENT_TIMEFIELD
constexpr OUStringLiteral FM_COMPONENT_HIDDENCONTROL
constexpr OUStringLiteral FM_COMPONENT_FORMATTEDFIELD
constexpr OUStringLiteral FM_COMPONENT_IMAGEBUTTON
constexpr OUStringLiteral FM_COMPONENT_FIXEDTEXT
constexpr OUStringLiteral FM_SUN_COMPONENT_SPINBUTTON
constexpr OUStringLiteral FM_COMPONENT_DATEFIELD
constexpr OUStringLiteral FM_COMPONENT_CHECKBOX
constexpr OUStringLiteral FM_COMPONENT_COMBOBOX
constexpr OUStringLiteral FM_COMPONENT_IMAGECONTROL
constexpr OUStringLiteral FM_COMPONENT_GROUPBOX
constexpr OUStringLiteral FM_COMPONENT_COMMANDBUTTON
constexpr OUStringLiteral FM_COMPONENT_PATTERNFIELD
const sal_Int16 DlgSlotMap[]
static void saveFilter(const Reference< runtime::XFormController > &_rxController)
static bool isControlList(const SdrMarkList &rMarkList)
const SdrObjKind nObjectTypes[]
IMPL_LINK_NOARG(FmXFormShell, OnInvalidateSlots_Lock, void *, void)
const sal_Int16 SelObjectSlotMap[]
IMPL_LINK(FmXFormShell, OnFoundData_Lock, FmFoundRecordInformation &, rfriWhere, void)
static Reference< XForm > GetForm(const Reference< XInterface > &_rxElement)
static std::u16string_view aConvertSlots[]
bool IsSearchableControl(const css::uno::Reference< css::uno::XInterface > &_rxControl, OUString *_pCurrentText)
constexpr rtl::OUStringConstExpr aImgIds[]
const sal_uInt16 DatabaseSlotMap[]
::cppu::WeakComponentImplHelper< css::beans::XPropertyChangeListener, css::container::XContainerListener, css::view::XSelectionChangeListener, css::form::XFormControllerListener > FmXFormShell_BD_BASE
std::vector< css::uno::Reference< css::form::XForm > > FmFormArray
#define DO_SAFE(statement)
constexpr OUStringLiteral FMURL_GRIDVIEW_CLEARVIEW
constexpr OUStringLiteral FMARG_ATTACHTO_MASTERFORM
constexpr OUStringLiteral FMARG_ADDCOL_COLUMNPOS
constexpr OUStringLiteral FMURL_GRIDVIEW_ATTACHTOFORM
constexpr OUStringLiteral FMARG_ADDCOL_COLUMNTYPE
constexpr OUStringLiteral FMURL_COMPONENT_FORMGRIDVIEW
constexpr OUStringLiteral FMURL_GRIDVIEW_ADDCOLUMN
#define FM_COL_FORMATTEDFIELD
#define FM_COL_PATTERNFIELD
#define FM_COL_NUMERICFIELD
#define FM_COL_CURRENCYFIELD
Reference< XIntrospection > xIntrospection
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
OString stripEnd(const OString &rIn, char c)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
Reference< XComponentContext > getProcessComponentContext()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Reference< XController > xController
Reference< XModel > xModel
E3dObject * DynCastE3dObject(SdrObject *pObj)