23#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
24#include <com/sun/star/sdbc/SQLException.hpp>
25#include <com/sun/star/sdb/XParametersSupplier.hpp>
26#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
27#include <com/sun/star/util/XNumberFormatTypes.hpp>
41 using ::com::sun::star::uno::Reference;
42 using ::com::sun::star::report::XFormattedField;
43 using ::com::sun::star::uno::UNO_QUERY;
44 using ::com::sun::star::sdb::XSingleSelectQueryComposer;
45 using ::com::sun::star::sdbcx::XColumnsSupplier;
46 using ::com::sun::star::container::XIndexAccess;
47 using ::com::sun::star::beans::XPropertySet;
48 using ::com::sun::star::uno::UNO_QUERY_THROW;
49 using ::com::sun::star::uno::Exception;
50 using ::com::sun::star::sdb::XParametersSupplier;
51 using ::com::sun::star::sdbc::SQLException;
52 using ::com::sun::star::util::XNumberFormatsSupplier;
53 using ::com::sun::star::util::XNumberFormatTypes;
61 ,m_bFieldListDirty( true )
83 if ( xFormatted.is() )
94 if ( !xFormatted.is() )
113 if ( _rChangedPropName !=
u"Command" && _rChangedPropName !=
u"CommandType" && _rChangedPropName !=
u"EscapeProcessing" )
122 if ( _rChangedPropName !=
u"DataField" )
136 sal_Int32
nCount( _rxColumns->getCount() );
137 _inout_rFields.reserve( _inout_rFields.size() +
static_cast<size_t>(nCount) );
142 for ( sal_Int32 i=0;
i<
nCount; ++
i )
144 xColumn.set( _rxColumns->getByIndex( i ), UNO_QUERY_THROW );
145 OSL_VERIFY(
xColumn->getPropertyValue(
"Name") >>= aField.
sName );
147 OSL_VERIFY(
xColumn->getPropertyValue(
"Scale") >>= aField.
nScale );
149 _inout_rFields.push_back( aField );
152 catch(
const Exception& )
166 OSL_PRECOND(
m_xReportDefinition.is(),
"FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no report definition!" );
171 OSL_ENSURE( pController,
"FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no controller? how can *this* happen?!" );
181 if ( !xComposer.is() )
187 lcl_collectFields_throw( xColumns,
m_aFields );
191 lcl_collectFields_throw( xParams,
m_aFields );
193 catch(
const SQLException& )
216 sal_Int32 nFormatKey = _rxFormatted->getFormatKey();
217 if ( nFormatKey != 0 )
221 OUString sDataField( _rxFormatted->getDataField() );
222 static constexpr OUStringLiteral sFieldPrefix(
u"field:[" );
223 if ( sDataField.indexOf( sFieldPrefix ) != 0 )
227 if ( !sDataField.endsWith(
"]") )
230 OSL_FAIL(
"FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow: suspicious data field value!" );
233 sDataField = sDataField.copy( sFieldPrefix.getLength(), sDataField.getLength() - sFieldPrefix.getLength() - 1 );
236 [&sDataField](
const Field& rField) { return rField.sName == sDataField; });
244 nFormatKey = ::dbtools::getDefaultNumberFormat( field->nDataType, field->nScale, field->bIsCurrency, xNumFmtTypes,
246 _rxFormatted->setFormatKey( nFormatKey );
const css::uno::Reference< css::sdbc::XConnection > & getConnection() const
css::uno::Reference< css::report::XReportDefinition > getReportDefinition() const
returns the XReportDefinition which the OReportModel belongs to
dbaui::DBSubComponentController * getController() const
#define DBG_UNHANDLED_EXCEPTION(...)
const LanguageTag & getLocale()