[Libreoffice-commits] .: 2 commits - sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Sun Jul 15 19:26:58 PDT 2012
sc/source/ui/condformat/colorformat.cxx | 2 -
sc/source/ui/condformat/condformatdlg.cxx | 40 ++++++++++++++++++++++++++++++
sc/source/ui/inc/condformatdlg.hxx | 1
3 files changed, 42 insertions(+), 1 deletion(-)
New commits:
commit b85a2af72e3ce0a4111972d51c8f1d43599dee5e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Jul 16 04:21:40 2012 +0200
disable edit field for min and max type, fdo#51834
Change-Id: Id77c58f333bfab5446cf96d24cd9ccfc18802862
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 2ec2dc7..f77fe37 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -173,6 +173,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc):
SwitchToType(COLLAPSED);
SetHeight();
SetCondType();
+
+ EntryTypeHdl(&maLbEntryTypeMin);
+ EntryTypeHdl(&maLbEntryTypeMiddle);
+ EntryTypeHdl(&maLbEntryTypeMax);
}
ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry):
@@ -297,6 +301,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
SwitchToType(COLLAPSED);
SetHeight();
+
+ EntryTypeHdl(&maLbEntryTypeMin);
+ EntryTypeHdl(&maLbEntryTypeMiddle);
+ EntryTypeHdl(&maLbEntryTypeMax);
}
ScCondFrmtEntry::~ScCondFrmtEntry()
@@ -307,6 +315,12 @@ void ScCondFrmtEntry::Init()
{
maLbType.SetSelectHdl( LINK( this, ScCondFrmtEntry, TypeListHdl ) );
maLbColorFormat.SetSelectHdl( LINK( this, ScCondFrmtEntry, ColFormatTypeHdl ) );
+ maLbEntryTypeMin.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMax.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+
+
+
SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() )
{
@@ -813,6 +827,31 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl)
return 0;
}
+IMPL_LINK( ScCondFrmtEntry, EntryTypeHdl, ListBox*, pBox )
+{
+ bool bEnableEdit = true;
+ sal_Int32 nPos = pBox->GetSelectEntryPos();
+ if(nPos == 0 || nPos == 1)
+ {
+ bEnableEdit = false;
+ }
+
+ Edit* pEd = NULL;
+ if(pBox == &maLbEntryTypeMin)
+ pEd = &maEdMin;
+ else if(pBox == &maLbEntryTypeMiddle)
+ pEd = &maEdMiddle;
+ else if(pBox == &maLbEntryTypeMax)
+ pEd = &maEdMax;
+
+ if(bEnableEdit)
+ pEd->Enable();
+ else
+ pEd->Disable();
+
+ return 0;
+}
+
IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl)
{
if(maLbStyle.GetSelectEntryPos() == 0)
@@ -906,6 +945,7 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
{
maEdVal2.Hide();
}
+
return 0;
}
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 2c53ab0..46938b9 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -124,6 +124,7 @@ private:
DECL_LINK( OptionBtnHdl, void* );
DECL_LINK( DataBarTypeSelectHdl, void* );
DECL_LINK( ConditionTypeSelectHdl, void* );
+ DECL_LINK( EntryTypeHdl, ListBox* );
public:
ScCondFrmtEntry( Window* pParent, ScDocument* pDoc );
commit e11c88d999ad9cab8e309c87088d433fde0d4d9d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Jul 16 04:02:23 2012 +0200
use correct value to check for min and max, fdo#51831
Change-Id: I8a5412bc9c22048dd8f6618b38e5a522b7ea02c2
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 867f29f..daa14a8 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -288,7 +288,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
mpNumberFormatter->IsNumberFormat(aMinString, nIndex, nMinValue);
nIndex = 0;
double nMaxValue = 0;
- mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMinValue);
+ mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMaxValue);
if(rtl::math::approxEqual(nMinValue, nMaxValue) || nMinValue > nMaxValue)
bWarn = true;
}
More information about the Libreoffice-commits
mailing list