summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-08-11 14:17:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-08-13 12:34:18 +0200
commitc467aa6f29a004b03c072bb89fa36b687daca9f3 (patch)
tree14a84ee5e0a8c88a0d7c112cead675a7a99cadd6 /sc/source
parent06aeaad3d1ec55dafe985642ef2b34beef384012 (diff)
implement the ui part for AutoMin and AutoMax, related fdo#50462
Change-Id: Ib7ad4801e56b879539e2b8446a58e011e0ea978c
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/condformat/colorformat.cxx24
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx11
-rw-r--r--sc/source/ui/src/colorformat.src2
-rw-r--r--sc/source/ui/src/condformatdlg.src2
4 files changed, 34 insertions, 5 deletions
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 71f3bc71aa11..77acc7df5d56 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -91,6 +91,12 @@ void SetType(const ScColorScaleEntry* pEntry, ListBox& aLstBox)
case COLORSCALE_VALUE:
aLstBox.SelectEntryPos(4);
break;
+ case COLORSCALE_AUTOMIN:
+ aLstBox.SelectEntryPos(6);
+ break;
+ case COLORSCALE_AUTOMAX:
+ aLstBox.SelectEntryPos(7);
+ break;
}
}
@@ -122,6 +128,13 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry,
pEntry->SetValue(nVal);
break;
case 5:
+ //TODO: moggi
+ break;
+ case 6:
+ pEntry->SetType(COLORSCALE_AUTOMIN);
+ break;
+ case 7:
+ pEntry->SetType(COLORSCALE_AUTOMAX);
break;
}
}
@@ -257,7 +270,6 @@ void GetAxesPosition(ScDataBarFormatData* pData, const ListBox& rLbox)
}
}
-
}
ScDataBarFormatData* ScDataBarSettingsDlg::GetData()
@@ -281,9 +293,11 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
{
//check that min < max
bool bWarn = false;
- if(maLbTypeMin.GetSelectEntryPos() == 1)
+ sal_Int32 nSelectMin = maLbTypeMin.GetSelectEntryPos();
+ if( nSelectMin == 1 || nSelectMin == 7)
bWarn = true;
- if(maLbTypeMax.GetSelectEntryPos() == 0)
+ sal_Int32 nSelectMax = maLbTypeMax.GetSelectEntryPos();
+ if( nSelectMax == 0 || nSelectMax == 6 )
bWarn = true;
if(!bWarn && maLbTypeMin.GetSelectEntryPos() == maLbTypeMax.GetSelectEntryPos())
@@ -319,7 +333,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl )
{
sal_Int32 nSelectMin = maLbTypeMin.GetSelectEntryPos();
- if( nSelectMin == 0 || nSelectMin == 1)
+ if( nSelectMin == 0 || nSelectMin == 1 || nSelectMin == 6 || nSelectMin == 7)
maEdMin.Disable();
else
{
@@ -334,7 +348,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl )
}
sal_Int32 nSelectMax = maLbTypeMax.GetSelectEntryPos();
- if(nSelectMax == 0 || nSelectMax == 1)
+ if(nSelectMax == 0 || nSelectMax == 1 || nSelectMax == 6 || nSelectMax == 7)
maEdMax.Disable();
else
{
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 21f33c8fba73..387fb3e5f82e 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -81,8 +81,10 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType,
rLbType.SelectEntryPos(3);
break;
case COLORSCALE_AUTOMIN:
+ rLbType.SelectEntryPos(6);
break;
case COLORSCALE_AUTOMAX:
+ rLbType.SelectEntryPos(7);
break;
}
rLbCol.SelectEntry(rEntry.GetColor());
@@ -97,6 +99,7 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed
break;
case COLORSCALE_MAX:
rLbType.SelectEntryPos(1);
+ break;
case COLORSCALE_PERCENTILE:
rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
rLbType.SelectEntryPos(2);
@@ -114,8 +117,10 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed
rLbType.SelectEntryPos(3);
break;
case COLORSCALE_AUTOMIN:
+ rLbType.SelectEntryPos(6);
break;
case COLORSCALE_AUTOMAX:
+ rLbType.SelectEntryPos(7);
break;
}
}
@@ -731,6 +736,12 @@ void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const
pEntry->SetType(COLORSCALE_FORMULA);
pEntry->SetFormula(rValue.GetText(), pDoc, rPos);
break;
+ case 6:
+ pEntry->SetType(COLORSCALE_AUTOMIN);
+ break;
+ case 7:
+ pEntry->SetType(COLORSCALE_AUTOMAX);
+ break;
default:
break;
}
diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src
index 58867c6e24ae..ce07fcb8e85e 100644
--- a/sc/source/ui/src/colorformat.src
+++ b/sc/source/ui/src/colorformat.src
@@ -140,6 +140,8 @@ ModalDialog RID_SCDLG_DATABAR
"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 12d4ef979ee2..2800724d2036 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -181,6 +181,8 @@ Control RID_COND_ENTRY
"Value";
"Percent";
"Formula";
+ "AutoMin";
+ "AutoMax";
};
};
Window WD_PREVIEW