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

more work for fixing lifecycle

Change-Id: Ieba2eef93777f616bda6a46fe206b773c09ab2a0
üst a017e073
...@@ -32,7 +32,7 @@ class ScConditionalFormatList; ...@@ -32,7 +32,7 @@ class ScConditionalFormatList;
class ScConditionalFormat; class ScConditionalFormat;
class ScIconSetFormat; class ScIconSetFormat;
class ScDataBarFormat; class ScDataBarFormat;
class ScColorScale; class ScColorScaleFormat;
class ScCondFormatEntry; class ScCondFormatEntry;
using namespace com::sun::star; using namespace com::sun::star;
...@@ -181,6 +181,8 @@ public: ...@@ -181,6 +181,8 @@ public:
static ScConditionEntryObj* getImplementation(uno::Reference<sheet::XConditionEntry> xCondition); static ScConditionEntryObj* getImplementation(uno::Reference<sheet::XConditionEntry> xCondition);
ScCondFormatEntry* getCoreObject();
// XConditionEntry // XConditionEntry
virtual sal_Int32 SAL_CALL getType() virtual sal_Int32 SAL_CALL getType()
throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
...@@ -227,8 +229,9 @@ public: ...@@ -227,8 +229,9 @@ public:
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private: private:
ScDocShell* mpDocShell;
rtl::Reference<ScCondFormatObj> mxParent;
SfxItemPropertySet maPropSet; SfxItemPropertySet maPropSet;
ScCondFormatEntry* pFormat;
}; };
class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet> class ScColorScaleFormatObj : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySet>
...@@ -240,6 +243,8 @@ public: ...@@ -240,6 +243,8 @@ public:
static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScColorScaleFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
ScColorScaleFormat* getCoreObject();
// XPropertySet // XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo() SAL_CALL getPropertySetInfo()
...@@ -282,7 +287,8 @@ public: ...@@ -282,7 +287,8 @@ public:
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private: private:
ScColorScale* pColorScale; ScDocShell* mpDocShell;
rtl::Reference<ScCondFormatObj> mxParent;
SfxItemPropertySet maPropSet; SfxItemPropertySet maPropSet;
}; };
...@@ -294,6 +300,8 @@ public: ...@@ -294,6 +300,8 @@ public:
static ScDataBarFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScDataBarFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
ScDataBarFormat* getCoreObject();
// XPropertySet // XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo() SAL_CALL getPropertySetInfo()
...@@ -336,7 +344,8 @@ public: ...@@ -336,7 +344,8 @@ public:
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private: private:
ScDataBarFormat* mpDataBar; ScDocShell* mpDocShell;
rtl::Reference<ScCondFormatObj> mxParent;
SfxItemPropertySet maPropSet; SfxItemPropertySet maPropSet;
}; };
...@@ -348,6 +357,8 @@ public: ...@@ -348,6 +357,8 @@ public:
static ScIconSetFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet); static ScIconSetFormatObj* getImplementation(uno::Reference<beans::XPropertySet> xPropSet);
ScIconSetFormat* getCoreObject();
// XPropertySet // XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo() SAL_CALL getPropertySetInfo()
...@@ -390,8 +401,8 @@ public: ...@@ -390,8 +401,8 @@ public:
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private: private:
ScDocShell* mpDocShell;
ScIconSetFormat* mpIconSet; rtl::Reference<ScCondFormatObj> mxParent;
SfxItemPropertySet maPropSet; SfxItemPropertySet maPropSet;
}; };
......
...@@ -455,6 +455,11 @@ ScConditionEntryObj::~ScConditionEntryObj() ...@@ -455,6 +455,11 @@ ScConditionEntryObj::~ScConditionEntryObj()
{ {
} }
ScCondFormatEntry* ScConditionEntryObj::getCoreObject()
{
return NULL;
}
sal_Int32 ScConditionEntryObj::getType() sal_Int32 ScConditionEntryObj::getType()
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -580,6 +585,11 @@ ScColorScaleFormatObj::~ScColorScaleFormatObj() ...@@ -580,6 +585,11 @@ ScColorScaleFormatObj::~ScColorScaleFormatObj()
{ {
} }
ScColorScaleFormat* ScColorScaleFormatObj::getCoreObject()
{
return NULL;
}
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScColorScaleFormatObj::getPropertySetInfo() uno::Reference<beans::XPropertySetInfo> SAL_CALL ScColorScaleFormatObj::getPropertySetInfo()
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -675,6 +685,11 @@ ScDataBarFormatObj::~ScDataBarFormatObj() ...@@ -675,6 +685,11 @@ ScDataBarFormatObj::~ScDataBarFormatObj()
{ {
} }
ScDataBarFormat* ScDataBarFormatObj::getCoreObject()
{
return NULL;
}
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDataBarFormatObj::getPropertySetInfo() uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDataBarFormatObj::getPropertySetInfo()
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -708,7 +723,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( ...@@ -708,7 +723,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
bool bUseGradient = true; bool bUseGradient = true;
if (aValue >>= bUseGradient) if (aValue >>= bUseGradient)
{ {
mpDataBar->GetDataBarData()->mbGradient = bUseGradient; getCoreObject()->GetDataBarData()->mbGradient = bUseGradient;
} }
} }
break; break;
...@@ -717,10 +732,10 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( ...@@ -717,10 +732,10 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
bool bUseNegativeColor = false; bool bUseNegativeColor = false;
if (aValue >>= bUseNegativeColor) if (aValue >>= bUseNegativeColor)
{ {
mpDataBar->GetDataBarData()->mbNeg = bUseNegativeColor; getCoreObject()->GetDataBarData()->mbNeg = bUseNegativeColor;
if (bUseNegativeColor && !mpDataBar->GetDataBarData()->mpNegativeColor) if (bUseNegativeColor && !getCoreObject()->GetDataBarData()->mpNegativeColor)
{ {
mpDataBar->GetDataBarData()->mpNegativeColor.reset(new Color(COL_AUTO)); getCoreObject()->GetDataBarData()->mpNegativeColor.reset(new Color(COL_AUTO));
} }
} }
} }
...@@ -730,7 +745,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( ...@@ -730,7 +745,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
bool bShowValue = true; bool bShowValue = true;
if (aValue >>= bShowValue) if (aValue >>= bShowValue)
{ {
mpDataBar->GetDataBarData()->mbOnlyBar = !bShowValue; getCoreObject()->GetDataBarData()->mbOnlyBar = !bShowValue;
} }
} }
break; break;
...@@ -739,7 +754,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( ...@@ -739,7 +754,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
sal_Int32 nColor = COL_AUTO; sal_Int32 nColor = COL_AUTO;
if (aValue >>= nColor) if (aValue >>= nColor)
{ {
mpDataBar->GetDataBarData()->maPositiveColor.SetColor(nColor); getCoreObject()->GetDataBarData()->maPositiveColor.SetColor(nColor);
} }
} }
break; break;
...@@ -748,16 +763,16 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( ...@@ -748,16 +763,16 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
sal_Int32 nAxisColor = COL_AUTO; sal_Int32 nAxisColor = COL_AUTO;
if (aValue >>= nAxisColor) if (aValue >>= nAxisColor)
{ {
mpDataBar->GetDataBarData()->maAxisColor.SetColor(nAxisColor); getCoreObject()->GetDataBarData()->maAxisColor.SetColor(nAxisColor);
} }
} }
break; break;
case NegativeColor: case NegativeColor:
{ {
sal_Int32 nNegativeColor = COL_AUTO; sal_Int32 nNegativeColor = COL_AUTO;
if ((aValue >>= nNegativeColor) && mpDataBar->GetDataBarData()->mbNeg) if ((aValue >>= nNegativeColor) && getCoreObject()->GetDataBarData()->mbNeg)
{ {
mpDataBar->GetDataBarData()->mpNegativeColor->SetColor(nNegativeColor); getCoreObject()->GetDataBarData()->mpNegativeColor->SetColor(nNegativeColor);
} }
else else
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
...@@ -786,7 +801,7 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert ...@@ -786,7 +801,7 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert
{ {
case AxisPosition: case AxisPosition:
{ {
databar::ScAxisPosition ePos = mpDataBar->GetDataBarData()->meAxisPosition; databar::ScAxisPosition ePos = getCoreObject()->GetDataBarData()->meAxisPosition;
sal_Int32 nApiPos = sheet::DataBarAxis::AXIS_NONE; sal_Int32 nApiPos = sheet::DataBarAxis::AXIS_NONE;
for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarAxisMap); ++i) for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarAxisMap); ++i)
{ {
...@@ -801,36 +816,36 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert ...@@ -801,36 +816,36 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert
break; break;
case UseGradient: case UseGradient:
{ {
aAny <<= mpDataBar->GetDataBarData()->mbGradient; aAny <<= getCoreObject()->GetDataBarData()->mbGradient;
} }
break; break;
case UseNegativeColor: case UseNegativeColor:
{ {
aAny <<= mpDataBar->GetDataBarData()->mbNeg; aAny <<= getCoreObject()->GetDataBarData()->mbNeg;
} }
break; break;
case DataBar_ShowValue: case DataBar_ShowValue:
{ {
aAny <<= !mpDataBar->GetDataBarData()->mbOnlyBar; aAny <<= !getCoreObject()->GetDataBarData()->mbOnlyBar;
} }
break; break;
case DataBar_Color: case DataBar_Color:
{ {
sal_Int32 nColor = mpDataBar->GetDataBarData()->maPositiveColor.GetColor(); sal_Int32 nColor = getCoreObject()->GetDataBarData()->maPositiveColor.GetColor();
aAny <<= nColor; aAny <<= nColor;
} }
break; break;
case AxisColor: case AxisColor:
{ {
sal_Int32 nAxisColor = mpDataBar->GetDataBarData()->maAxisColor.GetColor(); sal_Int32 nAxisColor = getCoreObject()->GetDataBarData()->maAxisColor.GetColor();
aAny <<= nAxisColor; aAny <<= nAxisColor;
} }
break; break;
case NegativeColor: case NegativeColor:
{ {
if (mpDataBar->GetDataBarData()->mbNeg && mpDataBar->GetDataBarData()->mpNegativeColor) if (getCoreObject()->GetDataBarData()->mbNeg && getCoreObject()->GetDataBarData()->mpNegativeColor)
{ {
sal_Int32 nNegativeColor = mpDataBar->GetDataBarData() ->mpNegativeColor->GetColor(); sal_Int32 nNegativeColor = getCoreObject()->GetDataBarData()->mpNegativeColor->GetColor();
aAny <<= nNegativeColor; aAny <<= nNegativeColor;
} }
} }
...@@ -884,6 +899,11 @@ ScIconSetFormatObj::~ScIconSetFormatObj() ...@@ -884,6 +899,11 @@ ScIconSetFormatObj::~ScIconSetFormatObj()
{ {
} }
ScIconSetFormat* ScIconSetFormatObj::getCoreObject()
{
return NULL;
}
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getPropertySetInfo() uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getPropertySetInfo()
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -912,14 +932,14 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue( ...@@ -912,14 +932,14 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
{ {
bool bShowValue = true; bool bShowValue = true;
aValue >>= bShowValue; aValue >>= bShowValue;
mpIconSet->GetIconSetData()->mbShowValue = bShowValue; getCoreObject()->GetIconSetData()->mbShowValue = bShowValue;
} }
break; break;
case Reverse: case Reverse:
{ {
bool bReverse = false; bool bReverse = false;
aValue >>= bReverse; aValue >>= bReverse;
mpIconSet->GetIconSetData()->mbReverse = bReverse; getCoreObject()->GetIconSetData()->mbReverse = bReverse;
} }
break; break;
case Icons: case Icons:
...@@ -943,7 +963,7 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue( ...@@ -943,7 +963,7 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
} }
mpIconSet->GetIconSetData()->eIconSetType = eType; getCoreObject()->GetIconSetData()->eIconSetType = eType;
} }
break; break;
} }
...@@ -965,14 +985,14 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert ...@@ -965,14 +985,14 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert
switch(pEntry->nWID) switch(pEntry->nWID)
{ {
case ShowValue: case ShowValue:
aAny <<= mpIconSet->GetIconSetData()->mbShowValue; aAny <<= getCoreObject()->GetIconSetData()->mbShowValue;
break; break;
case Reverse: case Reverse:
aAny <<= mpIconSet->GetIconSetData()->mbReverse; aAny <<= getCoreObject()->GetIconSetData()->mbReverse;
break; break;
case Icons: case Icons:
{ {
ScIconSetType eType = mpIconSet->GetIconSetData()->eIconSetType; ScIconSetType eType = getCoreObject()->GetIconSetData()->eIconSetType;
for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetApiMap); ++i) for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetApiMap); ++i)
{ {
if (aIconSetApiMap[i].eType == eType) if (aIconSetApiMap[i].eType == eType)
...@@ -985,8 +1005,8 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert ...@@ -985,8 +1005,8 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert
break; break;
case IconSetEntries: case IconSetEntries:
{ {
uno::Sequence< sheet::XIconSetEntry > aEntries(mpIconSet->size()); uno::Sequence< sheet::XIconSetEntry > aEntries(getCoreObject()->size());
for (auto it = mpIconSet->begin(), itEnd = mpIconSet->end(); it != itEnd; ++it) for (auto it = getCoreObject()->begin(), itEnd = getCoreObject()->end(); it != itEnd; ++it)
{ {
//aEntries.operator[] = ; //aEntries.operator[] = ;
} }
......
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