Kaydet (Commit) 97054f53 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

implement one more method

Change-Id: Ie18be81fa664df88af605674968e302c59f7dc98
üst 35ea7ffe
...@@ -93,6 +93,7 @@ public: ...@@ -93,6 +93,7 @@ public:
virtual ~ScCondFormatObj(); virtual ~ScCondFormatObj();
static ScCondFormatObj* getImplementation( uno::Reference<sheet::XConditionalFormat> XCondFormat); static ScCondFormatObj* getImplementation( uno::Reference<sheet::XConditionalFormat> XCondFormat);
ScDocShell* getDocShell();
// XConditionalFormat // XConditionalFormat
virtual void SAL_CALL addEntry(const uno::Reference<sheet::XConditionEntry>& xEntry) virtual void SAL_CALL addEntry(const uno::Reference<sheet::XConditionEntry>& xEntry)
...@@ -176,7 +177,7 @@ class ScConditionEntryObj : public cppu::WeakImplHelper2<com::sun::star::beans:: ...@@ -176,7 +177,7 @@ class ScConditionEntryObj : public cppu::WeakImplHelper2<com::sun::star::beans::
{ {
public: public:
ScConditionEntryObj(); ScConditionEntryObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScConditionEntryObj(); virtual ~ScConditionEntryObj();
static ScConditionEntryObj* getImplementation(uno::Reference<sheet::XConditionEntry> xCondition); static ScConditionEntryObj* getImplementation(uno::Reference<sheet::XConditionEntry> xCondition);
...@@ -238,7 +239,7 @@ class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans ...@@ -238,7 +239,7 @@ class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans
{ {
public: public:
ScColorScaleFormatObj(); ScColorScaleFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScColorScaleFormatObj(); virtual ~ScColorScaleFormatObj();
static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
...@@ -295,7 +296,7 @@ private: ...@@ -295,7 +296,7 @@ private:
class ScDataBarFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> class ScDataBarFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet>
{ {
public: public:
ScDataBarFormatObj(); ScDataBarFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScDataBarFormatObj(); virtual ~ScDataBarFormatObj();
static ScDataBarFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScDataBarFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
...@@ -352,7 +353,7 @@ private: ...@@ -352,7 +353,7 @@ private:
class ScIconSetFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> class ScIconSetFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet>
{ {
public: public:
ScIconSetFormatObj(); ScIconSetFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScIconSetFormatObj(); virtual ~ScIconSetFormatObj();
static ScIconSetFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScIconSetFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
......
...@@ -295,6 +295,35 @@ ScConditionalFormatList* ScCondFormatsObj::getCoreObject() ...@@ -295,6 +295,35 @@ ScConditionalFormatList* ScCondFormatsObj::getCoreObject()
return pList; return pList;
} }
namespace {
uno::Reference<beans::XPropertySet> createConditionEntry(const ScFormatEntry* pEntry,
rtl::Reference<ScCondFormatObj> xParent)
{
switch (pEntry->GetType())
{
case condformat::CONDITION:
return new ScConditionEntryObj(xParent);
break;
case condformat::COLORSCALE:
return new ScColorScaleFormatObj(xParent);
break;
case condformat::DATABAR:
return new ScDataBarFormatObj(xParent);
break;
case condformat::ICONSET:
return new ScIconSetFormatObj(xParent);
break;
case condformat::DATE:
break;
default:
break;
}
return uno::Reference<beans::XPropertySet>();
}
}
ScCondFormatObj::ScCondFormatObj(ScDocShell* pDocShell, rtl::Reference<ScCondFormatsObj> xCondFormats, ScCondFormatObj::ScCondFormatObj(ScDocShell* pDocShell, rtl::Reference<ScCondFormatsObj> xCondFormats,
sal_Int32 nKey): sal_Int32 nKey):
mxCondFormatList(xCondFormats), mxCondFormatList(xCondFormats),
...@@ -318,6 +347,11 @@ ScConditionalFormat* ScCondFormatObj::getCoreObject() ...@@ -318,6 +347,11 @@ ScConditionalFormat* ScCondFormatObj::getCoreObject()
return pFormat; return pFormat;
} }
ScDocShell* ScCondFormatObj::getDocShell()
{
return mpDocShell;
}
void ScCondFormatObj::addEntry(const uno::Reference<sheet::XConditionEntry>& /*xEntry*/) void ScCondFormatObj::addEntry(const uno::Reference<sheet::XConditionEntry>& /*xEntry*/)
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -356,10 +390,18 @@ sal_Int32 ScCondFormatObj::getCount() ...@@ -356,10 +390,18 @@ sal_Int32 ScCondFormatObj::getCount()
return pFormat->size(); return pFormat->size();
} }
uno::Any ScCondFormatObj::getByIndex(sal_Int32 /*nIndex*/) uno::Any ScCondFormatObj::getByIndex(sal_Int32 nIndex)
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard;
if (getCoreObject()->size() >= size_t(nIndex))
throw lang::IllegalArgumentException();
const ScFormatEntry* pEntry = getCoreObject()->GetEntry(nIndex);
uno::Reference<beans::XPropertySet> xCondEntry =
createConditionEntry(pEntry, this);
uno::Any aAny; uno::Any aAny;
aAny <<= xCondEntry;
return aAny; return aAny;
} }
...@@ -477,7 +519,9 @@ void SAL_CALL ScCondFormatObj::removeVetoableChangeListener( const OUString&, ...@@ -477,7 +519,9 @@ void SAL_CALL ScCondFormatObj::removeVetoableChangeListener( const OUString&,
SAL_WARN("sc", "not implemented"); SAL_WARN("sc", "not implemented");
} }
ScConditionEntryObj::ScConditionEntryObj(): ScConditionEntryObj::ScConditionEntryObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getConditionEntryrPropSet()) maPropSet(getConditionEntryrPropSet())
{ {
} }
...@@ -653,7 +697,9 @@ void SAL_CALL ScConditionEntryObj::removeVetoableChangeListener( const OUString& ...@@ -653,7 +697,9 @@ void SAL_CALL ScConditionEntryObj::removeVetoableChangeListener( const OUString&
SAL_WARN("sc", "not implemented"); SAL_WARN("sc", "not implemented");
} }
ScColorScaleFormatObj::ScColorScaleFormatObj(): ScColorScaleFormatObj::ScColorScaleFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getColorScalePropSet()) maPropSet(getColorScalePropSet())
{ {
} }
...@@ -753,7 +799,9 @@ void SAL_CALL ScColorScaleFormatObj::removeVetoableChangeListener( const OUStrin ...@@ -753,7 +799,9 @@ void SAL_CALL ScColorScaleFormatObj::removeVetoableChangeListener( const OUStrin
SAL_WARN("sc", "not implemented"); SAL_WARN("sc", "not implemented");
} }
ScDataBarFormatObj::ScDataBarFormatObj(): ScDataBarFormatObj::ScDataBarFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getDataBarPropSet()) maPropSet(getDataBarPropSet())
{ {
} }
...@@ -980,7 +1028,9 @@ void SAL_CALL ScDataBarFormatObj::removeVetoableChangeListener( const OUString&, ...@@ -980,7 +1028,9 @@ void SAL_CALL ScDataBarFormatObj::removeVetoableChangeListener( const OUString&,
SAL_WARN("sc", "not implemented"); SAL_WARN("sc", "not implemented");
} }
ScIconSetFormatObj::ScIconSetFormatObj(): ScIconSetFormatObj::ScIconSetFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getIconSetPropSet()) maPropSet(getIconSetPropSet())
{ {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment