--- Orig/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx 2007-05-23 01:16:14.000000000 +0800 +++ new/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx 2007-06-25 13:53:00.000000000 +0800 @@ -104,6 +104,7 @@ PROP_AXIS_AUTO_STEPMAIN, PROP_AXIS_AUTO_STEPHELP, PROP_AXIS_LOGARITHMIC, + PROP_AXIS_REVERSEDIRECTION, PROP_AXIS_DISPLAY_LABELS, PROP_AXIS_TEXT_ROTATION, PROP_AXIS_MARKS, @@ -200,6 +201,13 @@ | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( + Property( C2U( "ReverseDirection" ), + PROP_AXIS_REVERSEDIRECTION, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( Property( C2U( "DisplayLabels" ), PROP_AXIS_DISPLAY_LABELS, ::getBooleanCppuType(), --- Orig/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx 2007-05-23 01:22:44.000000000 +0800 +++ new/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx 2007-07-02 09:58:04.000000000 +0800 @@ -50,6 +50,9 @@ #ifndef _COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ #include #endif +#ifndef _COM_SUN_STAR_CHART2_AXISORIENTATION_HPP_ +#include +#endif #ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ #include @@ -57,6 +60,7 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Any; +using namespace ::com::sun::star::chart2; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::rtl::OUString; @@ -108,6 +112,9 @@ case SCALE_PROP_LOGARITHMIC: m_aOuterName = C2U("Logarithmic"); break; + case SCALE_PROP_REVERSEDIRECTION: + m_aOuterName = C2U("ReverseDirection"); + break; default: OSL_ENSURE(false,"unknown scale property"); break; @@ -133,6 +140,7 @@ rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPMAIN, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPHELP, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_LOGARITHMIC, spChart2ModelContact ) ); + rList.push_back( new WrappedScaleProperty( SCALE_PROP_REVERSEDIRECTION, spChart2ModelContact ) ); } void WrappedScaleProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const @@ -284,6 +292,32 @@ } break; } + case SCALE_PROP_REVERSEDIRECTION: + { + if( rOuterValue >>= bBool ) + { + bool bWasReverse = false; + if ( AxisOrientation_REVERSE == aScaleData.Orientation ) + { + bWasReverse = true; + } + + // safe comparison between sal_Bool and bool + if( (!bBool) != (!bWasReverse) ) + { + if( bBool ) + { + aScaleData.Orientation = AxisOrientation_REVERSE; + } + else + { + aScaleData.Orientation = AxisOrientation_MATHEMATICAL; + } + bSetScaleData = true; + } + } + break; + } default: { OSL_ENSURE(false,"unknown scale property"); @@ -435,6 +469,11 @@ C2U( "com.sun.star.chart2.LogarithmicScaling" ))); break; } + case SCALE_PROP_REVERSEDIRECTION: + { + aRet <<= static_cast< sal_Bool >( AxisOrientation_REVERSE == aScaleData.Orientation ); + break; + } default: { OSL_ENSURE(false,"unknown scale property"); --- Orig/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx 2007-05-23 01:22:52.000000000 +0800 +++ new/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx 2007-06-25 13:54:48.000000000 +0800 @@ -63,6 +63,7 @@ , SCALE_PROP_AUTO_STEPMAIN , SCALE_PROP_AUTO_STEPHELP , SCALE_PROP_LOGARITHMIC + , SCALE_PROP_REVERSEDIRECTION }; public: --- Orig/chart2/source/controller/dialogs/TabPages.hrc 2007-05-23 01:31:10.000000000 +0800 +++ new/chart2/source/controller/dialogs/TabPages.hrc 2007-07-02 09:39:26.000000000 +0800 @@ -146,7 +146,7 @@ #define FL_SEPARATOR 18 -//#define TP_SCALE_Y 903 +//#define TP_SCALE_Y 903 #define FL_SCALE_Y 1 #define FL_TICKS 2 @@ -168,6 +168,7 @@ #define CBX_HELPTICKS_INNER 8 #define CBX_TICKS_OUTER 9 #define CBX_HELPTICKS_OUTER 10 +#define CBX_REVERSE 11 #define EDT_STEP_MAIN 1 #define EDT_MAX 2 --- Orig/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 2007-05-23 01:37:02.000000000 +0800 +++ new/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx 2007-07-02 09:42:28.000000000 +0800 @@ -127,6 +127,7 @@ , m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) ) , m_bAffectsMultipleObjects(false) , m_aLocalizedName() + , m_nAxisType(0) , m_bHasGeometryProperties(false) , m_bHasStatisticProperties(false) , m_bHasRegressionProperties(false) @@ -135,7 +136,6 @@ , m_bHasAreaProperties(false) , m_bHasLineProperties(false) , m_bHasSymbolProperties(false) - , m_bHasScaleProperties(false) , m_bCanAxisLabelsBeStaggered(false) { rtl::OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID ); @@ -152,6 +152,10 @@ { return m_aLocalizedName; } +sal_Int32 ObjectPropertiesDialogParameter::getAxisType() const +{ + return m_nAxisType; +} void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel >& xChartModel ) { @@ -176,18 +180,12 @@ if( OBJECTTYPE_AXIS == m_eObjectType ) { - //show scale properties only for a single axis not for multiselection - m_bHasScaleProperties = !m_bAffectsMultipleObjects; - - //no scale page for category axis - if( m_bHasScaleProperties ) + if( !m_bAffectsMultipleObjects ) { uno::Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel ) ); if( xAxis.is() ) { - ScaleData aData( xAxis->getScaleData() ); - if( aData.AxisType == chart2::AxisType::CATEGORY || aData.AxisType == chart2::AxisType::SERIES ) - m_bHasScaleProperties = false; + m_nAxisType = ( xAxis->getScaleData() ).AxisType; } } @@ -245,10 +243,6 @@ { return m_bHasSymbolProperties; } -bool ObjectPropertiesDialogParameter::HasScaleProperties() const -{ - return m_bHasScaleProperties; -} bool ObjectPropertiesDialogParameter::CanAxisLabelsBeStaggered() const { return m_bCanAxisLabelsBeStaggered; @@ -337,11 +331,28 @@ AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE))); AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS))); AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS))); - AddTabPage(TP_AXIS_LABEL, String(SchResId(STR_OBJECT_LABEL)), SchAxisLabelTabPage::Create, NULL); - if( m_pParameter->HasScaleProperties() ) + AddTabPage(TP_AXIS_LABEL, String(SchResId(STR_OBJECT_LABEL)), SchAxisLabelTabPage::Create, NULL); + switch ( m_pParameter->getAxisType() ) { - AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), SchScaleYAxisTabPage::Create, NULL); - AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS))); + case chart2::AxisType::REALNUMBER : + { + AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), ScaleTabPage::CreateValueScalePage, NULL); + AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS))); + } + break; + case chart2::AxisType::PERCENT : + { + AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), ScaleTabPage::CreatePercentAxisScalePage, NULL); + AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS))); + } + break; + case chart2::AxisType::CATEGORY : + { + AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), ScaleTabPage::CreateCategroyScalePage, NULL); + } + break; + case chart2::AxisType::SERIES : + break; } break; } @@ -359,7 +370,7 @@ AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_LINE))); AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)), SvxCharNamePage::Create, NULL); AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)), SvxCharEffectsPage::Create, NULL); - AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), SchScaleYAxisTabPage::Create, NULL); + AddTabPage(TP_SCALE_Y, String(SchResId(STR_PAGE_SCALE)), ScaleTabPage::Create, NULL); AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS)), SvxNumberFormatTabPage::Create, NULL); AddTabPage(TP_AXIS_LABEL, String(SchResId(STR_OBJECT_LABEL)), SchAxisLabelTabPage::Create, NULL); //// ((SfxItemSet * const) pAttr)->ClearItem (SCHATTR_AXISTYPE); @@ -485,7 +496,7 @@ case TP_SCALE_Y: { - SchScaleYAxisTabPage & rAxisTabPage = static_cast< SchScaleYAxisTabPage & >( rPage ); + ScaleTabPage & rAxisTabPage = static_cast< ScaleTabPage & >( rPage ); static SvNumberFormatter aNumberFormatter = SvNumberFormatter( LANGUAGE_SYSTEM ); --- Orig/chart2/source/controller/dialogs/tp_Scale.cxx 2007-05-23 01:48:22.000000000 +0800 +++ new/chart2/source/controller/dialogs/tp_Scale.cxx 2007-07-02 09:34:14.000000000 +0800 @@ -81,7 +81,7 @@ { //............................................................................. -SchScaleYAxisTabPage::SchScaleYAxisTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : +ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs, const ScalePageType& rScalePageType ) : SfxTabPage(pWindow, SchResId(TP_SCALE_Y), rInAttrs), aFlScale(this, SchResId(FL_SCALE_Y)), @@ -101,6 +101,7 @@ aFmtFldOrigin(this, SchResId(EDT_ORIGIN)), aCbxAutoOrigin(this, SchResId(CBX_AUTO_ORIGIN)), aCbxLogarithm(this, SchResId(CBX_LOGARITHM)), + aCbxReverse(this, SchResId(CBX_REVERSE)), aFlTicks(this,SchResId(FL_TICKS)), aCbxTicksInner(this, SchResId(CBX_TICKS_INNER)), @@ -121,17 +122,40 @@ FreeResource(); SetExchangeSupport(); - aCbxAutoMin.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); - aCbxAutoMax.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); - aCbxAutoStepMain.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); - aCbxAutoStepHelp.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); - aCbxAutoOrigin.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); + EnableControls( rScalePageType ); + + aCbxAutoMin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl)); + aCbxAutoMax.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl)); + aCbxAutoStepMain.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl)); + aCbxAutoStepHelp.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl)); + aCbxAutoOrigin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl)); const SfxPoolItem *pPoolItem = NULL; if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET) nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue(); } -IMPL_LINK( SchScaleYAxisTabPage, EnableValueHdl, CheckBox *, pCbx ) +void ScaleTabPage::EnableControls( const ScalePageType& rScalePageType ) +{ + aFlScale.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aTxtMin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aFmtFldMin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxAutoMin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aTxtMax.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aFmtFldMax.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxAutoMax.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aTxtMain.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aFmtFldStepMain.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxAutoStepMain.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aTxtHelp.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aMtStepHelp.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxAutoStepHelp.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aTxtOrigin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aFmtFldOrigin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxAutoOrigin.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); + aCbxLogarithm.Enable( ValueScalePage == rScalePageType || PercentScalePage == rScalePageType ); +} + +IMPL_LINK( ScaleTabPage, EnableValueHdl, CheckBox *, pCbx ) { if (pCbx == &aCbxAutoMin) { @@ -157,12 +181,22 @@ return 0; } -SfxTabPage* SchScaleYAxisTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs) +SfxTabPage* ScaleTabPage::CreateValueScalePage(Window* pWindow,const SfxItemSet& rOutAttrs) +{ + return new ScaleTabPage(pWindow, rOutAttrs, ValueScalePage ); +} + +SfxTabPage* ScaleTabPage::CreatePercentAxisScalePage(Window* pWindow,const SfxItemSet& rOutAttrs) +{ + return new ScaleTabPage(pWindow, rOutAttrs, PercentScalePage ); +} + +SfxTabPage* ScaleTabPage::CreateCategroyScalePage(Window* pWindow,const SfxItemSet& rOutAttrs) { - return new SchScaleYAxisTabPage(pWindow, rOutAttrs); + return new ScaleTabPage(pWindow, rOutAttrs, CategroyScalePage ); } -BOOL SchScaleYAxisTabPage::FillItemSet(SfxItemSet& rOutAttrs) +BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs) { DBG_ASSERT( pNumFormatter, "No NumberFormatter available" ); @@ -186,6 +220,7 @@ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,aCbxAutoStepHelp.IsChecked())); rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,aCbxAutoOrigin.IsChecked())); rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked())); + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_REVERSE ,aCbxReverse.IsChecked())); rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX)); rOutAttrs.Put(SvxDoubleItem(fMin , SCHATTR_AXIS_MIN)); rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp)); @@ -197,7 +232,7 @@ return TRUE; } -void SchScaleYAxisTabPage::Reset(const SfxItemSet& rInAttrs) +void ScaleTabPage::Reset(const SfxItemSet& rInAttrs) { DBG_ASSERT( pNumFormatter, "No NumberFormatter available" ); if(!pNumFormatter) @@ -246,6 +281,8 @@ aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,TRUE, &pPoolItem) == SFX_ITEM_SET) aCbxLogarithm.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + if (rInAttrs.GetItemState(SCHATTR_AXIS_REVERSE,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxReverse.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET) { nStepHelp = ((const SfxInt32Item*)pPoolItem)->GetValue(); @@ -266,7 +303,7 @@ EnableValueHdl(&aCbxAutoOrigin); } -int SchScaleYAxisTabPage::DeactivatePage(SfxItemSet* pItemSet) +int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet) { if( !pNumFormatter ) { @@ -363,7 +400,7 @@ return LEAVE_PAGE; } -void SchScaleYAxisTabPage::SetNumFormatter( SvNumberFormatter* pFormatter ) +void ScaleTabPage::SetNumFormatter( SvNumberFormatter* pFormatter ) { pNumFormatter = pFormatter; aFmtFldMax.SetFormatter( pNumFormatter ); @@ -373,7 +410,7 @@ SetNumFormat(); } -void SchScaleYAxisTabPage::SetNumFormat() +void ScaleTabPage::SetNumFormat() { const SfxPoolItem *pPoolItem = NULL; @@ -415,7 +452,7 @@ } } -bool SchScaleYAxisTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ ) +bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ ) { if( nResIdMessage == 0 ) return false; --- Orig/chart2/source/controller/dialogs/tp_Scale.hxx 2007-05-23 01:48:32.000000000 +0800 +++ new/chart2/source/controller/dialogs/tp_Scale.hxx 2007-07-02 09:37:52.000000000 +0800 @@ -62,7 +62,7 @@ { //............................................................................. -class SchScaleYAxisTabPage : public SfxTabPage +class ScaleTabPage : public SfxTabPage { private: FixedLine aFlScale; @@ -87,6 +87,7 @@ FormattedField aFmtFldOrigin; CheckBox aCbxAutoOrigin; CheckBox aCbxLogarithm; + CheckBox aCbxReverse; FixedLine aFlTicks; CheckBox aCbxTicksInner; @@ -104,6 +105,24 @@ int nAxisType; SvNumberFormatter* pNumFormatter; + enum ScalePageType + { + /** scale page for the value axis + */ + ValueScalePage = 0, + /** scale page for the percent axis + */ + PercentScalePage = 1, + /** scale page for the category axis + */ + CategroyScalePage = 2, + /** scale page for the series names (z axis) + */ + SeriesScalePage = 3, + }; + + void EnableControls( const ScalePageType& rScalePageType ); + DECL_LINK( EnableValueHdl, CheckBox* ); /** shows a warning window due to an invalid input. @@ -122,9 +141,11 @@ bool ShowWarning( USHORT nResIdMessage, Edit * pControl = NULL ); public: - SchScaleYAxisTabPage( Window* pParent, const SfxItemSet& rInAttrs ); + ScaleTabPage( Window* pParent, const SfxItemSet& rInAttrs, const ScalePageType& rScalePageType ); - static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs ); + static SfxTabPage* CreateValueScalePage( Window* pParent, const SfxItemSet& rInAttrs ); + static SfxTabPage* CreateCategroyScalePage( Window* pParent, const SfxItemSet& rInAttrs ); + static SfxTabPage* CreatePercentAxisScalePage( Window* pParent, const SfxItemSet& rInAttrs ); virtual BOOL FillItemSet( SfxItemSet& rOutAttrs ); virtual void Reset( const SfxItemSet& rInAttrs ); virtual int DeactivatePage( SfxItemSet* pItemSet = NULL ); --- Orig/chart2/source/controller/dialogs/tp_Scale.src 2007-05-23 01:48:46.000000000 +0800 +++ new/chart2/source/controller/dialogs/tp_Scale.src 2007-07-02 09:36:46.000000000 +0800 @@ -168,10 +168,18 @@ CheckBox CBX_LOGARITHM { Pos = MAP_APPFONT ( 11 , 97 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; + Size = MAP_APPFONT ( 78 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "~Logarithmic scale" ; }; + + CheckBox CBX_REVERSE + { + Pos = MAP_APPFONT ( 103 , 97 ) ; + Size = MAP_APPFONT ( 78 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Reverse ~direction" ; + }; FixedLine FL_TICKS { @@ -188,7 +196,7 @@ }; CheckBox CBX_TICKS_OUTER { - Pos = MAP_APPFONT ( 93 , 127 ) ; + Pos = MAP_APPFONT ( 103 , 127 ) ; Size = MAP_APPFONT ( 78 , 10 ) ; Text [ en-US ] = "~Outer"; }; @@ -208,7 +216,7 @@ }; CheckBox CBX_HELPTICKS_OUTER { - Pos = MAP_APPFONT ( 93 , 160 ) ; + Pos = MAP_APPFONT ( 103 , 160 ) ; Size = MAP_APPFONT ( 78 , 10 ) ; Text [ en-US ] = "Out~er"; }; --- Orig/chart2/source/controller/inc/dlg_ObjectProperties.hxx 2007-05-23 01:59:32.000000000 +0800 +++ new/chart2/source/controller/inc/dlg_ObjectProperties.hxx 2007-07-02 10:04:40.000000000 +0800 @@ -60,9 +60,10 @@ ObjectPropertiesDialogParameter( const rtl::OUString& rObjectCID ); virtual ~ObjectPropertiesDialogParameter(); - void init( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); + void init( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); ObjectType getObjectType() const; rtl::OUString getLocalizedName() const; + sal_Int32 getAxisType() const; bool HasGeometryProperties() const; bool HasStatisticProperties() const; @@ -72,7 +73,6 @@ bool HasAreaProperties() const; bool HasLineProperties() const; bool HasSymbolProperties() const; - bool HasScaleProperties() const; bool CanAxisLabelsBeStaggered() const; private: @@ -80,7 +80,9 @@ ObjectType m_eObjectType; bool m_bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles) - rtl::OUString m_aLocalizedName; + rtl::OUString m_aLocalizedName; + + sal_Int32 m_nAxisType; bool m_bHasGeometryProperties; bool m_bHasStatisticProperties; @@ -90,7 +92,6 @@ bool m_bHasAreaProperties; bool m_bHasLineProperties; bool m_bHasSymbolProperties; - bool m_bHasScaleProperties; bool m_bCanAxisLabelsBeStaggered; }; --- Orig/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx 2007-05-23 02:00:06.000000000 +0800 +++ new/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx 2007-07-02 09:46:36.000000000 +0800 @@ -54,6 +54,9 @@ #ifndef _COM_SUN_STAR_CHART2_XAXIS_HPP_ #include #endif +#ifndef _COM_SUN_STAR_CHART2_AXISORIENTATION_HPP_ +#include +#endif // #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ // #include @@ -253,6 +256,17 @@ } break; + case SCHATTR_AXIS_REVERSE: + { + bool bWasReverse = false; + if ( AxisOrientation_REVERSE == aScale.Orientation ) + { + bWasReverse = true; + } + rOutItemSet.Put( SfxBoolItem( nWhichId, bWasReverse )); + } + break; + // Increment case SCHATTR_AXIS_AUTO_STEP_MAIN: // if the any has no value => auto is on @@ -467,6 +481,35 @@ } break; + case SCHATTR_AXIS_REVERSE: + { + bool bWasReverse = false; + if ( AxisOrientation_REVERSE == aScale.Orientation ) + { + bWasReverse = true; + } + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() )) + { + // reverse is ture + if ( !bWasReverse ) + { + aScale.Orientation = AxisOrientation_REVERSE; + bSetScale = true; + } + } + else + { + // reverse is false => MATHEMATICAL + if ( bWasReverse ) + { + aScale.Orientation = AxisOrientation_MATHEMATICAL; + bSetScale = true; + } + } + } + break; + // Increment case SCHATTR_AXIS_AUTO_STEP_MAIN: if( (reinterpret_cast< const SfxBoolItem & >( --- Orig/chart2/source/inc/chartview/ChartSfxItemIds.hxx 2007-05-23 02:26:00.000000000 +0800 +++ new/chart2/source/inc/chartview/ChartSfxItemIds.hxx 2007-06-20 15:12:30.000000000 +0800 @@ -189,8 +189,8 @@ #define SCHATTR_AXIS_SHOWHELPGRID (SCHATTR_AXIS_START + 17)//87 #define SCHATTR_AXIS_TOPDOWN (SCHATTR_AXIS_START + 18)//88 #define SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_START + 19)//89 +#define SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 20)//90 -#define SCHATTR_AXIS_DUMMY0 (SCHATTR_AXIS_START + 20)//90 #define SCHATTR_AXIS_DUMMY1 (SCHATTR_AXIS_START + 21)//91 #define SCHATTR_AXIS_DUMMY2 (SCHATTR_AXIS_START + 22)//92 #define SCHATTR_AXIS_DUMMY3 (SCHATTR_AXIS_START + 23)//93 --- Orig/chart2/source/view/main/ChartItemPool.cxx 2007-06-20 15:28:22.000000000 +0800 +++ new/chart2/source/view/main/ChartItemPool.cxx 2007-07-02 09:49:48.000000000 +0800 @@ -196,8 +196,8 @@ ppPoolDefaults[SCHATTR_AXIS_SHOWMAINGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWMAINGRID,0); ppPoolDefaults[SCHATTR_AXIS_SHOWHELPGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWHELPGRID,0); ppPoolDefaults[SCHATTR_AXIS_TOPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_TOPDOWN,0); + ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,0); - ppPoolDefaults[SCHATTR_AXIS_DUMMY0 - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_DUMMY0,0); ppPoolDefaults[SCHATTR_AXIS_DUMMY1 - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_DUMMY1,0); ppPoolDefaults[SCHATTR_AXIS_DUMMY2 - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_DUMMY2,0); ppPoolDefaults[SCHATTR_AXIS_DUMMY3 - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_DUMMY3,0); @@ -446,9 +446,9 @@ delete ppPoolDefaults[SCHATTR_AXIS_SHOWHELPGRID - SCHATTR_START]; SetRefCount(*ppPoolDefaults[SCHATTR_AXIS_TOPDOWN - SCHATTR_START], 0); delete ppPoolDefaults[SCHATTR_AXIS_TOPDOWN - SCHATTR_START]; + SetRefCount(*ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START], 0); + delete ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START]; - SetRefCount(*ppPoolDefaults[SCHATTR_AXIS_DUMMY0 - SCHATTR_START], 0); - delete ppPoolDefaults[SCHATTR_AXIS_DUMMY0 - SCHATTR_START]; SetRefCount(*ppPoolDefaults[SCHATTR_AXIS_DUMMY1 - SCHATTR_START], 0); delete ppPoolDefaults[SCHATTR_AXIS_DUMMY1 - SCHATTR_START]; SetRefCount(*ppPoolDefaults[SCHATTR_AXIS_DUMMY2 - SCHATTR_START], 0); --- Orig/sc/source/filter/excel/xechart.cxx 2007-06-28 17:35:20.000000000 +0800 +++ new/sc/source/filter/excel/xechart.cxx 2007-06-28 17:44:46.000000000 +0800 @@ -2061,14 +2061,12 @@ if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin ) ) maData.mnCross = limit_cast< sal_uInt16 >( fOrigin, 1, 32767 ); -#if EXC_CHART2_REVERSE_AXIS // reverse order if( rScaleData.Orientation == ::com::sun::star::chart2::AxisOrientation_REVERSE ) { ::set_flag( maData.mnFlags, EXC_CHLABELRANGE_REVERSE ); SwapAxisMaxCross(); } -#endif } void XclExpChLabelRange::WriteBody( XclExpStream& rStrm ) @@ -2116,11 +2114,9 @@ maData.mfMinorStep = maData.mfMajorStep / nCount; ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_AUTOMINOR, bAutoMinor ); -#if EXC_CHART2_REVERSE_AXIS // reverse order namespace cssc = ::com::sun::star::chart2; ::set_flag( maData.mnFlags, EXC_CHVALUERANGE_REVERSE, rScaleData.Orientation == cssc::AxisOrientation_REVERSE ); -#endif } void XclExpChValueRange::WriteBody( XclExpStream& rStrm ) --- Orig/sc/source/filter/excel/xichart.cxx 2007-05-23 03:49:06.000000000 +0800 +++ new/sc/source/filter/excel/xichart.cxx 2007-06-28 17:44:52.000000000 +0800 @@ -2379,11 +2379,9 @@ bool bMaxCross = ::get_flag( maData.mnFlags, EXC_CHLABELRANGE_MAXCROSS ); lclSetValueOrClearAny( rScaleData.Origin, static_cast< double >( maData.mnCross ), bMaxCross ); -#if EXC_CHART2_REVERSE_AXIS // reverse order bool bReverse = ::get_flag( maData.mnFlags, EXC_CHLABELRANGE_REVERSE ); rScaleData.Orientation = bReverse ? cssc::AxisOrientation_REVERSE : cssc::AxisOrientation_MATHEMATICAL; -#endif //! TODO #i58731# show n-th category } @@ -2445,12 +2443,10 @@ } lclSetValueOrClearAny( rSubIncrementSeq[ 0 ].IntervalCount, nCount, nCount == 0 ); -#if EXC_CHART2_REVERSE_AXIS // reverse order namespace cssc = ::com::sun::star::chart2; bool bReverse = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_REVERSE ); rScaleData.Orientation = bReverse ? cssc::AxisOrientation_REVERSE : cssc::AxisOrientation_MATHEMATICAL; -#endif } // ---------------------------------------------------------------------------- --- Orig/sc/source/filter/inc/xlchart.hxx 2007-05-23 03:58:44.000000000 +0800 +++ new/sc/source/filter/inc/xlchart.hxx 2007-06-28 11:20:10.000000000 +0800 @@ -36,8 +36,6 @@ #ifndef SC_XLCHART_HXX #define SC_XLCHART_HXX -// disable/enable support for reversed axes -#define EXC_CHART2_REVERSE_AXIS 0 // disable/enable support for varied point colors property #define EXC_CHART2_VARYCOLORSBY_PROP 0 --- Orig/xmloff/inc/xmloff/xmltoken.hxx 2007-05-23 00:04:32.000000000 +0800 +++ new/xmloff/inc/xmloff/xmltoken.hxx 2007-07-02 09:51:34.000000000 +0800 @@ -2035,7 +2035,7 @@ XML_UNCOVER_TO_UPPERLEFT, XML_UNCOVER_TO_TOP, XML_UNCOVER_TO_UPPERRIGHT, - XML_UNCOVER_TO_RIGHT, + XML_UNCOVER_TO_RIGHT, XML_UNCOVER_TO_LOWERRIGHT, XML_UNCOVER_TO_BOTTOM, XML_UNCOVER_TO_LOWERLEFT, @@ -2048,6 +2048,7 @@ XML_APPLICATION, XML_SYMBOL_IMAGE, XML_TEXT_OVERLAP, + XML_REVERSE_DIRECTION, XML_SPLINE_ORDER, XML_SPLINE_RESOLUTION, --- Orig/xmloff/source/chart/PropertyMap.hxx 2007-05-23 00:05:14.000000000 +0800 +++ new/xmloff/source/chart/PropertyMap.hxx 2007-07-02 09:52:16.000000000 +0800 @@ -177,6 +177,7 @@ MAP_ENTRY( "GapWidth", CHART, XML_GAP_WIDTH, XML_TYPE_NUMBER ), MAP_ENTRY( "Overlap", CHART, XML_OVERLAP, XML_TYPE_NUMBER ), MAP_ENTRY( "TextCanOverlap", CHART, XML_TEXT_OVERLAP, XML_TYPE_BOOL ), + MAP_ENTRY( "ReverseDirection", CHART, XML_REVERSE_DIRECTION, XML_TYPE_BOOL ), MAP_ENTRY( "TextBreak", TEXT, XML_LINE_BREAK, XML_TYPE_BOOL ), MAP_ENTRY( "ArrangeOrder", CHART, XML_LABEL_ARRANGEMENT, XML_SCH_TYPE_AXIS_ARRANGEMENT ), MAP_SPECIAL( "NumberFormat", STYLE, XML_DATA_STYLE_NAME, XML_TYPE_NUMBER, NUMBER_FORMAT ), --- Orig/xmloff/source/core/xmltoken.cxx 2007-05-23 00:10:02.000000000 +0800 +++ new/xmloff/source/core/xmltoken.cxx 2007-06-22 09:58:52.000000000 +0800 @@ -2059,6 +2059,7 @@ TOKEN( "symbol-image", XML_SYMBOL_IMAGE ), TOKEN( "text-overlap", XML_TEXT_OVERLAP ), + TOKEN( "reverse-direction", XML_REVERSE_DIRECTION ), TOKEN( "spline-order", XML_SPLINE_ORDER ), TOKEN( "spline-resolution", XML_SPLINE_RESOLUTION ), TOKEN( "paper-tray-name", XML_PAPER_TRAY_NAME ),