diff options
-rw-r--r-- | sc/inc/colorscale.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 13 | ||||
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 22 | ||||
-rw-r--r-- | sc/source/filter/excel/xeextlst.cxx | 22 | ||||
-rw-r--r-- | sc/source/filter/inc/xecontent.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/inc/xeextlst.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcondformat.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformatdlgentry.cxx | 88 | ||||
-rw-r--r-- | sc/source/ui/src/colorformat.src | 3 | ||||
-rw-r--r-- | sc/source/ui/src/condformatdlg.src | 9 |
13 files changed, 113 insertions, 119 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 146c10b7c28e..7ee92ce09c6e 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -53,8 +53,7 @@ enum ScColorScaleEntryType COLORSCALE_PERCENT, COLORSCALE_PERCENTILE, COLORSCALE_FORMULA, - COLORSCALE_AUTOMIN, - COLORSCALE_AUTOMAX + COLORSCALE_AUTO, }; class SC_DLLPUBLIC ScColorScaleEntry diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 6951e8b1af1e..1f6779f7b0ea 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -397,12 +397,8 @@ double ScColorScaleFormat::CalcValue(double nMin, double nMax, ScColorScaleForma return nMin + (nMax-nMin)*(itr->GetValue()/100); case COLORSCALE_MIN: return nMin; - case COLORSCALE_AUTOMIN: - return std::min<double>(0, nMin); case COLORSCALE_MAX: return nMax; - case COLORSCALE_AUTOMAX: - return std::max<double>(0, nMax); case COLORSCALE_PERCENTILE: { std::vector<double>& rValues = getValues(); @@ -526,8 +522,6 @@ bool ScColorScaleFormat::CheckEntriesForRel(const ScRange& rRange) const { case COLORSCALE_MIN: case COLORSCALE_MAX: - case COLORSCALE_AUTOMIN: - case COLORSCALE_AUTOMAX: bNeedUpdate = true; break; case COLORSCALE_FORMULA: @@ -634,8 +628,7 @@ bool NeedUpdate(ScColorScaleEntry* pEntry) case COLORSCALE_MIN: case COLORSCALE_MAX: case COLORSCALE_FORMULA: - case COLORSCALE_AUTOMIN: - case COLORSCALE_AUTOMAX: + case COLORSCALE_AUTO: return true; default: return false; @@ -678,7 +671,7 @@ double ScDataBarFormat::getMin(double nMin, double nMax) const case COLORSCALE_MIN: return nMin; - case COLORSCALE_AUTOMIN: + case COLORSCALE_AUTO: return std::min<double>(0, nMin); case COLORSCALE_PERCENT: @@ -704,7 +697,7 @@ double ScDataBarFormat::getMax(double nMin, double nMax) const { case COLORSCALE_MAX: return nMax; - case COLORSCALE_AUTOMAX: + case COLORSCALE_AUTO: return std::max<double>(0, nMax); case COLORSCALE_PERCENT: return nMin + (nMax-nMin)/100*mpFormatData->mpUpperLimit->GetValue(); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index c6bffc3b8f42..c73155be6518 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -885,17 +885,18 @@ void XclExpCF::SaveXml( XclExpXmlStream& rStrm ) mxImpl->SaveXml( rStrm ); } -XclExpCfvo::XclExpCfvo(const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rAddr): +XclExpCfvo::XclExpCfvo(const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rAddr, bool bFirst): XclExpRecord(), XclExpRoot( rRoot ), mrEntry(rEntry), - maSrcPos(rAddr) + maSrcPos(rAddr), + mbFirst(bFirst) { } namespace { -rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry ) +rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry, bool bFirst ) { switch(rEntry.GetType()) { @@ -907,10 +908,11 @@ rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry ) return "percent"; case COLORSCALE_FORMULA: return "formula"; - case COLORSCALE_AUTOMIN: - return "min"; - case COLORSCALE_AUTOMAX: - return "max"; + case COLORSCALE_AUTO: + if(bFirst) + return "min"; + else + return "max"; case COLORSCALE_PERCENTILE: return "percentile"; default: @@ -938,7 +940,7 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm ) } rWorksheet->startElement( XML_cfvo, - XML_type, getColorScaleType(mrEntry).getStr(), + XML_type, getColorScaleType(mrEntry, mbFirst).getStr(), XML_val, aValue.getStr(), FSEND ); @@ -1115,8 +1117,8 @@ XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rF const ScRange* pRange = rFormat.GetRange().front(); ScAddress aAddr = pRange->aStart; // exact position is not important, we allow only absolute refs - mpCfvoLowerLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit.get(), aAddr ) ); - mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr ) ); + mpCfvoLowerLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit.get(), aAddr, true ) ); + mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr, false ) ); mpCol.reset( new XclExpColScaleCol( GetRoot(), mrFormat.GetDataBarData()->maPositiveColor ) ); if(xExtLst.get()) diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index 32041c52b000..53ab66ba2ec5 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -51,9 +51,10 @@ void XclExpExtAxisColor::SaveXml( XclExpXmlStream& rStrm ) FSEND ); } -XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rSrcPos ): +XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rSrcPos, bool bFirst ): XclExpRoot(rRoot), - meType(rEntry.GetType()) + meType(rEntry.GetType()), + mbFirst(bFirst) { if( rEntry.GetType() == COLORSCALE_FORMULA ) { @@ -66,7 +67,7 @@ XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& namespace { -const char* getColorScaleType( ScColorScaleEntryType eType ) +const char* getColorScaleType( ScColorScaleEntryType eType, bool bFirst ) { switch(eType) { @@ -78,10 +79,11 @@ const char* getColorScaleType( ScColorScaleEntryType eType ) return "percent"; case COLORSCALE_FORMULA: return "formula"; - case COLORSCALE_AUTOMIN: - return "autoMin"; - case COLORSCALE_AUTOMAX: - return "autoMax"; + case COLORSCALE_AUTO: + if(bFirst) + return "autoMin"; + else + return "autoMax"; case COLORSCALE_PERCENTILE: return "percentile"; default: @@ -96,7 +98,7 @@ void XclExpExtCfvo::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); rWorksheet->singleElementNS( XML_x14, XML_cfvo, - XML_type, getColorScaleType(meType), + XML_type, getColorScaleType(meType, mbFirst), XML_value, maValue.getStr(), FSEND ); } @@ -105,8 +107,8 @@ XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarForm XclExpRoot(rRoot) { const ScDataBarFormatData& rFormatData = *rFormat.GetDataBarData(); - mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos ) ); - mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos ) ); + mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos, true ) ); + mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos, false ) ); if(rFormatData.mpNegativeColor.get()) mpNegativeColor.reset( new XclExpExtNegativeColor( *rFormatData.mpNegativeColor.get() ) ); else diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index 23ca6e40750b..9417ab28b66b 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -194,13 +194,14 @@ private: class XclExpCfvo : public XclExpRecord, protected XclExpRoot { public: - explicit XclExpCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rFormatEntry, const ScAddress& rPos); + explicit XclExpCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rFormatEntry, const ScAddress& rPos, bool bFirst = true); virtual ~XclExpCfvo() {} virtual void SaveXml( XclExpXmlStream& rStrm ); private: const ScColorScaleEntry& mrEntry; ScAddress maSrcPos; + bool mbFirst; }; class XclExpColScaleCol : public XclExpRecord, protected XclExpRoot diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx index 6ce7b703187e..466811174c51 100644 --- a/sc/source/filter/inc/xeextlst.hxx +++ b/sc/source/filter/inc/xeextlst.hxx @@ -40,12 +40,13 @@ protected: class XclExpExtCfvo : public XclExpRecordBase, protected XclExpRoot { public: - XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos ); + XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos, bool bFirst ); virtual void SaveXml( XclExpXmlStream& rStrm ); private: ScColorScaleEntryType meType; rtl::OString maValue; + bool mbFirst; }; class XclExpExtNegativeColor diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 78fd832fc540..43a3859ddaa8 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -131,9 +131,9 @@ void ExtCfRuleContext::importCfvo( const AttributeList& rAttribs ) else if (aColorScaleType == "max") pEntry->SetType(COLORSCALE_MAX); else if (aColorScaleType == "autoMin") - pEntry->SetType(COLORSCALE_AUTOMIN); + pEntry->SetType(COLORSCALE_AUTO); else if (aColorScaleType == "autoMax") - pEntry->SetType(COLORSCALE_AUTOMAX); + pEntry->SetType(COLORSCALE_AUTO); else if (aColorScaleType == "percentile") pEntry->SetType(COLORSCALE_PERCENTILE); else if (aColorScaleType == "percent") diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index 32e075149752..9733bd28e9a1 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -436,11 +436,9 @@ void setColorEntryType(const rtl::OUString& rType, ScColorScaleEntry* pEntry, co pEntry->SetFormula(rFormula, rImport.GetDocument(), ScAddress(0,0,rImport.GetTables().GetCurrentSheet()), formula::FormulaGrammar::GRAM_ODFF); } else if(rType == "auto-minimum") - pEntry->SetType(COLORSCALE_AUTOMIN); + pEntry->SetType(COLORSCALE_AUTO); else if(rType == "auto-maximum") - pEntry->SetType(COLORSCALE_AUTOMAX); - - //TODO: add formulas + pEntry->SetType(COLORSCALE_AUTO); } } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index a9eaf1b30960..98e15c65119e 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3784,7 +3784,7 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) namespace { -rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry) +rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry, bool bFirst = true) { switch(rEntry.GetType()) { @@ -3800,10 +3800,12 @@ rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry) return rtl::OUString("formula"); case COLORSCALE_VALUE: return rtl::OUString("number"); - case COLORSCALE_AUTOMIN: - return rtl::OUString("auto-minimum"); - case COLORSCALE_AUTOMAX: - return rtl::OUString("auto-maximum"); + case COLORSCALE_AUTO: + // only important for data bars + if(bFirst) + return rtl::OUString("auto-minimum"); + else + return rtl::OUString("auto-maximum"); } return rtl::OUString(); } @@ -3977,7 +3979,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) } else AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpLowerLimit->GetValue())); - AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit)); + AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit, true)); SvXMLElementExport aElementDataBarEntryLower(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true); } @@ -3989,7 +3991,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) } else AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpUpperLimit->GetValue())); - AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit)); + AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit, false)); SvXMLElementExport aElementDataBarEntryUpper(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true); } } diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 77acc7df5d56..7dfa918d6e3b 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -63,7 +63,7 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc): FreeResource(); maLbTypeMin.SelectEntryPos(0); - maLbTypeMax.SelectEntryPos(1); + maLbTypeMax.SelectEntryPos(0); maLbAxisPos.SelectEntryPos(0); } @@ -73,29 +73,26 @@ void SetType(const ScColorScaleEntry* pEntry, ListBox& aLstBox) { switch(pEntry->GetType()) { - case COLORSCALE_MIN: + case COLORSCALE_AUTO: aLstBox.SelectEntryPos(0); break; - case COLORSCALE_MAX: + case COLORSCALE_MIN: aLstBox.SelectEntryPos(1); break; - case COLORSCALE_PERCENTILE: + case COLORSCALE_MAX: aLstBox.SelectEntryPos(2); break; - case COLORSCALE_PERCENT: + case COLORSCALE_PERCENTILE: aLstBox.SelectEntryPos(3); break; - case COLORSCALE_FORMULA: - aLstBox.SelectEntryPos(5); - break; - case COLORSCALE_VALUE: + case COLORSCALE_PERCENT: aLstBox.SelectEntryPos(4); break; - case COLORSCALE_AUTOMIN: + case COLORSCALE_FORMULA: aLstBox.SelectEntryPos(6); break; - case COLORSCALE_AUTOMAX: - aLstBox.SelectEntryPos(7); + case COLORSCALE_VALUE: + aLstBox.SelectEntryPos(5); break; } } @@ -107,34 +104,31 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, switch(rLstBox.GetSelectEntryPos()) { case 0: - pEntry->SetType(COLORSCALE_MIN); + pEntry->SetType(COLORSCALE_AUTO); break; case 1: - pEntry->SetType(COLORSCALE_MAX); + pEntry->SetType(COLORSCALE_MIN); break; case 2: + pEntry->SetType(COLORSCALE_MAX); + break; + case 3: pEntry->SetType(COLORSCALE_PERCENTILE); pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); pEntry->SetValue(nVal); break; - case 3: + case 4: pEntry->SetType(COLORSCALE_PERCENT); pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); pEntry->SetValue(nVal); break; - case 4: + case 5: pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); pEntry->SetType(COLORSCALE_VALUE); pEntry->SetValue(nVal); break; - case 5: - //TODO: moggi - break; case 6: - pEntry->SetType(COLORSCALE_AUTOMIN); - break; - case 7: - pEntry->SetType(COLORSCALE_AUTOMAX); + //TODO: moggi break; } } diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 707462f3c879..ef022c0aa1b5 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -518,72 +518,72 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, switch(rEntry.GetType()) { case COLORSCALE_MIN: - rLbType.SelectEntryPos(0); + rLbType.SelectEntryPos(1); break; case COLORSCALE_MAX: - rLbType.SelectEntryPos(1); + rLbType.SelectEntryPos(2); break; case COLORSCALE_PERCENTILE: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(2); + rLbType.SelectEntryPos(3); break; case COLORSCALE_PERCENT: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(4); + rLbType.SelectEntryPos(5); break; case COLORSCALE_FORMULA: rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); - rLbType.SelectEntryPos(5); + rLbType.SelectEntryPos(6); break; case COLORSCALE_VALUE: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(3); - break; - case COLORSCALE_AUTOMIN: - rLbType.SelectEntryPos(6); + rLbType.SelectEntryPos(4); break; - case COLORSCALE_AUTOMAX: - rLbType.SelectEntryPos(7); + case COLORSCALE_AUTO: + abort(); break; } rLbCol.SelectEntry(rEntry.GetColor()); } -void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos ) +void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos, bool bDataBar ) { sal_uInt32 nIndex = 0; double nVal = 0; SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); pNumberFormatter->IsNumberFormat(rValue.GetText(), nIndex, nVal); - switch(rType.GetSelectEntryPos()) + + // color scale does not have the automatic entry + sal_Int32 nPos = rType.GetSelectEntryPos(); + if(!bDataBar) + ++nPos; + + switch(nPos) { - case 0: + case 1: pEntry->SetType(COLORSCALE_MIN); break; - case 1: + case 2: pEntry->SetType(COLORSCALE_MAX); break; - case 2: + case 3: pEntry->SetType(COLORSCALE_PERCENTILE); pEntry->SetValue(nVal); break; - case 3: + case 4: pEntry->SetType(COLORSCALE_VALUE); pEntry->SetValue(nVal); break; - case 4: + case 5: pEntry->SetType(COLORSCALE_PERCENT); pEntry->SetValue(nVal); break; - case 5: + case 6: pEntry->SetType(COLORSCALE_FORMULA); pEntry->SetFormula(rValue.GetText(), pDoc, rPos); break; - case 6: - pEntry->SetType(COLORSCALE_AUTOMIN); - break; - case 7: - pEntry->SetType(COLORSCALE_AUTOMAX); + case 0: + pEntry->SetType(COLORSCALE_AUTO); break; default: break; @@ -594,7 +594,7 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB { ScColorScaleEntry* pEntry = new ScColorScaleEntry(); - SetColorScaleEntry( pEntry, rType, rValue, pDoc, rPos ); + SetColorScaleEntry( pEntry, rType, rValue, pDoc, rPos, false ); Color aColor = rColor.GetSelectEntryColor(); pEntry->SetColor(aColor); return pEntry; @@ -612,6 +612,10 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( Window* pParent, ScDocument* pDo maLbColMin( this, ScResId( LB_COL_MIN ) ), maLbColMax( this, ScResId( LB_COL_MAX ) ) { + // remove the automatic entry from color scales + maLbEntryTypeMin.RemoveEntry(0); + maLbEntryTypeMax.RemoveEntry(0); + maLbType.SelectEntryPos(0); maLbColorFormat.SelectEntryPos(0); if(pFormat) @@ -771,6 +775,11 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( Window* pParent, ScDocument* pDo maLbColMiddle( this, ScResId( LB_COL_MIDDLE ) ), maLbColMax( this, ScResId( LB_COL_MAX ) ) { + // remove the automatic entry from color scales + maLbEntryTypeMin.RemoveEntry(0); + maLbEntryTypeMiddle.RemoveEntry(0); + maLbEntryTypeMax.RemoveEntry(0); + maLbType.SelectEntryPos(0); if(pFormat) { @@ -949,32 +958,29 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed switch(rEntry.GetType()) { case COLORSCALE_MIN: - rLbType.SelectEntryPos(0); + rLbType.SelectEntryPos(1); break; case COLORSCALE_MAX: - rLbType.SelectEntryPos(1); + rLbType.SelectEntryPos(2); break; case COLORSCALE_PERCENTILE: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(2); + rLbType.SelectEntryPos(3); break; case COLORSCALE_PERCENT: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(4); + rLbType.SelectEntryPos(5); break; case COLORSCALE_FORMULA: rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); - rLbType.SelectEntryPos(5); + rLbType.SelectEntryPos(6); break; case COLORSCALE_VALUE: rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(3); - break; - case COLORSCALE_AUTOMIN: - rLbType.SelectEntryPos(6); + rLbType.SelectEntryPos(4); break; - case COLORSCALE_AUTOMAX: - rLbType.SelectEntryPos(7); + case COLORSCALE_AUTO: + rLbType.SelectEntryPos(0); break; } } @@ -1002,7 +1008,7 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry( Window* pParent, ScDocument* pDoc, const else { maLbDataBarMinType.SelectEntryPos(0); - maLbDataBarMaxType.SelectEntryPos(1); + maLbDataBarMaxType.SelectEntryPos(0); } Init(); @@ -1033,8 +1039,8 @@ void ScDataBarFrmtEntry::Init() ScFormatEntry* ScDataBarFrmtEntry::createDatabarEntry() const { - SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos); - SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos); + SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true); + SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true); ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc); pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get())); return pDataBar; @@ -1081,8 +1087,8 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, DataBarTypeSelectHdl ) IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl ) { - SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos); - SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos); + SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true); + SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true); ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc); if( pDlg->Execute() == RET_OK) { diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src index ce07fcb8e85e..dd702e100b95 100644 --- a/sc/source/ui/src/colorformat.src +++ b/sc/source/ui/src/colorformat.src @@ -134,14 +134,13 @@ ModalDialog RID_SCDLG_DATABAR DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; "Minimum"; "Maximum"; "Percentile"; "Percent"; "Value"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; ListBox LB_AXIS_POSITION diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src index 4adff8f62fc4..5bd45a05d6ef 100644 --- a/sc/source/ui/src/condformatdlg.src +++ b/sc/source/ui/src/condformatdlg.src @@ -199,14 +199,13 @@ Control RID_COND_ENTRY DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; "Min"; "Max"; "Percentile"; "Value"; "Percent"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; ListBox LB_TYPE_COL_SCALE_MIDDLE @@ -217,14 +216,13 @@ Control RID_COND_ENTRY DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; "Min"; "Max"; "Percentile"; "Value"; "Percent"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; ListBox LB_TYPE_COL_SCALE_MAX @@ -235,14 +233,13 @@ Control RID_COND_ENTRY DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; "Min"; "Max"; "Percentile"; "Value"; "Percent"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; Window WD_PREVIEW |