get rid of some Germanism (and some Windowsism)
Change-Id: I2ca1b34ff688a7d4fcf6c84c02035eda3ab0dee8
This commit is contained in:
parent
f1efc98b45
commit
29bfb507b3
@ -379,25 +379,25 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
|
|||||||
// HACK, beause the numberformatter doesn't swap the place holders
|
// HACK, beause the numberformatter doesn't swap the place holders
|
||||||
// for month, day and year according to the system setting.
|
// for month, day and year according to the system setting.
|
||||||
// Problem: Print Year(Date) under engl. BS
|
// Problem: Print Year(Date) under engl. BS
|
||||||
// also have a look at: svtools\source\sbx\sbxdate.cxx
|
// also have a look at: basic/source/sbx/sbxdate.cxx
|
||||||
|
|
||||||
OUString aDateStr;
|
OUString aDateStr;
|
||||||
switch( eDate )
|
switch( eDate )
|
||||||
{
|
{
|
||||||
case MDY: aDateStr = "MM.TT.JJJJ"; break;
|
default:
|
||||||
case DMY: aDateStr = "TT.MM.JJJJ"; break;
|
case MDY: aDateStr = "MM/DD/YYYY"; break;
|
||||||
case YMD: aDateStr = "JJJJ.MM.TT"; break;
|
case DMY: aDateStr = "DD/MM/YYYY"; break;
|
||||||
default: aDateStr = "MM.TT.JJJJ"; break;
|
case YMD: aDateStr = "YYYY/MM/DD"; break;
|
||||||
}
|
}
|
||||||
OUString aStr( aDateStr ); // PutandConvertEntry() modifies string!
|
OUString aStr( aDateStr ); // PutandConvertEntry() modifies string!
|
||||||
rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
||||||
rnStdDateIdx, LANGUAGE_GERMAN, eLangType );
|
rnStdDateIdx, LANGUAGE_ENGLISH_US, eLangType );
|
||||||
nCheckPos = 0;
|
nCheckPos = 0;
|
||||||
OUString aStrHHMMSS(" HH:MM:SS");
|
OUString aStrHHMMSS(" HH:MM:SS");
|
||||||
aDateStr += aStrHHMMSS;
|
aDateStr += aStrHHMMSS;
|
||||||
aStr = aDateStr;
|
aStr = aDateStr;
|
||||||
rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
||||||
rnStdDateTimeIdx, LANGUAGE_GERMAN, eLangType );
|
rnStdDateTimeIdx, LANGUAGE_ENGLISH_US, eLangType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,24 +110,24 @@ double ImpGetDate( const SbxValues* p )
|
|||||||
// HACK, because the number formatter in PutandConvertEntry replace the wildcard
|
// HACK, because the number formatter in PutandConvertEntry replace the wildcard
|
||||||
// for month, day, year not according to the configuration.
|
// for month, day, year not according to the configuration.
|
||||||
// Problem: Print Year(Date) under Engl. OS
|
// Problem: Print Year(Date) under Engl. OS
|
||||||
// quod vide basic\source\runtime\runtime.cxx
|
// quod vide basic/source/runtime/runtime.cxx
|
||||||
|
|
||||||
SvtSysLocale aSysLocale;
|
SvtSysLocale aSysLocale;
|
||||||
DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat();
|
DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat();
|
||||||
OUString aDateStr;
|
OUString aDateStr;
|
||||||
switch( eDate )
|
switch( eDate )
|
||||||
{
|
{
|
||||||
case MDY: aDateStr = "MM.TT.JJJJ"; break;
|
default:
|
||||||
case DMY: aDateStr = "TT.MM.JJJJ"; break;
|
case MDY: aDateStr = "MM/DD/YYYY"; break;
|
||||||
case YMD: aDateStr = "JJJJ.MM.TT"; break;
|
case DMY: aDateStr = "DD/MM/YYYY"; break;
|
||||||
default: aDateStr = "MM.TT.JJJJ";
|
case YMD: aDateStr = "YYYY/MM/DD"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString aStr( aDateStr );
|
OUString aStr( aDateStr );
|
||||||
aStr += " HH:MM:SS";
|
aStr += " HH:MM:SS";
|
||||||
|
|
||||||
pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
|
||||||
nIndex, LANGUAGE_GERMAN, eLangType );
|
nIndex, LANGUAGE_ENGLISH_US, eLangType );
|
||||||
sal_Bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
|
sal_Bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
|
||||||
if ( bSuccess )
|
if ( bSuccess )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user