summaryrefslogtreecommitdiff
path: root/chart2/source/model/main
diff options
context:
space:
mode:
authorIngrid Halama [iha] <Ingrid.Halama@oracle.com>2011-02-24 17:39:29 +0100
committerIngrid Halama [iha] <Ingrid.Halama@oracle.com>2011-02-24 17:39:29 +0100
commit33e01cba5102bd326b0cca887879df4d49b2fca6 (patch)
tree72ac95f98aa00aa35b00471dfc6f2e6ee7ff28bd /chart2/source/model/main
parent1b904022140bf76d41dc6f6a03bd3a86f3bdd544 (diff)
parentce6308e4fad2281241bf4ca78280eba29f744d43 (diff)
chart51: merge with DEV300_m101
Diffstat (limited to 'chart2/source/model/main')
-rwxr-xr-xchart2/source/model/main/Legend.cxx70
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Legend.hxx19
2 files changed, 16 insertions, 73 deletions
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index e9f5f5324365..a7c2ab86f5c1 100755
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -40,8 +40,9 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <algorithm>
@@ -63,10 +64,11 @@ 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
+ PROP_LEGEND_REL_POS,
+ PROP_LEGEND_REL_SIZE
};
void lcl_AddPropertiesToVector(
@@ -81,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 ));
@@ -105,6 +107,14 @@ 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 ));
+
}
struct StaticLegendDefaults_Initializer
@@ -123,7 +133,7 @@ private:
::chart::CharacterProperties::AddDefaultsToMap( 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;
@@ -197,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
index 6b645828f4c1..56c41db2e38a 100644..100755
--- 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;
};