From df5e24fa7d085508a0929c9213a515af344485e2 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Tue, 16 Nov 2010 15:03:23 +0100 Subject: chart52: #28670# make the legend within charts resizeable - part 1 - patch from hackfest2010 --- chart2/source/model/main/Legend.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'chart2/source/model/main') diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index c1143ecdf77a..9949f768a642 100644 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -66,7 +67,8 @@ enum PROP_LEGEND_PREFERRED_EXPANSION, PROP_LEGEND_SHOW, PROP_LEGEND_REF_PAGE_SIZE, - PROP_LEGEND_REL_POS + PROP_LEGEND_REL_POS, + PROP_LEGEND_REL_SIZE }; void lcl_AddPropertiesToVector( @@ -105,6 +107,15 @@ void lcl_AddPropertiesToVector( ::getCppuType( reinterpret_cast< const chart2::RelativePosition * >(0)), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID )); + + + rOutProperties.push_back( + Property( C2U( "RelativeSize" ), + PROP_LEGEND_REL_SIZE, + ::getCppuType( reinterpret_cast< const chart2::RelativeSize * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + } void lcl_AddDefaultsToMap( -- cgit From 0e685f0d9f64e57367cbc0a369885dad894d41d5 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Mon, 24 Jan 2011 17:44:18 +0100 Subject: chart52: #28670# make the legend within charts resizeable - part 2 --- chart2/source/model/main/Legend.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'chart2/source/model/main') diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index 9949f768a642..1408bcb91012 100644 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -64,7 +64,7 @@ static const OUString lcl_aServiceName( enum { PROP_LEGEND_ANCHOR_POSITION, - PROP_LEGEND_PREFERRED_EXPANSION, + PROP_LEGEND_EXPANSION, PROP_LEGEND_SHOW, PROP_LEGEND_REF_PAGE_SIZE, PROP_LEGEND_REL_POS, @@ -83,8 +83,8 @@ void lcl_AddPropertiesToVector( rOutProperties.push_back( Property( C2U( "Expansion" ), - PROP_LEGEND_PREFERRED_EXPANSION, - ::getCppuType( reinterpret_cast< const chart2::LegendExpansion * >(0)), + PROP_LEGEND_EXPANSION, + ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendExpansion * >(0)), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT )); @@ -122,7 +122,7 @@ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap ) { ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, ::com::sun::star::chart::ChartLegendExpansion_HIGH ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true ); float fDefaultCharHeight = 10.0; -- cgit From 9487ac66bc5abc276451550d4c6c5af80ba113e5 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Tue, 25 Jan 2011 23:08:33 +0100 Subject: chart52: merge with DEV300_m98 --- chart2/source/model/main/Legend.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chart2/source/model/main') diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index d7360b64fef7..86ee1180e372 100755 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -134,7 +134,7 @@ private: ::chart::CharacterProperties::AddDefaultsToMap( rOutMap ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END ); - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, chart2::LegendExpansion_HIGH ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, ::com::sun::star::chart::ChartLegendExpansion_HIGH ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true ); float fDefaultCharHeight = 10.0; -- cgit From d6f9cfd061e34b2354b2f2fa09f833a0dcf1cefe Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Thu, 27 Jan 2011 20:57:37 +0100 Subject: chart52: #28670# make the legend within charts resizeable - part 3 --- chart2/source/model/main/Legend.cxx | 1 - 1 file changed, 1 deletion(-) (limited to 'chart2/source/model/main') diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index 86ee1180e372..64fb39f91b65 100755 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -108,7 +108,6 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID )); - rOutProperties.push_back( Property( C2U( "RelativeSize" ), PROP_LEGEND_REL_SIZE, -- cgit From 7bafb42bf101d13ab336221652124376661f1d05 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Fri, 4 Feb 2011 12:59:11 +0100 Subject: chart52: cleanup unused legend entry stuff in preparation of issue #i82802# --- chart2/source/model/main/Legend.cxx | 48 ------------------------------------- chart2/source/model/main/Legend.hxx | 19 --------------- 2 files changed, 67 deletions(-) mode change 100644 => 100755 chart2/source/model/main/Legend.hxx (limited to 'chart2/source/model/main') diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index 64fb39f91b65..a7c2ab86f5c1 100755 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -207,58 +207,10 @@ Legend::Legend( const Legend & rOther ) : ::property::OPropertySet( rOther, m_aMutex ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { - CloneHelper::CloneRefVector< Reference< chart2::XLegendEntry > >( rOther.m_aLegendEntries, m_aLegendEntries ); - ModifyListenerHelper::addListenerToAllElements( m_aLegendEntries, m_xModifyEventForwarder ); } Legend::~Legend() { - try - { - ModifyListenerHelper::removeListenerFromAllElements( m_aLegendEntries, m_xModifyEventForwarder ); - } - catch( const uno::Exception & ex ) - { - ASSERT_EXCEPTION( ex ); - } -} - -// ____ XLegend ____ -void SAL_CALL Legend::registerEntry( const Reference< chart2::XLegendEntry >& xEntry ) - throw (lang::IllegalArgumentException, - uno::RuntimeException) -{ - if( ::std::find( m_aLegendEntries.begin(), - m_aLegendEntries.end(), - xEntry ) != m_aLegendEntries.end()) - throw lang::IllegalArgumentException(); - - m_aLegendEntries.push_back( xEntry ); - ModifyListenerHelper::addListener( xEntry, m_xModifyEventForwarder ); - fireModifyEvent(); -} - -void SAL_CALL Legend::revokeEntry( const Reference< chart2::XLegendEntry >& xEntry ) - throw (container::NoSuchElementException, - uno::RuntimeException) -{ - tLegendEntries::iterator aIt( - ::std::find( m_aLegendEntries.begin(), - m_aLegendEntries.end(), - xEntry )); - - if( aIt == m_aLegendEntries.end()) - throw container::NoSuchElementException(); - - m_aLegendEntries.erase( aIt ); - ModifyListenerHelper::removeListener( xEntry, m_xModifyEventForwarder ); - fireModifyEvent(); -} - -Sequence< Reference< chart2::XLegendEntry > > SAL_CALL Legend::getEntries() - throw (uno::RuntimeException) -{ - return ContainerHelper::ContainerToSequence( m_aLegendEntries ); } // ____ XCloneable ____ diff --git a/chart2/source/model/main/Legend.hxx b/chart2/source/model/main/Legend.hxx old mode 100644 new mode 100755 index 6b645828f4c1..56c41db2e38a --- a/chart2/source/model/main/Legend.hxx +++ b/chart2/source/model/main/Legend.hxx @@ -97,20 +97,6 @@ protected: // const ::com::sun::star::uno::Any& rValue ) // throw (::com::sun::star::lang::IllegalArgumentException); - // ____ XLegend ____ - virtual void SAL_CALL registerEntry( const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XLegendEntry >& xEntry ) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL revokeEntry( const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XLegendEntry >& xEntry ) - throw (::com::sun::star::container::NoSuchElementException, - ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XLegendEntry > > SAL_CALL getEntries() - throw (::com::sun::star::uno::RuntimeException); - // ____ XCloneable ____ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw (::com::sun::star::uno::RuntimeException); @@ -140,11 +126,6 @@ protected: void fireModifyEvent(); private: - typedef ::std::vector< - ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XLegendEntry > > tLegendEntries; - - tLegendEntries m_aLegendEntries; ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; }; -- cgit