diff options
Diffstat (limited to 'svx/source/form/fmtools.cxx')
-rw-r--r-- | svx/source/form/fmtools.cxx | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 66bb70881252..d3b83f7c7676 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -288,7 +288,7 @@ sal_Bool searchElement(const Reference< ::com::sun::star::container::XIndexAcces xCont->getByIndex(i) >>= xComp; if (xComp.is()) { - if (((XInterface *)xElement.get()) == (XInterface*)xComp.get()) + if ( xElement == xComp ) return sal_True; else { @@ -1120,82 +1120,3 @@ sal_Bool isRowSetAlive(const Reference< XInterface >& _rxRowSet) return bIsAlive; } -// ----------------------------------------------------------------------------- -namespace -{ - //.................................................................... - static Sequence< PropertyValue > lcl_getDataSourceIndirectProperties( const Reference< XPropertySet >& _rxControlModel, - const Reference< XMultiServiceFactory >& _rxORB ) SAL_THROW(()) - { - OSL_PRECOND( _rxControlModel.is(), "lcl_getDataSourceIndirectProperties: invalid model!" ); - - Sequence< PropertyValue > aInfo; - try - { - Reference< XChild > xChild( _rxControlModel, UNO_QUERY ); - Reference< XPropertySet > xForm; - if ( xChild.is() ) - xForm = xForm.query( xChild->getParent() ); - - if ( Reference< XGridColumnFactory >( xForm, UNO_QUERY ).is() ) - { // hmm. the model is a grid column, in real - xChild = xChild.query( xForm ); - xForm = xForm.query( xChild->getParent() ); - } - - OSL_ENSURE( xForm.is(), "lcl_getDataSourceIndirectProperties: could not determine the form!" ); - if ( !xForm.is() ) - return aInfo; - ::rtl::OUString sDataSourceName; - xForm->getPropertyValue( FM_PROP_DATASOURCE ) >>= sDataSourceName; - - Reference< XPropertySet > xDsProperties; - if ( sDataSourceName.getLength() ) - xDsProperties = xDsProperties.query( OStaticDataAccessTools().getDataSource( sDataSourceName, _rxORB ) ); - if ( xDsProperties.is() ) - xDsProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Info" ) ) ) >>= aInfo; - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "lcl_getDataSourceIndirectProperties: caught an exception!" ); - } - return aInfo; - } -} - -//------------------------------------------------------------------------------ -void initializeTextFieldLineEnds( const Reference< XPropertySet >& _rxModel, const Reference< XMultiServiceFactory >& _rxORB ) SAL_THROW(()) -{ - OSL_PRECOND( _rxModel.is(), "initializeTextFieldLineEnds: invalid model!" ); - if ( !_rxModel.is() ) - return; - - try - { - Reference< XPropertySetInfo > xInfo = _rxModel->getPropertySetInfo(); - if ( !xInfo.is() || !xInfo->hasPropertyByName( FM_PROP_LINEENDFORMAT ) ) - return; - - // let's see if the data source which the form belongs to (if any) - // has a setting for the preferred line end format - sal_Bool bDosLineEnds = sal_False; - Sequence< PropertyValue > aInfo = lcl_getDataSourceIndirectProperties( _rxModel, _rxORB ); - const PropertyValue* pInfo = aInfo.getConstArray(); - const PropertyValue* pInfoEnd = pInfo + aInfo.getLength(); - for ( ; pInfo != pInfoEnd; ++pInfo ) - { - if ( pInfo->Name.equalsAscii( "PreferDosLikeLineEnds" ) ) - { - pInfo->Value >>= bDosLineEnds; - break; - } - } - - sal_Int16 nLineEndFormat = bDosLineEnds ? LineEndFormat::CARRIAGE_RETURN_LINE_FEED : LineEndFormat::LINE_FEED; - _rxModel->setPropertyValue( FM_PROP_LINEENDFORMAT, makeAny( nLineEndFormat ) ); - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "initializeTextFieldLineEnds: caught an exception!" ); - } -} |