View | Details | Raw Unified | Return to issue 21191
Collapse All | Expand All

(-)sal/util/sal.map (+1 lines)
Lines 86-91 UDK_3_0_0 { Link Here
86
        osl_getSocketOption;
86
        osl_getSocketOption;
87
        osl_getSocketType;
87
        osl_getSocketType;
88
        osl_getSymbol;
88
        osl_getSymbol;
89
        osl_getSystemLocale;
89
        osl_getSystemPathFromFileURL;
90
        osl_getSystemPathFromFileURL;
90
        osl_getSystemTime;
91
        osl_getSystemTime;
91
        osl_getThreadIdentifier;
92
        osl_getThreadIdentifier;
(-)sal/inc/rtl/locale.h (+9 lines)
Lines 130-135 rtl_Locale * SAL_CALL rtl_locale_registe Link Here
130
rtl_Locale * SAL_CALL rtl_locale_getDefault();
130
rtl_Locale * SAL_CALL rtl_locale_getDefault();
131
131
132
/**
132
/**
133
   As above - but actually useful - and not strangely deprecated,
134
   and with no setter.
135
 */
136
typedef enum {
137
		rtl_LocaleSystemMessages,
138
		rtl_LocaleSystemCType
139
} rtl_LocaleSystemType;
140
141
/**
133
	Sets the default.
142
	Sets the default.
134
	Normally set once at the beginning of applet or application,
143
	Normally set once at the beginning of applet or application,
135
	then never reset. <code>setDefault</code> does not reset the host locale.
144
	then never reset. <code>setDefault</code> does not reset the host locale.
(-)sal/inc/rtl/locale.hxx (+10 lines)
Lines 263-268 public: Link Here
263
	 */
263
	 */
264
	OUString getVariant() const { return pData->Variant; }
264
	OUString getVariant() const { return pData->Variant; }
265
265
266
    /**
267
	    Getter for lang-country name
268
	 */
269
    inline OUString getRawName()
270
    {
271
        rtl::OUString aRaw = ( getLanguage() +
272
							   rtl::OUString::createFromAscii( "-" ) + 
273
							   getCountry() );
274
		return aRaw;
275
	}
266
276
267
	/**
277
	/**
268
	 	Returns the hash code of the locale This.
278
	 	Returns the hash code of the locale This.
(-)sal/inc/osl/process.h (+2 lines)
Lines 360-365 oslProcessError SAL_CALL osl_getProcessL Link Here
360
*/
360
*/
361
361
362
oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale );
362
oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale );
363
364
rtl_Locale * SAL_CALL osl_getSystemLocale( rtl_LocaleSystemType nType );
363
 
365
 
364
366
365
sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket);
367
sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket);
(-)sal/osl/unx/nlsupport.c (+43 lines)
Lines 1347-1349 int _imp_setProcessLocale( rtl_Locale * Link Here
1347
#endif /* ifdef LINUX || SOLARIS || MACOSX || NETBSD */
1347
#endif /* ifdef LINUX || SOLARIS || MACOSX || NETBSD */
1348
1348
1349
1349
1350
1351
// Get locale of category LC_CTYPE of environment variables
1352
static sal_Char* GetLangFromEnvironment()
1353
{
1354
    static sal_Char* pFallback = "C";
1355
    sal_Char *pLang = NULL;
1356
1357
    pLang = getenv ( "LC_ALL" );
1358
    if (! pLang)
1359
        pLang = getenv ( "LC_CTYPE" );
1360
    if (! pLang)
1361
        pLang = getenv( "LANG" );
1362
    if (! pLang)
1363
        pLang = pFallback;
1364
1365
    return pLang;
1366
}
1367
1368
rtl_Locale * SAL_CALL osl_getSystemLocale( rtl_LocaleSystemType nType )
1369
{
1370
    const char *pMessages[] = { "LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", NULL };
1371
	const char *pCType[]    = { "LC_ALL", "LC_CTYPE", NULL };
1372
	const char **pScan;
1373
	const char *pLang = NULL;
1374
	static rtl_Locale *pLocales[2] = { NULL, NULL };
1375
	
1376
	if( !pLocales[ nType ] )
1377
	{
1378
		pScan = (nType == rtl_LocaleSystemMessages) ? pMessages : pCType;
1379
		while (*pScan)
1380
		{
1381
    		if( pLang = getenv( *pScan ) )
1382
				break;
1383
			pScan++;
1384
		}
1385
		if( !pLang )
1386
			pLang = "C";
1387
1388
		pLocales[ nType ] = _parse_locale( pLang );
1389
	}
1390
		
1391
	return pLocales[ nType ];
1392
}		

Return to issue 21191