using std::pair; using com::sun::star::uno::Reference; using com::sun::star::uno::Exception; using com::sun::star::uno::UNO_QUERY; using com::sun::star::uno::UNO_QUERY_THROW; using com::sun::star::uno::UNO_SET_THROW; using com::sun::star::uno::Sequence; using com::sun::star::beans::XPropertySet; using com::sun::star::beans::XPropertySetInfo; using com::sun::star::beans::PropertyValue; using com::sun::star::frame::XModel; using com::sun::star::container::XNameAccess; using com::sun::star::form::binding::XValueBinding; using com::sun::star::form::binding::XBindableValue; using com::sun::star::form::binding::XListEntrySource; using com::sun::star::form::binding::XListEntrySink; using com::sun::star::form::submission::XSubmission; using com::sun::star::form::submission::XSubmissionSupplier;
Reference< XNameAccess > xModelSettings( ::comphelper::NamedValueCollection::get( _rSettings, u"XFormModels" ), UNO_QUERY ); if ( !xModelSettings.is() )
{
OSL_FAIL( "applyXFormsSettings: wrong type for the XFormModels settings!" ); return;
}
try
{ const Sequence< OUString > aSettingsForModels( xModelSettings->getElementNames() ); for ( autoconst & modelName : aSettingsForModels )
{ // the settings for this particular model
Sequence< PropertyValue > aModelSettings;
OSL_VERIFY( xModelSettings->getByName( modelName ) >>= aModelSettings );
// the model itself if ( !_rXForms->hasByName( modelName ) )
{
OSL_FAIL( "applyXFormsSettings: have settings for a non-existent XForms model!" ); continue;
}
// propagate the settings, being tolerant by omitting properties which are not supported
Reference< XPropertySet > xModelProps( _rXForms->getByName( modelName ), UNO_QUERY_THROW );
Reference< XPropertySetInfo > xModelPSI( xModelProps->getPropertySetInfo(), UNO_SET_THROW );
for (autoconst& setting : aModelSettings)
{ if ( !xModelPSI->hasPropertyByName( setting.Name ) )
{
OSL_FAIL( "applyXFormsSettings: non-existent model property!" ); continue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.