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>
103#include <string_view>
114 SID_FM_RECORD_DELETE,
115 SID_FM_RECORD_ABSOLUTE,
119 SID_FM_REMOVE_FILTER_SORT,
124 SID_FM_FORM_FILTERED,
126 SID_FM_REFRESH_FORM_CONTROL,
137 SID_FM_CTL_PROPERTIES,
141 SID_FM_SHOW_FMEXPLORER,
142 SID_FM_FIELDS_CONTROL,
143 SID_FM_SHOW_PROPERTIES,
144 SID_FM_PROPERTY_CONTROL,
145 SID_FM_FMEXPLORER_CONTROL,
146 SID_FM_SHOW_DATANAVIGATOR,
147 SID_FM_DATANAVIGATOR_CONTROL,
153 SID_FM_CONVERTTO_EDIT,
154 SID_FM_CONVERTTO_BUTTON,
155 SID_FM_CONVERTTO_FIXEDTEXT,
156 SID_FM_CONVERTTO_LISTBOX,
157 SID_FM_CONVERTTO_CHECKBOX,
158 SID_FM_CONVERTTO_RADIOBUTTON,
159 SID_FM_CONVERTTO_GROUPBOX,
160 SID_FM_CONVERTTO_COMBOBOX,
161 SID_FM_CONVERTTO_IMAGEBUTTON,
162 SID_FM_CONVERTTO_FILECONTROL,
163 SID_FM_CONVERTTO_DATE,
164 SID_FM_CONVERTTO_TIME,
165 SID_FM_CONVERTTO_NUMERIC,
166 SID_FM_CONVERTTO_CURRENCY,
167 SID_FM_CONVERTTO_PATTERN,
168 SID_FM_CONVERTTO_IMAGECONTROL,
169 SID_FM_CONVERTTO_FORMATTED,
170 SID_FM_CONVERTTO_SCROLLBAR,
171 SID_FM_CONVERTTO_SPINBUTTON,
172 SID_FM_CONVERTTO_NAVIGATIONBAR,
174 SID_FM_FMEXPLORER_CONTROL,
175 SID_FM_DATANAVIGATOR_CONTROL,
193 "ConvertToFileControl",
199 "ConvertToImageControl",
200 "ConvertToFormatted",
201 "ConvertToScrollBar",
202 "ConvertToSpinButton",
203 "ConvertToNavigationBar"
210 RID_SVXBMP_FIXEDTEXT,
213 RID_SVXBMP_RADIOBUTTON,
216 RID_SVXBMP_IMAGEBUTTON,
217 RID_SVXBMP_FILECONTROL,
218 RID_SVXBMP_DATEFIELD,
219 RID_SVXBMP_TIMEFIELD,
220 RID_SVXBMP_NUMERICFIELD,
221 RID_SVXBMP_CURRENCYFIELD,
222 RID_SVXBMP_PATTERNFIELD,
223 RID_SVXBMP_IMAGECONTROL,
224 RID_SVXBMP_FORMATTEDFIELD,
225 RID_SVXBMP_SCROLLBAR,
226 RID_SVXBMP_SPINBUTTON,
227 RID_SVXBMP_NAVIGATIONBAR
263using namespace ::com::sun::star::form::binding;
270using namespace ::
svx;
281 _rInterfaces.
clear();
284 for (
size_t i = 0;
i < nMarkCount; ++
i)
288 std::unique_ptr<SdrObjListIter> pGroupIterator;
292 pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() :
nullptr;
297 FmFormObj* pAsFormObject = FmFormObj::GetFormObject( pCurrent );
301 Reference< XInterface > xControlModel( pAsFormObject->GetUnoControlModel(), UNO_QUERY );
303 if ( xControlModel.is() )
304 _rInterfaces.
insert( xControlModel );
308 pCurrent = pGroupIterator && pGroupIterator->IsMore() ? pGroupIterator->Next() :
nullptr;
314 sal_Int32 GridView2ModelPos(
const Reference< XIndexAccess>& rColumns, sal_Int16 nViewPos)
322 Reference< XPropertySet> xCur;
323 for (i=0;
i<rColumns->getCount(); ++
i)
325 rColumns->getByIndex(i) >>= xCur;
326 if (!::comphelper::getBOOL(xCur->getPropertyValue(
FM_PROP_HIDDEN)))
336 if (i<rColumns->getCount())
340 catch(
const Exception&)
348 void TransferEventScripts(
const Reference< XControlModel>& xModel,
const Reference< XControl>& xControl,
349 const Sequence< ScriptEventDescriptor>& rTransferIfAvailable)
352 Reference< XChild> xModelChild(xModel, UNO_QUERY);
353 if (!xModelChild.is())
356 Reference< XEventAttacherManager> xEventManager(xModelChild->getParent(), UNO_QUERY);
357 if (!xEventManager.is())
360 if (!rTransferIfAvailable.hasElements())
364 Reference< XIndexAccess> xParentIndex(xModelChild->getParent(), UNO_QUERY);
365 if (!xParentIndex.is())
368 if (nIndex<0 || nIndex>=xParentIndex->getCount())
372 Sequence< Type> aModelListeners;
373 Sequence< Type> aControlListeners;
375 Reference< XIntrospection>
xIntrospection = theIntrospection::get(::comphelper::getProcessComponentContext());
380 aModelListeners =
xIntrospection->inspect(aModel)->getSupportedListeners();
385 Any aControl(xControl);
386 aControlListeners =
xIntrospection->inspect(aControl)->getSupportedListeners();
389 sal_Int32 nMaxNewLen = aModelListeners.getLength() + aControlListeners.getLength();
393 Sequence< ScriptEventDescriptor> aTransferable(nMaxNewLen);
394 ScriptEventDescriptor* pTransferable = aTransferable.getArray();
396 for (
const ScriptEventDescriptor& rCurrent : rTransferIfAvailable)
399 for (
const Sequence< Type>* pCurrentArray : { &aModelListeners, &aControlListeners })
401 for (
const Type& rCurrentListener : *pCurrentArray)
403 OUString aListener = rCurrentListener.getTypeName();
404 if (!aListener.isEmpty())
405 aListener = aListener.copy(aListener.lastIndexOf(
'.')+1);
407 if (aListener == rCurrent.ListenerType)
412 Sequence< OUString> aMethodsNames = ::comphelper::getEventMethodsForType(rCurrentListener);
417 *pTransferable = rCurrent;
425 sal_Int32 nRealNewLen = pTransferable - aTransferable.getArray();
426 aTransferable.realloc(nRealNewLen);
428 xEventManager->registerScriptEvents(nIndex, aTransferable);
432 OUString getServiceNameByControlType(
SdrObjKind nType)
469 OUString* _pCurrentText )
471 if ( !_rxControl.is() )
474 Reference< XTextComponent > xAsText( _rxControl, UNO_QUERY );
478 *_pCurrentText = xAsText->getText();
482 Reference< XListBox > xListBox( _rxControl, UNO_QUERY );
486 *_pCurrentText = xListBox->getSelectedItem();
490 Reference< XCheckBox > xCheckBox( _rxControl, UNO_QUERY );
491 if ( xCheckBox.is() )
495 switch (
static_cast<::
TriState>(xCheckBox->getState()) )
499 default: _pCurrentText->clear();
break;
515 return Reference< XControlModel>(_rContainer, UNO_QUERY).is();
525 if (Reference< XForm>(_rElement, UNO_QUERY).is() || Reference< XGrid>(_rElement, UNO_QUERY).is())
529 Reference< XPropertySet> xSet(_rElement, UNO_QUERY);
535 if (aVal.getValueTypeClass() != TypeClass_INTERFACE)
539 return aVal.hasValue();
547 bool bControlList = nMarkCount != 0;
549 bool bHadAnyLeafs =
false;
551 for (
size_t i = 0;
i < nMarkCount && bControlList; ++
i)
568 while (aIter.
IsMore() && bControlList)
582 return bControlList && bHadAnyLeafs;
586static Reference< XForm >
GetForm(
const Reference< XInterface>& _rxElement)
588 Reference< XForm > xForm( _rxElement, UNO_QUERY );
592 Reference< XChild > xChild( _rxElement, UNO_QUERY );
594 return GetForm( xChild->getParent() );
596 return Reference< XForm >();
607 ,m_aMarkTimer(
"svx::FmXFormShell m_aMarkTimer")
608 ,m_eNavigate( NavigationBarMode_NONE )
609 ,m_nInvalidationEvent( nullptr )
610 ,m_nActivationEvent( nullptr )
612 ,m_pTextShell( new
svx::FmTextControlShell( _pViewFrame ) )
613 ,m_aActiveControllerFeatures( this )
614 ,m_aNavControllerFeatures( this )
616 ,m_nLockSlotInvalidation( 0 )
617 ,m_bHadPropertyBrowserInDesignMode( false )
618 ,m_bTrackProperties( true )
619 ,m_bUseWizards( true )
620 ,m_bDatabaseBar( false )
621 ,m_bInActivate( false )
622 ,m_bSetFocus( false )
623 ,m_bFilterMode( false )
624 ,m_bChangingDesignMode( false )
625 ,m_bPreparedClose( false )
626 ,m_bFirstActivation( true )
628 m_aMarkTimer.SetTimeout(100);
629 m_aMarkTimer.SetInvokeHandler(
LINK(
this, FmXFormShell, OnTimeOut_Lock));
634 osl_atomic_increment(&m_refCount);
637 osl_atomic_decrement(&m_refCount);
640 implAdjustConfigCache_Lock();
642 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
643 EnableNotification(aNames);
647FmXFormShell::~FmXFormShell()
652Reference< css::frame::XModel > FmXFormShell::getContextDocument_Lock()
const
654 Reference< css::frame::XModel >
xModel;
660 if ( m_xAttachedFrame.is() )
665 catch(
const Exception& )
673bool FmXFormShell::isEnhancedForm_Lock()
const
679bool FmXFormShell::impl_checkDisposed_Lock()
const
684 OSL_FAIL(
"FmXFormShell::impl_checkDisposed: already disposed!" );
694 return m_eDocumentType;
697 Reference<css::frame::XModel>
xModel = getContextDocument_Lock();
699 m_eDocumentType = DocumentClassification::classifyDocument( xModel );
702 OSL_FAIL(
"FmXFormShell::getDocumentType: can't determine the document type!" );
707 return m_eDocumentType;
711bool FmXFormShell::IsReadonlyDoc_Lock()
const
713 if (impl_checkDisposed_Lock())
724void SAL_CALL FmXFormShell::disposing(
const lang::EventObject& e)
728 if (m_xActiveController == e.Source)
731 stopListening_Lock();
732 m_xActiveForm =
nullptr;
733 m_xActiveController =
nullptr;
734 m_xNavigationController =
nullptr;
736 m_aActiveControllerFeatures.dispose();
737 m_aNavControllerFeatures.dispose();
740 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().InvalidateShell(*m_pShell);
743 if (e.Source != m_xExternalViewController)
746 Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY );
747 OSL_ENSURE( xFormController.is(),
"FmXFormShell::disposing: invalid external view controller!" );
748 if (xFormController.is())
749 xFormController->removeActivateListener(
static_cast<XFormControllerListener*
>(
this));
751 if (m_xExternalViewController.is())
752 m_xExternalViewController->removeEventListener(
static_cast<XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
754 m_xExternalViewController =
nullptr;
755 m_xExternalDisplayedForm =
nullptr;
756 m_xExtViewTriggerController =
nullptr;
758 InvalidateSlot_Lock( SID_FM_VIEW_AS_GRID,
false );
762void SAL_CALL FmXFormShell::propertyChange(
const PropertyChangeEvent& evt)
766 if (impl_checkDisposed_Lock())
782 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_RECORD_TOTAL,
true);
783 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Update(SID_FM_RECORD_TOTAL);
789 LockSlotInvalidation_Lock(
true);
790 InvalidateSlot_Lock(SID_FM_RECORD_TOTAL,
false);
791 LockSlotInvalidation_Lock(
false);
796 LockSlotInvalidation_Lock(
true);
797 InvalidateSlot_Lock(0,
false);
798 LockSlotInvalidation_Lock(
false);
802void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatures )
806 if (impl_checkDisposed_Lock())
809 OSL_ENSURE( !_rFeatures.empty(),
"FmXFormShell::invalidateFeatures: invalid arguments!" );
811 if ( !(
m_pShell->GetViewShell() &&
m_pShell->GetViewShell()->GetViewFrame()) )
815 ::std::vector< sal_uInt16 > aSlotIds( _rFeatures.begin(), _rFeatures.end() );
818 aSlotIds.push_back( 0 );
821 ::std::sort( aSlotIds.begin(), aSlotIds.end() - 1 );
823 sal_uInt16 *pSlotIds = aSlotIds.data();
824 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate( pSlotIds );
828void SAL_CALL FmXFormShell::formActivated(
const lang::EventObject& rEvent)
832 if (impl_checkDisposed_Lock())
835 Reference< runtime::XFormController >
xController( rEvent.Source, UNO_QUERY_THROW );
836 m_pTextShell->formActivated( xController );
837 setActiveController_Lock(xController);
841void SAL_CALL FmXFormShell::formDeactivated(
const lang::EventObject& rEvent)
845 if (impl_checkDisposed_Lock())
848 Reference< runtime::XFormController >
xController( rEvent.Source, UNO_QUERY_THROW );
849 m_pTextShell->formDeactivated( xController );
853void FmXFormShell::disposing()
857 FmXFormShell_BASE::disposing();
859 if ( m_pShell && !
m_pShell->IsDesignMode() )
860 setActiveController_Lock(
nullptr,
true);
866 m_pTextShell->dispose();
868 m_xAttachedFrame =
nullptr;
870 CloseExternalFormViewer_Lock();
872 while ( !m_aLoadingPages.empty() )
875 m_aLoadingPages.pop();
879 if (m_nInvalidationEvent)
882 m_nInvalidationEvent =
nullptr;
884 if ( m_nActivationEvent )
887 m_nActivationEvent =
nullptr;
892 DBG_ASSERT(!m_nInvalidationEvent,
"FmXFormShell::~FmXFormShell : still have an invalidation event !");
898 DisableNotification();
900 RemoveElement_Lock(m_xForms);
903 impl_switchActiveControllerListening_Lock(
false);
904 m_xActiveController =
nullptr;
905 m_xActiveForm =
nullptr;
908 m_xNavigationController =
nullptr;
909 m_xCurrentForm =
nullptr;
910 m_xLastGridFound =
nullptr;
911 m_xAttachedFrame =
nullptr;
912 m_xExternalViewController =
nullptr;
913 m_xExtViewTriggerController =
nullptr;
914 m_xExternalDisplayedForm =
nullptr;
918 m_aActiveControllerFeatures.dispose();
919 m_aNavControllerFeatures.dispose();
923void FmXFormShell::UpdateSlot_Lock(sal_Int16 _nId)
925 if (impl_checkDisposed_Lock())
928 if ( m_nLockSlotInvalidation )
930 OSL_FAIL(
"FmXFormShell::UpdateSlot: cannot update if invalidation is currently locked!" );
931 InvalidateSlot_Lock(_nId,
false);
935 OSL_ENSURE( _nId,
"FmXFormShell::UpdateSlot: can't update the complete shell!" );
936 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate( _nId,
true,
true );
937 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);
960void FmXFormShell::LockSlotInvalidation_Lock(
bool bLock)
962 if (impl_checkDisposed_Lock())
965 DBG_ASSERT(bLock || m_nLockSlotInvalidation>0,
"FmXFormShell::LockSlotInvalidation : invalid call !");
968 ++m_nLockSlotInvalidation;
969 else if (!--m_nLockSlotInvalidation)
972 if (!m_nInvalidationEvent)
980 if (impl_checkDisposed_Lock())
983 m_nInvalidationEvent =
nullptr;
985 for (
const auto& rInvalidSlot : m_arrInvalidSlots)
988 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(rInvalidSlot.id,
true, (rInvalidSlot.flags & 0x01));
990 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().InvalidateShell(*
m_pShell);
992 m_arrInvalidSlots.clear();
996void FmXFormShell::ForceUpdateSelection_Lock()
998 if (impl_checkDisposed_Lock())
1001 if (IsSelectionUpdatePending_Lock())
1003 m_aMarkTimer.Stop();
1006 LockSlotInvalidation_Lock(
true);
1008 SetSelection_Lock(
m_pShell->GetFormView()->GetMarkedObjectList());
1010 LockSlotInvalidation_Lock(
false);
1014void FmXFormShell::GetConversionMenu_Lock(
weld::Menu& rNewMenu)
1023OString FmXFormShell::SlotToIdent(sal_uInt16 nSlot)
1036bool FmXFormShell::isControlConversionSlot(std::string_view rIdent)
1039 if (rIdent == rConvertSlot)
1044void FmXFormShell::executeControlConversionSlot_Lock(std::string_view rIdent)
1046 OSL_PRECOND( canConvertCurrentSelectionToControl_Lock(rIdent),
"FmXFormShell::executeControlConversionSlot: illegal call!" );
1048 if ( aSelectedElement == m_aCurrentSelection.end() )
1051 executeControlConversionSlot_Lock(Reference<XFormComponent>(*aSelectedElement, UNO_QUERY), rIdent);
1054bool FmXFormShell::executeControlConversionSlot_Lock(
const Reference<XFormComponent>& _rxObject, std::string_view rIdent)
1056 if (impl_checkDisposed_Lock())
1059 OSL_ENSURE( _rxObject.is(),
"FmXFormShell::executeControlConversionSlot: invalid object!" );
1060 if ( !_rxObject.is() )
1065 OSL_ENSURE( pFormPage,
"FmXFormShell::executeControlConversionSlot: no current (form) page!" );
1069 OSL_ENSURE( isSolelySelected_Lock(_rxObject),
1070 "FmXFormShell::executeControlConversionSlot: hmm ... shouldn't this parameter be redundant?" );
1076 Reference< XInterface > xNormalizedObject( _rxObject, UNO_QUERY );
1078 FmFormObj* pFormObject =
nullptr;
1080 while ( aPageIter.IsMore() )
1083 pFormObject = FmFormObj::GetFormObject( pCurrent );
1087 Reference< XInterface > xCurrentNormalized( pFormObject->GetUnoControlModel(), UNO_QUERY );
1088 if ( xCurrentNormalized.get() == xNormalizedObject.get() )
1091 pFormObject =
nullptr;
1097 OUString sNewName( getServiceNameByControlType(
nObjectTypes[ lookupSlot ] ) );
1099 Reference< XControlModel> xNewModel( xContext->getServiceManager()->createInstanceWithContext(sNewName, xContext), UNO_QUERY );
1100 if (!xNewModel.is())
1103 Reference< XControlModel> xOldModel( pFormObject->GetUnoControlModel() );
1106 Reference< XPropertySet> xOldSet(xOldModel, UNO_QUERY);
1107 Reference< XPropertySet> xNewSet(xNewModel, UNO_QUERY);
1113 Sequence< css::script::ScriptEventDescriptor> aOldScripts;
1114 Reference< XChild> xChild(xOldModel, UNO_QUERY);
1117 Reference< XIndexAccess> xParent(xChild->getParent(), UNO_QUERY);
1120 Reference< css::script::XEventAttacherManager> xEvManager(xChild->getParent(), UNO_QUERY);
1121 if (xParent.is() && xEvManager.is())
1124 if (nIndex>=0 && nIndex<xParent->getCount())
1125 aOldScripts = xEvManager->getScriptEvents(nIndex);
1129 Reference< XIndexContainer> xIndexParent(xChild->getParent(), UNO_QUERY);
1130 if (xIndexParent.is())
1133 Reference< XFormComponent> xComponent(xNewModel, UNO_QUERY);
1134 DBG_ASSERT(xComponent.is(),
"FmXFormShell::executeControlConversionSlot: the new model is no form component !");
1135 Any aNewModel(xComponent);
1140 if (nIndex>=0 && nIndex<xParent->getCount())
1141 xIndexParent->replaceByIndex(nIndex, aNewModel);
1144 OSL_FAIL(
"FmXFormShell::executeControlConversionSlot: could not replace the model !");
1145 Reference< css::lang::XComponent> xNewComponent(xNewModel, UNO_QUERY);
1146 if (xNewComponent.is())
1147 xNewComponent->dispose();
1153 OSL_FAIL(
"FmXFormShell::executeControlConversionSlot: could not replace the model !");
1154 Reference< css::lang::XComponent> xNewComponent(xNewModel, UNO_QUERY);
1155 if (xNewComponent.is())
1156 xNewComponent->dispose();
1178 pFormObject->SetChanged();
1179 pFormObject->SetUnoControlModel(xNewModel);
1183 if (aOldScripts.hasElements())
1186 Reference<XControlContainer> xControlContainer(getControlContainerForView_Lock());
1188 const Sequence< Reference< XControl> > aControls( xControlContainer->getControls() );
1190 Reference< XControl> xControl;
1191 auto pControl = std::find_if(aControls.begin(), aControls.end(),
1192 [&xNewModel](
const Reference< XControl>& rControl) { return rControl->getModel() == xNewModel; });
1193 if (pControl != aControls.end())
1194 xControl = *pControl;
1195 TransferEventScripts(xNewModel, xControl, aOldScripts);
1200 Reference< XBindableValue > xOldBindable( xOldModel, UNO_QUERY );
1201 Reference< XBindableValue > xNewBindable( xNewModel, UNO_QUERY );
1202 if ( xOldBindable.is() )
1206 if ( xNewBindable.is() )
1207 xNewBindable->setValueBinding( xOldBindable->getValueBinding() );
1208 xOldBindable->setValueBinding(
nullptr );
1210 catch(
const Exception&)
1218 Reference< XListEntrySink > xOldSink( xOldModel, UNO_QUERY );
1219 Reference< XListEntrySink > xNewSink( xNewModel, UNO_QUERY );
1220 if ( xOldSink.is() )
1224 if ( xNewSink.is() )
1225 xNewSink->setListEntrySource( xOldSink->getListEntrySource() );
1226 xOldSink->setListEntrySource(
nullptr );
1228 catch(
const Exception&)
1237 DBG_ASSERT(pModel !=
nullptr,
"FmXFormShell::executeControlConversionSlot: my shell has no model !");
1240 pModel->
AddUndo(std::make_unique<FmUndoModelReplaceAction>(*pModel, pFormObject, xOldModel));
1253bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(std::string_view rIdent)
1255 if ( m_aCurrentSelection.empty() )
1259 Reference< lang::XServiceInfo > xElementInfo( *aCheck, UNO_QUERY );
1260 if ( !xElementInfo.is() )
1264 if ( ++aCheck != m_aCurrentSelection.end() )
1268 if ( Reference< XForm >::query( xElementInfo ).is() )
1281 "FmXFormShell::canConvertCurrentSelectionToControl: aConvertSlots & nObjectTypes must have the same size !");
1290void FmXFormShell::checkControlConversionSlotsForCurrentSelection_Lock(
weld::Menu& rMenu)
1292 for (
int i = 0, nCount = rMenu.
n_children(); i < nCount; ++i)
1296 rMenu.
set_sensitive(sIdent, canConvertCurrentSelectionToControl_Lock(sIdent));
1302 if (impl_checkDisposed_Lock())
1305 Reference< XIndexContainer> xControlModels(m_xActiveForm, UNO_QUERY);
1306 if (!xControlModels.is())
1309 for (sal_Int32 i=0;
i<xControlModels->getCount(); ++
i)
1311 Reference< XPropertySet> xModelSet;
1312 xControlModels->getByIndex(i) >>= xModelSet;
1313 if (!xModelSet.is())
1318 sal_Int16 nClassId = ::comphelper::getINT16(xModelSet->getPropertyValue(
FM_PROP_CLASSID));
1319 if (FormComponentType::GRIDCONTROL != nClassId)
1349 Reference< XPropertyState> xModelPropState(xModelSet, UNO_QUERY);
1350 if (xModelPropState.is())
1359Reference< XControlContainer > FmXFormShell::getControlContainerForView_Lock()
const
1361 if (impl_checkDisposed_Lock())
1365 if ( m_pShell &&
m_pShell->GetFormView() )
1366 pPageView =
m_pShell->GetFormView()->GetSdrPageView();
1368 Reference< XControlContainer> xControlContainer;
1372 return xControlContainer;
1376void FmXFormShell::ExecuteTabOrderDialog_Lock(
const Reference<XTabControllerModel>& _rxForForm)
1378 if (impl_checkDisposed_Lock())
1381 OSL_PRECOND( _rxForForm.is(),
"FmXFormShell::ExecuteTabOrderDialog: invalid tabbing model!" );
1382 if ( !_rxForForm.is() )
1387 Reference< XWindow > xParentWindow;
1388 if (
m_pShell->GetViewShell() &&
m_pShell->GetViewShell()->GetViewFrame() )
1391 Reference< dialogs::XExecutableDialog > xDialog = form::TabOrderDialog::createWithModel(
1393 _rxForForm, getControlContainerForView_Lock(), xParentWindow
1398 catch(
const Exception& )
1405void FmXFormShell::ExecuteSearch_Lock()
1407 if (impl_checkDisposed_Lock())
1412 ::std::vector< OUString > aContextNames;
1413 impl_collectFormSearchContexts_nothrow_Lock(
1414 m_pShell->GetCurPage()->GetForms(), u
"",
1415 m_aSearchForms, aContextNames);
1417 if ( m_aSearchForms.size() != aContextNames.size() )
1419 SAL_WARN (
"svx.form",
"FmXFormShell::ExecuteSearch: nonsense!" );
1426 ::std::vector< OUString > aValidContexts;
1427 FmFormArray::const_iterator form = m_aSearchForms.begin();
1428 ::std::vector< OUString >::const_iterator contextName = aContextNames.begin();
1429 for ( ; form != m_aSearchForms.end(); ++form, ++contextName )
1432 aTestContext.
nContext =
static_cast< sal_Int16
>( form - m_aSearchForms.begin() );
1433 sal_uInt32 nValidControls = OnSearchContextRequest_Lock(aTestContext);
1434 if ( nValidControls > 0 )
1436 aValidForms.push_back( *form );
1437 aValidContexts.push_back( *contextName );
1441 m_aSearchForms.swap( aValidForms );
1442 aContextNames.swap( aValidContexts );
1445 if (m_aSearchForms.empty() )
1449 VclMessageType::Warning, VclButtonsType::Ok,
1450 SvxResId(RID_STR_NODATACONTROLS)));
1456 sal_Int16 nInitialContext = 0;
1457 Reference<XForm> xActiveForm(getActiveForm_Lock());
1458 for (
size_t i=0;
i<m_aSearchForms.size(); ++
i )
1460 if (m_aSearchForms.at(i) == xActiveForm)
1462 nInitialContext =
static_cast<sal_Int16
>(
i);
1470 OUString strActiveField;
1471 OUString strInitialText;
1473 DBG_ASSERT(m_xActiveController.is(),
"FmXFormShell::ExecuteSearch : no active controller !");
1474 Reference< XControl> xActiveControl( m_xActiveController->getCurrentControl());
1475 if (xActiveControl.is())
1478 Reference< XControlModel> xActiveModel( xActiveControl->getModel());
1479 DBG_ASSERT(xActiveModel.is(),
"FmXFormShell::ExecuteSearch : active control has no model !");
1482 Reference< XPropertySet> xProperties(xActiveControl->getModel(), UNO_QUERY);
1485 Reference< XPropertySet> xField;
1490 Reference< XTextComponent> xText(xActiveControl, UNO_QUERY);
1494 strInitialText = xText->getText();
1501 Reference< XGrid> xGrid(xActiveControl, UNO_QUERY);
1506 Reference< XGridPeer> xGridPeer(xActiveControl->getPeer(), UNO_QUERY);
1507 Reference< XIndexAccess> xColumns;
1509 xColumns = xGridPeer->getColumns();
1511 sal_Int16 nViewCol = xGrid->getCurrentColumnPosition();
1512 sal_Int32 nModelCol = GridView2ModelPos(xColumns, nViewCol);
1513 Reference< XPropertySet> xCurrentCol;
1515 xColumns->getByIndex(nModelCol) >>= xCurrentCol;
1516 if (xCurrentCol.is())
1517 strActiveField = ::comphelper::getString(xCurrentCol->getPropertyValue(
FM_PROP_LABEL));
1520 Reference< XIndexAccess> xColControls(xGridPeer, UNO_QUERY);
1521 Reference< XInterface> xCurControl;
1522 xColControls->getByIndex(nViewCol) >>= xCurControl;
1523 OUString sInitialText;
1525 strInitialText = sInitialText;
1542 m_pShell->GetViewShell()->GetViewFrame()->GetFrameWeld(),
1543 strInitialText, aContextNames, nInitialContext,
1544 LINK(
this, FmXFormShell, OnSearchContextRequest_Lock) ));
1545 pDialog->SetActiveField( strActiveField );
1546 pDialog->SetFoundHandler(
LINK(
this, FmXFormShell, OnFoundData_Lock));
1547 pDialog->SetCanceledNotFoundHdl(
LINK(
this, FmXFormShell, OnCanceledNotFound_Lock));
1549 pDialog.disposeAndClear();
1554 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
1559bool FmXFormShell::GetY2KState_Lock(sal_uInt16& n)
1561 if (impl_checkDisposed_Lock())
1568 Reference<XForm> xForm(getActiveForm_Lock());
1573 Reference< XRowSet> xDB(xForm, UNO_QUERY);
1574 DBG_ASSERT(xDB.is(),
"FmXFormShell::GetY2KState : current form has no dbform-interface !");
1579 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1584 Any aVal( xSet->getPropertyValue(
"TwoDigitDateStart") );
1598void FmXFormShell::SetY2KState_Lock(sal_uInt16 n)
1600 if (impl_checkDisposed_Lock())
1603 Reference<XForm> xActiveForm(getActiveForm_Lock());
1604 Reference< XRowSet > xActiveRowSet( xActiveForm, UNO_QUERY );
1605 if ( xActiveRowSet.is() )
1610 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1615 xSet->setPropertyValue(
"TwoDigitDateStart",
Any(sal_uInt16(n)));
1628 Reference< XIndexAccess> xCurrentForms( m_xForms);
1629 if (!xCurrentForms.is())
1632 xCurrentForms =
m_pShell->GetCurPage()->GetForms(
false );
1634 if (!xCurrentForms.is())
1638 Reference< XInterface> xCurrentElement( aIter.Next());
1639 while (xCurrentElement.is())
1642 Reference< XRowSet> xElementAsRowSet( xCurrentElement, UNO_QUERY );
1643 if ( xElementAsRowSet.is() )
1646 if (!xSupplier.is())
1649 Reference< XPropertySet> xSet(xSupplier->getNumberFormatSettings());
1654 xSet->setPropertyValue(
"TwoDigitDateStart",
Any(sal_uInt16(n)));
1663 xCurrentElement = aIter.Next();
1668void FmXFormShell::CloseExternalFormViewer_Lock()
1670 if (impl_checkDisposed_Lock())
1673 if (!m_xExternalViewController.is())
1676 Reference< css::frame::XFrame> xExternalViewFrame( m_xExternalViewController->getFrame());
1677 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
1678 if (!xCommLink.is())
1681 xExternalViewFrame->setComponent(
nullptr,
nullptr);
1682 ::comphelper::disposeComponent(xExternalViewFrame);
1683 m_xExternalViewController =
nullptr;
1684 m_xExtViewTriggerController =
nullptr;
1685 m_xExternalDisplayedForm =
nullptr;
1689Reference<XResultSet> FmXFormShell::getInternalForm_Lock(
const Reference<XResultSet>& _xForm)
const
1691 if (impl_checkDisposed_Lock())
1694 Reference< runtime::XFormController> xExternalCtrlr(m_xExternalViewController, UNO_QUERY);
1695 if (xExternalCtrlr.is() && (_xForm == xExternalCtrlr->getModel()))
1697 DBG_ASSERT(m_xExternalDisplayedForm.is(),
"FmXFormShell::getInternalForm : invalid external form !");
1698 return m_xExternalDisplayedForm;
1704Reference<XForm> FmXFormShell::getInternalForm_Lock(
const Reference<XForm>& _xForm)
const
1706 if (impl_checkDisposed_Lock())
1709 Reference< runtime::XFormController > xExternalCtrlr(m_xExternalViewController, UNO_QUERY);
1710 if (xExternalCtrlr.is() && (_xForm == xExternalCtrlr->getModel()))
1712 DBG_ASSERT(m_xExternalDisplayedForm.is(),
"FmXFormShell::getInternalForm : invalid external form !");
1713 return Reference< XForm>(m_xExternalDisplayedForm, UNO_QUERY);
1721 bool lcl_isNavigationRelevant( sal_Int32 _nWhich )
1723 return ( _nWhich == SID_FM_RECORD_FIRST )
1724 || ( _nWhich == SID_FM_RECORD_PREV )
1725 || ( _nWhich == SID_FM_RECORD_NEXT )
1726 || ( _nWhich == SID_FM_RECORD_LAST )
1727 || ( _nWhich == SID_FM_RECORD_NEW );
1732bool FmXFormShell::IsFormSlotEnabled( sal_Int32 _nSlot, FeatureState* _pCompleteState )
const
1735 lcl_isNavigationRelevant( _nSlot )
1736 ? getNavControllerFeatures_Lock()
1737 : getActiveControllerFeatures_Lock();
1739 if ( !_pCompleteState )
1740 return rController->
isEnabled( _nSlot );
1742 rController->
getState( _nSlot, *_pCompleteState );
1743 return _pCompleteState->Enabled;
1747void FmXFormShell::ExecuteFormSlot_Lock( sal_Int32 _nSlot )
1750 lcl_isNavigationRelevant( _nSlot )
1751 ? getNavControllerFeatures_Lock()
1752 : getActiveControllerFeatures_Lock();
1754 rController->
execute( _nSlot );
1756 if ( _nSlot != SID_FM_RECORD_UNDO )
1761 if (getInternalForm_Lock(getActiveForm_Lock()) != m_xExternalDisplayedForm)
1764 Reference< XIndexAccess > xContainer( m_xExternalDisplayedForm, UNO_QUERY );
1765 if ( !xContainer.is() )
1768 Reference< XReset > xReset;
1769 for ( sal_Int32 i = 0;
i < xContainer->getCount(); ++
i )
1771 if ( ( xContainer->getByIndex( i ) >>= xReset ) && xReset.is() )
1774 Reference< XForm > xAsForm( xReset, UNO_QUERY );
1775 if ( !xAsForm.is() )
1782void FmXFormShell::impl_switchActiveControllerListening_Lock(
const bool _bListen)
1784 if ( !m_xActiveController.is() )
1788 m_xActiveController->addEventListener(
static_cast<XFormControllerListener*
>(
this) );
1790 m_xActiveController->removeEventListener(
static_cast<XFormControllerListener*
>(
this) );
1794void FmXFormShell::setActiveController_Lock(
const Reference<runtime::XFormController>& xController,
bool _bNoSaveOldContent)
1796 if (impl_checkDisposed_Lock())
1799 if (m_bChangingDesignMode)
1811 if (xController == m_xActiveController)
1815 Reference< XResultSet> xNavigationForm;
1816 if (m_xNavigationController.is())
1817 xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY);
1819 m_bInActivate =
true;
1822 Reference< XResultSet> xOldForm;
1823 if (m_xActiveController.is())
1824 xOldForm.set(m_xActiveController->getModel(), UNO_QUERY);
1825 Reference< XResultSet> xNewForm;
1827 xNewForm = Reference< XResultSet>(
xController->getModel(), UNO_QUERY);
1828 xOldForm = getInternalForm_Lock(xOldForm);
1829 xNewForm = getInternalForm_Lock(xNewForm);
1831 bool bDifferentForm = ( xOldForm.get() != xNewForm.get() );
1832 bool bNeedSave = bDifferentForm && !_bNoSaveOldContent;
1835 if ( m_xActiveController.is() && bNeedSave )
1838 if ( m_aActiveControllerFeatures->commitCurrentControl() )
1841 if ( m_aActiveControllerFeatures->isModifiedRow() )
1843 bool bIsNew = m_aActiveControllerFeatures->isInsertionRow();
1844 bool bResult = m_aActiveControllerFeatures->commitCurrentRecord();
1845 if ( !bResult && m_bSetFocus )
1849 Reference< XWindow > xWindow( m_xActiveController->getCurrentControl(), UNO_QUERY );
1851 xWindow->setFocus();
1852 m_bInActivate =
false;
1855 else if ( bResult && bIsNew )
1857 Reference< XResultSet > xCursor( m_aActiveControllerFeatures->getCursor() );
1867 stopListening_Lock();
1869 impl_switchActiveControllerListening_Lock(
false);
1871 m_aActiveControllerFeatures.dispose();
1873 if ( m_xActiveController.is() )
1874 m_aActiveControllerFeatures.assign( m_xActiveController );
1876 impl_switchActiveControllerListening_Lock(
true);
1878 if ( m_xActiveController.is() )
1879 m_xActiveForm = getInternalForm_Lock(Reference<XForm>(m_xActiveController->getModel(), UNO_QUERY));
1881 m_xActiveForm =
nullptr;
1883 startListening_Lock();
1886 xNavigationForm =
nullptr;
1887 if (m_xNavigationController.is())
1888 xNavigationForm.set(m_xNavigationController->getModel(), UNO_QUERY);
1890 m_bInActivate =
false;
1893 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().InvalidateShell(*m_pShell);
1895 InvalidateSlot_Lock(SID_FM_FILTER_NAVIGATOR_CONTROL,
true);
1899void FmXFormShell::getCurrentSelection_Lock(
InterfaceBag& _rSelection)
const
1901 _rSelection = m_aCurrentSelection;
1905bool FmXFormShell::setCurrentSelectionFromMark_Lock(
const SdrMarkList& _rMarkList)
1907 m_aLastKnownMarkedControls.
clear();
1910 collectInterfacesFromMarkList( _rMarkList, m_aLastKnownMarkedControls );
1916bool FmXFormShell::selectLastMarkedControls_Lock()
1922bool FmXFormShell::setCurrentSelection_Lock(
InterfaceBag&& _rSelection )
1924 if (impl_checkDisposed_Lock())
1927 DBG_ASSERT(
m_pShell->IsDesignMode(),
"FmXFormShell::setCurrentSelection: only to be used in design mode!" );
1929 if ( _rSelection.empty() && m_aCurrentSelection.empty() )
1933 if ( _rSelection.size() == m_aCurrentSelection.size() )
1937 for ( ; aNew != _rSelection.end(); ++aNew, ++aOld )
1939 OSL_ENSURE( Reference< XInterface >( *aNew, UNO_QUERY ).
get() == aNew->get(),
"FmXFormShell::setCurrentSelection: new interface not normalized!" );
1940 OSL_ENSURE( Reference< XInterface >( *aOld, UNO_QUERY ).
get() == aOld->get(),
"FmXFormShell::setCurrentSelection: old interface not normalized!" );
1942 if ( aNew->get() != aOld->get() )
1946 if ( aNew == _rSelection.end() )
1954 if ( !m_aCurrentSelection.empty() )
1956 Reference< XChild > xCur;
if ( m_aCurrentSelection.size() == 1 ) xCur.set(*m_aCurrentSelection.begin(), css::uno::UNO_QUERY);
1957 Reference< XChild > xNew;
if ( _rSelection.size() == 1 ) xNew.set(*_rSelection.begin(), css::uno::UNO_QUERY);
1961 if ( xCur.is() && ( !xNew.is() || ( xCur->getParent() != xNew->getParent() ) ) )
1963 Reference< XSelectionSupplier > xSel( xCur->getParent(), UNO_QUERY );
1965 xSel->select(
Any() );
1969 m_aCurrentSelection = _rSelection;
1972 Reference< XForm > xNewCurrentForm;
1973 for (
const auto& rpSelection : m_aCurrentSelection)
1975 Reference< XForm > xThisRoundsForm(
GetForm( rpSelection ) );
1976 OSL_ENSURE( xThisRoundsForm.is(),
"FmXFormShell::setCurrentSelection: *everything* should belong to a form!" );
1978 if ( !xNewCurrentForm.is() )
1980 xNewCurrentForm = xThisRoundsForm;
1982 else if ( xNewCurrentForm != xThisRoundsForm )
1984 xNewCurrentForm.clear();
1989 if ( !m_aCurrentSelection.empty() )
1990 impl_updateCurrentForm_Lock(xNewCurrentForm);
1994 InvalidateSlot_Lock(i,
false);
2000bool FmXFormShell::isSolelySelected_Lock(
const Reference<XInterface>& _rxObject)
2002 return ( m_aCurrentSelection.size() == 1 ) && ( *m_aCurrentSelection.begin() == _rxObject );
2006void FmXFormShell::forgetCurrentForm_Lock()
2008 if ( !m_xCurrentForm.is() )
2012 impl_updateCurrentForm_Lock(
nullptr);
2016 impl_defaultCurrentForm_nothrow_Lock();
2020void FmXFormShell::impl_updateCurrentForm_Lock(
const Reference<XForm>& _rxNewCurForm)
2022 if (impl_checkDisposed_Lock())
2025 m_xCurrentForm = _rxNewCurForm;
2034 InvalidateSlot_Lock(i,
false);
2038void FmXFormShell::startListening_Lock()
2040 if (impl_checkDisposed_Lock())
2043 Reference< XRowSet> xDatabaseForm(m_xActiveForm, UNO_QUERY);
2044 if (xDatabaseForm.is() &&
getConnection(xDatabaseForm).is())
2046 Reference< XPropertySet> xActiveFormSet(m_xActiveForm, UNO_QUERY);
2047 if (xActiveFormSet.is())
2053 OUString aSource = ::comphelper::getString(xActiveFormSet->getPropertyValue(
FM_PROP_COMMAND));
2054 if (!aSource.isEmpty())
2056 m_bDatabaseBar =
true;
2060 switch (m_eNavigate)
2062 case NavigationBarMode_PARENT:
2065 Reference< XChild> xChild = m_xActiveController;
2066 Reference< runtime::XFormController > xParent;
2069 xChild.set(xChild->getParent(), UNO_QUERY);
2070 xParent.set(xChild, UNO_QUERY);
2071 Reference< XPropertySet> xParentSet;
2073 xParentSet.set(xParent->getModel(), UNO_QUERY);
2074 if (xParentSet.is())
2077 if (m_eNavigate == NavigationBarMode_CURRENT)
2081 m_xNavigationController = xParent;
2085 case NavigationBarMode_CURRENT:
2086 m_xNavigationController = m_xActiveController;
2090 m_xNavigationController =
nullptr;
2091 m_bDatabaseBar =
false;
2094 m_aNavControllerFeatures.dispose();
2095 if ( m_xNavigationController.is() && ( m_xNavigationController != m_xActiveController ) )
2096 m_aNavControllerFeatures.assign( m_xNavigationController );
2099 Reference< XPropertySet> xNavigationSet;
2100 if (m_xNavigationController.is())
2102 xNavigationSet.set(m_xNavigationController->getModel(), UNO_QUERY);
2103 if (xNavigationSet.is())
2111 m_eNavigate = NavigationBarMode_NONE;
2112 m_bDatabaseBar =
false;
2113 m_xNavigationController =
nullptr;
2117void FmXFormShell::stopListening_Lock()
2119 if (impl_checkDisposed_Lock())
2122 Reference< XRowSet> xDatabaseForm(m_xActiveForm, UNO_QUERY);
2123 if ( xDatabaseForm.is() )
2125 if (m_xNavigationController.is())
2127 Reference< XPropertySet> xSet(m_xNavigationController->getModel(), UNO_QUERY);
2134 m_bDatabaseBar =
false;
2135 m_eNavigate = NavigationBarMode_NONE;
2136 m_xNavigationController =
nullptr;
2140void FmXFormShell::ShowSelectionProperties_Lock(
bool bShow)
2142 if (impl_checkDisposed_Lock())
2146 bool bHasChild =
m_pShell->GetViewShell()->GetViewFrame()->HasChildWindow( SID_FM_SHOW_PROPERTIES );
2147 if ( bHasChild && bShow )
2148 UpdateSlot_Lock(SID_FM_PROPERTY_CONTROL);
2152 m_pShell->GetViewShell()->GetViewFrame()->ToggleChildWindow(SID_FM_SHOW_PROPERTIES);
2154 InvalidateSlot_Lock(SID_FM_PROPERTIES,
false);
2155 InvalidateSlot_Lock(SID_FM_CTL_PROPERTIES,
false);
2161 if (impl_checkDisposed_Lock())
2165 "FmXFormShell::OnFoundData : invalid context!");
2166 Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
2167 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnFoundData : invalid form!");
2169 Reference< XRowLocate> xCursor(xForm, UNO_QUERY);
2176 xCursor->moveToBookmark(rfriWhere.aPosition);
2178 catch(
const SQLException&)
2180 OSL_FAIL(
"Can position on bookmark!");
2187 m_arrSearchedControls.size(),
2188 "svx.form",
"FmXFormShell::OnFoundData : invalid index!");
2191 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
2194 FmFormObj* pFormObject = FmFormObj::GetFormObject(
pObject );
2195 Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
2196 DBG_ASSERT( xControlModel.is(),
"FmXFormShell::OnFoundData: invalid control!" );
2197 if ( !xControlModel.is() )
2201 if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel))
2203 Reference< XPropertySet> xOldSet(m_xLastGridFound, UNO_QUERY);
2205 Reference< XPropertyState> xOldSetState(xOldSet, UNO_QUERY);
2206 if (xOldSetState.is())
2213 sal_Int32 nGridColumn = m_arrRelativeGridColumn[rfriWhere.nFieldPos];
2214 if (nGridColumn != -1)
2216 Reference<XControl> xControl(pFormObject ? impl_getControl_Lock(xControlModel, *pFormObject) : Reference<XControl>());
2217 Reference< XGrid> xGrid(xControl, UNO_QUERY);
2218 DBG_ASSERT(xGrid.is(),
"FmXFormShell::OnFoundData : invalid control!");
2222 Reference< XPropertySet> xModelSet(xControlModel, UNO_QUERY);
2223 DBG_ASSERT(xModelSet.is(),
"FmXFormShell::OnFoundData : invalid control model (no property set) !");
2226 m_xLastGridFound = xControlModel;
2229 xGrid->setCurrentColumnPosition(
static_cast<sal_Int16
>(nGridColumn));
2235 sal_uInt16
nPos = 0;
2244 if (impl_checkDisposed_Lock())
2248 "FmXFormShell::OnCanceledNotFound : invalid context!");
2249 Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
2250 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnCanceledNotFound : invalid form!");
2252 Reference< XRowLocate> xCursor(xForm, UNO_QUERY);
2259 xCursor->moveToBookmark(rfriWhere.aPosition);
2261 catch(
const SQLException&)
2263 OSL_FAIL(
"Can position on bookmark!");
2267 m_pShell->GetFormView()->UnMarkAll(
m_pShell->GetFormView()->GetSdrPageView());
2273 if (impl_checkDisposed_Lock())
2276 DBG_ASSERT(rfmscContextInfo.nContext <
static_cast<sal_Int16
>(m_aSearchForms.size()),
"FmXFormShell::OnSearchContextRequest : invalid parameter !");
2277 Reference< XForm> xForm( m_aSearchForms.at(rfmscContextInfo.nContext));
2278 DBG_ASSERT(xForm.is(),
"FmXFormShell::OnSearchContextRequest : unexpected : invalid context !");
2280 Reference< XResultSet> xIter(xForm, UNO_QUERY);
2281 DBG_ASSERT(xIter.is(),
"FmXFormShell::OnSearchContextRequest : unexpected : context has no iterator !");
2285 OUString strFieldList, sFieldDisplayNames;
2286 m_arrSearchedControls.clear();
2287 m_arrRelativeGridColumn.clear();
2302 Reference< XNameAccess> xValidFormFields;
2303 Reference< XColumnsSupplier> xSupplyCols(xIter, UNO_QUERY);
2304 DBG_ASSERT(xSupplyCols.is(),
"FmXFormShell::OnSearchContextRequest : invalid cursor : no columns supplier !");
2305 if (xSupplyCols.is())
2306 xValidFormFields = xSupplyCols->getColumns();
2307 DBG_ASSERT(xValidFormFields.is(),
"FmXFormShell::OnSearchContextRequest : form has no fields !");
2311 assert(pCurrentPage &&
"FmXFormShell::OnSearchContextRequest : no page !");
2313 OUString sControlSource,
aName;
2316 while ( aPageIter.
IsMore() )
2319 FmFormObj* pFormObject = FmFormObj::GetFormObject( pCurrent );
2326 Reference< XControlModel> xControlModel( pFormObject->GetUnoControlModel() );
2327 Reference< XFormComponent > xCurrentFormComponent( xControlModel, UNO_QUERY );
2328 DBG_ASSERT( xCurrentFormComponent.is(),
"FmXFormShell::OnSearchContextRequest: invalid objects!" );
2329 if ( !xCurrentFormComponent.is() )
2333 if ( xCurrentFormComponent->getParent() != xForm )
2338 Reference< XControl> xControl;
2343 Reference< XInterface > xSearchable( iter.
Next() );
2344 while ( xSearchable.is() )
2347 if ( sControlSource.isEmpty() )
2351 xControl = impl_getControl_Lock(xControlModel, *pFormObject);
2352 DBG_ASSERT(xControl.is(),
"FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
2354 Reference< XGridPeer> xGridPeer;
2355 if ( xControl.is() )
2356 xGridPeer.set( xControl->getPeer(), UNO_QUERY );
2359 if (!xGridPeer.is())
2362 Reference< XIndexAccess> xPeerContainer(xGridPeer, UNO_QUERY);
2363 if (!xPeerContainer.is())
2366 Reference< XIndexAccess> xModelColumns = xGridPeer->getColumns();
2367 DBG_ASSERT(xModelColumns.is(),
"FmXFormShell::OnSearchContextRequest : there is a grid control without columns !");
2369 DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(),
"FmXFormShell::OnSearchContextRequest : impossible : have more view than model columns !");
2371 Reference< XInterface> xCurrentColumn;
2372 for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos)
2374 xPeerContainer->getByIndex(nViewPos) >>= xCurrentColumn;
2375 if (!xCurrentColumn.is())
2382 sal_Int32 nModelPos = GridView2ModelPos(xModelColumns, nViewPos);
2383 Reference< XPropertySet> xCurrentColModel;
2384 xModelColumns->getByIndex(nModelPos) >>= xCurrentColModel;
2387 if (xValidFormFields->hasByName(
aName))
2389 strFieldList +=
aName +
";";
2391 sFieldDisplayNames +=
2392 ::comphelper::getString(xCurrentColModel->getPropertyValue(
FM_PROP_LABEL)) +
2395 rfmscContextInfo.arrFields.push_back(xCurrentColumn);
2398 m_arrSearchedControls.push_back(pCurrent);
2400 m_arrRelativeGridColumn.push_back(nViewPos);
2407 if (!sControlSource.isEmpty() && xValidFormFields->hasByName(sControlSource))
2412 xControl = impl_getControl_Lock(xControlModel, *pFormObject);
2413 DBG_ASSERT(xControl.is(),
"FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
2419 strFieldList += sControlSource +
";";
2422 sFieldDisplayNames +=
2423 getLabelName(Reference< XPropertySet>(xControlModel, UNO_QUERY)) +
2427 m_arrSearchedControls.push_back(pCurrent);
2430 m_arrRelativeGridColumn.push_back(-1);
2433 rfmscContextInfo.arrFields.emplace_back( xControl, UNO_QUERY );
2438 xSearchable = iter.
Next();
2445 if (rfmscContextInfo.arrFields.empty())
2447 rfmscContextInfo.arrFields.clear();
2448 rfmscContextInfo.xCursor =
nullptr;
2449 rfmscContextInfo.strUsedFields.clear();
2453 rfmscContextInfo.xCursor = xIter;
2454 rfmscContextInfo.strUsedFields = strFieldList;
2455 rfmscContextInfo.sFieldDisplayNames = sFieldDisplayNames;
2459 Reference< XPropertySet> xCursorSet(rfmscContextInfo.xCursor, UNO_QUERY);
2460 Reference< XResultSetUpdate> xUpdateCursor(rfmscContextInfo.xCursor, UNO_QUERY);
2461 if (xUpdateCursor.is() && xCursorSet.is())
2463 if (::comphelper::getBOOL(xCursorSet->getPropertyValue(
FM_PROP_ISNEW)))
2464 xUpdateCursor->moveToCurrentRow();
2466 xUpdateCursor->cancelRowUpdates();
2469 return rfmscContextInfo.arrFields.size();
2474void SAL_CALL FmXFormShell::elementInserted(
const ContainerEvent& evt)
2478 if (impl_checkDisposed_Lock())
2482 Reference< XInterface> xTemp;
2483 evt.Element >>= xTemp;
2484 AddElement_Lock(xTemp);
2490void SAL_CALL FmXFormShell::elementReplaced(
const ContainerEvent& evt)
2494 if (impl_checkDisposed_Lock() )
2497 Reference< XInterface> xTemp;
2498 evt.ReplacedElement >>= xTemp;
2499 RemoveElement_Lock(xTemp);
2500 evt.Element >>= xTemp;
2501 AddElement_Lock(xTemp);
2505void SAL_CALL FmXFormShell::elementRemoved(
const ContainerEvent& evt)
2509 if (impl_checkDisposed_Lock())
2512 Reference< XInterface> xTemp;
2513 evt.Element >>= xTemp;
2514 RemoveElement_Lock(xTemp);
2520void FmXFormShell::UpdateForms_Lock(
bool _bInvalidate)
2522 if (impl_checkDisposed_Lock())
2525 Reference< XIndexAccess > xForms;
2528 if ( pPage &&
m_pShell->m_bDesignMode )
2531 if ( m_xForms != xForms )
2533 RemoveElement_Lock( m_xForms );
2535 AddElement_Lock(m_xForms);
2539 m_pShell->DetermineForms( _bInvalidate );
2543void FmXFormShell::AddElement_Lock(
const Reference<XInterface>& _xElement)
2545 if (impl_checkDisposed_Lock())
2547 impl_AddElement_nothrow(_xElement);
2550void FmXFormShell::impl_AddElement_nothrow(
const Reference< XInterface>& Element)
2553 const Reference< XIndexContainer> xContainer(Element, UNO_QUERY);
2554 if (xContainer.is())
2556 const sal_uInt32
nCount = xContainer->getCount();
2557 Reference< XInterface> xElement;
2558 for (sal_uInt32 i = 0;
i <
nCount; ++
i)
2560 xElement.set(xContainer->getByIndex(i),UNO_QUERY);
2561 impl_AddElement_nothrow(xElement);
2564 const Reference< XContainer> xCont(Element, UNO_QUERY);
2566 xCont->addContainerListener(
this);
2569 const Reference< css::view::XSelectionSupplier> xSelSupplier(Element, UNO_QUERY);
2570 if (xSelSupplier.is())
2571 xSelSupplier->addSelectionChangeListener(
this);
2575void FmXFormShell::RemoveElement_Lock(
const Reference<XInterface>& Element)
2577 if (impl_checkDisposed_Lock())
2579 impl_RemoveElement_nothrow_Lock(Element);
2582void FmXFormShell::impl_RemoveElement_nothrow_Lock(
const Reference<XInterface>& Element)
2584 const Reference< css::view::XSelectionSupplier> xSelSupplier(Element, UNO_QUERY);
2585 if (xSelSupplier.is())
2586 xSelSupplier->removeSelectionChangeListener(
this);
2589 const Reference< XIndexContainer> xContainer(Element, UNO_QUERY);
2590 if (xContainer.is())
2592 const Reference< XContainer> xCont(Element, UNO_QUERY);
2594 xCont->removeContainerListener(
this);
2596 const sal_uInt32
nCount = xContainer->getCount();
2597 Reference< XInterface> xElement;
2598 for (sal_uInt32 i = 0;
i <
nCount;
i++)
2600 xElement.set(xContainer->getByIndex(i),UNO_QUERY);
2601 impl_RemoveElement_nothrow_Lock(xElement);
2605 auto wasSelectedPos = m_aCurrentSelection.find( Element );
2606 if ( wasSelectedPos != m_aCurrentSelection.end() )
2607 m_aCurrentSelection.erase( wasSelectedPos );
2611void SAL_CALL FmXFormShell::selectionChanged(
const lang::EventObject& rEvent)
2615 if (impl_checkDisposed_Lock())
2618 Reference< XSelectionSupplier > xSupplier( rEvent.Source, UNO_QUERY );
2619 Reference< XInterface > xSelObj( xSupplier->getSelection(), UNO_QUERY );
2621 if ( !xSelObj.is() )
2624 EnableTrackProperties_Lock(
false);
2626 bool bMarkChanged =
m_pShell->GetFormView()->checkUnMarkAll(rEvent.Source);
2629 aNewSelection.insert( Reference<XInterface>( xSelObj, UNO_QUERY ) );
2631 if (setCurrentSelection_Lock(std::move(aNewSelection)) && IsPropBrwOpen_Lock())
2632 ShowSelectionProperties_Lock(
true);
2634 EnableTrackProperties_Lock(
true);
2643 if (impl_checkDisposed_Lock())
2647 SetSelection_Lock(
m_pShell->GetFormView()->GetMarkedObjectList());
2651void FmXFormShell::SetSelectionDelayed_Lock()
2653 if (impl_checkDisposed_Lock())
2656 if (
m_pShell->IsDesignMode() && IsTrackPropertiesEnabled_Lock() && !m_aMarkTimer.IsActive())
2657 m_aMarkTimer.Start();
2661void FmXFormShell::SetSelection_Lock(
const SdrMarkList& rMarkList)
2663 if (impl_checkDisposed_Lock())
2666 DetermineSelection_Lock(rMarkList);
2671void FmXFormShell::DetermineSelection_Lock(
const SdrMarkList& rMarkList)
2673 if (setCurrentSelectionFromMark_Lock(rMarkList) && IsPropBrwOpen_Lock())
2674 ShowSelectionProperties_Lock(
true);
2678bool FmXFormShell::IsPropBrwOpen_Lock()
const
2680 if (impl_checkDisposed_Lock())
2683 return m_pShell->GetViewShell() &&
m_pShell->GetViewShell()->GetViewFrame()
2684 &&
m_pShell->GetViewShell()->GetViewFrame()->HasChildWindow(SID_FM_SHOW_PROPERTIES);
2699 if (
m_rShell.IsTrackPropertiesEnabled_Lock())
2701 m_rShell.EnableTrackProperties_Lock(
false);
2709 m_rShell.EnableTrackProperties_Lock(
true);
2714void FmXFormShell::SetDesignMode_Lock(
bool bDesign)
2716 if (impl_checkDisposed_Lock())
2719 DBG_ASSERT(
m_pShell->GetFormView(),
"FmXFormShell::SetDesignMode : invalid call (have no shell or no view) !");
2720 m_bChangingDesignMode =
true;
2727 m_bHadPropertyBrowserInDesignMode =
m_pShell->GetViewShell()->GetViewFrame()->HasChildWindow(SID_FM_SHOW_PROPERTIES);
2728 if (m_bHadPropertyBrowserInDesignMode)
2729 m_pShell->GetViewShell()->GetViewFrame()->ToggleChildWindow(SID_FM_SHOW_PROPERTIES);
2737 stopFiltering_Lock(
false);
2744 m_aMarkTimer.Stop();
2746 SuspendPropertyTracking aSuspend( *
this );
2750 if (bDesign && m_xExternalViewController.is())
2751 CloseExternalFormViewer_Lock();
2760 UpdateForms_Lock(
false);
2762 m_pTextShell->designModeChanged();
2769 SuspendPropertyTracking aSuspend( *
this );
2776 SetSelection_Lock(aList);
2788 if (bDesign && m_bHadPropertyBrowserInDesignMode)
2794 m_pShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( SID_FM_SHOW_PROPERTY_BROWSER, SfxCallMode::ASYNCHRON );
2796 m_bChangingDesignMode =
false;
2800Reference< XControl> FmXFormShell::impl_getControl_Lock(
const Reference<XControlModel>& i_rxModel,
const FmFormObj& i_rKnownFormObj)
2802 if (impl_checkDisposed_Lock())
2805 Reference< XControl > xControl;
2808 Reference< XControlContainer> xControlContainer(getControlContainerForView_Lock(), UNO_SET_THROW);
2810 const Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
2812 for (Reference< XControl >
const & control : seqControls)
2814 xControl.set( control, UNO_SET_THROW );
2815 Reference< XControlModel > xCurrentModel( xControl->getModel() );
2816 if ( xCurrentModel == i_rxModel )
2821 if ( !xControl.is() )
2824 Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW );
2826 ENSURE_OR_THROW( pContainerWindow,
"unexpected control container implementation" );
2831 xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow->
GetOutDev() ), UNO_SET_THROW );
2834 catch(
const Exception& )
2839 OSL_ENSURE( xControl.is(),
"FmXFormShell::impl_getControl: no control found!" );
2844void FmXFormShell::impl_collectFormSearchContexts_nothrow_Lock(
const Reference<XInterface>& _rxStartingPoint,
2845 std::u16string_view _rCurrentLevelPrefix,
FmFormArray& _out_rForms, ::std::vector< OUString >& _out_rNames )
2849 Reference< XIndexAccess> xContainer( _rxStartingPoint, UNO_QUERY );
2850 if ( !xContainer.is() )
2853 sal_Int32
nCount( xContainer->getCount() );
2857 OUString sCurrentFormName;
2858 OUStringBuffer aNextLevelPrefix;
2859 for ( sal_Int32 i=0;
i<
nCount; ++
i )
2862 Reference< XForm > xCurrentAsForm( xContainer->getByIndex(i), UNO_QUERY );
2863 if ( !xCurrentAsForm.is() )
2866 Reference< XNamed > xNamed( xCurrentAsForm, UNO_QUERY_THROW );
2867 sCurrentFormName = xNamed->getName();
2870 OUString sCompleteCurrentName( sCurrentFormName );
2871 if ( !_rCurrentLevelPrefix.empty() )
2873 sCompleteCurrentName += OUString::Concat(
" (") + _rCurrentLevelPrefix +
")";
2877 aNextLevelPrefix = _rCurrentLevelPrefix;
2878 if ( !_rCurrentLevelPrefix.empty() )
2879 aNextLevelPrefix.append(
'/' );
2880 aNextLevelPrefix.append( sCurrentFormName );
2883 _out_rForms.push_back( xCurrentAsForm );
2884 _out_rNames.push_back( sCompleteCurrentName );
2887 impl_collectFormSearchContexts_nothrow_Lock(
2888 xCurrentAsForm, aNextLevelPrefix,
2889 _out_rForms, _out_rNames);
2890 aNextLevelPrefix.setLength(0);
2893 catch(
const Exception& )
2900void FmXFormShell::startFiltering_Lock()
2902 if (impl_checkDisposed_Lock())
2909 Reference< XControlContainer> xContainer;
2910 if (getActiveController_Lock() == m_xExternalViewController)
2912 DBG_ASSERT(m_xExtViewTriggerController.is(),
"FmXFormShell::startFiltering : inconsistent : active external controller, but no one triggered this !");
2913 xContainer = m_xExtViewTriggerController->getContainer();
2916 xContainer = getActiveController_Lock()->getContainer();
2919 if ( pAdapter.is() )
2921 const ::std::vector< Reference< runtime::XFormController> >& rControllerList = pAdapter->GetList();
2922 for (
const auto& rpController : rControllerList)
2924 Reference< XModeSelector> xModeSelector(rpController, UNO_QUERY);
2925 if (xModeSelector.is())
2926 xModeSelector->setMode(
"FilterMode" );
2930 m_bFilterMode =
true;
2945static void saveFilter(
const Reference< runtime::XFormController >& _rxController)
2947 Reference< XPropertySet> xFormAsSet(_rxController->getModel(), UNO_QUERY);
2948 Reference< XPropertySet> xControllerAsSet(_rxController, UNO_QUERY);
2951 Reference< runtime::XFormController >
xController;
2952 for (sal_Int32
i = 0,
nCount = _rxController->getCount();
i <
nCount; ++
i)
2972void FmXFormShell::stopFiltering_Lock(
bool bSave)
2974 if (impl_checkDisposed_Lock())
2977 m_bFilterMode =
false;
2982 Reference< XControlContainer> xContainer;
2983 if (getActiveController_Lock() == m_xExternalViewController)
2985 DBG_ASSERT(m_xExtViewTriggerController.is(),
"FmXFormShell::stopFiltering : inconsistent : active external controller, but no one triggered this !");
2986 xContainer = m_xExtViewTriggerController->getContainer();
2989 xContainer = getActiveController_Lock()->getContainer();
2992 if ( pAdapter.is() )
2994 const ::std::vector< Reference< runtime::XFormController > >& rControllerList = pAdapter->GetList();
2995 ::std::vector < OUString > aOriginalFilters;
2996 ::std::vector < bool > aOriginalApplyFlags;
3000 for (
const auto& rpController : rControllerList)
3005 Reference< XPropertySet > xFormAsSet(rpController->getModel(), UNO_QUERY);
3006 aOriginalFilters.push_back(::comphelper::getString(xFormAsSet->getPropertyValue(
FM_PROP_FILTER)));
3007 aOriginalApplyFlags.push_back(::comphelper::getBOOL(xFormAsSet->getPropertyValue(
FM_PROP_APPLYFILTER)));
3011 OSL_FAIL(
"FmXFormShell::stopFiltering : could not get the original filter !");
3014 if (aOriginalFilters.size() == aOriginalApplyFlags.size())
3016 aOriginalFilters.emplace_back( );
3017 aOriginalApplyFlags.push_back(
false );
3022 for (
const auto& rController : rControllerList)
3025 Reference< XModeSelector> xModeSelector(rController, UNO_QUERY);
3026 if (xModeSelector.is())
3027 xModeSelector->setMode(
"DataMode" );
3031 const ::std::vector< Reference< runtime::XFormController > > & rControllers = pAdapter->GetList();
3032 for (::std::vector< Reference< runtime::XFormController > > ::const_iterator j = rControllers.begin();
3033 j != rControllers.end(); ++j)
3035 Reference< XLoadable> xReload((*j)->getModel(), UNO_QUERY);
3038 Reference< XPropertySet > xFormSet(xReload, UNO_QUERY);
3051 OUString sOriginalFilter = aOriginalFilters[ j - rControllers.begin() ];
3052 bool bOriginalApplyFlag = aOriginalApplyFlags[ j - rControllers.begin() ];
3059 catch(
const Exception&)
3069 m_pShell->GetViewShell()->GetViewFrame()->GetBindings().InvalidateShell(*m_pShell);
3073void FmXFormShell::CreateExternalView_Lock()
3075 if (impl_checkDisposed_Lock())
3078 DBG_ASSERT(m_xAttachedFrame.is(),
"FmXFormShell::CreateExternalView : no frame !");
3081 bool bAlreadyExistent = m_xExternalViewController.is();
3082 Reference< css::frame::XFrame> xExternalViewFrame;
3084 Reference<runtime::XFormController> xCurrentNavController(getNavController_Lock());
3091 bool bHaveUsableControls =
false;
3094 Reference< XPropertySet> xCurrentModelSet(aModelIterator.Next(), UNO_QUERY);
3095 if (!xCurrentModelSet.is())
3099 sal_Int16 nClassId = ::comphelper::getINT16(xCurrentModelSet->getPropertyValue(
FM_PROP_CLASSID));
3102 case FormComponentType::IMAGECONTROL:
3103 case FormComponentType::CONTROL:
3106 bHaveUsableControls =
true;
3110 if (!bHaveUsableControls)
3113 VclMessageType::Warning, VclButtonsType::Ok,
3114 SvxResId(RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY)));
3121 if (!bAlreadyExistent)
3124 URL aWantToDispatch;
3127 Reference< css::frame::XDispatchProvider> xProv(m_xAttachedFrame, UNO_QUERY);
3128 Reference< css::frame::XDispatch> xDisp;
3130 xDisp = xProv->queryDispatch(aWantToDispatch, sFrameName,
3131 css::frame::FrameSearchFlag::CHILDREN | css::frame::FrameSearchFlag::CREATE);
3134 xDisp->dispatch(aWantToDispatch, Sequence< PropertyValue>());
3138 xExternalViewFrame = m_xAttachedFrame->findFrame(sFrameName, css::frame::FrameSearchFlag::CHILDREN);
3139 if (xExternalViewFrame.is())
3141 m_xExternalViewController = xExternalViewFrame->getController();
3142 if (m_xExternalViewController.is())
3143 m_xExternalViewController->addEventListener(
static_cast<XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
3148 xExternalViewFrame = m_xExternalViewController->getFrame();
3149 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
3152 Reference< XForm> xCurrentModel(xCurrentNavController->getModel(), UNO_QUERY);
3153 if ((xCurrentModel == m_xExternalDisplayedForm) || (getInternalForm_Lock(xCurrentModel) == m_xExternalDisplayedForm))
3155 if (m_xExternalViewController == getActiveController_Lock())
3157 Reference< runtime::XFormController > xAsFormController( m_xExternalViewController, UNO_QUERY );
3158 ControllerFeatures
aHelper( xAsFormController );
3159 (void)
aHelper->commitCurrentControl();
3162 Reference< runtime::XFormController > xNewController(m_xExtViewTriggerController);
3163 CloseExternalFormViewer_Lock();
3164 setActiveController_Lock(xNewController);
3171 Reference< css::frame::XDispatch> xClear( xCommLink->queryDispatch(aClearURL, OUString(), 0));
3173 xClear->dispatch(aClearURL, Sequence< PropertyValue>());
3180 Reference< css::frame::XDispatchProvider> xCommLink(xExternalViewFrame, UNO_QUERY);
3182 if (m_xExternalViewController.is())
3184 DBG_ASSERT(xCommLink.is(),
"FmXFormShell::CreateExternalView : the component doesn't have the necessary interfaces !");
3188 Reference< css::frame::XDispatch> xAddColumnDispatch( xCommLink->queryDispatch(aAddColumnURL, OUString(), 0));
3191 Reference< css::frame::XDispatch> xAttachDispatch( xCommLink->queryDispatch(aAttachURL, OUString(), 0));
3193 if (xAddColumnDispatch.is() && xAttachDispatch.is())
3195 DBG_ASSERT(xCurrentNavController.is(),
"FmXFormShell::CreateExternalView : invalid call : have no nav controller !");
3197 sal_Int16 nAddedColumns = 0;
3200 typedef std::map< OUString, Sequence< OUString> > MapUString2UstringSeq;
3201 typedef std::map< OUString, OUString > FmMapUString2UString;
3202 typedef std::map< OUString, sal_Int16 > FmMapUString2Int16;
3204 MapUString2UstringSeq aRadioValueLists;
3205 MapUString2UstringSeq aRadioListSources;
3206 FmMapUString2UString aRadioControlSources;
3207 FmMapUString2Int16 aRadioPositions;
3210 OUString sColumnType,aGroupName,sControlSource;
3211 Sequence< Property> aProps;
3214 Reference< XPropertySet> xCurrentModelSet(aModelIterator.Next(), UNO_QUERY);
3215 if (!xCurrentModelSet.is())
3217 OSL_ENSURE(xCurrentModelSet.is(),
"xCurrentModelSet is null!");
3221 sal_Int16 nClassId = ::comphelper::getINT16(xCurrentModelSet->getPropertyValue(
FM_PROP_CLASSID));
3224 case FormComponentType::RADIOBUTTON:
3230 Sequence< OUString>& aThisGroupLabels = aRadioListSources[aGroupName];
3231 sal_Int32 nNewSizeL = aThisGroupLabels.getLength() + 1;
3232 aThisGroupLabels.realloc(nNewSizeL);
3233 aThisGroupLabels.getArray()[nNewSizeL - 1] = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_REFVALUE));
3236 Sequence< OUString>& aThisGroupControlSources = aRadioValueLists[aGroupName];
3237 sal_Int32 nNewSizeC = aThisGroupControlSources.getLength() + 1;
3238 aThisGroupControlSources.realloc(nNewSizeC);
3239 aThisGroupControlSources.getArray()[nNewSizeC - 1] = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_LABEL));
3242 sControlSource = ::comphelper::getString(xCurrentModelSet->getPropertyValue(
FM_PROP_CONTROLSOURCE));
3243 if (aRadioControlSources.find(aGroupName) == aRadioControlSources.end())
3244 aRadioControlSources[aGroupName] = sControlSource;
3247 DBG_ASSERT(aRadioControlSources[aGroupName] == sControlSource,
3248 "FmXFormShell::CreateExternalView : inconsistent radio buttons detected !");
3252 if (aRadioPositions.find(aGroupName) == aRadioPositions.end())
3253 aRadioPositions[aGroupName] = nAddedColumns;
3259 case FormComponentType::IMAGECONTROL:
3260 case FormComponentType::CONTROL:
3263 case FormComponentType::CHECKBOX:
3265 case FormComponentType::LISTBOX:
3267 case FormComponentType::COMBOBOX:
3269 case FormComponentType::DATEFIELD:
3271 case FormComponentType::TIMEFIELD:
3273 case FormComponentType::NUMERICFIELD:
3275 case FormComponentType::CURRENCYFIELD:
3277 case FormComponentType::PATTERNFIELD:
3280 case FormComponentType::TEXTFIELD:
3285 Reference< lang::XServiceInfo> xInfo(xCurrentModelSet, UNO_QUERY);
3298 const sal_Int16 nDispatchArgs = 3;
3299 Sequence< PropertyValue> aDispatchArgs(nDispatchArgs);
3300 PropertyValue* pDispatchArgs = aDispatchArgs.getArray();
3305 pDispatchArgs->Value <<= sColumnType;
3310 pDispatchArgs->Value <<= nAddedColumns;
3314 Sequence< PropertyValue> aColumnProps(1);
3315 PropertyValue* pColumnProps = aColumnProps.getArray();
3319 pColumnProps->Value <<=
getLabelName(xCurrentModelSet);
3323 Reference< XPropertySetInfo> xControlModelInfo( xCurrentModelSet->getPropertySetInfo());
3324 DBG_ASSERT(xControlModelInfo.is(),
"FmXFormShell::CreateExternalView : the control model has no property info ! This will crash !");
3325 aProps = xControlModelInfo->getProperties();
3328 sal_Int32 nExistentDescs = pColumnProps - aColumnProps.getArray();
3329 aColumnProps.realloc(nExistentDescs + aProps.getLength());
3330 pColumnProps = aColumnProps.getArray() + nExistentDescs;
3332 for (
const Property& rProp : std::as_const(aProps))
3340 if (rProp.Attributes & PropertyAttribute::READONLY)
3344 pColumnProps->Name = rProp.Name;
3345 pColumnProps->Value = xCurrentModelSet->getPropertyValue(rProp.Name);
3348 aColumnProps.realloc(pColumnProps - aColumnProps.getArray());
3351 pDispatchArgs->Name =
"ColumnProperties";
3352 pDispatchArgs->Value <<= aColumnProps;
3354 DBG_ASSERT(nDispatchArgs == (pDispatchArgs - aDispatchArgs.getConstArray()),
3355 "FmXFormShell::CreateExternalView : forgot to adjust nDispatchArgs ?");
3358 xAddColumnDispatch->dispatch(aAddColumnURL, aDispatchArgs);
3363 sal_Int16 nOffset(0);
3365 const sal_Int16 nListBoxDescription = 6;
3366 Sequence< PropertyValue> aListBoxDescription(nListBoxDescription);
3367 for (
const auto& rCtrlSource : aRadioControlSources)
3369 PropertyValue* pListBoxDescription = aListBoxDescription.getArray();
3372 pListBoxDescription->Value <<= rCtrlSource.first;
3373 ++pListBoxDescription;
3377 pListBoxDescription->Value <<= rCtrlSource.second;
3378 ++pListBoxDescription;
3382 pListBoxDescription->Value <<= sal_Int16(1);
3383 ++pListBoxDescription;
3387 pListBoxDescription->Value <<= ListSourceType_VALUELIST;
3388 ++pListBoxDescription;
3391 MapUString2UstringSeq::const_iterator aCurrentListSource = aRadioListSources.find(rCtrlSource.first);
3392 DBG_ASSERT(aCurrentListSource != aRadioListSources.end(),
3393 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3395 pListBoxDescription->Value <<= (*aCurrentListSource).second;
3396 ++pListBoxDescription;
3399 MapUString2UstringSeq::const_iterator aCurrentValueList = aRadioValueLists.find(rCtrlSource.first);
3400 DBG_ASSERT(aCurrentValueList != aRadioValueLists.end(),
3401 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3403 pListBoxDescription->Value <<= (*aCurrentValueList).second;
3404 ++pListBoxDescription;
3406 DBG_ASSERT(nListBoxDescription == (pListBoxDescription - aListBoxDescription.getConstArray()),
3407 "FmXFormShell::CreateExternalView : forgot to adjust nListBoxDescription ?");
3410 const sal_Int16 nDispatchArgs = 3;
3411 Sequence< PropertyValue> aDispatchArgs(nDispatchArgs);
3412 PropertyValue* pDispatchArgs = aDispatchArgs.getArray();
3422 FmMapUString2Int16::const_iterator aOffset = aRadioPositions.find(rCtrlSource.first);
3424 "FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
3425 sal_Int16 nPosition = (*aOffset).second;
3426 nPosition = nPosition + nOffset;
3428 pDispatchArgs->Value <<= nPosition;
3432 pDispatchArgs->Name =
"ColumnProperties";
3433 pDispatchArgs->Value <<= aListBoxDescription;
3435 DBG_ASSERT(nDispatchArgs == (pDispatchArgs - aDispatchArgs.getConstArray()),
3436 "FmXFormShell::CreateExternalView : forgot to adjust nDispatchArgs ?");
3439 xAddColumnDispatch->dispatch(aAddColumnURL, aDispatchArgs);
3445 DBG_ASSERT(nAddedColumns > 0,
"FmXFormShell::CreateExternalView : no controls (inconsistent) !");
3451 Reference< XResultSet> xForm(xCurrentNavController->getModel(), UNO_QUERY);
3452 aArg.Value <<= xForm;
3454 m_xExternalDisplayedForm = xForm;
3458 xAttachDispatch->dispatch(aAttachURL, Sequence< PropertyValue>(&aArg, 1));
3460 m_xExtViewTriggerController = xCurrentNavController;
3464 Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY );
3465 OSL_ENSURE( xFormController.is(),
"FmXFormShell::CreateExternalView:: invalid external view controller!" );
3466 if (xFormController.is())
3467 xFormController->addActivateListener(
static_cast<XFormControllerListener*
>(
this));
3473 OSL_FAIL(
"FmXFormShell::CreateExternalView : could not create the external form view !");
3476 InvalidateSlot_Lock(SID_FM_VIEW_AS_GRID,
false);
3480void FmXFormShell::implAdjustConfigCache_Lock()
3483 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
3484 Sequence< Any > aFlags = GetProperties(aNames);
3485 if (1 == aFlags.getLength())
3486 m_bUseWizards = ::cppu::any2bool(aFlags[0]);
3490void FmXFormShell::Notify(
const css::uno::Sequence< OUString >& _rPropertyNames)
3493 if (impl_checkDisposed_Lock())
3496 for (
const OUString& rName : _rPropertyNames)
3497 if (rName ==
"FormControlPilotsEnabled")
3499 implAdjustConfigCache_Lock();
3500 InvalidateSlot_Lock(SID_FM_USE_WIZARDS,
true);
3504void FmXFormShell::ImplCommit()
3509void FmXFormShell::SetWizardUsing_Lock(
bool _bUseThem)
3511 m_bUseWizards = _bUseThem;
3513 Sequence< OUString > aNames {
"FormControlPilotsEnabled" };
3514 Sequence< Any > aValues{
Any(m_bUseWizards) };
3515 PutProperties(aNames, aValues);
3519void FmXFormShell::viewDeactivated_Lock(
FmFormView& _rCurrentView,
bool _bDeactivateController)
3533 ::std::queue< FmLoadAction > aNewEvents;
3534 while ( !m_aLoadingPages.empty() )
3537 m_aLoadingPages.pop();
3538 if ( pPage != aAction.
pPage )
3540 aNewEvents.push( aAction );
3547 m_aLoadingPages = aNewEvents;
3552 UpdateForms_Lock(
true);
3558 if (impl_checkDisposed_Lock())
3561 m_nActivationEvent =
nullptr;
3564 if ( pDocument && !pDocument->
HasName() )
3566 if (isEnhancedForm_Lock())
3569 if ( !
m_pShell->GetViewShell()->GetViewFrame()->HasChildWindow( SID_FM_SHOW_DATANAVIGATOR ) )
3570 m_pShell->GetViewShell()->GetViewFrame()->ToggleChildWindow( SID_FM_SHOW_DATANAVIGATOR );
3578 UpdateForms_Lock(
true);
3582void FmXFormShell::viewActivated_Lock(
FmFormView& _rCurrentView,
bool _bSyncAction)
3617 UpdateForms_Lock(
true);
3619 if ( m_bFirstActivation )
3622 m_bFirstActivation =
false;
3627 impl_defaultCurrentForm_nothrow_Lock();
3631void FmXFormShell::impl_defaultCurrentForm_nothrow_Lock()
3633 if (impl_checkDisposed_Lock())
3636 if ( m_xCurrentForm.is() )
3647 Reference< XIndexAccess > xForms = pPage->
GetForms(
false );
3648 if ( !xForms.is() || !xForms->hasElements() )
3651 Reference< XForm > xNewCurrentForm( xForms->getByIndex(0), UNO_QUERY_THROW );
3652 impl_updateCurrentForm_Lock(xNewCurrentForm);
3654 catch(
const Exception& )
3661void FmXFormShell::smartControlReset(
const Reference< XIndexAccess >& _rxModels )
3663 if (!_rxModels.is())
3665 OSL_FAIL(
"FmXFormShell::smartControlReset: invalid container!");
3669 sal_Int32
nCount = _rxModels->getCount();
3670 Reference< XPropertySet > xCurrent;
3671 Reference< XPropertySetInfo > xCurrentInfo;
3672 Reference< XPropertySet > xBoundField;
3676 _rxModels->getByIndex(i) >>= xCurrent;
3678 xCurrentInfo = xCurrent->getPropertySetInfo();
3680 xCurrentInfo.clear();
3681 if (!xCurrentInfo.is())
3691 xBoundField.clear();
3694 bool bReset = !xBoundField.is();
3697 Reference< XBindableValue > xBindable( xCurrent, UNO_QUERY );
3698 if ( xBindable.is() && xBindable->getValueBinding().is() )
3703 Reference< XReset > xControlReset( xCurrent, UNO_QUERY );
3704 if ( xControlReset.is() )
3705 xControlReset->reset();
3710 Reference< XIndexAccess > xContainer(xCurrent, UNO_QUERY);
3711 if (xContainer.is())
3712 smartControlReset(xContainer);
3721 m_aLoadingPages.pop();
3729 bool lcl_isLoadable(
const Reference< XInterface >& _rxLoadable )
3733 Reference< XPropertySet > xSet( _rxLoadable, UNO_QUERY );
3738 Reference< XConnection > xConn;
3747 OUString sPropertyValue;
3749 if ( !sPropertyValue.isEmpty() )
3752 OSL_VERIFY( xSet->getPropertyValue(
FM_PROP_URL ) >>= sPropertyValue );
3753 if ( !sPropertyValue.isEmpty() )
3756 catch(
const Exception&)
3768 "FmXFormShell::loadForms: async loading not supported - this will heavily fail!" );
3780 DBG_ASSERT( _pPage,
"FmXFormShell::loadForms: invalid page!" );
3787 rFmFormModel.GetUndoEnv().Lock();
3790 Reference< XIndexAccess > xForms = _pPage->
GetForms(
false );
3794 Reference< XLoadable > xForm;
3795 for ( sal_Int32 j = 0, nCount = xForms->getCount(); j < nCount; ++j )
3797 xForms->getByIndex( j ) >>= xForm;
3798 bool bFormWasLoaded =
false;
3804 if ( lcl_isLoadable( xForm ) && !xForm->isLoaded() )
3809 if ( xForm->isLoaded() )
3811 bFormWasLoaded =
true;
3816 catch(
const Exception& )
3822 if ( bFormWasLoaded )
3824 Reference< XIndexAccess > xContainer( xForm, UNO_QUERY );
3825 DBG_ASSERT( xContainer.is(),
"FmXFormShell::loadForms: the form is no container!" );
3826 if ( xContainer.is() )
3827 smartControlReset( xContainer );
3833 rFmFormModel.GetUndoEnv().UnLock();
3837void FmXFormShell::ExecuteTextAttribute_Lock(
SfxRequest& _rReq)
3840 m_pTextShell->ExecuteTextAttribute( _rReq );
3844void FmXFormShell::GetTextAttributeState_Lock(
SfxItemSet& _rSet)
3847 m_pTextShell->GetTextAttributeState( _rSet );
3851bool FmXFormShell::IsActiveControl_Lock(
bool _bCountRichTextOnly )
const
3854 return m_pTextShell->IsActiveControl( _bCountRichTextOnly );
3858void FmXFormShell::ForgetActiveControl_Lock()
3861 m_pTextShell->ForgetActiveControl();
3868 m_pTextShell->SetControlActivationHandler( _rHdl );
3871void FmXFormShell::handleShowPropertiesRequest_Lock()
3873 if (onlyControlsAreMarked_Lock())
3874 ShowSelectionProperties_Lock(
true );
3878void FmXFormShell::handleMouseButtonDown_Lock(
const SdrViewEvent& _rViewEvent)
3885 if (onlyControlsAreMarked_Lock())
3886 ShowSelectionProperties_Lock(
true );
3892bool FmXFormShell::HasControlFocus_Lock()
const
3894 bool bHasControlFocus =
false;
3898 Reference<runtime::XFormController>
xController(getActiveController_Lock());
3899 Reference< XControl > xCurrentControl;
3901 xCurrentControl.set(
xController->getCurrentControl() );
3902 if ( xCurrentControl.is() )
3904 Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW );
3905 bHasControlFocus = xPeerWindow->hasFocus();
3908 catch(
const Exception& )
3913 return bHasControlFocus;
3918 :IndexAccessIterator(xStartingPoint)
3926 Reference< XPropertySet> xProperties(xElement, UNO_QUERY);
3930 Reference< XPropertySet> xField;
3944 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)
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)
bool IsSearchableControl(const css::uno::Reference< css::uno::XInterface > &_rxControl, OUString *_pCurrentText)
constexpr rtl::OUStringConstExpr aImgIds[]
const sal_uInt16 DatabaseSlotMap[]
static const char * aConvertSlots[]
::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)