diff options
Diffstat (limited to 'chart2/source/controller/itemsetwrapper')
14 files changed, 409 insertions, 284 deletions
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 0f1ce591ad4f..4eb1a92d21c0 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -39,12 +39,14 @@ #include "ChartModelHelper.hxx" #include "AxisHelper.hxx" #include "CommonConverters.hxx" +#include "ChartTypeHelper.hxx" #include <com/sun/star/chart/ChartAxisLabelPosition.hpp> #include <com/sun/star/chart/ChartAxisMarkPosition.hpp> #include <com/sun/star/chart/ChartAxisPosition.hpp> #include <com/sun/star/chart2/XAxis.hpp> #include <com/sun/star/chart2/AxisOrientation.hpp> +#include <com/sun/star/chart2/AxisType.hpp> // for SfxBoolItem #include <svl/eitem.hxx> @@ -59,6 +61,8 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; using ::com::sun::star::uno::Reference; +using ::com::sun::star::chart::TimeInterval; +using ::com::sun::star::chart::TimeIncrement; namespace { @@ -66,13 +70,13 @@ namespace { static ::comphelper::ItemPropertyMapType aAxisPropertyMap( ::comphelper::MakeItemPropertyMap - IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 ) - IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 ) - IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 ) - IPM_MAP_ENTRY( SCHATTR_TEXT_ORDER, "ArrangeOrder", 0 ) - IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 ) - IPM_MAP_ENTRY( SCHATTR_TEXTBREAK, "TextBreak", 0 ) - IPM_MAP_ENTRY( SCHATTR_TEXT_OVERLAP, "TextOverlap", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_ORDER, "ArrangeOrder", 0 ) + IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_BREAK, "TextBreak", 0 ) + IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_OVERLAP, "TextOverlap", 0 ) ); return aAxisPropertyMap; @@ -89,8 +93,8 @@ AxisItemConverter::AxisItemConverter( SfxItemPool& rItemPool, SdrModel& rDrawModel, const Reference< chart2::XChartDocument > & xChartDoc, - chart2::ExplicitScaleData * pScale /* = NULL */, - chart2::ExplicitIncrementData * pIncrement /* = NULL */, + ::chart::ExplicitScaleData * pScale /* = NULL */, + ::chart::ExplicitIncrementData * pIncrement /* = NULL */, ::std::auto_ptr< awt::Size > pRefSize /* = NULL */ ) : ItemConverter( rPropertySet, rItemPool ), m_xChartDoc( xChartDoc ), @@ -100,9 +104,9 @@ AxisItemConverter::AxisItemConverter( Reference< lang::XMultiServiceFactory > xNamedPropertyContainerFactory( xChartDoc, uno::UNO_QUERY ); if( pScale ) - m_pExplicitScale = new chart2::ExplicitScaleData( *pScale ); + m_pExplicitScale = new ::chart::ExplicitScaleData( *pScale ); if( pIncrement ) - m_pExplicitIncrement = new chart2::ExplicitIncrementData( *pIncrement ); + m_pExplicitIncrement = new ::chart::ExplicitIncrementData( *pIncrement ); m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, @@ -144,7 +148,7 @@ bool AxisItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * AxisItemConverter::GetWhichPairs() const +const sal_uInt16 * AxisItemConverter::GetWhichPairs() const { // must span all used items! return nAxisWhichPairs; @@ -163,30 +167,40 @@ bool AxisItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWit return true; } -void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const +bool lcl_hasTimeIntervalValue( const uno::Any& rAny ) +{ + bool bRet = false; + TimeInterval aValue; + if( rAny >>= aValue ) + bRet = true; + return bRet; +} + +void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { - if( ! m_xAxis.is() ) + if( !m_xAxis.is() ) return; - const chart2::ScaleData aScale( m_xAxis->getScaleData() ); - const chart2::IncrementData aInc( aScale.IncrementData ); - const uno::Sequence< chart2::SubIncrement > aSubIncs( aScale.IncrementData.SubIncrements ); + const chart2::ScaleData& rScale( m_xAxis->getScaleData() ); + const chart2::IncrementData& rIncrement( rScale.IncrementData ); + const uno::Sequence< chart2::SubIncrement >& rSubIncrements( rScale.IncrementData.SubIncrements ); + const TimeIncrement& rTimeIncrement( rScale.TimeIncrement ); + bool bDateAxis = (chart2::AxisType::DATE == rScale.AxisType); + if( m_pExplicitScale ) + bDateAxis = (chart2::AxisType::DATE == m_pExplicitScale->AxisType); switch( nWhichId ) { case SCHATTR_AXIS_AUTO_MAX: - // if the any has no value => auto is on - rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Maximum) ) ); + rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Maximum) ) ); break; case SCHATTR_AXIS_MAX: { double fMax = 10.0; - if( aScale.Maximum >>= fMax ) - { + if( rScale.Maximum >>= fMax ) rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) ); - } else { if( m_pExplicitScale ) @@ -197,106 +211,141 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS break; case SCHATTR_AXIS_AUTO_MIN: - // if the any has no value => auto is on - rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Minimum) ) ); + rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Minimum) ) ); break; case SCHATTR_AXIS_MIN: { double fMin = 0.0; - if( aScale.Minimum >>= fMin ) - { + if( rScale.Minimum >>= fMin ) rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) ); - } - else - { - if( m_pExplicitScale ) - rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId )); - } + else if( m_pExplicitScale ) + rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId )); } break; case SCHATTR_AXIS_LOGARITHM: - { - BOOL bValue = AxisHelper::isLogarithmic( aScale.Scaling ); - rOutItemSet.Put( SfxBoolItem( nWhichId, bValue )); - } - break; + { + sal_Bool bValue = AxisHelper::isLogarithmic( rScale.Scaling ); + rOutItemSet.Put( SfxBoolItem( nWhichId, bValue )); + } + break; case SCHATTR_AXIS_REVERSE: - rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == aScale.Orientation) )); + rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == rScale.Orientation) )); break; // Increment case SCHATTR_AXIS_AUTO_STEP_MAIN: - // if the any has no value => auto is on - rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aInc.Distance) ) ); + if( bDateAxis ) + rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MajorTimeInterval) ) ); + else + rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rIncrement.Distance) ) ); + break; + + case SCHATTR_AXIS_MAIN_TIME_UNIT: + { + TimeInterval aTimeInterval; + if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval ) + rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) ); + else if( m_pExplicitIncrement ) + rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MajorTimeInterval.TimeUnit ) ); + } break; case SCHATTR_AXIS_STEP_MAIN: + if( bDateAxis ) + { + TimeInterval aTimeInterval; + if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval ) + rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, nWhichId )); + else if( m_pExplicitIncrement ) + rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, nWhichId )); + } + else { double fDistance = 1.0; - if( aInc.Distance >>= fDistance ) - { + if( rIncrement.Distance >>= fDistance ) rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId )); - } - else - { - if( m_pExplicitIncrement ) - rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId )); - } + else if( m_pExplicitIncrement ) + rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId )); } break; // SubIncrement case SCHATTR_AXIS_AUTO_STEP_HELP: - { - // if the any has no value => auto is on - rOutItemSet.Put( - SfxBoolItem( - nWhichId, - ! ( aSubIncs.getLength() > 0 && - aSubIncs[0].IntervalCount.hasValue() ))); - } - break; + if( bDateAxis ) + rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MinorTimeInterval) ) ); + else + rOutItemSet.Put( SfxBoolItem( nWhichId, + ! ( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue() ))); + break; + + case SCHATTR_AXIS_HELP_TIME_UNIT: + { + TimeInterval aTimeInterval; + if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval ) + rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) ); + else if( m_pExplicitIncrement ) + rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.TimeUnit ) ); + } + break; case SCHATTR_AXIS_STEP_HELP: - { - if( aSubIncs.getLength() > 0 && - aSubIncs[0].IntervalCount.hasValue()) + if( bDateAxis ) { - OSL_ASSERT( aSubIncs[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG ); - rOutItemSet.Put( - SfxInt32Item( - nWhichId, - *reinterpret_cast< const sal_Int32 * >( - aSubIncs[0].IntervalCount.getValue()) )); + TimeInterval aTimeInterval; + if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval ) + rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.Number )); + else if( m_pExplicitIncrement ) + rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.Number )); } else { - if( m_pExplicitIncrement && - m_pExplicitIncrement->SubIncrements.getLength() > 0 ) + if( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue()) + { + OSL_ASSERT( rSubIncrements[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG ); + rOutItemSet.Put( SfxInt32Item( nWhichId, + *reinterpret_cast< const sal_Int32 * >( + rSubIncrements[0].IntervalCount.getValue()) )); + } + else { - rOutItemSet.Put( - SfxInt32Item( - nWhichId, - m_pExplicitIncrement->SubIncrements[0].IntervalCount )); + if( m_pExplicitIncrement && !m_pExplicitIncrement->SubIncrements.empty() ) + { + rOutItemSet.Put( SfxInt32Item( nWhichId, + m_pExplicitIncrement->SubIncrements[0].IntervalCount )); + } } } - } - break; + break; + + case SCHATTR_AXIS_AUTO_TIME_RESOLUTION: + { + rOutItemSet.Put( SfxBoolItem( nWhichId, + !rTimeIncrement.TimeResolution.hasValue() )); + } + break; + case SCHATTR_AXIS_TIME_RESOLUTION: + { + long nTimeResolution=0; + if( rTimeIncrement.TimeResolution >>= nTimeResolution ) + rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) ); + else if( m_pExplicitScale ) + rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitScale->TimeResolution ) ); + } + break; case SCHATTR_AXIS_AUTO_ORIGIN: { - // if the any has no double value => auto is on - rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(aScale.Origin) ))); + rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(rScale.Origin) ))); } break; case SCHATTR_AXIS_ORIGIN: { double fOrigin = 0.0; - if( !(aScale.Origin >>= fOrigin) ) + if( !(rScale.Origin >>= fOrigin) ) { if( m_pExplicitScale ) fOrigin = m_pExplicitScale->Origin; @@ -391,12 +440,45 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS break; case SCHATTR_AXISTYPE: - rOutItemSet.Put( SfxInt32Item( nWhichId, aScale.AxisType )); + rOutItemSet.Put( SfxInt32Item( nWhichId, rScale.AxisType )); + break; + + case SCHATTR_AXIS_AUTO_DATEAXIS: + rOutItemSet.Put( SfxBoolItem( nWhichId, rScale.AutoDateAxis )); + break; + + case SCHATTR_AXIS_ALLOW_DATEAXIS: + { + Reference< chart2::XCoordinateSystem > xCooSys( + AxisHelper::getCoordinateSystemOfAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) ); + sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0; + AxisHelper::getIndicesForAxis(m_xAxis, xCooSys, nDimensionIndex, nAxisIndex ); + bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), 2, nDimensionIndex ); + rOutItemSet.Put( SfxBoolItem( nWhichId, bChartTypeAllowsDateAxis )); + } break; } } -bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) +bool lcl_isDateAxis( const SfxItemSet & rItemSet ) +{ + sal_Int32 nAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( SCHATTR_AXISTYPE )).GetValue();//::com::sun::star::chart2::AxisType + return (chart2::AxisType::DATE == nAxisType); +} + +bool lcl_isAutoMajor( const SfxItemSet & rItemSet ) +{ + bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue(); + return bRet; +} + +bool lcl_isAutoMinor( const SfxItemSet & rItemSet ) +{ + bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue(); + return bRet; +} + +bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { if( !m_xAxis.is() ) @@ -502,23 +584,47 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI // Increment case SCHATTR_AXIS_AUTO_STEP_MAIN: - if( (static_cast< const SfxBoolItem & >( - rItemSet.Get( nWhichId )).GetValue() )) + if( lcl_isAutoMajor(rItemSet) ) { aScale.IncrementData.Distance.clear(); + aScale.TimeIncrement.MajorTimeInterval.clear(); bSetScale = true; } // else SCHATTR_AXIS_STEP_MAIN must have some value break; + case SCHATTR_AXIS_MAIN_TIME_UNIT: + if( !lcl_isAutoMajor(rItemSet) ) + { + if( rItemSet.Get( nWhichId ).QueryValue( aValue ) ) + { + TimeInterval aTimeInterval; + aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval; + aValue >>= aTimeInterval.TimeUnit; + aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval ); + bSetScale = true; + } + } + break; + case SCHATTR_AXIS_STEP_MAIN: // only if auto if false - if( ! (static_cast< const SfxBoolItem & >( - rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue() )) + if( !lcl_isAutoMajor(rItemSet) ) { rItemSet.Get( nWhichId ).QueryValue( aValue ); - - if( aScale.IncrementData.Distance != aValue ) + if( lcl_isDateAxis(rItemSet) ) + { + double fValue = 1.0; + if( aValue >>= fValue ) + { + TimeInterval aTimeInterval; + aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval; + aTimeInterval.Number = static_cast<double>(fValue); + aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval ); + bSetScale = true; + } + } + else if( aScale.IncrementData.Distance != aValue ) { aScale.IncrementData.Distance = aValue; bSetScale = true; @@ -528,35 +634,85 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI // SubIncrement case SCHATTR_AXIS_AUTO_STEP_HELP: - if( (static_cast< const SfxBoolItem & >( - rItemSet.Get( nWhichId )).GetValue() ) && - aScale.IncrementData.SubIncrements.getLength() > 0 && - aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ) + if( lcl_isAutoMinor(rItemSet) ) { - aScale.IncrementData.SubIncrements[0].IntervalCount.clear(); + if( aScale.IncrementData.SubIncrements.getLength() > 0 && + aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ) + { + aScale.IncrementData.SubIncrements[0].IntervalCount.clear(); + bSetScale = true; + } + if( aScale.TimeIncrement.MinorTimeInterval.hasValue() ) + { + aScale.TimeIncrement.MinorTimeInterval.clear(); bSetScale = true; + } } // else SCHATTR_AXIS_STEP_MAIN must have some value break; + case SCHATTR_AXIS_HELP_TIME_UNIT: + if( !lcl_isAutoMinor(rItemSet) ) + { + if( rItemSet.Get( nWhichId ).QueryValue( aValue ) ) + { + TimeInterval aTimeInterval; + aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval; + aValue >>= aTimeInterval.TimeUnit; + aScale.TimeIncrement.MinorTimeInterval = uno::makeAny( aTimeInterval ); + bSetScale = true; + } + } + break; + case SCHATTR_AXIS_STEP_HELP: - // only if auto if false - if( ! (static_cast< const SfxBoolItem & >( - rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue() ) && - aScale.IncrementData.SubIncrements.getLength() > 0 ) + // only if auto is false + if( !lcl_isAutoMinor(rItemSet) ) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + if( lcl_isDateAxis(rItemSet) ) + { + TimeInterval aTimeInterval; + aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval; + aValue >>= aTimeInterval.Number; + aScale.TimeIncrement.MinorTimeInterval = uno::makeAny(aTimeInterval); + bSetScale = true; + } + else if( aScale.IncrementData.SubIncrements.getLength() > 0 ) + { + if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() || + aScale.IncrementData.SubIncrements[0].IntervalCount != aValue ) + { + OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG ); + aScale.IncrementData.SubIncrements[0].IntervalCount = aValue; + bSetScale = true; + } + } + } + break; + + case SCHATTR_AXIS_AUTO_TIME_RESOLUTION: + if( (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() )) + { + aScale.TimeIncrement.TimeResolution.clear(); + bSetScale = true; + } + break; + case SCHATTR_AXIS_TIME_RESOLUTION: + // only if auto is false + if( ! (static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_TIME_RESOLUTION )).GetValue() )) { rItemSet.Get( nWhichId ).QueryValue( aValue ); - if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() || - aScale.IncrementData.SubIncrements[0].IntervalCount != aValue ) + if( aScale.TimeIncrement.TimeResolution != aValue ) { - OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG ); - aScale.IncrementData.SubIncrements[0].IntervalCount = aValue; + aScale.TimeIncrement.TimeResolution = aValue; bSetScale = true; } } break; + case SCHATTR_AXIS_AUTO_ORIGIN: { if( (static_cast< const SfxBoolItem & >( @@ -820,7 +976,23 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI break; case SCHATTR_AXISTYPE: - //don't allow to change the axis type so far + { + sal_Int32 nNewAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();//::com::sun::star::chart2::AxisType + aScale.AxisType = nNewAxisType; + bSetScale = true; + } + break; + + case SCHATTR_AXIS_AUTO_DATEAXIS: + { + bool bNewValue = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue(); + bool bOldValue = aScale.AutoDateAxis; + if( bOldValue != bNewValue ) + { + aScale.AutoDateAxis = bNewValue; + bSetScale = true; + } + } break; } diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx index 3993a98a90ae..d047a6ac03b6 100644 --- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -103,7 +103,7 @@ CharacterPropertyItemConverter::CharacterPropertyItemConverter( CharacterPropertyItemConverter::~CharacterPropertyItemConverter() {} -const USHORT * CharacterPropertyItemConverter::GetWhichPairs() const +const sal_uInt16 * CharacterPropertyItemConverter::GetWhichPairs() const { return nCharacterPropertyWhichPairs; } @@ -121,7 +121,7 @@ bool CharacterPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tPr } void CharacterPropertyItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) @@ -289,7 +289,7 @@ void CharacterPropertyItemConverter::FillSpecialItem( } bool CharacterPropertyItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 4359efa95909..e399e4ba82b1 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -108,13 +108,13 @@ sal_Int32 lcl_getSymbolStyleForSymbol( const chart2::Symbol & rSymbol ) return nStyle; } -bool lcl_NumberFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso ) +bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso ) { bool bChanged = false; if( !xPropertySet.is() ) return bChanged; rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" ); - USHORT nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; + sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; if( SFX_ITEM_SET != rItemSet.GetItemState( nSourceWhich ) ) return bChanged; @@ -155,13 +155,13 @@ bool lcl_NumberFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet & return bChanged; } -bool lcl_UseSourceFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso ) +bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso ) { bool bChanged = false; if( !xPropertySet.is() ) return bChanged; rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" ); - USHORT nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; + sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; if( SFX_ITEM_SET != rItemSet.GetItemState( nWhichId ) ) return bChanged; @@ -291,7 +291,7 @@ bool DataPointItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * DataPointItemConverter::GetWhichPairs() const +const sal_uInt16 * DataPointItemConverter::GetWhichPairs() const { // must span all used items! if( m_bDataSeries ) @@ -313,7 +313,7 @@ bool DataPointItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNa bool DataPointItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -545,7 +545,7 @@ bool DataPointItemConverter::ApplySpecialItem( } void DataPointItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) @@ -643,7 +643,7 @@ void DataPointItemConverter::FillSpecialItem( { SvULongs aList; for ( sal_Int32 nN=0; nN<m_aAvailableLabelPlacements.getLength(); nN++ ) - aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< USHORT >(nN) ); + aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< sal_uInt16 >(nN) ); rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) ); } break; diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx index 072768c13658..59a24c238544 100644 --- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx @@ -134,7 +134,7 @@ bool ErrorBarItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * ErrorBarItemConverter::GetWhichPairs() const +const sal_uInt16 * ErrorBarItemConverter::GetWhichPairs() const { // must span all used items! return nErrorBarWhichPairs; @@ -148,7 +148,7 @@ bool ErrorBarItemConverter::GetItemProperty( } bool ErrorBarItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -343,7 +343,7 @@ bool ErrorBarItemConverter::ApplySpecialItem( } void ErrorBarItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index dd41bb4af525..b593f8d19f47 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -140,7 +140,7 @@ bool lcl_supportsLineProperties( ::chart::wrapper::GraphicPropertyItemConverter: bool lcl_SetContentForNamedProperty( const uno::Reference< lang::XMultiServiceFactory > & xFactory, const ::rtl::OUString & rTableName, - NameOrIndex & rItem, BYTE nMemberId ) + NameOrIndex & rItem, sal_uInt8 nMemberId ) { bool bResult = false; if( xFactory.is()) @@ -184,9 +184,9 @@ GraphicPropertyItemConverter::GraphicPropertyItemConverter( GraphicPropertyItemConverter::~GraphicPropertyItemConverter() {} -const USHORT * GraphicPropertyItemConverter::GetWhichPairs() const +const sal_uInt16 * GraphicPropertyItemConverter::GetWhichPairs() const { - const USHORT * pResult = NULL; + const sal_uInt16 * pResult = NULL; switch( m_eGraphicObjectType ) { @@ -251,7 +251,7 @@ bool GraphicPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tProp } void GraphicPropertyItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) @@ -294,7 +294,7 @@ void GraphicPropertyItemConverter::FillSpecialItem( if( (aValue >>= aName) && aName.getLength()) { - aItem.SetEnabled( TRUE ); + aItem.SetEnabled( sal_True ); rOutItemSet.Put( aItem ); } } @@ -453,7 +453,7 @@ void GraphicPropertyItemConverter::FillSpecialItem( } bool GraphicPropertyItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index 322061b61b06..57cf1143ecf9 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -101,7 +101,7 @@ void ItemConverter::_disposing( const lang::EventObject& rSource ) void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const { - const USHORT * pRanges = rOutItemSet.GetRanges(); + const sal_uInt16 * pRanges = rOutItemSet.GetRanges(); tPropertyNameWithMemberId aProperty; SfxItemPool & rPool = GetItemPool(); @@ -111,13 +111,13 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const while( (*pRanges) != 0) { - USHORT nBeg = (*pRanges); + sal_uInt16 nBeg = (*pRanges); ++pRanges; - USHORT nEnd = (*pRanges); + sal_uInt16 nEnd = (*pRanges); ++pRanges; OSL_ASSERT( nBeg <= nEnd ); - for( USHORT nWhich = nBeg; nWhich <= nEnd; ++nWhich ) + for( sal_uInt16 nWhich = nBeg; nWhich <= nEnd; ++nWhich ) { if( GetItemProperty( nWhich, aProperty )) { @@ -172,14 +172,14 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const } void ItemConverter::FillSpecialItem( - USHORT /*nWhichId*/, SfxItemSet & /*rOutItemSet*/ ) const + sal_uInt16 /*nWhichId*/, SfxItemSet & /*rOutItemSet*/ ) const throw( uno::Exception ) { OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" ); } bool ItemConverter::ApplySpecialItem( - USHORT /*nWhichId*/, const SfxItemSet & /*rItemSet*/ ) + sal_uInt16 /*nWhichId*/, const SfxItemSet & /*rItemSet*/ ) throw( uno::Exception ) { OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" ); @@ -198,7 +198,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) while( pItem ) { - if( rItemSet.GetItemState( pItem->Which(), FALSE ) == SFX_ITEM_SET ) + if( rItemSet.GetItemState( pItem->Which(), sal_False ) == SFX_ITEM_SET ) { if( GetItemProperty( pItem->Which(), aProperty )) { @@ -242,13 +242,13 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItemSet &rSourceSet ) { SfxWhichIter aIter (rSourceSet); - USHORT nWhich = aIter.FirstWhich (); + sal_uInt16 nWhich = aIter.FirstWhich (); const SfxPoolItem *pPoolItem = NULL; while (nWhich) { - if ((rSourceSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET) && - (rDestSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET)) + if ((rSourceSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_SET) && + (rDestSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_SET)) { if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich)) { @@ -258,7 +258,7 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem } } } - else if( rSourceSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_DONTCARE ) + else if( rSourceSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_DONTCARE ) rDestSet.InvalidateItem(nWhich); nWhich = aIter.NextWhich (); diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx index d17feda59b48..75f2254c2218 100644 --- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx @@ -34,10 +34,12 @@ #include "ItemPropertyMap.hxx" #include "GraphicPropertyItemConverter.hxx" #include "CharacterPropertyItemConverter.hxx" -#include <svx/chrtitem.hxx> #include <com/sun/star/chart2/XLegend.hpp> #include <com/sun/star/chart2/LegendPosition.hpp> -#include <com/sun/star/chart2/LegendExpansion.hpp> +#include <com/sun/star/chart/ChartLegendExpansion.hpp> + +#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <functional> #include <algorithm> @@ -92,7 +94,7 @@ bool LegendItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * LegendItemConverter::GetWhichPairs() const +const sal_uInt16 * LegendItemConverter::GetWhichPairs() const { // must span all used items! return nLegendWhichPairs; @@ -105,52 +107,19 @@ bool LegendItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPropertyN } -bool LegendItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) +bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet& rInItemSet ) throw( uno::Exception ) { bool bChanged = false; switch( nWhichId ) { - case SCHATTR_LEGEND_POS: + case SCHATTR_LEGEND_SHOW: { - chart2::LegendPosition eNewPos = chart2::LegendPosition_LINE_END; - chart2::LegendPosition eOldPos; - bool bIsWide = false; - sal_Bool bShow = sal_True; - - SvxChartLegendPos eItemPos = - static_cast< const SvxChartLegendPosItem & >( - rItemSet.Get( nWhichId )).GetValue(); - switch( eItemPos ) - { - case CHLEGEND_LEFT: - eNewPos = chart2::LegendPosition_LINE_START; - break; - case CHLEGEND_RIGHT: - eNewPos = chart2::LegendPosition_LINE_END; - break; - case CHLEGEND_TOP: - eNewPos = chart2::LegendPosition_PAGE_START; - bIsWide = true; - break; - case CHLEGEND_BOTTOM: - eNewPos = chart2::LegendPosition_PAGE_END; - bIsWide = true; - break; - - case CHLEGEND_NONE: - case CHLEGEND_NONE_LEFT: - case CHLEGEND_NONE_RIGHT: - case CHLEGEND_NONE_TOP: - case CHLEGEND_NONE_BOTTOM: - bShow = sal_False; - break; - } - - try + const SfxPoolItem* pPoolItem = NULL; + if( rInItemSet.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET ) { + sal_Bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); sal_Bool bWasShown = sal_True; if( ! (GetPropertySet()->getPropertyValue( C2U("Show")) >>= bWasShown) || ( bWasShown != bShow )) @@ -158,25 +127,48 @@ bool LegendItemConverter::ApplySpecialItem( GetPropertySet()->setPropertyValue( C2U("Show"), uno::makeAny( bShow )); bChanged = true; } + } + + } + break; + case SCHATTR_LEGEND_POS: + { + const SfxPoolItem* pPoolItem = NULL; + if( rInItemSet.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET ) + { + chart2::LegendPosition eNewPos = static_cast<chart2::LegendPosition>(((const SfxInt32Item*)pPoolItem)->GetValue()); - if( bShow ) + ::com::sun::star::chart::ChartLegendExpansion eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH; + switch( eNewPos ) { + case chart2::LegendPosition_LINE_START: + case chart2::LegendPosition_LINE_END: + eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH; + break; + case chart2::LegendPosition_PAGE_START: + case chart2::LegendPosition_PAGE_END: + eExpansion = ::com::sun::star::chart::ChartLegendExpansion_WIDE; + break; + default: + break; + } + + try + { + chart2::LegendPosition eOldPos; if( ! ( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eOldPos ) || ( eOldPos != eNewPos )) { GetPropertySet()->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( eNewPos )); - chart2::LegendExpansion eExp = bIsWide - ? chart2::LegendExpansion_WIDE - : chart2::LegendExpansion_HIGH; - GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExp )); + GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion )); GetPropertySet()->setPropertyValue( C2U( "RelativePosition" ), uno::Any()); bChanged = true; } } - } - catch( uno::Exception & ex ) - { - ASSERT_EXCEPTION( ex ); + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } } } break; @@ -186,48 +178,23 @@ bool LegendItemConverter::ApplySpecialItem( } void LegendItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) { - case SCHATTR_LEGEND_POS: + case SCHATTR_LEGEND_SHOW: { - SvxChartLegendPos eItemPos( CHLEGEND_RIGHT ); - chart2::LegendPosition ePos; - sal_Bool bShow = sal_True; GetPropertySet()->getPropertyValue( C2U( "Show" )) >>= bShow; - - if( ! bShow ) - { - eItemPos = CHLEGEND_NONE; - } - else if( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos ) - { - switch( ePos ) - { - case chart2::LegendPosition_LINE_START: - eItemPos = CHLEGEND_LEFT; - break; - case chart2::LegendPosition_LINE_END: - eItemPos = CHLEGEND_RIGHT; - break; - case chart2::LegendPosition_PAGE_START: - eItemPos = CHLEGEND_TOP; - break; - case chart2::LegendPosition_PAGE_END: - eItemPos = CHLEGEND_BOTTOM; - break; - - case chart2::LegendPosition_CUSTOM: - default: - eItemPos = CHLEGEND_RIGHT; - break; - } - } - - rOutItemSet.Put( SvxChartLegendPosItem( eItemPos, SCHATTR_LEGEND_POS ) ); + rOutItemSet.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, bShow) ); + } + break; + case SCHATTR_LEGEND_POS: + { + chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END ); + GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eLegendPos; + rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, eLegendPos ) ); } break; } diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx index 9ba75dbbe6ea..46d5269793de 100644 --- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx +++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx @@ -84,7 +84,7 @@ AllAxisItemConverter::~AllAxisItemConverter() { } -const USHORT * AllAxisItemConverter::GetWhichPairs() const +const sal_uInt16 * AllAxisItemConverter::GetWhichPairs() const { // must span all used items! return nAllAxisWhichPairs; @@ -114,7 +114,7 @@ AllGridItemConverter::~AllGridItemConverter() { } -const USHORT * AllGridItemConverter::GetWhichPairs() const +const sal_uInt16 * AllGridItemConverter::GetWhichPairs() const { // must span all used items! return nGridWhichPairs; @@ -162,7 +162,7 @@ AllDataLabelItemConverter::~AllDataLabelItemConverter() { } -const USHORT * AllDataLabelItemConverter::GetWhichPairs() const +const sal_uInt16 * AllDataLabelItemConverter::GetWhichPairs() const { // must span all used items! return nDataLabelWhichPairs; @@ -196,7 +196,7 @@ AllTitleItemConverter::~AllTitleItemConverter() { } -const USHORT * AllTitleItemConverter::GetWhichPairs() const +const sal_uInt16 * AllTitleItemConverter::GetWhichPairs() const { // must span all used items! return nTitleWhichPairs; @@ -224,7 +224,7 @@ AllSeriesStatisticsConverter::AllSeriesStatisticsConverter( AllSeriesStatisticsConverter::~AllSeriesStatisticsConverter() {} -const USHORT * AllSeriesStatisticsConverter::GetWhichPairs() const +const sal_uInt16 * AllSeriesStatisticsConverter::GetWhichPairs() const { // must span all used items! return nStatWhichPairs; diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx index 672bf52ab652..e517fdd82702 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx @@ -112,7 +112,7 @@ bool RegressionCurveItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * RegressionCurveItemConverter::GetWhichPairs() const +const sal_uInt16 * RegressionCurveItemConverter::GetWhichPairs() const { // must span all used items! return nRegressionCurveWhichPairs; @@ -127,7 +127,7 @@ bool RegressionCurveItemConverter::GetItemProperty( bool RegressionCurveItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY ); @@ -172,7 +172,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem( OSL_ASSERT( xCurve.is()); if( xCurve.is()) { - bool bNewShow = static_cast< BOOL >( + bool bNewShow = static_cast< sal_Bool >( static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue()); @@ -195,7 +195,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem( OSL_ASSERT( xCurve.is()); if( xCurve.is()) { - bool bNewShow = static_cast< BOOL >( + bool bNewShow = static_cast< sal_Bool >( static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue()); @@ -218,7 +218,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem( } void RegressionCurveItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY ); diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx index e4e95884461c..0244bc6cba92 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx @@ -105,7 +105,7 @@ bool RegressionEquationItemConverter::ApplyItemSet( const SfxItemSet & rItemSet return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * RegressionEquationItemConverter::GetWhichPairs() const +const sal_uInt16 * RegressionEquationItemConverter::GetWhichPairs() const { // must span all used items! return nRegEquationWhichPairs; @@ -124,7 +124,7 @@ bool RegressionEquationItemConverter::GetItemProperty( tWhichIdType nWhichId, tP } bool RegressionEquationItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -149,7 +149,7 @@ bool RegressionEquationItemConverter::ApplySpecialItem( } void RegressionEquationItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx index 596c495b8635..7a842dfe2174 100644 --- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx +++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx @@ -42,10 +42,9 @@ namespace EE_ITEMS_START, EE_ITEMS_END, \ SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING -const USHORT nTitleWhichPairs[] = +const sal_uInt16 nTitleWhichPairs[] = { - SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx - SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_TEXT_START, SCHATTR_TEXT_END, XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx @@ -53,40 +52,33 @@ const USHORT nTitleWhichPairs[] = 0 }; -const USHORT nAxisWhichPairs[] = +const sal_uInt16 nAxisWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx CHARACTER_WHICHPAIRS, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, // 10585 - 10585 svx/svxids.hrc SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, // 11432 svx/svxids.hrc - SCHATTR_AXISTYPE, SCHATTR_AXISTYPE, // 39 sch/schattr.hxx - SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx - SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx - SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx - SCHATTR_AXIS_START, SCHATTR_AXIS_END, // 70 - 95 sch/schattr.hxx - SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx + SCHATTR_AXIS_START, SCHATTR_AXIS_END, + SCHATTR_TEXT_START, SCHATTR_TEXT_END, 0 }; -const USHORT nAllAxisWhichPairs[] = +const sal_uInt16 nAllAxisWhichPairs[] = { - XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_LINE_FIRST, XATTR_LINE_LAST, CHARACTER_WHICHPAIRS, - SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx - SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx - SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx - SCHATTR_AXIS_SHOWDESCR, SCHATTR_AXIS_SHOWDESCR, // 85 sch/schattr.hxx - SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx + SCHATTR_AXIS_LABEL_START, SCHATTR_AXIS_LABEL_END, + SCHATTR_TEXT_START, SCHATTR_TEXT_END, 0 }; -const USHORT nGridWhichPairs[] = +const sal_uInt16 nGridWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx 0 }; -const USHORT nLegendWhichPairs[] = +const sal_uInt16 nLegendWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx @@ -96,13 +88,11 @@ const USHORT nLegendWhichPairs[] = 0 }; -const USHORT nDataLabelWhichPairs[] = +const sal_uInt16 nDataLabelWhichPairs[] = { SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \ SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \ - SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \ - SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \ SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR, 0 @@ -116,15 +106,13 @@ const USHORT nDataLabelWhichPairs[] = SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, /* 1 - 2 sch/schattr.hxx*/ \ SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \ SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \ - SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \ - SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \ SCHATTR_TEXT_DEGREES, SCHATTR_TEXT_DEGREES, \ SCHATTR_STYLE_START,SCHATTR_STYLE_END, /* 59 - 68 sch/schattr.hxx*/ \ SCHATTR_SYMBOL_BRUSH,SCHATTR_SYMBOL_BRUSH, /* 94 sch/schattr.hxx*/ \ SCHATTR_SYMBOL_SIZE,SCHATTR_SYMBOL_SIZE, /* 97 sch/schattr.hxx*/ \ SDRATTR_3D_FIRST, SDRATTR_3D_LAST /* 1244 - 1334 svx/svddef.hxx */ -const USHORT nDataPointWhichPairs[] = +const sal_uInt16 nDataPointWhichPairs[] = { CHART_POINT_WHICHPAIRS, 0 @@ -140,20 +128,20 @@ const USHORT nDataPointWhichPairs[] = SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, \ SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS -const USHORT nSeriesOptionsWhichPairs[] = +const sal_uInt16 nSeriesOptionsWhichPairs[] = { CHART_SERIES_OPTIONS_WHICHPAIRS, 0 }; -const USHORT nRowWhichPairs[] = +const sal_uInt16 nRowWhichPairs[] = { CHART_POINT_WHICHPAIRS, CHART_SERIES_OPTIONS_WHICHPAIRS, 0 }; -const USHORT nAreaWhichPairs[] = +const sal_uInt16 nAreaWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx @@ -161,30 +149,28 @@ const USHORT nAreaWhichPairs[] = 0 }; -const USHORT nTextWhichPairs[] = +const sal_uInt16 nTextWhichPairs[] = { CHARACTER_WHICHPAIRS, - SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx - SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_TEXT_START, SCHATTR_TEXT_END, 0 }; -const USHORT nTextOrientWhichPairs[] = +const sal_uInt16 nTextOrientWhichPairs[] = { CHARACTER_WHICHPAIRS, - SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx - SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_TEXT_START, SCHATTR_TEXT_END, 0 }; -const USHORT nStatWhichPairs[]= +const sal_uInt16 nStatWhichPairs[]= { SCHATTR_STAT_START, SCHATTR_STAT_END, // 45 - 52 sch/schattr.hxx SCHATTR_REGRESSION_START, SCHATTR_REGRESSION_END, // 108 - 109 0 }; -const USHORT nErrorBarWhichPairs[]= +const sal_uInt16 nErrorBarWhichPairs[]= { SCHATTR_STAT_START, SCHATTR_STAT_END, // 45 - 52 sch/schattr.hxx XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx @@ -193,26 +179,26 @@ const USHORT nErrorBarWhichPairs[]= // for CharacterProperties -const USHORT nCharacterPropertyWhichPairs[] = +const sal_uInt16 nCharacterPropertyWhichPairs[] = { CHARACTER_WHICHPAIRS, 0 }; -const USHORT nLinePropertyWhichPairs[] = +const sal_uInt16 nLinePropertyWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx 0 }; -const USHORT nFillPropertyWhichPairs[] = +const sal_uInt16 nFillPropertyWhichPairs[] = { XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx 0 }; -const USHORT nLineAndFillPropertyWhichPairs[] = +const sal_uInt16 nLineAndFillPropertyWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx @@ -220,7 +206,7 @@ const USHORT nLineAndFillPropertyWhichPairs[] = 0 }; -const USHORT nChartStyleWhichPairs[] = +const sal_uInt16 nChartStyleWhichPairs[] = { SCHATTR_DIAGRAM_STYLE, SCHATTR_DIAGRAM_STYLE, SCHATTR_STYLE_SHAPE, SCHATTR_STYLE_SHAPE, @@ -230,14 +216,14 @@ const USHORT nChartStyleWhichPairs[] = 0 }; -const USHORT nRegressionCurveWhichPairs[] = +const sal_uInt16 nRegressionCurveWhichPairs[] = { SCHATTR_REGRESSION_START, SCHATTR_REGRESSION_END, // 108 - 109 XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx 0 }; -const USHORT nRegEquationWhichPairs[] = +const sal_uInt16 nRegEquationWhichPairs[] = { XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index ce2bf41a7479..1782d9513caa 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -187,7 +187,7 @@ SeriesOptionsItemConverter::~SeriesOptionsItemConverter() { } -const USHORT * SeriesOptionsItemConverter::GetWhichPairs() const +const sal_uInt16 * SeriesOptionsItemConverter::GetWhichPairs() const { // must span all used items! return nSeriesOptionsWhichPairs; @@ -198,7 +198,7 @@ bool SeriesOptionsItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPr return false; } -bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) +bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -373,7 +373,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte } void SeriesOptionsItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) @@ -435,7 +435,7 @@ void SeriesOptionsItemConverter::FillSpecialItem( { SvULongs aList; for ( sal_Int32 nN=0; nN<m_aSupportedMissingValueTreatments.getLength(); nN++ ) - aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< USHORT >(nN) ); + aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< sal_uInt16 >(nN) ); rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) ); break; } diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index 409b675e41b9..6b35080a5cb3 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -154,7 +154,7 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties( { SvxChartRegress eRegress = CHREGRESS_NONE; const SfxPoolItem *pPoolItem = NULL; - if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, sal_True, &pPoolItem ) == SFX_ITEM_SET ) { eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue(); bEquationExists = ( eRegress != CHREGRESS_NONE ); @@ -204,7 +204,7 @@ StatisticsItemConverter::StatisticsItemConverter( StatisticsItemConverter::~StatisticsItemConverter() {} -const USHORT * StatisticsItemConverter::GetWhichPairs() const +const sal_uInt16 * StatisticsItemConverter::GetWhichPairs() const { // must span all used items! return nStatWhichPairs; @@ -218,7 +218,7 @@ bool StatisticsItemConverter::GetItemProperty( } bool StatisticsItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -522,7 +522,7 @@ bool StatisticsItemConverter::ApplySpecialItem( } void StatisticsItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx index fffaa31a8590..2dd9d8730055 100644 --- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx @@ -76,7 +76,7 @@ public: virtual ~FormattedStringsConverter(); protected: - virtual const USHORT * GetWhichPairs() const; + virtual const sal_uInt16 * GetWhichPairs() const; }; // ---------------------------------------- @@ -110,7 +110,7 @@ FormattedStringsConverter::~FormattedStringsConverter() { } -const USHORT * FormattedStringsConverter::GetWhichPairs() const +const sal_uInt16 * FormattedStringsConverter::GetWhichPairs() const { return nCharacterPropertyWhichPairs; } @@ -171,7 +171,7 @@ bool TitleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) return ItemConverter::ApplyItemSet( rItemSet ) || bResult; } -const USHORT * TitleItemConverter::GetWhichPairs() const +const sal_uInt16 * TitleItemConverter::GetWhichPairs() const { // must span all used items! return nTitleWhichPairs; @@ -191,7 +191,7 @@ bool TitleItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWi bool TitleItemConverter::ApplySpecialItem( - USHORT nWhichId, const SfxItemSet & rItemSet ) + sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) throw( uno::Exception ) { bool bChanged = false; @@ -222,7 +222,7 @@ bool TitleItemConverter::ApplySpecialItem( } void TitleItemConverter::FillSpecialItem( - USHORT nWhichId, SfxItemSet & rOutItemSet ) const + sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const throw( uno::Exception ) { switch( nWhichId ) |