Kaydet (Commit) 8f25120e authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Andras Timar

tdf#91501: Add data bar colour to the list if not there yet

Change-Id: I18dd5b8dc49bd9f4dc9c27556782fa5f2b3c4f58
üst 111a86b5
...@@ -66,6 +66,16 @@ void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit) ...@@ -66,6 +66,16 @@ void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit)
aEdit.Disable(); aEdit.Disable();
} }
void SelectColor(const Color& aColor, const OUString aCustomName, ColorListBox& rLstBox)
{
rLstBox.SelectEntry( aColor );
if ( rLstBox.GetSelectEntryColor() != aColor )
{
rLstBox.InsertEntry( aColor, aCustomName );
rLstBox.SelectEntry( aColor );
}
}
} }
ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos): ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos):
...@@ -90,13 +100,14 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar ...@@ -90,13 +100,14 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar
get( mpCbOnlyBar, "only_bar"); get( mpCbOnlyBar, "only_bar");
maStrWarnSameValue = get<FixedText>("str_same_value")->GetText(); maStrWarnSameValue = get<FixedText>("str_same_value")->GetText();
maCustomColor = get<FixedText>("custom_color")->GetText();
Init(); Init();
mpLbPos->SelectEntry( rData.maPositiveColor ); ::SelectColor( rData.maPositiveColor, maCustomColor, *mpLbPos);
mpLbFillType->SelectEntryPos( rData.mbGradient ? 1 : 0 ); mpLbFillType->SelectEntryPos( rData.mbGradient ? 1 : 0 );
if(rData.mpNegativeColor) if(rData.mpNegativeColor)
mpLbNeg->SelectEntry( *rData.mpNegativeColor ); ::SelectColor( *rData.mpNegativeColor, maCustomColor, *mpLbNeg );
switch (rData.meAxisPosition) switch (rData.meAxisPosition)
{ {
......
...@@ -43,6 +43,7 @@ private: ...@@ -43,6 +43,7 @@ private:
VclPtr<CheckBox> mpCbOnlyBar; VclPtr<CheckBox> mpCbOnlyBar;
OUString maStrWarnSameValue; OUString maStrWarnSameValue;
OUString maCustomColor;
SvNumberFormatter* mpNumberFormatter; SvNumberFormatter* mpNumberFormatter;
ScDocument* mpDoc; ScDocument* mpDoc;
......
...@@ -523,6 +523,17 @@ ...@@ -523,6 +523,17 @@
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel" id="custom_color">
<property name="can_focus">False</property>
<property name="label" translatable="yes">Custom</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
......
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