summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2000-11-20 08:16:31 +0000
committerjp <jp@openoffice.org>2000-11-20 08:16:31 +0000
commited94ad6b32bcd746cc4ac6f5c85075ade2a67a2c (patch)
tree3a619e4cb8ac41800ed0984532732872f9584fce
parent97729079cd2ac8aab0cea36b534837bd38514a34 (diff)
should change: use LocaleDataWrapper
-rw-r--r--sw/inc/calc.hxx10
-rw-r--r--sw/inc/swtypes.hxx7
-rw-r--r--sw/source/core/bastyp/calc.cxx195
-rw-r--r--sw/source/core/bastyp/init.cxx61
-rw-r--r--sw/source/core/doc/docdesc.cxx10
-rw-r--r--sw/source/core/doc/poolfmt.cxx48
-rw-r--r--sw/source/core/fields/fldbas.cxx22
-rw-r--r--sw/source/core/txtnode/swfont.cxx22
-rw-r--r--sw/source/ui/app/docshini.cxx15
9 files changed, 173 insertions, 217 deletions
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index b839ffe26463..8c9e9fc3ef57 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: calc.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:24 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:16:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,7 +71,7 @@
#endif
class CharClass;
-class International;
+class LocaleDataWrapper;
class SwFieldType;
class SwDoc;
@@ -210,7 +210,7 @@ class SwCalc
xub_StrLen nCommandPos;
SwDoc& rDoc;
- International* pInter;
+ LocaleDataWrapper* pLclData;
CharClass* pCharClass;
USHORT nListPor;
@@ -255,7 +255,7 @@ public:
static FASTBOOL Str2Double( const String& rStr, xub_StrLen& rPos,
double& rVal,
- const International* pInter = 0 );
+ const LocaleDataWrapper* pData = 0 );
};
#endif
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index b210606416cf..ec2e618f2a25 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swtypes.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: tl $ $Date: 2000-10-27 11:48:47 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:16:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,6 +99,7 @@ class SwPathFinder;
class Graphic;
class OutputDevice;
class CharClass;
+class LocaleDataWrapper;
typedef long SwTwips;
#define INVALID_TWIPS LONG_MAX
@@ -290,6 +291,6 @@ enum SetAttrMode
// returns the APP - CharClass instance - used for all ToUpper/ToLower/...
CharClass& GetAppCharClass();
-
+LocaleDataWrapper& GetAppLocaleData();
#endif
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 942758aba756..42314afd02d0 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: calc.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2000-11-14 12:08:22 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:15:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,30 +83,28 @@
#include <tools/svwin.h>
#endif
-#ifndef _INTN_HXX //autogen
-#include <tools/intn.hxx>
-#endif
#ifndef _TOOLS_SOLMATH_HXX
#include <tools/solmath.hxx>
#endif
-#ifndef _SV_SYSTEM_HXX
-#include <vcl/system.hxx>
-#endif
-#ifndef _APP_HXX //autogen
-#include <vcl/svapp.hxx>
-#endif
-#ifndef _OFF_APP_HXX //autogen
-#include <offmgr/app.hxx>
-#endif
#ifndef _SVX_ADRITEM_HXX //autogen
#include <svx/adritem.hxx>
#endif
#ifndef _SVX_LANGITEM_HXX
#include <svx/langitem.hxx>
#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
#ifndef _UNOTOOLS_CHARCLASS_HXX
#include <unotools/charclass.hxx>
#endif
+
#ifndef _UNO_LINGU_HXX
#include <svx/unolingu.hxx>
#endif
@@ -142,7 +140,6 @@
#include <docfld.hxx>
#endif
-
// tippt sich schneller
#define RESOURCE ViewShell::GetShellRes()
@@ -326,29 +323,22 @@ SwCalc::SwCalc( SwDoc& rD )
eError( CALC_NOERR ),
nListPor( 0 ),
aErrExpr( aEmptyStr, SwSbxValue(), 0 ),
- pInter( (International*)&Application::GetAppInternational() ),
+ pLclData( &GetAppLocaleData() ),
pCharClass( &GetAppCharClass() )
{
aErrExpr.aStr.AssignAscii( "~C_ERR~" );
memset( VarTable, 0, sizeof(VarTable) );
LanguageType eLang = ((SvxLanguageItem&)rDoc.GetDefault(
RES_CHRATR_LANGUAGE )).GetLanguage();
- if( pInter->GetFormatLanguage() != eLang )
+ if( eLang != SvxLocaleToLanguage( pLclData->getLocale() ) )
{
- pInter = new International( eLang );
- pCharClass = new CharClass( SvxCreateLocale( eLang ));
-
-#ifdef JP_DEBUG
- printf( "Language: %d, AppLang: %d, AppFmtLang: %d, Decimal: %c, Thousand: %c\n",
- pInter->GetLanguage(),
- Application::GetAppInternational().GetLanguage(),
- Application::GetAppInternational().GetFormatLanguage(),
- pInter->GetNumDecimalSep(),
- pInter->GetNumThousandSep() );
-#endif
+ ::com::sun::star::lang::Locale aLocale( SvxCreateLocale( eLang ));
+ pCharClass = new CharClass( aLocale );
+ pLclData = new LocaleDataWrapper(
+ ::comphelper::getProcessServiceFactory(), aLocale );
}
- sCurrSym = pInter->GetCurrSymbol();
+ sCurrSym = pLclData->getCurrSymbol();
sCurrSym.EraseLeadingChars().EraseTrailingChars();
pCharClass->toLower( sCurrSym );
@@ -476,8 +466,8 @@ SwCalc::~SwCalc()
{
for( USHORT n = 0; n < TBLSZ; ++n )
delete VarTable[n];
- if( pInter != (International*)&Application::GetAppInternational() )
- delete pInter;
+ if( pLclData != &GetAppLocaleData() )
+ delete pLclData;
if( pCharClass != &GetAppCharClass() )
delete pCharClass;
}
@@ -554,116 +544,15 @@ String SwCalc::GetStrResult( double nValue, BOOL bRound )
default : return RESOURCE->aCalc_Default;
}
- USHORT nDec = pInter->GetNumDigits();
+ USHORT nDec = 15; //pLclData->getNumDigits();
String aRetStr;
SolarMath::DoubleToString( aRetStr, nValue,
'A', /// 'F' 'E' 'G' 'A'
nDec, /// Nachkommastellen
- pInter->GetNumDecimalSep(), /// Dezimalseparator
+ pLclData->getNumDecimalSep().GetChar(0), /// Dezimalseparator
TRUE );
-#if 0
- String aLast;
- int nExp = 0,
- nDigit,
- nDecPos,
- nDigits = nDec + 1;
-
- if( !bRound )
- nDigits = nDec = 14;
-
- if( nValue < 0 )
- {
- nValue = -nValue;
- aRetStr += '-';
- }
-
- if (nValue > 0 )
- {
- while( nValue < 1 )
- nValue *= 10, --nExp;
- while( nValue >= 10 )
- nValue /= 10, ++nExp;
- }
- nDigits += nExp;
- if( nDigits >= 0 &&
- 9 < int( nValue += nRoundVal[ nDigits > 15 ? 15 : nDigits ] ))
- {
- nValue = 1;
- nExp++;
- nDigits++;
- }
-
- if( nExp < 0 )
- {
- int nPos;
- if( pInter->IsNumLeadingZero() )
- aRetStr += '0';
- aRetStr += pInter->GetNumDecimalSep();
- nPos = -nExp - 1;
- if( nDigits <= 0 )
- nPos = nDec;
- while( nPos-- )
- aRetStr += '0';
- nDecPos = 0;
- }
- else
- nDecPos = nExp + 1;
- if( nDigits > 0 )
- {
- short nSep = nDecPos % 3;
- BOOL bFirst = TRUE;
- if( !nSep )
- nSep = 3;
- for( USHORT x = 0 ; ; x++ )
- {
- if( x < 15 )
- {
- if( 1 == nDigits && x && 14 > x )
- nDigit = (int) floor( nValue + nKorrVal[ 15 - x ] );
- else
- nDigit = (int) ( nValue + 1E-15 );
-
- if( 9 < nDigit )
- {
- ASSERT( !this, "Rundungsfehler" );
- nDigit = 9;
- }
- if( bFirst )
- aRetStr += (sal_Unicode) ( nDigit + '0' );
- else
- aLast += (sal_Unicode) ( nDigit + '0' );
- nValue = ( nValue - nDigit ) * 10;
- }
- else
- {
- if( bFirst )
- aRetStr += '0';
- else
- aLast += '0';
- }
- if(!--nDigits)
- break;
-
- if( nDecPos )
- {
- if( !--nDecPos )
- bFirst = FALSE;
- if( nDecPos && !--nSep && pInter->IsNumThousandSep() )
- {
- nSep = 3;
- aRetStr += pInter->GetNumThousandSep();
- }
- }
- }
- }
- if( 0L != aLast.ToInt32() )
- {
- aRetStr += pInter->GetNumDecimalSep();
- aRetStr += aLast;
- }
-#endif
return aRetStr;
}
@@ -679,8 +568,8 @@ enum TMStatus { TM_START, TM_THSEP, TM_MIN, TM_TMSEP, TM_SEC,
BOOL SwCalc::ParseTime( USHORT *pHour, USHORT *pMin, USHORT *pSec )
{
- TimeFormat aTMFmt = pInter->GetTimeFormat();
- sal_Unicode ch, cTMSep = pInter->GetTimeSep();
+//?? TimeFormat aTMFmt = pInter->GetTimeFormat();
+ sal_Unicode ch, cTMSep = pLclData->getTimeSep().GetChar(0);
EatWhite( sCommand, nCommandPos );
ch = NextCh( sCommand, nCommandPos );
@@ -697,8 +586,8 @@ BOOL SwCalc::ParseTime( USHORT *pHour, USHORT *pMin, USHORT *pSec )
xub_StrLen nStt = --nCommandPos;
BOOL bFnd = FALSE;
String aStr;
- const String& rPMStr = pInter->GetTimePM();
- const String& rAMStr = pInter->GetTimeAM();
+ const String& rPMStr = pLclData->getTimePM();
+ const String& rAMStr = pLclData->getTimeAM();
while( nCommandPos < sCommand.Len() )
{
EatWhite( sCommand, nCommandPos );
@@ -766,8 +655,8 @@ BOOL SwCalc::ParseTime( USHORT *pHour, USHORT *pMin, USHORT *pSec )
pCharClass->isDigit( sCommand, nCommandPos - 1 ) )
{
if( eState != TM_START ||
- aTMFmt == HOUR_12 && nVal <= 1 ||
- aTMFmt == HOUR_24 && nVal <= 2 )
+ /*aTMFmt == HOUR_12 && nVal <= 1 ||
+ aTMFmt == HOUR_24 &&*/ nVal <= 2 )
{
*pActVal = nVal * 10 + ( cNext - '0');
cNext = 0;
@@ -1044,8 +933,8 @@ void SwCalc::Pop( const VoidPtr pPtr )
SwCalcOper SwCalc::GetToken()
{
sal_Unicode ch;
- sal_Unicode cTSep = pInter->GetNumThousandSep(),
- cDSep = pInter->GetNumDecimalSep();
+ sal_Unicode cTSep = pLclData->getNumThousandSep().GetChar(0),
+ cDSep = pLclData->getNumDecimalSep().GetChar(0);
do {
if( 0 == ( ch = NextCh( sCommand, nCommandPos ) ) )
@@ -1113,7 +1002,7 @@ SwCalcOper SwCalc::GetToken()
case '.': {
double nVal;
--nCommandPos; // auf das 1. Zeichen zurueck
- if( Str2Double( sCommand, nCommandPos, nVal, pInter ))
+ if( Str2Double( sCommand, nCommandPos, nVal, pLclData ))
{
nNumberValue.PutDouble( nVal );
eCurrOper = CALC_NUMBER;
@@ -1655,26 +1544,22 @@ String SwCalc::GetDBName(const String& rName)
* Aenderung : JP 27.10.98
******************************************************************************/
FASTBOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
- double& rVal, const International* pInter )
+ double& rVal, const LocaleDataWrapper* pLclData )
{
- const International* pIntr = pInter;
- if( !pIntr )
- {
- pIntr = &Application::GetAppInternational();
- if( pIntr->GetFormatLanguage() != System::GetLanguage() )
- pIntr = new International( System::GetLanguage() );
- }
+ const LocaleDataWrapper* pLclD = pLclData;
+ if( !pLclD )
+ pLclD = &GetAppLocaleData();
const xub_Unicode* pEnd;
int nErrno;
rVal = SolarMath::StringToDouble( rCommand.GetBuffer() + rCommandPos,
- pIntr->GetNumThousandSep(),
- pIntr->GetNumDecimalSep(),
+ pLclD->getNumThousandSep().GetChar(0),
+ pLclD->getNumDecimalSep().GetChar(0),
nErrno, &pEnd );
rCommandPos = pEnd - rCommand.GetBuffer();
- if( !pInter && pIntr != &Application::GetAppInternational() )
- delete (International*)pIntr;
+ if( !pLclData && pLclD != &GetAppLocaleData() )
+ delete (LocaleDataWrapper*)pLclD;
return 0 == nErrno;
}
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 51bc6a90a5aa..6576ee595ade 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: init.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jp $ $Date: 2000-11-16 21:30:50 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:15:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,6 +169,12 @@
#ifndef _SVX_TWOLINESITEM_HXX
#include <svx/twolinesitem.hxx>
#endif
+#ifndef _SVX_SCRIPSPACEITEM_HXX
+#include <svx/scriptspaceitem.hxx>
+#endif
+#ifndef _SVX_HNGPNCTITEM_HXX
+#include <svx/hngpnctitem.hxx>
+#endif
#ifndef _SVX_CMAPITEM_HXX //autogen
#include <svx/cmapitem.hxx>
#endif
@@ -308,6 +314,15 @@
#ifndef _BREAKIT_HXX
#include <breakit.hxx>
#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
extern void _FrmFinit();
extern void ClearFEShellTabCols();
@@ -482,7 +497,17 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ FN_FORMAT_DROPCAPS, 0 }, // RES_PARATR_DROP
{ SID_ATTR_PARA_REGISTER, SFX_ITEM_POOLABLE }, // RES_PARATR_REGISTER
{ SID_ATTR_PARA_NUMRULE, 0 }, // RES_PARATR_NUMRULE
+ { SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE }, // RES_PARATR_SCRIPTSPACE
+ { SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE },// RES_PARATR_HANGINGPUNCTUATION
+
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY1
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY2
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY3
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY4
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY5
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY6
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY7
+ { 0, SFX_ITEM_POOLABLE }, // RES_PARATR_DUMMY8
{ 0, SFX_ITEM_POOLABLE }, // RES_FILL_ORDER
{ 0, SFX_ITEM_POOLABLE }, // RES_FRM_SIZE
@@ -550,6 +575,7 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
USHORT* SwAttrPool::pVersionMap1 = 0;
USHORT* SwAttrPool::pVersionMap2 = 0;
USHORT* SwAttrPool::pVersionMap3 = 0;
+USHORT* SwAttrPool::pVersionMap4 = 0;
SwIndexReg* SwIndexReg::pEmptyIndexArray = 0;
const sal_Char* __FAR_DATA pMarkToTable = "table";
@@ -566,6 +592,7 @@ SwAutoCompleteWord* SwDoc::pACmpltWords = 0;
SwBreakIt* pBreakIt = 0;
CharClass* pAppCharClass = 0;
+LocaleDataWrapper* pAppLocaleData = 0;
/******************************************************************************
* void _InitCore()
@@ -727,8 +754,20 @@ void _InitCore()
aAttrTab[ RES_PARATR_REGISTER - POOLATTR_BEGIN ] = new SwRegisterItem( FALSE );
aAttrTab[ RES_PARATR_NUMRULE - POOLATTR_BEGIN ] = new SwNumRuleItem( aEmptyStr );
+ aAttrTab[ RES_PARATR_SCRIPTSPACE - POOLATTR_BEGIN ] =
+ new SvxScriptSpaceItem;
+ aAttrTab[ RES_PARATR_HANGINGPUNCTUATION - POOLATTR_BEGIN ] =
+ new SvxHangingPunctuationItem;
+
// ParaAttr - Dummies
+ aAttrTab[ RES_PARATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY1 );
aAttrTab[ RES_PARATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY2 );
+ aAttrTab[ RES_PARATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY3 );
+ aAttrTab[ RES_PARATR_DUMMY4 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY4 );
+ aAttrTab[ RES_PARATR_DUMMY5 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY5 );
+ aAttrTab[ RES_PARATR_DUMMY6 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY6 );
+ aAttrTab[ RES_PARATR_DUMMY7 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY7 );
+ aAttrTab[ RES_PARATR_DUMMY8 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_PARATR_DUMMY8 );
// ParatAttr - Dummies
aAttrTab[ RES_FILL_ORDER- POOLATTR_BEGIN ] = new SwFmtFillOrder;
@@ -838,8 +877,18 @@ void _InitCore()
for ( i = 83; i <= 86; ++i )
SwAttrPool::pVersionMap3[ i-1 ] = i + 35;
+ // 4. Version - neue Paragraph Attribute fuer die CJK-Version
+ SwAttrPool::pVersionMap4 = new USHORT[ 121 ];
+ for( i = 1; i <= 65; i++ )
+ SwAttrPool::pVersionMap4[ i-1 ] = i;
+ for ( i = 66; i <= 121; ++i )
+ SwAttrPool::pVersionMap4[ i-1 ] = i + 9;
+
pBreakIt = new SwBreakIt();
- pAppCharClass = new CharClass( SvxCreateLocale( LANGUAGE_SYSTEM ));
+ ::com::sun::star::lang::Locale aLcl( SvxCreateLocale( LANGUAGE_SYSTEM ));
+ pAppCharClass = new CharClass( aLcl );
+ pAppLocaleData = new LocaleDataWrapper(
+ ::comphelper::getProcessServiceFactory(), aLcl );
_FrmInit();
_TextInit();
@@ -909,6 +958,8 @@ void _FinitCore()
delete SwIndexReg::pEmptyIndexArray;
delete SwAttrPool::pVersionMap1;
delete SwAttrPool::pVersionMap2;
+ delete SwAttrPool::pVersionMap3;
+ delete SwAttrPool::pVersionMap4;
for ( USHORT i = 0; i < pGlobalOLEExcludeList->Count(); ++i )
delete (SvGlobalName*)(*pGlobalOLEExcludeList)[i];
@@ -920,6 +971,10 @@ CharClass& GetAppCharClass()
{
return *pAppCharClass;
}
+LocaleDataWrapper& GetAppLocaleData()
+{
+ return *pAppLocaleData;
+}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 2cedfa0f7100..6ed6116e87d2 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docdesc.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:08:15 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:15:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,9 @@
#ifndef _GLOBNAME_HXX //autogen
#include <tools/globname.hxx>
#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
#ifndef _FMTFSIZE_HXX //autogen
#include <fmtfsize.hxx>
@@ -234,9 +237,8 @@ void lcl_DefaultPageFmt( SwFrmFmt &rFmt1, SwFrmFmt &rFmt2, SfxPrinter *pPrt,
//Raender haben eine defaultmaessige Mindestgroesse.
//wenn der Drucker einen groesseren Rand vorgibt, so
//ist mir dass auch recht.
- International aInternational;
long nMinTopBottom, nMinLeftRight;
- if ( MEASURE_METRIC == aInternational.GetMeasurementSystem() )
+ if ( MEASURE_METRIC == GetAppLocaleData().getMeasurementSystemEnum() )
nMinTopBottom = nMinLeftRight = 1134; //2 Zentimeter
else
{
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index aa2200217569..f411f91b961b 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: poolfmt.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: os $ $Date: 2000-11-08 11:20:51 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:14:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,9 @@
#ifndef _SYSTEM_HXX //autogen
#include <vcl/system.hxx>
#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
#ifndef _SVX_PAPERINF_HXX //autogen
#include <svx/paperinf.hxx>
@@ -204,8 +207,7 @@ const USHORT PT_24 = 24 * 20; // 22 pt
inline USHORT GetMetricVal( int n )
{
#ifdef USE_MEASUREMENT
- USHORT nVal = MEASURE_METRIC == Application::GetAppInternational().
- GetMeasurementSystem()
+ USHORT nVal = MEASURE_METRIC == GetAppLocaleData().getMeasurementSystemEnum()
? 567 // 1 cm
: 770; // 1/2 Inch
#else
@@ -259,11 +261,7 @@ long lcl_GetRightMargin( SwDoc& rDoc )
if( !pPrt )
{
SvxPaper ePaper;
-// JP 26.05.99: so gibts einen GPF -> warum???
-// if( MEASURE_METRIC == Application::GetAppInternational().
-// GetMeasurementSystem() )
- International aInter;
- if( MEASURE_METRIC == aInter.GetMeasurementSystem() )
+ if( MEASURE_METRIC == GetAppLocaleData().getMeasurementSystemEnum() )
{
ePaper = SVX_PAPER_A4;
nLeft = nRight = 1134; //2 Zentimeter
@@ -1779,8 +1777,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -1813,8 +1811,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
2156, 2387
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -1869,8 +1867,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -1903,8 +1901,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
};
#ifdef USE_MEASUREMENT
- const USHORT* pArr0to2 = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr0to2 = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace0to2
: aAbsSpaceInch0to2;
#else
@@ -1974,8 +1972,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -2010,8 +2008,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -2064,8 +2062,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
@@ -2106,8 +2104,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc,
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
- const USHORT* pArr = MEASURE_METRIC == Application::
- GetAppInternational().GetMeasurementSystem()
+ const USHORT* pArr = MEASURE_METRIC ==
+ GetAppLocaleData().getMeasurementSystemEnum()
? aAbsSpace
: aAbsSpaceInch;
#else
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index efee17482b5c..2c3fe357fb98 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fldbas.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:08:19 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:14:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,8 +87,11 @@
#ifndef _TOOLS_SOLMATH_HXX //autogen wg. SolarMath
#include <tools/solmath.hxx>
#endif
-#ifndef _TOOLS_INTN_HXX //autogen wg. International
-#include <tools/intn.hxx>
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
+#ifndef _UNO_LINGU_HXX
+#include <svx/unolingu.hxx>
#endif
#ifndef _DOC_HXX
@@ -828,8 +831,7 @@ void SwValueField::ChangeFormat(ULONG n)
ULONG SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, ULONG nFmt)
{
const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt);
- const International& rInter = Application::GetAppInternational();
- USHORT nLng = rInter.GetLanguage();
+ USHORT nLng = SvxLocaleToLanguage( GetAppLocaleData().getLocale() );
if (pEntry && nLng != pEntry->GetLanguage())
{
@@ -956,12 +958,12 @@ void SwFormulaField::SetFormula(const String& rStr)
// voll in die Hose. Ist aber nicht anders moeglich, da der Kalkulator
// nur im Systemformat rechnen kann und es keine Konvertierungsroutine
// gibt.
- const International& rInter = Application::GetAppInternational();
+ const LocaleDataWrapper& rLclD = GetAppLocaleData();
int nErrno;
double fValue = SolarMath::StringToDouble( rStr.GetBuffer(),
- rInter.GetNumThousandSep(),
- rInter.GetNumDecimalSep(),
- nErrno );
+ rLclD.getNumThousandSep().GetChar(0),
+ rLclD.getNumDecimalSep().GetChar(0),
+ nErrno );
if( !nErrno )
SwValueField::SetValue( fValue );
}
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 7f592340cb0b..c535ac7dd98e 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ama $ $Date: 2000-11-09 11:16:38 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:14:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,16 @@
#ifndef _SYSTEM_HXX //autogen
#include <vcl/system.hxx>
#endif
+#ifndef _OUTDEV_HXX //autogen
+#include <vcl/outdev.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
+#ifndef _UNO_LINGU_HXX
+#include <svx/unolingu.hxx>
+#endif
+
#ifndef _SVX_BRSHITEM_HXX //autogen
#include <svx/brshitem.hxx>
#endif
@@ -136,12 +146,6 @@
#ifndef _SWATRSET_HXX //autogen
#include <swatrset.hxx>
#endif
-#ifndef _APP_HXX //autogen
-#include <vcl/svapp.hxx>
-#endif
-#ifndef _OUTDEV_HXX //autogen
-#include <vcl/outdev.hxx>
-#endif
#include "viewsh.hxx" // Bildschirmabgleich
@@ -669,7 +673,7 @@ LanguageType GetSystemLang( )
{
// Hier wird bei LANGUAGE_SYSTEM die Sprache ermittelt.
// 1.Versuch: Was sagt die Applikation?
- LanguageType eTmp = GetpApp()->GetAppInternational().GetLanguage();
+ LanguageType eTmp = SvxLocaleToLanguage( GetAppLocaleData().getLocale() );
if ( ( eTmp == LANGUAGE_SYSTEM ) &&
// Was sagt die Systemumgebung?
( (eTmp = ::GetSystemLanguage()) == LANGUAGE_SYSTEM ) )
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index ab24bf262530..6876822fd77c 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docshini.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: tl $ $Date: 2000-11-19 11:36:18 $
+ * last change: $Author: jp $ $Date: 2000-11-20 09:12:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -104,6 +104,12 @@
#ifndef _SFX_PRINTER_HXX //autogen
#include <sfx2/printer.hxx>
#endif
+#ifndef _UNO_LINGU_HXX
+#include <svx/unolingu.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+#include <unotools/localedatawrapper.hxx>
+#endif
#ifndef _LINGUISTIC_LNGPROPS_HHX_
@@ -735,7 +741,7 @@ void SwDocShell::SubInitNew()
}
else
{ // guess DefaultLanguage to be used from other sources
- nVal = Application::GetAppInternational().GetLanguage();
+ nVal = SvxLocaleToLanguage( GetAppLocaleData().getLocale() );
if( nVal == LANGUAGE_SYSTEM )
nVal = ::GetSystemLanguage();
}
@@ -772,6 +778,9 @@ void SwDocShell::SubInitNew()
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.7 2000/11/19 11:36:18 tl
+ lngprops.hxx include changed
+
Revision 1.6 2000/10/31 20:32:32 jp
change usage of filestream to medium