diff options
8 files changed, 296 insertions, 192 deletions
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index fe24a0bf4eb0..7bdc5459ca20 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx @@ -29,10 +29,15 @@ #include "precompiled_chart2.hxx" #include "AxisWrapper.hxx" #include "AxisHelper.hxx" +#include "TitleHelper.hxx" #include "Chart2ModelContact.hxx" #include "ContainerHelper.hxx" #include "macros.hxx" #include "WrappedDirectStateProperty.hxx" +#include "GridWrapper.hxx" +#include "TitleWrapper.hxx" +#include "DisposeHelper.hxx" + #include <comphelper/InlineContainer.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> @@ -84,6 +89,7 @@ enum PROP_AXIS_AUTO_STEPHELP, PROP_AXIS_TYPE, PROP_AXIS_TIME_INCREMENT, + PROP_AXIS_EXPLICIT_TIME_INCREMENT, PROP_AXIS_LOGARITHMIC, PROP_AXIS_REVERSEDIRECTION, PROP_AXIS_VISIBLE, @@ -190,6 +196,13 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( + Property( C2U( "ExplicitTimeIncrement" ), + PROP_AXIS_EXPLICIT_TIME_INCREMENT, + ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)), + beans::PropertyAttribute::READONLY | + beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( Property( C2U( "Logarithmic" ), PROP_AXIS_LOGARITHMIC, ::getBooleanCppuType(), @@ -388,6 +401,83 @@ AxisWrapper::~AxisWrapper() { } +// ____ chart::XAxis ____ +Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getAxisTitle() throw (uno::RuntimeException) +{ + if( !m_xAxisTitle.is() ) + { + TitleHelper::eTitleType eTitleType( TitleHelper::X_AXIS_TITLE ); + switch( m_eType ) + { + case X_AXIS: + eTitleType = TitleHelper::X_AXIS_TITLE; + break; + case Y_AXIS: + eTitleType = TitleHelper::Y_AXIS_TITLE; + break; + case Z_AXIS: + eTitleType = TitleHelper::Z_AXIS_TITLE; + break; + case SECOND_X_AXIS: + eTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE; + break; + case SECOND_Y_AXIS: + eTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE; + break; + default: + return 0; + } + m_xAxisTitle = new TitleWrapper( eTitleType, m_spChart2ModelContact ); + } + return m_xAxisTitle; +} +Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMajorGrid() throw (uno::RuntimeException) +{ + if( !m_xMajorGrid.is() ) + { + GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID ); + switch( m_eType ) + { + case X_AXIS: + eGridType = GridWrapper::X_MAJOR_GRID; + break; + case Y_AXIS: + eGridType = GridWrapper::Y_MAJOR_GRID; + break; + case Z_AXIS: + eGridType = GridWrapper::Z_MAJOR_GRID; + break; + default: + return 0; + } + m_xMajorGrid = new GridWrapper( eGridType, m_spChart2ModelContact ); + } + return m_xMajorGrid; +} +Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMinorGrid() throw (uno::RuntimeException) +{ + if( !m_xMinorGrid.is() ) + { + GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID ); + switch( m_eType ) + { + case X_AXIS: + eGridType = GridWrapper::X_MINOR_GRID; + break; + case Y_AXIS: + eGridType = GridWrapper::Y_MINOR_GRID; + break; + case Z_AXIS: + eGridType = GridWrapper::Z_MINOR_GRID; + break; + default: + return 0; + } + m_xMinorGrid = new GridWrapper( eGridType, m_spChart2ModelContact ); + } + return m_xMinorGrid; +} + // ____ XShape ____ awt::Point SAL_CALL AxisWrapper::getPosition() throw (uno::RuntimeException) @@ -469,6 +559,10 @@ void SAL_CALL AxisWrapper::dispose() Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) ); m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) ); + DisposeHelper::DisposeAndClear( m_xAxisTitle ); + DisposeHelper::DisposeAndClear( m_xMajorGrid ); + DisposeHelper::DisposeAndClear( m_xMinorGrid ); + clearWrappedPropertySet(); } diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx index 86bd52367bbe..f7a7d514e1f4 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx @@ -30,9 +30,10 @@ #include "WrappedPropertySet.hxx" #include "ReferenceSizePropertyProvider.hxx" #include "ServiceMacros.hxx" -#include <cppuhelper/implbase4.hxx> +#include <cppuhelper/implbase5.hxx> #include <comphelper/uno3.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <com/sun/star/chart/XAxis.hpp> #include <com/sun/star/chart2/XAxis.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/drawing/XShape.hpp> @@ -45,14 +46,13 @@ namespace chart { - namespace wrapper { - class Chart2ModelContact; -class AxisWrapper : public ::cppu::ImplInheritanceHelper4< +class AxisWrapper : public ::cppu::ImplInheritanceHelper5< WrappedPropertySet + , com::sun::star::chart::XAxis , com::sun::star::drawing::XShape , com::sun::star::lang::XComponent , com::sun::star::lang::XServiceInfo @@ -93,6 +93,11 @@ public: ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + // ____ chart::XAxis ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getAxisTitle( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMajorGrid( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMinorGrid( ) throw (::com::sun::star::uno::RuntimeException); + // ____ XShape ____ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw (::com::sun::star::uno::RuntimeException); @@ -131,6 +136,10 @@ private: //member tAxisType m_eType; ::com::sun::star::uno::Any m_aTemporaryHelpStepValue; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAxisTitle; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMajorGrid; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMinorGrid; }; } // namespace wrapper diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index c0be0ddcbf0d..16992ac02b51 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -30,14 +30,11 @@ #include "DiagramWrapper.hxx" #include "macros.hxx" #include "servicenames_charttypes.hxx" -#include "TitleWrapper.hxx" #include "DataSeriesPointWrapper.hxx" #include "AxisWrapper.hxx" #include "AxisHelper.hxx" #include "Chart2ModelContact.hxx" #include "PositionAndSizeHelper.hxx" -#include "TitleHelper.hxx" -#include "GridWrapper.hxx" #include "WallFloorWrapper.hxx" #include "MinMaxLineWrapper.hxx" #include "UpDownBarWrapper.hxx" @@ -88,6 +85,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; using ::com::sun::star::beans::Property; +using ::com::sun::star::chart::XAxis; using ::osl::MutexGuard; using ::rtl::OUString; @@ -883,193 +881,209 @@ void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( cons return m_spChart2ModelContact->GetDiagramRectangleIncludingTitle(); } -// ____ XAxisZSupplier ____ -Reference< - drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle() +// ____ XAxisSupplier ____ +Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex ) throw (uno::RuntimeException) { - if( !m_xZAxisTitle.is() ) + Reference< XAxis > xAxis; + if(!nDimensionIndex) + { + if( !m_xXAxis.is() ) + m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact ); + xAxis = m_xXAxis; + } + else if(1==nDimensionIndex) + { + if( !m_xYAxis.is() ) + m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact ); + xAxis = m_xYAxis; + } + else if(2==nDimensionIndex) { - m_xZAxisTitle = new TitleWrapper( TitleHelper::Z_AXIS_TITLE, m_spChart2ModelContact ); + if( !m_xZAxis.is() ) + m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact ); + xAxis = m_xZAxis; } - return m_xZAxisTitle; + return xAxis; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid() +Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex ) throw (uno::RuntimeException) { - if( ! m_xZMainGrid.is()) + Reference< XAxis > xAxis; + if(!nDimensionIndex) { - m_xZMainGrid = new GridWrapper( GridWrapper::Z_MAIN_GRID, m_spChart2ModelContact ); + if( !m_xSecondXAxis.is() ) + m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact ); + xAxis = m_xSecondXAxis; } - return m_xZMainGrid; + else if(1==nDimensionIndex) + { + if( !m_xSecondYAxis.is() ) + m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact ); + xAxis = m_xSecondYAxis; + } + return xAxis; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid() +// ____ XAxisZSupplier ____ +Reference< drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle() throw (uno::RuntimeException) { - if( !m_xZHelpGrid.is() ) - { - m_xZHelpGrid = new GridWrapper( GridWrapper::Z_SUB_GRID, m_spChart2ModelContact ); - } - return m_xZHelpGrid; + Reference< drawing::XShape > xRet; + Reference< XAxis > xAxis( getAxis(2) ); + if( xAxis.is() ) + xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xRet; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid() + throw (uno::RuntimeException) +{ + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(2) ); + if( xAxis.is() ) + xRet = xAxis->getMajorGrid(); + return xRet; +} + +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid() + throw (uno::RuntimeException) +{ + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(2) ); + if( xAxis.is() ) + xRet = xAxis->getMinorGrid(); + return xRet; +} + +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis() throw (uno::RuntimeException) { if( ! m_xZAxis.is()) - { m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact ); - } - return m_xZAxis; + return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY ); } // ____ XTwoAxisXSupplier ____ -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis() throw (uno::RuntimeException) { if( ! m_xSecondXAxis.is()) - { m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact ); - } - return m_xSecondXAxis; + return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY ); } // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____ -Reference< - drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle() +Reference< drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle() throw (uno::RuntimeException) { - - if( !m_xXAxisTitle.is() ) - { - m_xXAxisTitle = new TitleWrapper( TitleHelper::X_AXIS_TITLE, m_spChart2ModelContact ); - } - return m_xXAxisTitle; + Reference< drawing::XShape > xRet; + Reference< XAxis > xAxis( getAxis(0) ); + if( xAxis.is() ) + xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xRet; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis() throw (uno::RuntimeException) { if( ! m_xXAxis.is()) - { m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact ); - } - - return m_xXAxis; + return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY ); } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid() throw (uno::RuntimeException) { - if( ! m_xXMainGrid.is()) - { - m_xXMainGrid = new GridWrapper( GridWrapper::X_MAIN_GRID, m_spChart2ModelContact ); - } - - return m_xXMainGrid; + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(0) ); + if( xAxis.is() ) + xRet = xAxis->getMajorGrid(); + return xRet; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid() throw (uno::RuntimeException) { - if( ! m_xXHelpGrid.is()) - { - m_xXHelpGrid = new GridWrapper( GridWrapper::X_SUB_GRID, m_spChart2ModelContact ); - } - return m_xXHelpGrid; + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(0) ); + if( xAxis.is() ) + xRet = xAxis->getMinorGrid(); + return xRet; } // ____ XTwoAxisYSupplier ____ -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis() throw (uno::RuntimeException) { if( ! m_xSecondYAxis.is()) - { m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact ); - } - return m_xSecondYAxis; + return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY ); } // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____ -Reference< - drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle() +Reference< drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle() throw (uno::RuntimeException) { - if( !m_xYAxisTitle.is() ) - { - m_xYAxisTitle = new TitleWrapper( TitleHelper::Y_AXIS_TITLE, m_spChart2ModelContact ); - } - return m_xYAxisTitle; + Reference< drawing::XShape > xRet; + Reference< XAxis > xAxis( getAxis(1) ); + if( xAxis.is() ) + xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xRet; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis() throw (uno::RuntimeException) { if( ! m_xYAxis.is()) - { m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact ); - } - return m_xYAxis; + return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY ); } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid() throw (uno::RuntimeException) { - if( ! m_xYHelpGrid.is()) - { - m_xYHelpGrid = new GridWrapper( GridWrapper::Y_SUB_GRID, m_spChart2ModelContact ); - } - return m_xYHelpGrid; + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(1) ); + if( xAxis.is() ) + xRet = xAxis->getMajorGrid(); + return xRet; } -Reference< - beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid() +Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid() throw (uno::RuntimeException) { - if( ! m_xYMainGrid.is()) - { - m_xYMainGrid = new GridWrapper( GridWrapper::Y_MAIN_GRID, m_spChart2ModelContact ); - } - return m_xYMainGrid; + Reference< beans::XPropertySet > xRet; + Reference< XAxis > xAxis( getAxis(1) ); + if( xAxis.is() ) + xRet = xAxis->getMinorGrid(); + return xRet; } // ____ XSecondAxisTitleSupplier ____ -Reference< - drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle() +Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle() throw (uno::RuntimeException) { - if( !m_xSecondXAxisTitle.is() ) - { - m_xSecondXAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_X_AXIS_TITLE, m_spChart2ModelContact ); - } - return m_xSecondXAxisTitle; + Reference< drawing::XShape > xRet; + Reference< XAxis > xAxis( getSecondaryAxis(0) ); + if( xAxis.is() ) + xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xRet; } -Reference< - drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle() +Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle() throw (uno::RuntimeException) { - if( !m_xSecondYAxisTitle.is() ) - { - m_xSecondYAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_Y_AXIS_TITLE, m_spChart2ModelContact ); - } - return m_xSecondYAxisTitle; + Reference< drawing::XShape > xRet; + Reference< XAxis > xAxis( getSecondaryAxis(1) ); + if( xAxis.is() ) + xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY ); + return xRet; } // ____ XStatisticDisplay ____ @@ -1162,22 +1176,11 @@ void SAL_CALL DiagramWrapper::dispose() // /-- MutexGuard aGuard( GetMutex()); - DisposeHelper::DisposeAndClear( m_xXAxisTitle ); - DisposeHelper::DisposeAndClear( m_xYAxisTitle ); - DisposeHelper::DisposeAndClear( m_xZAxisTitle ); - DisposeHelper::DisposeAndClear( m_xSecondXAxisTitle ); - DisposeHelper::DisposeAndClear( m_xSecondYAxisTitle ); DisposeHelper::DisposeAndClear( m_xXAxis ); DisposeHelper::DisposeAndClear( m_xYAxis ); DisposeHelper::DisposeAndClear( m_xZAxis ); DisposeHelper::DisposeAndClear( m_xSecondXAxis ); DisposeHelper::DisposeAndClear( m_xSecondYAxis ); - DisposeHelper::DisposeAndClear( m_xXMainGrid ); - DisposeHelper::DisposeAndClear( m_xYMainGrid ); - DisposeHelper::DisposeAndClear( m_xZMainGrid ); - DisposeHelper::DisposeAndClear( m_xXHelpGrid ); - DisposeHelper::DisposeAndClear( m_xYHelpGrid ); - DisposeHelper::DisposeAndClear( m_xZHelpGrid ); DisposeHelper::DisposeAndClear( m_xWall ); DisposeHelper::DisposeAndClear( m_xFloor ); DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper ); @@ -2146,3 +2149,4 @@ APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx index 111e24bd6a8b..678041420cf3 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx @@ -30,7 +30,13 @@ #include "WrappedPropertySet.hxx" #include "ServiceMacros.hxx" #include "DiagramHelper.hxx" -#include <cppuhelper/implbase12.hxx> + +#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13) +#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13 +#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13 +#include "comphelper/implbase_var.hxx" +#endif + #include <comphelper/uno3.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <com/sun/star/chart2/XChartDocument.hpp> @@ -41,6 +47,7 @@ #include <com/sun/star/chart2/XChartTypeTemplate.hpp> #include <com/sun/star/chart2/XChartTypeManager.hpp> #include <com/sun/star/chart/XDiagram.hpp> +#include <com/sun/star/chart/XAxisSupplier.hpp> #include <com/sun/star/chart/XAxisZSupplier.hpp> #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> #include <com/sun/star/chart/XTwoAxisYSupplier.hpp> @@ -56,15 +63,15 @@ namespace chart { - namespace wrapper { class Chart2ModelContact; -class DiagramWrapper : public ::cppu::ImplInheritanceHelper12< +class DiagramWrapper : public ::comphelper::ImplInheritanceHelper13< WrappedPropertySet , ::com::sun::star::chart::XDiagram + , ::com::sun::star::chart::XAxisSupplier , ::com::sun::star::chart::XAxisZSupplier , ::com::sun::star::chart::XTwoAxisXSupplier // : XAxisXSupplier , ::com::sun::star::chart::XTwoAxisYSupplier // : XAxisYSupplier @@ -123,6 +130,14 @@ public: virtual ::rtl::OUString SAL_CALL getShapeType() throw (::com::sun::star::uno::RuntimeException); + // ____ XAxisSupplier ____ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::chart::XAxis > SAL_CALL getAxis( sal_Int32 nDimensionIndex ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::chart::XAxis > SAL_CALL getSecondaryAxis( sal_Int32 nDimensionIndex ) + throw (::com::sun::star::uno::RuntimeException); + // ____ XAxisZSupplier ____ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle() @@ -244,72 +259,27 @@ private: ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape > - m_xXAxisTitle; - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape > - m_xYAxisTitle; - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape > - m_xZAxisTitle; - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape > - m_xSecondXAxisTitle; - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape > - m_xSecondYAxisTitle; - - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xXAxis; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xYAxis; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xZAxis; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xSecondXAxis; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xSecondYAxis; - - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xXMainGrid; - ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xYMainGrid; + ::com::sun::star::chart::XAxis > m_xXAxis; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xZMainGrid; + ::com::sun::star::chart::XAxis > m_xYAxis; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xXHelpGrid; + ::com::sun::star::chart::XAxis > m_xZAxis; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xYHelpGrid; + ::com::sun::star::chart::XAxis > m_xSecondXAxis; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xZHelpGrid; + ::com::sun::star::chart::XAxis > m_xSecondYAxis; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xWall; + ::com::sun::star::beans::XPropertySet > m_xWall; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xFloor; + ::com::sun::star::beans::XPropertySet > m_xFloor; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xMinMaxLineWrapper; + ::com::sun::star::beans::XPropertySet > m_xMinMaxLineWrapper; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xUpBarWrapper; + ::com::sun::star::beans::XPropertySet > m_xUpBarWrapper; ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > - m_xDownBarWrapper; + ::com::sun::star::beans::XPropertySet > m_xDownBarWrapper; }; } // namespace wrapper diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx index ff36c4cebcc7..9d50a76557f8 100644 --- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx @@ -112,17 +112,17 @@ void GridWrapper::getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDime switch( eType ) { - case X_MAIN_GRID: + case X_MAJOR_GRID: rnDimensionIndex = 0; rbSubGrid = false; break; - case Y_MAIN_GRID: + case Y_MAJOR_GRID: rnDimensionIndex = 1; rbSubGrid = false; break; - case Z_MAIN_GRID: + case Z_MAJOR_GRID: rnDimensionIndex = 2; rbSubGrid = false; break; - case X_SUB_GRID: + case X_MINOR_GRID: rnDimensionIndex = 0; rbSubGrid = true; break; - case Y_SUB_GRID: + case Y_MINOR_GRID: rnDimensionIndex = 1; rbSubGrid = true; break; - case Z_SUB_GRID: + case Z_MINOR_GRID: rnDimensionIndex = 2; rbSubGrid = true; break; } } @@ -209,3 +209,4 @@ APPHELPER_XSERVICEINFO_IMPL( GridWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx index c731b6c22666..653c46353676 100644 --- a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx @@ -42,7 +42,6 @@ namespace chart { - namespace wrapper { @@ -57,12 +56,12 @@ class GridWrapper : public ::cppu::ImplInheritanceHelper2< public: enum tGridType { - X_MAIN_GRID, - Y_MAIN_GRID, - Z_MAIN_GRID, - X_SUB_GRID, - Y_SUB_GRID, - Z_SUB_GRID + X_MAJOR_GRID, + Y_MAJOR_GRID, + Z_MAJOR_GRID, + X_MINOR_GRID, + Y_MINOR_GRID, + Z_MINOR_GRID }; GridWrapper( tGridType eType, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx index 037a5795baa5..61abab9e7209 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx @@ -97,6 +97,9 @@ WrappedScaleProperty::WrappedScaleProperty( tScaleProperty eScaleProperty case SCALE_PROP_DATE_INCREMENT: m_aOuterName = C2U("TimeIncrement"); break; + case SCALE_PROP_EXPLICIT_DATE_INCREMENT: + m_aOuterName = C2U("ExplicitTimeIncrement"); + break; case SCALE_PROP_LOGARITHMIC: m_aOuterName = C2U("Logarithmic"); break; @@ -130,6 +133,7 @@ void WrappedScaleProperty::addWrappedProperties( std::vector< WrappedProperty* > rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPHELP, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_AXIS_TYPE, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_DATE_INCREMENT, spChart2ModelContact ) ); + rList.push_back( new WrappedScaleProperty( SCALE_PROP_EXPLICIT_DATE_INCREMENT, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_LOGARITHMIC, spChart2ModelContact ) ); rList.push_back( new WrappedScaleProperty( SCALE_PROP_REVERSEDIRECTION, spChart2ModelContact ) ); } @@ -308,6 +312,9 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons bSetScaleData = true; break; } + case SCALE_PROP_EXPLICIT_DATE_INCREMENT: + //read only property + break; case SCALE_PROP_LOGARITHMIC: { if( rOuterValue >>= bBool ) @@ -550,6 +557,25 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const aRet = uno::makeAny( aScaleData.TimeIncrement ); break; } + case SCALE_PROP_EXPLICIT_DATE_INCREMENT: + { + if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis ) + { + m_spChart2ModelContact->getExplicitValuesForAxis( xAxis, aExplicitScale, aExplicitIncrement ); + if( aExplicitScale.AxisType == AxisType::DATE ) + { + TimeIncrement aTimeIncrement; + aTimeIncrement.MajorTimeInterval = uno::makeAny( aExplicitIncrement.MajorTimeInterval ); + aTimeIncrement.MinorTimeInterval = uno::makeAny( aExplicitIncrement.MinorTimeInterval ); + aTimeIncrement.TimeResolution = uno::makeAny( aExplicitScale.TimeResolution ); + aRet = uno::makeAny(aTimeIncrement); + } + } + + if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis ) + aRet = uno::makeAny( aScaleData.TimeIncrement ); + break; + } case SCALE_PROP_LOGARITHMIC: { aRet <<= static_cast< sal_Bool >( AxisHelper::isLogarithmic(aScaleData.Scaling) ); @@ -571,5 +597,5 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const } } // namespace wrapper -} //namespace chart +} // namespace chart //............................................................................. diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx index 1543d7b645fb..8df55339a46e 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx @@ -57,6 +57,7 @@ public: , SCALE_PROP_AUTO_STEPHELP , SCALE_PROP_AXIS_TYPE , SCALE_PROP_DATE_INCREMENT + , SCALE_PROP_EXPLICIT_DATE_INCREMENT , SCALE_PROP_LOGARITHMIC , SCALE_PROP_REVERSEDIRECTION }; |