diff options
Diffstat (limited to 'dbaccess/source/core/misc/DatabaseDataProvider.cxx')
-rw-r--r-- | dbaccess/source/core/misc/DatabaseDataProvider.cxx | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index c177ce70573c..d2aa735fa8ba 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -24,7 +24,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <connectivity/FValue.hxx> #include <sal/macros.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/sdb/CommandType.hpp> @@ -37,6 +37,7 @@ #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/XChartDataArray.hpp> +#include <utility> #include <vector> // TODO: update for new HavingClause-aware FilterManager @@ -69,8 +70,8 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex uno::Reference<beans::XPropertySet> xProp(static_cast< ::cppu::OWeakObject* >( this ),uno::UNO_QUERY); m_aFilterManager.initialize( m_xAggregateSet ); m_aParameterManager.initialize( xProp, m_xAggregate ); - m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND_TYPE,uno::makeAny(m_CommandType)); - m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,uno::makeAny(m_EscapeProcessing)); + m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND_TYPE,uno::Any(m_CommandType)); + m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,uno::Any(m_EscapeProcessing)); } osl_atomic_decrement( &m_refCount ); } @@ -123,7 +124,7 @@ void SAL_CALL DatabaseDataProvider::initialize(const uno::Sequence< uno::Any > & else if ( !m_xHandler.is() ) (*pIter) >>= m_xHandler; } - m_xAggregateSet->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, uno::makeAny( m_xActiveConnection ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, uno::Any( m_xActiveConnection ) ); } // chart2::data::XDataProvider: @@ -201,7 +202,7 @@ uno::Reference< chart2::data::XDataSource > SAL_CALL DatabaseDataProvider::creat uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY); if ( xIni.is() ) { - beans::NamedValue aParam("CreateDefaultData",uno::makeAny(true)); + beans::NamedValue aParam("CreateDefaultData",uno::Any(true)); uno::Sequence< uno::Any > aInitArgs{ uno::Any(aParam) }; xIni->initialize(aInitArgs); } @@ -215,9 +216,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum { ::comphelper::NamedValueCollection aArguments; aArguments.put( "CellRangeRepresentation", uno::Any( OUString( "all" ) ) ); - aArguments.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) ); + aArguments.put( "DataRowSource", uno::Any( chart::ChartDataRowSource_COLUMNS ) ); // internal data always contains labels - aArguments.put( "FirstCellAsLabel", uno::makeAny( true ) ); + aArguments.put( "FirstCellAsLabel", uno::Any( true ) ); bool bHasCategories = false; if( _xDataSource.is()) @@ -241,7 +242,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum } } } - aArguments.put( "HasCategories", uno::makeAny( bHasCategories ) ); + aArguments.put( "HasCategories", uno::Any( bHasCategories ) ); return aArguments.getPropertyValues(); } @@ -255,7 +256,7 @@ uno::Any DatabaseDataProvider::impl_getNumberFormatKey_nothrow(const OUString & std::map< OUString,css::uno::Any>::const_iterator aFind = m_aNumberFormats.find(_sRangeRepresentation); if ( aFind != m_aNumberFormats.end() ) return aFind->second; - return uno::makeAny(sal_Int32(0)); + return uno::Any(sal_Int32(0)); } uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::createDataSequenceByRangeRepresentation(const OUString & _sRangeRepresentation) @@ -263,7 +264,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre osl::MutexGuard g(m_aMutex); uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation); uno::Reference<beans::XPropertySet> xProp(xData,uno::UNO_QUERY); - static constexpr OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey"; + static constexpr OUString s_sNumberFormatKey = u"NumberFormatKey"_ustr; if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) ) { xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation)); @@ -444,7 +445,7 @@ void SAL_CALL DatabaseDataProvider::setCommand(const OUString & the_value) { osl::MutexGuard g(m_aMutex); impl_invalidateParameter_nothrow(); - m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND, uno::Any( the_value ) ); } set(PROPERTY_COMMAND,the_value,m_Command); } @@ -459,7 +460,7 @@ void SAL_CALL DatabaseDataProvider::setCommandType(::sal_Int32 the_value) { { osl::MutexGuard g(m_aMutex); - m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND_TYPE, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_COMMAND_TYPE, uno::Any( the_value ) ); } set(PROPERTY_COMMAND_TYPE,the_value,m_CommandType); } @@ -489,7 +490,7 @@ void SAL_CALL DatabaseDataProvider::setApplyFilter( sal_Bool the_value ) { { osl::MutexGuard g(m_aMutex); - m_xAggregateSet->setPropertyValue( PROPERTY_APPLYFILTER, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_APPLYFILTER, uno::Any( the_value ) ); } set(PROPERTY_APPLYFILTER,static_cast<bool>(the_value),m_ApplyFilter); } @@ -504,7 +505,7 @@ void SAL_CALL DatabaseDataProvider::setHavingClause( const OUString& the_value ) { { osl::MutexGuard g(m_aMutex); - m_xAggregateSet->setPropertyValue( PROPERTY_HAVING_CLAUSE, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_HAVING_CLAUSE, uno::Any( the_value ) ); } set(PROPERTY_HAVING_CLAUSE,the_value,m_HavingClause); } @@ -519,7 +520,7 @@ void SAL_CALL DatabaseDataProvider::setGroupBy( const OUString& the_value ) { { osl::MutexGuard g(m_aMutex); - m_xAggregateSet->setPropertyValue( PROPERTY_GROUP_BY, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_GROUP_BY, uno::Any( the_value ) ); } set(PROPERTY_GROUP_BY,the_value,m_GroupBy); } @@ -534,7 +535,7 @@ void SAL_CALL DatabaseDataProvider::setOrder( const OUString& the_value ) { { osl::MutexGuard g(m_aMutex); - m_xAggregateSet->setPropertyValue( PROPERTY_ORDER, uno::makeAny( the_value ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_ORDER, uno::Any( the_value ) ); } set(PROPERTY_ORDER,the_value,m_Order); } @@ -598,8 +599,8 @@ namespace ,nDataType( sdbc::DataType::VARCHAR ) { } - explicit ColumnDescription( const OUString& i_rName ) - :sName( i_rName ) + explicit ColumnDescription( OUString i_sName ) + :sName(std::move( i_sName )) ,nResultSetPosition( 0 ) ,nDataType( sdbc::DataType::VARCHAR ) { @@ -755,7 +756,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor { aRowLabels.push_back(OUString::number(h+1)); std::vector< double > aRow; - const sal_Int32 nSize = SAL_N_ELEMENTS(fDefaultData); + const sal_Int32 nSize = std::size(fDefaultData); for (size_t j = 0; j < (aColumns.size()-1); ++j,++k) { if ( k >= nSize ) @@ -792,7 +793,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor void DatabaseDataProvider::impl_fillRowSet_throw() { - m_xAggregateSet->setPropertyValue( PROPERTY_FILTER, uno::makeAny( getFilter() ) ); + m_xAggregateSet->setPropertyValue( PROPERTY_FILTER, uno::Any( getFilter() ) ); uno::Reference< sdbc::XParameters> xParam(m_xRowSet,uno::UNO_QUERY_THROW); xParam->clearParameters( ); } |