summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2001-02-21 12:27:16 +0000
committerjp <jp@openoffice.org>2001-02-21 12:27:16 +0000
commitd8adf7a2ce47149c6011e3bd7823e6989a82e7ec (patch)
tree38eef0c05821686614d55666f01cc51b8fbb91aa /sw/source/ui
parent64ec09f38fa812b1cd1f85ace949bd518a9bbcb2 (diff)
use shell method to get the current Language
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx27
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx12
2 files changed, 8 insertions, 31 deletions
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 5b08d310328a..712289705d95 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dbinsdlg.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: os $ $Date: 2001-02-21 12:27:32 $
+ * last change: $Author: jp $ $Date: 2001-02-21 13:24:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -439,18 +439,8 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
if(xColSupp.is())
{
SwWrtShell& rSh = pView->GetWrtShell();
+ Locale aDocLocale( SvxCreateLocale( rSh.GetCurLang() ));
SvNumberFormatter* pNumFmtr = rSh.GetNumberFormatter();
- SfxItemSet aSet(pView->GetPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE);
- rSh.GetAttr( aSet );
- Locale aDocLocale;
- if(SFX_ITEM_DEFAULT <= aSet.GetItemState(RES_CHRATR_LANGUAGE, TRUE))
- {
- Any aLoc;
- const SfxPoolItem& rItem = aSet.Get(RES_CHRATR_LANGUAGE);
- rItem.QueryValue(aLoc, MID_LANG_LOCALE);
- aDocLocale = *(Locale*)aLoc.getValue();
- }
-
SvNumberFormatsSupplierObj* pNumFmt = new SvNumberFormatsSupplierObj( pNumFmtr );
Reference< util::XNumberFormatsSupplier > xDocNumFmtsSupplier = pNumFmt;
Reference< XNumberFormats > xDocNumberFormats = xDocNumFmtsSupplier->getNumberFormats();
@@ -1476,16 +1466,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<sal_Int32>& rSelection,
}
}
}
- SfxItemSet aSet(pView->GetPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE);
- rSh.GetAttr( aSet );
- if(SFX_ITEM_DEFAULT <= aSet.GetItemState(RES_CHRATR_LANGUAGE, TRUE))
- {
- Any aLoc;
- const SfxPoolItem& rItem = aSet.Get(RES_CHRATR_LANGUAGE);
- rItem.QueryValue(aLoc, MID_LANG_LOCALE);
- aDBFormatData.aLocale = *(Locale*)aLoc.getValue();
- }
-
+ aDBFormatData.aLocale = SvxCreateLocale( rSh.GetCurLang() );
SwDBNextSetField aNxtDBFld( (SwDBNextSetFieldType*)rSh.
GetFldType( 0, RES_DBNEXTSETFLD ),
C2S("1"), aEmptyStr, aDBData );
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 7151d91653df..8258fdc840eb 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fldmgr.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2001-02-21 12:27:35 $
+ * last change: $Author: jp $ $Date: 2001-02-21 13:27:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1795,12 +1795,8 @@ void SwFldMgr::EvalExpFlds(SwWrtShell* pSh)
USHORT SwFldMgr::GetCurrLanguage() const
{
SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell();
- if(pSh)
- {
- SfxItemSet aSet( pSh->GetAttrPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE);
- pSh->GetAttr(aSet);
- return ((const SvxLanguageItem&)aSet.Get( RES_CHRATR_LANGUAGE ) ).GetLanguage();
- }
+ if( pSh )
+ pSh->GetCurLang();
return SvxLocaleToLanguage( GetAppLocaleData().getLocale() );
}