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:
virtual ~ScCondFormatObj();
static ScCondFormatObj* getImplementation( uno::Reference<sheet::XConditionalFormat> XCondFormat);
ScDocShell* getDocShell();
// XConditionalFormat
virtual void SAL_CALL addEntry(const uno::Reference<sheet::XConditionEntry>& xEntry)
......@@ -176,7 +177,7 @@ class ScConditionEntryObj : public cppu::WeakImplHelper2<com::sun::star::beans::
{
public:
ScConditionEntryObj();
ScConditionEntryObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScConditionEntryObj();
static ScConditionEntryObj* getImplementation(uno::Reference<sheet::XConditionEntry> xCondition);
......@@ -238,7 +239,7 @@ class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans
{
public:
ScColorScaleFormatObj();
ScColorScaleFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScColorScaleFormatObj();
static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
......@@ -295,7 +296,7 @@ private:
class ScDataBarFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet>
{
public:
ScDataBarFormatObj();
ScDataBarFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScDataBarFormatObj();
static ScDataBarFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
......@@ -352,7 +353,7 @@ private:
class ScIconSetFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet>
{
public:
ScIconSetFormatObj();
ScIconSetFormatObj(rtl::Reference<ScCondFormatObj> xParent);
virtual ~ScIconSetFormatObj();
static ScIconSetFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
......
......@@ -295,6 +295,35 @@ ScConditionalFormatList* ScCondFormatsObj::getCoreObject()
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,
sal_Int32 nKey):
mxCondFormatList(xCondFormats),
......@@ -318,6 +347,11 @@ ScConditionalFormat* ScCondFormatObj::getCoreObject()
return pFormat;
}
ScDocShell* ScCondFormatObj::getDocShell()
{
return mpDocShell;
}
void ScCondFormatObj::addEntry(const uno::Reference<sheet::XConditionEntry>& /*xEntry*/)
throw(uno::RuntimeException, std::exception)
{
......@@ -356,10 +390,18 @@ sal_Int32 ScCondFormatObj::getCount()
return pFormat->size();
}
uno::Any ScCondFormatObj::getByIndex(sal_Int32 /*nIndex*/)
uno::Any ScCondFormatObj::getByIndex(sal_Int32 nIndex)
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;
aAny <<= xCondEntry;
return aAny;
}
......@@ -477,7 +519,9 @@ void SAL_CALL ScCondFormatObj::removeVetoableChangeListener( const OUString&,
SAL_WARN("sc", "not implemented");
}
ScConditionEntryObj::ScConditionEntryObj():
ScConditionEntryObj::ScConditionEntryObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getConditionEntryrPropSet())
{
}
......@@ -653,7 +697,9 @@ void SAL_CALL ScConditionEntryObj::removeVetoableChangeListener( const OUString&
SAL_WARN("sc", "not implemented");
}
ScColorScaleFormatObj::ScColorScaleFormatObj():
ScColorScaleFormatObj::ScColorScaleFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getColorScalePropSet())
{
}
......@@ -753,7 +799,9 @@ void SAL_CALL ScColorScaleFormatObj::removeVetoableChangeListener( const OUStrin
SAL_WARN("sc", "not implemented");
}
ScDataBarFormatObj::ScDataBarFormatObj():
ScDataBarFormatObj::ScDataBarFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
maPropSet(getDataBarPropSet())
{
}
......@@ -980,7 +1028,9 @@ void SAL_CALL ScDataBarFormatObj::removeVetoableChangeListener( const OUString&,
SAL_WARN("sc", "not implemented");
}
ScIconSetFormatObj::ScIconSetFormatObj():
ScIconSetFormatObj::ScIconSetFormatObj(rtl::Reference<ScCondFormatObj> xParent):
mpDocShell(xParent->getDocShell()),
mxParent(xParent),
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