summaryrefslogtreecommitdiff
path: root/sw/source/ui/utlui/numfmtlb.cxx
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-11-15 10:17:38 +0000
committerOliver Specht <os@openoffice.org>2002-11-15 10:17:38 +0000
commit2642352cae8e2adca845825cf65c2a98f5be24ba (patch)
tree1fcf439e224dc89d1aad764d1cdeb503ec718f5a /sw/source/ui/utlui/numfmtlb.cxx
parentef6790486f1e73a0ae2c33ebd6617813c8115b75 (diff)
#103096# optionally apply fixed (no language dependence) number format to text fields
Diffstat (limited to 'sw/source/ui/utlui/numfmtlb.cxx')
-rw-r--r--sw/source/ui/utlui/numfmtlb.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index dbf682605483..f78b49684bda 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: numfmtlb.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: jp $ $Date: 2001-09-27 17:23:38 $
+ * last change: $Author: os $ $Date: 2002-11-15 11:13:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -154,7 +154,9 @@ NumFormatListBox::NumFormatListBox( Window* pWin, const ResId& rResId,
bOneArea (FALSE),
nDefFormat (nDefFmt),
pVw (0),
- pOwnFormatter (0)
+ pOwnFormatter (0),
+ bUseAutomaticLanguage(TRUE),
+ bShowLanguageControl(FALSE)
{
Init(nFormatType, bUsrFmts);
}
@@ -172,7 +174,9 @@ NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView,
bOneArea (FALSE),
nDefFormat (nDefFmt),
pVw (pView),
- pOwnFormatter (0)
+ pOwnFormatter (0),
+ bUseAutomaticLanguage(TRUE),
+ bShowLanguageControl(FALSE)
{
Init(nFormatType, bUsrFmts);
}
@@ -488,6 +492,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA,
SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
+ SID_ATTR_NUMBERFORMAT_ADD_AUTO, SID_ATTR_NUMBERFORMAT_ADD_AUTO,
0 );
double fValue = GetDefValue( pFormatter, nCurrFormatType);
@@ -501,8 +506,8 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
if( (NUMBERFORMAT_DATE | NUMBERFORMAT_TIME) & nCurrFormatType )
aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, bOneArea));
- // Keine Sprachauswahl im Dialog, da Sprache im Textattribut enthalten ist
- aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_NOLANGUAGE, TRUE));
+ aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_NOLANGUAGE, !bShowLanguageControl));
+ aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage));
SwNumFmtDlg* pDlg = new SwNumFmtDlg(this, aCoreSet);
@@ -519,10 +524,18 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
pFormatter->DeleteEntry( pDelArr[i] );
}
- if( SFX_ITEM_SET == pDlg->GetOutputItemSet()->GetItemState(
+ const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+ if( SFX_ITEM_SET == pOutSet->GetItemState(
SID_ATTR_NUMBERFORMAT_VALUE, FALSE, &pItem ))
{
- SetDefFormat(((SfxUInt32Item*)pItem)->GetValue());
+ UINT32 nFormat = ((SfxUInt32Item*)pItem)->GetValue();
+ SetDefFormat(nFormat);
+ eCurLanguage = pFormatter->GetEntry(nFormat)->GetLanguage();
+ }
+ if( bShowLanguageControl && SFX_ITEM_SET == pOutSet->GetItemState(
+ SID_ATTR_NUMBERFORMAT_ADD_AUTO, FALSE, &pItem ))
+ {
+ bUseAutomaticLanguage = ((const SfxBoolItem*)pItem)->GetValue();
}
}
else