summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx38
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hxx1
2 files changed, 29 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index c12c5bdb3814..3cb2d2838e8c 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -98,6 +98,17 @@ void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
rAuto.SetPosPixel(aPos);
}
+long lcl_getLabelDistance( Control& rControl )
+{
+ return rControl.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
+}
+
+void lcl_setValue( FormattedField& rFmtField, double fValue )
+{
+ rFmtField.SetValue( fValue );
+ rFmtField.SetDefaultValue( fValue );
+}
+
}
ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
@@ -168,6 +179,18 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
m_aLB_TimeResolution.SetDropDownLineCount(3);
m_aLB_MainTimeUnit.SetDropDownLineCount(3);
m_aLB_HelpTimeUnit.SetDropDownLineCount(3);
+
+ aFmtFldMin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+}
+
+IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied )
+{
+ if( pFmtFied )
+ pFmtFied->SetDefaultValue( pFmtFied->GetValue() );
+ return 0;
}
void ScaleTabPage::StateChanged( StateChangedType nType )
@@ -178,11 +201,6 @@ void ScaleTabPage::StateChanged( StateChangedType nType )
AdjustControlPositions();
}
-long lcl_getLabelDistance( Control& rControl )
-{
- return rControl.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
-}
-
void ScaleTabPage::AdjustControlPositions()
{
//optimize position of the controls
@@ -320,7 +338,7 @@ void ScaleTabPage::EnableControls()
{
//transport value from one to other control
if( bWasDateAxis )
- aFmtFldStepMain.SetValue( m_aMt_MainDateStep.GetValue() );
+ lcl_setValue( aFmtFldStepMain, m_aMt_MainDateStep.GetValue() );
else
m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(aFmtFldStepMain.GetValue()) );
}
@@ -483,7 +501,7 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMin.SetValue( fMin );
+ lcl_setValue( aFmtFldMin, fMin );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
@@ -492,7 +510,7 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMax.SetValue( fMax );
+ lcl_setValue( aFmtFldMax, fMax );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
@@ -501,7 +519,7 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldStepMain.SetValue( fStepMain );
+ lcl_setValue( aFmtFldStepMain, fStepMain );
m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(fStepMain) );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
@@ -520,7 +538,7 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldOrigin.SetValue( fOrigin );
+ lcl_setValue( aFmtFldOrigin, fOrigin );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,TRUE, &pPoolItem) == SFX_ITEM_SET)
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index 953187d1d9cf..ecfc42c2c513 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -121,6 +121,7 @@ private:
DECL_LINK( SelectAxisTypeHdl, void* );
DECL_LINK( EnableValueHdl, CheckBox* );
+ DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
/** shows a warning window due to an invalid input.