diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-30 02:03:14 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-30 04:34:34 +0200 |
commit | 64c251f99ba633c96c1e3410e69dfcdcbf44a267 (patch) | |
tree | 58fe70a53f1d3e211badbaee2c85603a2d752ac4 /sc | |
parent | d21f9f5079c4ca705331dcb298709bc55971bafa (diff) |
let all cond format objects inherit from XConditionEntry
Change-Id: I60f156b4a64cc70bd1d19f4bb29c79cc8cff3e94
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/condformatuno.hxx | 26 | ||||
-rw-r--r-- | sc/source/ui/unoobj/condformatuno.cxx | 22 |
2 files changed, 41 insertions, 7 deletions
diff --git a/sc/source/ui/inc/condformatuno.hxx b/sc/source/ui/inc/condformatuno.hxx index 48ab6fee7464..99e5dec238f0 100644 --- a/sc/source/ui/inc/condformatuno.hxx +++ b/sc/source/ui/inc/condformatuno.hxx @@ -238,7 +238,8 @@ private: const ScCondFormatEntry* mpFormat; }; -class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> +class ScColorScaleFormatObj : public cppu::WeakImplHelper2<com::sun::star::beans::XPropertySet, + com::sun::star::sheet::XConditionEntry> { public: @@ -247,6 +248,11 @@ public: static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); + // XConditionEntry + virtual sal_Int32 SAL_CALL getType() + throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + ScColorScaleFormat* getCoreObject(); // XPropertySet @@ -329,7 +335,8 @@ private: size_t mnPos; }; -class ScDataBarFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> +class ScDataBarFormatObj : public cppu::WeakImplHelper2<com::sun::star::beans::XPropertySet, + com::sun::star::sheet::XConditionEntry> { public: ScDataBarFormatObj(rtl::Reference<ScCondFormatObj> xParent, @@ -340,7 +347,11 @@ public: ScDataBarFormat* getCoreObject(); - // XPropertySet + // XConditionEntry + virtual sal_Int32 SAL_CALL getType() + throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -414,7 +425,8 @@ private: size_t mnPos; }; -class ScIconSetFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> +class ScIconSetFormatObj : public cppu::WeakImplHelper2<com::sun::star::beans::XPropertySet, + com::sun::star::sheet::XConditionEntry> { public: ScIconSetFormatObj(rtl::Reference<ScCondFormatObj> xParent, @@ -425,7 +437,11 @@ public: ScIconSetFormat* getCoreObject(); - // XPropertySet + // XConditionEntry + virtual sal_Int32 SAL_CALL getType() + throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index b3ff5c94e754..ba9d49619430 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/sheet/DataBarEntryType.hpp> #include <com/sun/star/sheet/ColorScaleEntryType.hpp> #include <com/sun/star/sheet/IconSetFormatEntry.hpp> +#include <com/sun/star/sheet/ConditionEntryType.hpp> namespace { @@ -613,7 +614,7 @@ ScCondFormatEntry* ScConditionEntryObj::getCoreObject() sal_Int32 ScConditionEntryObj::getType() throw(uno::RuntimeException, std::exception) { - return 0; + return sheet::ConditionEntryType::CONDITION; } uno::Reference<beans::XPropertySetInfo> SAL_CALL ScConditionEntryObj::getPropertySetInfo() @@ -729,7 +730,6 @@ uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aProper { aAny <<= aConditionEntryMap[i].nApiMode; break; - } } } @@ -794,6 +794,12 @@ ScColorScaleFormat* ScColorScaleFormatObj::getCoreObject() throw lang::IllegalArgumentException(); } +sal_Int32 ScColorScaleFormatObj::getType() + throw(uno::RuntimeException, std::exception) +{ + return sheet::ConditionEntryType::COLORSCALE; +} + uno::Reference<beans::XPropertySetInfo> SAL_CALL ScColorScaleFormatObj::getPropertySetInfo() throw(uno::RuntimeException, std::exception) { @@ -1057,6 +1063,12 @@ ScDataBarFormat* ScDataBarFormatObj::getCoreObject() throw lang::IllegalArgumentException(); } +sal_Int32 ScDataBarFormatObj::getType() + throw(uno::RuntimeException, std::exception) +{ + return sheet::ConditionEntryType::DATABAR; +} + uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDataBarFormatObj::getPropertySetInfo() throw(uno::RuntimeException, std::exception) { @@ -1432,6 +1444,12 @@ ScIconSetFormat* ScIconSetFormatObj::getCoreObject() throw lang::IllegalArgumentException(); } +sal_Int32 ScIconSetFormatObj::getType() + throw(uno::RuntimeException, std::exception) +{ + return sheet::ConditionEntryType::ICONSET; +} + uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getPropertySetInfo() throw(uno::RuntimeException, std::exception) { |