forms/source/component/ComboBox.cxx | 4 - forms/source/component/DatabaseForm.cxx | 20 +++---- forms/source/component/Filter.cxx | 2 forms/source/component/FormComponent.cxx | 8 +- forms/source/component/ImageControl.cxx | 6 +- forms/source/component/ListBox.cxx | 4 - forms/source/inc/frm_resource.hxx | 2 forms/source/misc/InterfaceContainer.cxx | 6 +- forms/source/runtime/formoperations.cxx | 12 ++-- forms/source/solar/control/navtoolbar.cxx | 2 forms/source/xforms/binding.cxx | 30 +++++----- forms/source/xforms/datatyperepository.cxx | 26 ++++----- forms/source/xforms/model.cxx | 10 +-- forms/source/xforms/model_ui.cxx | 81 +++++++++++++++++------------ forms/source/xforms/propertysetbase.hxx | 5 - forms/source/xforms/submission.cxx | 32 +++++------ 16 files changed, 129 insertions(+), 121 deletions(-)
New commits: commit 01878ce321dbbffbc877fbe9eb399dec95f99755 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sun Nov 7 23:07:18 2021 +0100 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Mon Nov 8 07:04:47 2021 +0100 Replace some macros in forms part 17 Remove FRM_RES_STRING + PROP + PROPERTY_FLAGS Change-Id: I11befedbe83ad9d7c3f3f4d689230ffe422c0770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124830 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 4e59c99ed503..d43903bfea35 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -584,7 +584,7 @@ void OComboBoxModel::loadData( bool _bForce ) } catch(const SQLException& eSQL) { - onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); + onError(eSQL, ResourceManager::loadString(RID_BASELISTBOX_ERROR_FILLLIST)); return; } catch( const Exception& ) @@ -652,7 +652,7 @@ void OComboBoxModel::loadData( bool _bForce ) } catch(const SQLException& eSQL) { - onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); + onError(eSQL, ResourceManager::loadString(RID_BASELISTBOX_ERROR_FILLLIST)); return; } catch( const Exception& ) diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 5319b9ef05c0..60b35a8b5959 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -1151,7 +1151,7 @@ bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifie if (!m_sCurrentErrorContext.isEmpty()) onError(eDb, m_sCurrentErrorContext); else - onError(eDb, FRM_RES_STRING(RID_STR_READERROR)); + onError(eDb, ResourceManager::loadString(RID_STR_READERROR)); _rClearForNotifies.reset(); restoreInsertOnlyState( ); @@ -1193,7 +1193,7 @@ bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifie if (!m_sCurrentErrorContext.isEmpty()) onError(eDB, m_sCurrentErrorContext); else - onError(eDB, FRM_RES_STRING(RID_STR_READERROR)); + onError(eDB, ResourceManager::loadString(RID_STR_READERROR)); _rClearForNotifies.reset(); bSuccess = false; } @@ -2795,7 +2795,7 @@ bool ODatabaseForm::implEnsureConnection() } catch(const SQLException& eDB) { - onError(eDB, FRM_RES_STRING(RID_STR_CONNECTERROR)); + onError(eDB, ResourceManager::loadString(RID_STR_CONNECTERROR)); } catch(const Exception&) { @@ -2836,7 +2836,7 @@ void ODatabaseForm::load_impl(bool bCausedByParentForm, bool bMoveToFirst, const bool bSuccess = false; if (bExecute) { - m_sCurrentErrorContext = FRM_RES_STRING(RID_ERR_LOADING_FORM); + m_sCurrentErrorContext = ResourceManager::loadString(RID_ERR_LOADING_FORM); bSuccess = executeRowSet(aGuard, bMoveToFirst, _rxCompletionHandler); } @@ -2937,7 +2937,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction bool bSuccess = true; try { - m_sCurrentErrorContext = FRM_RES_STRING(RID_ERR_REFRESHING_FORM); + m_sCurrentErrorContext = ResourceManager::loadString(RID_ERR_REFRESHING_FORM); bSuccess = executeRowSet(aGuard, bMoveToFirst, _rxCompletionHandler); } catch(const SQLException&) @@ -3432,7 +3432,7 @@ void SAL_CALL ODatabaseForm::insertRow() } catch(const SQLException& eDb) { - onError(eDb, FRM_RES_STRING(RID_STR_ERR_INSERTRECORD)); + onError(eDb, ResourceManager::loadString(RID_STR_ERR_INSERTRECORD)); throw; } } @@ -3452,7 +3452,7 @@ void SAL_CALL ODatabaseForm::updateRow() } catch(const SQLException& eDb) { - onError(eDb, FRM_RES_STRING(RID_STR_ERR_UPDATERECORD)); + onError(eDb, ResourceManager::loadString(RID_STR_ERR_UPDATERECORD)); throw; } } @@ -3472,7 +3472,7 @@ void SAL_CALL ODatabaseForm::deleteRow() } catch(const SQLException& eDb) { - onError(eDb, FRM_RES_STRING(RID_STR_ERR_DELETERECORD)); + onError(eDb, ResourceManager::loadString(RID_STR_ERR_DELETERECORD)); throw; } } @@ -3492,7 +3492,7 @@ void SAL_CALL ODatabaseForm::cancelRowUpdates() } catch(const SQLException& eDb) { - onError(eDb, FRM_RES_STRING(RID_STR_ERR_INSERTRECORD)); + onError(eDb, ResourceManager::loadString(RID_STR_ERR_INSERTRECORD)); throw; } } @@ -3556,7 +3556,7 @@ Sequence<sal_Int32> SAL_CALL ODatabaseForm::deleteRows(const Sequence<Any>& rows } catch(const SQLException& eDb) { - onError(eDb, FRM_RES_STRING(RID_STR_ERR_DELETERECORDS)); + onError(eDb, ResourceManager::loadString(RID_STR_ERR_DELETERECORDS)); throw; } diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index ce137f3bb1ca..7fc70280e696 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -522,7 +522,7 @@ namespace frm { // display the error and outta here SQLContext aError; - aError.Message = FRM_RES_STRING( RID_STR_SYNTAXERROR ); + aError.Message = ResourceManager::loadString(RID_STR_SYNTAXERROR); aError.Details = sErrorMessage; displayException( aError ); return false; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 6ebd8ff6a468..d9aa7941b007 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -743,7 +743,7 @@ void SAL_CALL OControlModel::write(const Reference<css::io::XObjectOutputStream> if ( !xMark.is() ) { throw IOException( - FRM_RES_STRING( RID_STR_INVALIDSTREAM ), + ResourceManager::loadString(RID_STR_INVALIDSTREAM), static_cast< ::cppu::OWeakObject* >( this ) ); } @@ -786,7 +786,7 @@ void OControlModel::read(const Reference<css::io::XObjectInputStream>& InStream) if ( !xMark.is() ) { throw IOException( - FRM_RES_STRING( RID_STR_INVALIDSTREAM ), + ResourceManager::loadString(RID_STR_INVALIDSTREAM), static_cast< ::cppu::OWeakObject* >( this ) ); } @@ -2471,7 +2471,7 @@ void SAL_CALL OBoundControlModel::setValueBinding( const Reference< XValueBindin if ( _rxBinding.is() && !impl_approveValueBinding_nolock( _rxBinding ) ) { throw IncompatibleTypesException( - FRM_RES_STRING( RID_STR_INCOMPATIBLE_TYPES ), + ResourceManager::loadString(RID_STR_INCOMPATIBLE_TYPES), *this ); } @@ -2690,7 +2690,7 @@ void SAL_CALL OBoundControlModel::setValidator( const Reference< XValidator >& _ if ( m_xValidator.is() && ( m_xValidator == m_xExternalBinding ) ) throw VetoException( - FRM_RES_STRING( RID_STR_INVALID_VALIDATOR ), + ResourceManager::loadString(RID_STR_INVALID_VALIDATOR), *this ); diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 08276d84bba6..af4c1e32f979 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -775,7 +775,7 @@ bool OImageControlControl::implInsertGraphics() if ( !xSet.is() ) return false; - OUString sTitle = FRM_RES_STRING(RID_STR_IMPORT_GRAPHIC); + OUString sTitle = ResourceManager::loadString(RID_STR_IMPORT_GRAPHIC); // build some arguments for the upcoming dialog try { @@ -878,8 +878,8 @@ void OImageControlControl::mousePressed(const css::awt::MouseEvent& e) if ( xMenu.is() && xWindowPeer.is() ) { - xMenu->insertItem( ID_OPEN_GRAPHICS, FRM_RES_STRING( RID_STR_OPEN_GRAPHICS ), 0, 0 ); - xMenu->insertItem( ID_CLEAR_GRAPHICS, FRM_RES_STRING( RID_STR_CLEAR_GRAPHICS ), 0, 1 ); + xMenu->insertItem( ID_OPEN_GRAPHICS, ResourceManager::loadString(RID_STR_OPEN_GRAPHICS), 0, 0 ); + xMenu->insertItem( ID_CLEAR_GRAPHICS, ResourceManager::loadString(RID_STR_CLEAR_GRAPHICS), 0, 1 ); // check if the ImageURL is empty if ( impl_isEmptyGraphics_nothrow() ) diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 851add9092a5..1e9bcf2fc544 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -859,7 +859,7 @@ namespace frm } catch(const SQLException& eSQL) { - onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); + onError(eSQL, ResourceManager::loadString(RID_BASELISTBOX_ERROR_FILLLIST)); return; } catch(const Exception&) @@ -988,7 +988,7 @@ namespace frm } catch(const SQLException& eSQL) { - onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); + onError(eSQL, ResourceManager::loadString(RID_BASELISTBOX_ERROR_FILLLIST)); return; } catch( const Exception& ) diff --git a/forms/source/inc/frm_resource.hxx b/forms/source/inc/frm_resource.hxx index ea629440bbce..711018a158d0 100644 --- a/forms/source/inc/frm_resource.hxx +++ b/forms/source/inc/frm_resource.hxx @@ -25,8 +25,6 @@ namespace frm { -#define FRM_RES_STRING(id) ResourceManager::loadString(id) - // handling resources within the FormLayer library namespace ResourceManager { diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 61d1265aa4be..7dd3bbc20544 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -488,8 +488,8 @@ namespace { try { - xObjProps->setPropertyValue( PROPERTY_NAME, makeAny( FRM_RES_STRING( RID_STR_CONTROL_SUBSTITUTED_NAME ) ) ); - xObjProps->setPropertyValue( PROPERTY_TAG, makeAny( FRM_RES_STRING( RID_STR_CONTROL_SUBSTITUTED_EPXPLAIN ) ) ); + xObjProps->setPropertyValue( PROPERTY_NAME, makeAny( ResourceManager::loadString(RID_STR_CONTROL_SUBSTITUTED_NAME) ) ); + xObjProps->setPropertyValue( PROPERTY_TAG, makeAny( ResourceManager::loadString(RID_STR_CONTROL_SUBSTITUTED_EPXPLAIN) ) ); } catch(const Exception&) { @@ -733,7 +733,7 @@ void OInterfaceContainer::approveNewElement( const Reference< XPropertySet >& _r { // it has to be non-NULL if ( !_rxObject.is() ) - throw IllegalArgumentException(FRM_RES_STRING(RID_STR_NEED_NON_NULL_OBJECT), static_cast<XContainer*>(this), 1); + throw IllegalArgumentException(ResourceManager::loadString(RID_STR_NEED_NON_NULL_OBJECT), static_cast<XContainer*>(this), 1); // it has to support our element type interface Any aCorrectType = _rxObject->queryInterface( m_aElementType ); diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index d82c87d050af..e7c7d135f61a 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -435,7 +435,7 @@ namespace frm // TODO: shouldn't this be done with an interaction handler? std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, VclMessageType::Question, VclButtonsType::YesNo, - FRM_RES_STRING(RID_STR_QUERY_SAVE_MODIFIED_ROW))); + ResourceManager::loadString(RID_STR_QUERY_SAVE_MODIFIED_ROW))); xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL); xQueryBox->set_default_response(RET_YES); @@ -776,7 +776,7 @@ namespace frm pErrorResourceId = RID_STR_FEATURE_REQUIRES_PARAMETERS; else if ( !lcl_isExecutableFeature( _nFeature ) ) pErrorResourceId = RID_STR_FEATURE_NOT_EXECUTABLE; - throw IllegalArgumentException( FRM_RES_STRING( pErrorResourceId ), *this, 1 ); + throw IllegalArgumentException( ResourceManager::loadString(pErrorResourceId), *this, 1 ); } } // switch } @@ -804,7 +804,7 @@ namespace frm // at the moment we have only one feature which supports execution parameters if ( !lcl_isExecutableFeature( _nFeature ) ) - throw IllegalArgumentException( FRM_RES_STRING( RID_STR_FEATURE_NOT_EXECUTABLE ), *this, 1 ); + throw IllegalArgumentException( ResourceManager::loadString(RID_STR_FEATURE_NOT_EXECUTABLE), *this, 1 ); switch ( _nFeature ) { @@ -843,7 +843,7 @@ namespace frm } break; default: - throw IllegalArgumentException( FRM_RES_STRING( RID_STR_FEATURE_UNKNOWN ), *this, 1 ); + throw IllegalArgumentException( ResourceManager::loadString(RID_STR_FEATURE_UNKNOWN), *this, 1 ); } // switch } @@ -1742,7 +1742,7 @@ namespace frm throw; SQLExceptionInfo aInfo( ::cppu::getCaughtException() ); - OUString sAdditionalError( FRM_RES_STRING( pErrorResourceId ) ); + OUString sAdditionalError( ResourceManager::loadString(pErrorResourceId) ); aInfo.prepend( sAdditionalError ); aInfo.doThrow(); } @@ -1750,7 +1750,7 @@ namespace frm catch( const RuntimeException& ) { throw; } catch( const Exception& ) { - OUString sAdditionalError( FRM_RES_STRING( pErrorResourceId ) ); + OUString sAdditionalError( ResourceManager::loadString(pErrorResourceId) ); throw WrappedTargetException( sAdditionalError, *const_cast< FormOperations* >( this ), ::cppu::getCaughtException() ); } } diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index f92c9f93f3da..fdee49b3277c 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -58,7 +58,7 @@ namespace frm OUString getLabelString(TranslateId pResId) { - OUString sLabel( " " + FRM_RES_STRING(pResId) + " " ); + OUString sLabel( " " + ResourceManager::loadString(pResId) + " " ); return sLabel; } diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index b87b33e3a8c1..5d986bbd26cb 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -1190,49 +1190,49 @@ css::uno::Reference<css::util::XCloneable> SAL_CALL Binding::createClone() void Binding::initializePropertySet() { - registerProperty( PROPERTY_FLAGS( BindingID, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("BindingID", HANDLE_BindingID, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setBindingID, &Binding::getBindingID)); - registerProperty( PROPERTY_FLAGS( BindingExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("BindingExpression", HANDLE_BindingExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setBindingExpression, &Binding::getBindingExpression)); - registerProperty( PROPERTY_FLAGS( Model, css::uno::Reference<css::xforms::XModel>, css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), + registerProperty( css::beans::Property("Model", HANDLE_Model, cppu::UnoType<css::uno::Reference<css::xforms::XModel>>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), new DirectPropertyAccessor< Binding, css::uno::Reference<css::xforms::XModel> >(this, nullptr, &Binding::getModel)); - registerProperty( PROPERTY_FLAGS( BindingNamespaces, css::uno::Reference<css::container::XNameContainer>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("BindingNamespaces", HANDLE_BindingNamespaces, cppu::UnoType<css::uno::Reference<css::container::XNameContainer>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, css::uno::Reference<css::container::XNameContainer> >(this, &Binding::setBindingNamespaces, &Binding::getBindingNamespaces)); - registerProperty( PROPERTY_FLAGS( ModelNamespaces, css::uno::Reference<css::container::XNameContainer>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ModelNamespaces", HANDLE_ModelNamespaces, cppu::UnoType<css::uno::Reference<css::container::XNameContainer>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, css::uno::Reference<css::container::XNameContainer> >(this, &Binding::setModelNamespaces, &Binding::getModelNamespaces)); - registerProperty( PROPERTY_FLAGS( ModelID, OUString, css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), + registerProperty( css::beans::Property("ModelID", HANDLE_ModelID, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), new DirectPropertyAccessor< Binding, OUString >(this, nullptr, &Binding::getModelID)); - registerProperty( PROPERTY_FLAGS( ReadonlyExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ReadonlyExpression", HANDLE_ReadonlyExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setReadonlyExpression, &Binding::getReadonlyExpression)); - registerProperty( PROPERTY_FLAGS( RelevantExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("RelevantExpression", HANDLE_RelevantExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setRelevantExpression, &Binding::getRelevantExpression)); - registerProperty( PROPERTY_FLAGS( RequiredExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("RequiredExpression", HANDLE_RequiredExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setRequiredExpression, &Binding::getRequiredExpression)); - registerProperty( PROPERTY_FLAGS( ConstraintExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ConstraintExpression", HANDLE_ConstraintExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setConstraintExpression, &Binding::getConstraintExpression)); - registerProperty( PROPERTY_FLAGS( CalculateExpression, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("CalculateExpression", HANDLE_CalculateExpression, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setCalculateExpression, &Binding::getCalculateExpression)); - registerProperty( PROPERTY_FLAGS( Type, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Type", HANDLE_Type, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Binding, OUString >(this, &Binding::setType, &Binding::getType)); - registerProperty( PROPERTY_FLAGS( ReadOnly, bool, css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), + registerProperty( css::beans::Property("ReadOnly", HANDLE_ReadOnly, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), new DirectPropertyAccessor< Binding, bool >(this, nullptr, &Binding::getReadOnly)); - registerProperty( PROPERTY_FLAGS( Relevant, bool, css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), + registerProperty( css::beans::Property("Relevant", HANDLE_Relevant, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), new DirectPropertyAccessor< Binding, bool >(this, nullptr, &Binding::getRelevant)); - registerProperty( PROPERTY_FLAGS( ExternalData, sal_Bool, css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), + registerProperty( css::beans::Property("ExternalData", HANDLE_ExternalData, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ), new BooleanPropertyAccessor< Binding >(this, nullptr, &Binding::getExternalData)); initializePropertyValueCache( HANDLE_ReadOnly ); diff --git a/forms/source/xforms/datatyperepository.cxx b/forms/source/xforms/datatyperepository.cxx index 64b37b1a981e..76b9715ee48c 100644 --- a/forms/source/xforms/datatyperepository.cxx +++ b/forms/source/xforms/datatyperepository.cxx @@ -49,40 +49,40 @@ namespace xforms { // insert some basic types - OUString sName( FRM_RES_STRING( RID_STR_DATATYPE_STRING ) ); + OUString sName( ResourceManager::loadString(RID_STR_DATATYPE_STRING) ); m_aRepository[ sName ] = new OStringType( sName, css::xsd::DataTypeClass::STRING ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_URL ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_URL); m_aRepository[ sName ] = new OStringType( sName, css::xsd::DataTypeClass::anyURI ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_BOOLEAN ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_BOOLEAN); m_aRepository[ sName ] = new OBooleanType( sName ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_DECIMAL ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_DECIMAL); m_aRepository[ sName ] = new ODecimalType( sName, css::xsd::DataTypeClass::DECIMAL ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_FLOAT ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_FLOAT); m_aRepository[ sName ] = new ODecimalType( sName, css::xsd::DataTypeClass::FLOAT ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_DOUBLE ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_DOUBLE); m_aRepository[ sName ] = new ODecimalType( sName, css::xsd::DataTypeClass::DOUBLE ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_DATE ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_DATE); m_aRepository[ sName ] = new ODateType( sName ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_TIME ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_TIME); m_aRepository[ sName ] = new OTimeType( sName ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_DATETIME ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_DATETIME); m_aRepository[ sName ] = new ODateTimeType( sName ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_YEAR ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_YEAR); m_aRepository[ sName ] = new OShortIntegerType( sName, css::xsd::DataTypeClass::gYear ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_MONTH ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_MONTH); m_aRepository[ sName ] = new OShortIntegerType( sName, css::xsd::DataTypeClass::gMonth ); - sName = FRM_RES_STRING( RID_STR_DATATYPE_DAY ); + sName = ResourceManager::loadString(RID_STR_DATATYPE_DAY); m_aRepository[ sName ] = new OShortIntegerType( sName, css::xsd::DataTypeClass::gDay ); } @@ -145,7 +145,7 @@ namespace xforms Repository::iterator aTypePos = implLocate( typeName ); if ( aTypePos->second->getIsBasic() ) // "This is a built-in type and cannot be removed." - throw VetoException(FRM_RES_STRING( RID_STR_XFORMS_CANT_REMOVE_TYPE ), *this ); + throw VetoException(ResourceManager::loadString(RID_STR_XFORMS_CANT_REMOVE_TYPE), *this ); m_aRepository.erase( aTypePos ); } diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index eb52f06e0a9d..7001f4aaa8e8 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -562,18 +562,18 @@ css::uno::Reference<css::container::XSet> Model::getSubmissions() void Model::initializePropertySet() { - registerProperty( PROPERTY_FLAGS( ID, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ID", HANDLE_ID, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new APIPropertyAccessor< Model, OUString >(this, &Model::setID, &Model::getID) ); - registerProperty( PROPERTY_FLAGS( ForeignSchema, css::uno::Reference<css::xml::dom::XDocument>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ForeignSchema", HANDLE_ForeignSchema, cppu::UnoType<css::uno::Reference<css::xml::dom::XDocument>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Model, css::uno::Reference<css::xml::dom::XDocument> >( this, &Model::setForeignSchema, &Model::getForeignSchema) ); - registerProperty( PROPERTY_FLAGS( SchemaRef, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("SchemaRef", HANDLE_SchemaRef, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Model, OUString >( this, &Model::setSchemaRef, &Model::getSchemaRef) ); - registerProperty( PROPERTY_FLAGS( Namespaces, css::uno::Reference<css::container::XNameContainer>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Namespaces", HANDLE_Namespaces, cppu::UnoType<css::uno::Reference<css::container::XNameContainer>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Model, css::uno::Reference<css::container::XNameContainer> >( this, &Model::setNamespaces, &Model::getNamespaces) ); - registerProperty( PROPERTY_FLAGS( ExternalData, sal_Bool, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ExternalData", HANDLE_ExternalData, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND ), new BooleanPropertyAccessor< Model >( this, &Model::setExternalData, &Model::getExternalData ) ); } diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index 890e18ea73ae..018bec4503f1 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -924,15 +924,14 @@ void xforms::getInstanceData( for( sal_Int32 n = 0; n < nValues; n++ ) { const PropertyValue& rValue = pValues[n]; -#define PROP(NAME) \ - if( p##NAME != nullptr && \ - rValue.Name == #NAME ) \ - rValue.Value >>= (*p##NAME) - PROP(ID); - PROP(Instance); - PROP(URL); - PROP(URLOnce); -#undef PROP + if( pID != nullptr && rValue.Name == "ID") + rValue.Value >>= *pID; + if( pInstance != nullptr && rValue.Name == "Instance") + rValue.Value >>= *pInstance; + if( pURL != nullptr && rValue.Name == "URL") + rValue.Value >>= *pURL; + if( pURLOnce != nullptr && rValue.Name == "URLOnce") + rValue.Value >>= *pURLOnce; } } @@ -955,38 +954,54 @@ void xforms::setInstanceData( const bool* pURLOnce = ( bURLOnce && pURL != nullptr ) ? &bURLOnce : nullptr; // determine new instance data -#define PROP(NAME) if( _p##NAME != nullptr ) p##NAME = _p##NAME - PROP(ID); - PROP(Instance); - PROP(URL); - PROP(URLOnce); -#undef PROP + if (_pID != nullptr) + pID = _pID; + if (_pInstance != nullptr) + pInstance = _pInstance; + if (_pURL != nullptr) + pURL = _pURL; + if (_pURLOnce != nullptr) + pURLOnce = _pURLOnce; // count # of values we want to set sal_Int32 nCount = 0; -#define PROP(NAME) if( p##NAME != nullptr ) nCount++ - PROP(ID); - PROP(Instance); - PROP(URL); - PROP(URLOnce); -#undef PROP + if (pID != nullptr) + ++nCount; + if (pInstance != nullptr) + ++nCount; + if (pURL != nullptr) + ++nCount; + if (pURLOnce != nullptr) + ++nCount; // realloc sequence and enter values; aSequence.realloc( nCount ); PropertyValue* pSequence = aSequence.getArray(); sal_Int32 nIndex = 0; -#define PROP(NAME) \ - if( p##NAME != nullptr ) \ - { \ - pSequence[ nIndex ].Name = #NAME; \ - pSequence[ nIndex ].Value <<= *p##NAME; \ - nIndex++; \ - } - PROP(ID); - PROP(Instance); - PROP(URL); - PROP(URLOnce); -#undef PROP + if(pID != nullptr) + { + pSequence[ nIndex ].Name = "ID"; + pSequence[ nIndex ].Value <<= *pID; + nIndex++; + } + if(pInstance != nullptr) + { + pSequence[ nIndex ].Name = "Instance"; + pSequence[ nIndex ].Value <<= *pInstance; + nIndex++; + } + if(pURL != nullptr) + { + pSequence[ nIndex ].Name = "URL"; + pSequence[ nIndex ].Value <<= *pURL; + nIndex++; + } + if(pURLOnce != nullptr) + { + pSequence[ nIndex ].Name = "URLOnce"; + pSequence[ nIndex ].Value <<= *pURLOnce; + nIndex++; + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/xforms/propertysetbase.hxx b/forms/source/xforms/propertysetbase.hxx index 4d5a719582a7..d4b4212c45c7 100644 --- a/forms/source/xforms/propertysetbase.hxx +++ b/forms/source/xforms/propertysetbase.hxx @@ -337,9 +337,4 @@ public: } }; - -#define PROPERTY_FLAGS( NAME, TYPE, FLAG ) css::beans::Property( \ - #NAME, \ - HANDLE_##NAME, cppu::UnoType<TYPE>::get(), FLAG ) - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index 3e582514bd7e..6b30ff0f7c3e 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -299,52 +299,52 @@ Model* Submission::getModelImpl() const void Submission::initializePropertySet() { - registerProperty( PROPERTY_FLAGS( ID, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("ID", HANDLE_ID, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setID, &Submission::getID) ); - registerProperty( PROPERTY_FLAGS( Bind, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Bind", HANDLE_Bind, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setBind, &Submission::getBind) ); - registerProperty( PROPERTY_FLAGS( Ref, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Ref", HANDLE_Ref, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setRef, &Submission::getRef) ); - registerProperty( PROPERTY_FLAGS( Action, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Action", HANDLE_Action, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setAction, &Submission::getAction) ); - registerProperty( PROPERTY_FLAGS( Method, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Method", HANDLE_Method, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setMethod, &Submission::getMethod) ); - registerProperty( PROPERTY_FLAGS( Version, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Version", HANDLE_Version, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setVersion, &Submission::getVersion) ); - registerProperty( PROPERTY_FLAGS( Indent, bool, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Indent", HANDLE_Indent, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ), new BooleanPropertyAccessor< Submission >(this, &Submission::setIndent, &Submission::getIndent)); - registerProperty( PROPERTY_FLAGS( MediaType, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("MediaType", HANDLE_MediaType, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setMediaType, &Submission::getMediaType) ); - registerProperty( PROPERTY_FLAGS( Encoding, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Encoding", HANDLE_Encoding, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setEncoding, &Submission::getEncoding) ); - registerProperty( PROPERTY_FLAGS( OmitXmlDeclaration, bool, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("OmitXmlDeclaration", HANDLE_OmitXmlDeclaration, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ), new BooleanPropertyAccessor< Submission >(this, &Submission::setOmitXmlDeclaration, &Submission::getOmitXmlDeclaration)); - registerProperty( PROPERTY_FLAGS( Standalone, bool, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Standalone", HANDLE_Standalone, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ), new BooleanPropertyAccessor< Submission >(this, &Submission::setStandalone, &Submission::getStandalone)); - registerProperty( PROPERTY_FLAGS( CDataSectionElement, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("CDataSectionElement", HANDLE_CDataSectionElement, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setCDataSectionElement, &Submission::getCDataSectionElement) ); - registerProperty( PROPERTY_FLAGS( Replace, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Replace", HANDLE_Replace, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setReplace, &Submission::getReplace) ); - registerProperty( PROPERTY_FLAGS( Separator, OUString, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Separator", HANDLE_Separator, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, OUString >(this, &Submission::setSeparator, &Submission::getSeparator) ); - registerProperty( PROPERTY_FLAGS( IncludeNamespacePrefixes, Sequence<OUString>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("IncludeNamespacePrefixes", HANDLE_IncludeNamespacePrefixes, cppu::UnoType<Sequence<OUString>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, Sequence<OUString> >(this, &Submission::setIncludeNamespacePrefixes, &Submission::getIncludeNamespacePrefixes) ); - registerProperty( PROPERTY_FLAGS( Model, Reference<XModel>, css::beans::PropertyAttribute::BOUND ), + registerProperty( css::beans::Property("Model", HANDLE_Model, cppu::UnoType<Reference<XModel>>::get(), css::beans::PropertyAttribute::BOUND ), new DirectPropertyAccessor< Submission, Reference<XModel> >(this, &Submission::setModel, &Submission::getModel) ); initializePropertyValueCache( HANDLE_Indent );