fdo#46808, use service constructor for i18n::NumberFormatMapper
Also create a utility constructor for LocaleDataWrapper, which simplifies many of the calling sites. Change-Id: Ic8510b51c4201fa17fc0620e18d3e258e43636ba
This commit is contained in:
parent
5837402fb1
commit
d2f6a87ac7
@ -30,6 +30,9 @@
|
|||||||
class SfxBindings;
|
class SfxBindings;
|
||||||
class SdrView;
|
class SdrView;
|
||||||
class SfxViewShell;
|
class SfxViewShell;
|
||||||
|
namespace com { namespace sun { namespace star { namespace lang {
|
||||||
|
class XMultiServiceFactory;
|
||||||
|
}}}}
|
||||||
|
|
||||||
namespace basctl
|
namespace basctl
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,7 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
aDateStr = aLocaleWrapper.getDate( Date( Date::SYSTEM ) );
|
aDateStr = aLocaleWrapper.getDate( Date( Date::SYSTEM ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ IMPL_LINK_NOARG(SvxPostItDialog, Stamp)
|
|||||||
Date aDate( Date::SYSTEM );
|
Date aDate( Date::SYSTEM );
|
||||||
Time aTime( Time::SYSTEM );
|
Time aTime( Time::SYSTEM );
|
||||||
String aTmp( SvtUserOptions().GetID() );
|
String aTmp( SvtUserOptions().GetID() );
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
String aStr( aEditED.GetText() );
|
String aStr( aEditED.GetText() );
|
||||||
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\n---- " ) );
|
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\n---- " ) );
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ IMPL_LINK_NOARG(SvxPostItDialog, Stamp)
|
|||||||
|
|
||||||
IMPL_LINK_NOARG(SvxPostItDialog, OKHdl)
|
IMPL_LINK_NOARG(SvxPostItDialog, OKHdl)
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
pOutSet = new SfxItemSet( rSet );
|
pOutSet = new SfxItemSet( rSet );
|
||||||
pOutSet->Put( SvxPostItAuthorItem( SvtUserOptions().GetID(),
|
pOutSet->Put( SvxPostItAuthorItem( SvtUserOptions().GetID(),
|
||||||
rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) );
|
rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) );
|
||||||
|
@ -349,8 +349,7 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl)
|
|||||||
}
|
}
|
||||||
if(!bAvail)
|
if(!bAvail)
|
||||||
{
|
{
|
||||||
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
|
LocaleDataWrapper aWrap( aLocale );
|
||||||
LocaleDataWrapper aWrap( xMSF, aLocale );
|
|
||||||
ForbiddenCharacters aForbidden = aWrap.getForbiddenCharacters();
|
ForbiddenCharacters aForbidden = aWrap.getForbiddenCharacters();
|
||||||
sStart = aForbidden.beginLine;
|
sStart = aForbidden.beginLine;
|
||||||
sEnd = aForbidden.endLine;
|
sEnd = aForbidden.endLine;
|
||||||
|
@ -1697,7 +1697,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
|
|||||||
{
|
{
|
||||||
Locale aTempLocale;
|
Locale aTempLocale;
|
||||||
SvxLanguageToLocale( aTempLocale, Application::GetSettings().GetLanguage());
|
SvxLanguageToLocale( aTempLocale, Application::GetSettings().GetLanguage());
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
|
LocaleDataWrapper aLocaleWrapper( aTempLocale );
|
||||||
aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper);
|
aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper);
|
||||||
}
|
}
|
||||||
aDatePatternsED.SetText( aDatePatternsString);
|
aDatePatternsED.SetText( aDatePatternsString);
|
||||||
@ -1894,7 +1894,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox )
|
|||||||
// obtain corresponding locale data
|
// obtain corresponding locale data
|
||||||
Locale aTempLocale;
|
Locale aTempLocale;
|
||||||
SvxLanguageToLocale( aTempLocale, eLang );
|
SvxLanguageToLocale( aTempLocale, eLang );
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
|
LocaleDataWrapper aLocaleWrapper( aTempLocale );
|
||||||
|
|
||||||
// update the decimal separator key of the related CheckBox
|
// update the decimal separator key of the related CheckBox
|
||||||
String sTempLabel(sDecimalSeparatorLabel);
|
String sTempLabel(sDecimalSeparatorLabel);
|
||||||
|
@ -186,7 +186,7 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
|
|||||||
aFillChar.SetAccessibleRelationLabeledBy(&aFillSpecial);
|
aFillChar.SetAccessibleRelationLabeledBy(&aFillSpecial);
|
||||||
|
|
||||||
// Get the default decimal char from the system
|
// Get the default decimal char from the system
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep()[0];
|
aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
FreeResource();
|
FreeResource();
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
namespace com {
|
namespace com {
|
||||||
namespace sun {
|
namespace sun {
|
||||||
namespace star {
|
namespace star {
|
||||||
namespace lang {
|
namespace uno {
|
||||||
class XMultiServiceFactory;
|
class XComponentContext;
|
||||||
}}}}
|
}}}}
|
||||||
|
|
||||||
class EDITENG_DLLPUBLIC SvxForbiddenCharactersTable : public salhelper::SimpleReferenceObject
|
class EDITENG_DLLPUBLIC SvxForbiddenCharactersTable : public salhelper::SimpleReferenceObject
|
||||||
@ -39,10 +39,10 @@ public:
|
|||||||
typedef std::map<sal_uInt16, com::sun::star::i18n::ForbiddenCharacters> Map;
|
typedef std::map<sal_uInt16, com::sun::star::i18n::ForbiddenCharacters> Map;
|
||||||
private:
|
private:
|
||||||
Map maMap;
|
Map maMap;
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SvxForbiddenCharactersTable( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF);
|
SvxForbiddenCharactersTable( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
|
||||||
~SvxForbiddenCharactersTable() {}
|
~SvxForbiddenCharactersTable() {}
|
||||||
|
|
||||||
Map& GetMap() { return maMap; }
|
Map& GetMap() { return maMap; }
|
||||||
|
@ -1365,12 +1365,12 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
|
|||||||
lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang));
|
lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang));
|
||||||
|
|
||||||
if (!pImpEditEngine->xLocaleDataWrapper.isInitialized())
|
if (!pImpEditEngine->xLocaleDataWrapper.isInitialized())
|
||||||
pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getServiceFactory(), aLocale, eLang);
|
pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLocale, eLang);
|
||||||
else
|
else
|
||||||
pImpEditEngine->xLocaleDataWrapper.changeLocale( aLocale, eLang);
|
pImpEditEngine->xLocaleDataWrapper.changeLocale( aLocale, eLang);
|
||||||
|
|
||||||
if (!pImpEditEngine->xTransliterationWrapper.isInitialized())
|
if (!pImpEditEngine->xTransliterationWrapper.isInitialized())
|
||||||
pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getServiceFactory(), eLang, i18n::TransliterationModules_IGNORE_CASE);
|
pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE);
|
||||||
else
|
else
|
||||||
pImpEditEngine->xTransliterationWrapper.changeLocale( eLang);
|
pImpEditEngine->xTransliterationWrapper.changeLocale( eLang);
|
||||||
|
|
||||||
|
@ -172,8 +172,7 @@ rtl::Reference<SvxForbiddenCharactersTable> GlobalEditData::GetForbiddenCharsTab
|
|||||||
{
|
{
|
||||||
if ( !xForbiddenCharsTable.is() )
|
if ( !xForbiddenCharsTable.is() )
|
||||||
{
|
{
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
|
xForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
|
||||||
xForbiddenCharsTable = new SvxForbiddenCharactersTable( xMSF );
|
|
||||||
}
|
}
|
||||||
return xForbiddenCharsTable;
|
return xForbiddenCharsTable;
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
|
|
||||||
SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF)
|
SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext)
|
||||||
{
|
{
|
||||||
mxMSF = xMSF;
|
m_xContext = rxContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault )
|
const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault )
|
||||||
@ -36,9 +36,9 @@ const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::Ge
|
|||||||
Map::iterator it = maMap.find( nLanguage );
|
Map::iterator it = maMap.find( nLanguage );
|
||||||
if ( it != maMap.end() )
|
if ( it != maMap.end() )
|
||||||
pForbiddenCharacters = &(it->second);
|
pForbiddenCharacters = &(it->second);
|
||||||
else if ( bGetDefault && mxMSF.is() )
|
else if ( bGetDefault && m_xContext.is() )
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aWrapper( mxMSF, SvxCreateLocale( nLanguage ) );
|
LocaleDataWrapper aWrapper( m_xContext, SvxCreateLocale( nLanguage ) );
|
||||||
maMap[ nLanguage ] = aWrapper.getForbiddenCharacters();
|
maMap[ nLanguage ] = aWrapper.getForbiddenCharacters();
|
||||||
pForbiddenCharacters = &maMap[ nLanguage ];
|
pForbiddenCharacters = &maMap[ nLanguage ];
|
||||||
}
|
}
|
||||||
|
@ -202,8 +202,7 @@ static sal_uInt16 GetAppLang()
|
|||||||
}
|
}
|
||||||
static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang )
|
static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang )
|
||||||
{
|
{
|
||||||
static LocaleDataWrapper aLclDtWrp( GetProcessFact(),
|
static LocaleDataWrapper aLclDtWrp( SvxCreateLocale( GetAppLang() ) );
|
||||||
SvxCreateLocale( GetAppLang() ) );
|
|
||||||
::com::sun::star::lang::Locale aLcl( SvxCreateLocale( nLang ));
|
::com::sun::star::lang::Locale aLcl( SvxCreateLocale( nLang ));
|
||||||
const ::com::sun::star::lang::Locale& rLcl = aLclDtWrp.getLoadedLocale();
|
const ::com::sun::star::lang::Locale& rLcl = aLclDtWrp.getLoadedLocale();
|
||||||
if( aLcl.Language != rLcl.Language ||
|
if( aLcl.Language != rLcl.Language ||
|
||||||
|
@ -78,7 +78,6 @@ osl::Mutex & GetLinguMutex()
|
|||||||
LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang )
|
LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang )
|
||||||
{
|
{
|
||||||
static LocaleDataWrapper aLclDtaWrp(
|
static LocaleDataWrapper aLclDtaWrp(
|
||||||
comphelper::getProcessServiceFactory(),
|
|
||||||
CreateLocale( SvtSysLocale().GetUILanguage() ) );
|
CreateLocale( SvtSysLocale().GetUILanguage() ) );
|
||||||
|
|
||||||
const Locale &rLcl = aLclDtaWrp.getLoadedLocale();
|
const Locale &rLcl = aLclDtaWrp.getLoadedLocale();
|
||||||
|
@ -147,6 +147,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\
|
|||||||
CharacterClassification \
|
CharacterClassification \
|
||||||
LocaleCalendar \
|
LocaleCalendar \
|
||||||
LocaleData \
|
LocaleData \
|
||||||
|
NumberFormatMapper \
|
||||||
TextConversion \
|
TextConversion \
|
||||||
Transliteration \
|
Transliteration \
|
||||||
))
|
))
|
||||||
@ -861,7 +862,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\
|
|||||||
IndexEntrySupplier \
|
IndexEntrySupplier \
|
||||||
InputSequenceChecker \
|
InputSequenceChecker \
|
||||||
NativeNumberSupplier \
|
NativeNumberSupplier \
|
||||||
NumberFormatMapper \
|
|
||||||
OrdinalSuffix \
|
OrdinalSuffix \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/image,\
|
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/image,\
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/report/meta/XFormulaParser.hpp>
|
#include <com/sun/star/report/meta/XFormulaParser.hpp>
|
||||||
|
|
||||||
|
namespace com { namespace sun { namespace star { namespace lang {
|
||||||
|
class XMultiServiceFactory;
|
||||||
|
} } } }
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
namespace rptui
|
namespace rptui
|
||||||
{
|
{
|
||||||
|
@ -2300,7 +2300,7 @@ void ScXMLImport::ExamineDefaultStyle()
|
|||||||
aDecSep = ScGlobal::pLocaleData->getNumDecimalSep();
|
aDecSep = ScGlobal::pLocaleData->getNumDecimalSep();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aLocaleData( pDoc->GetServiceManager(),
|
LocaleDataWrapper aLocaleData( comphelper::getComponentContext(pDoc->GetServiceManager()),
|
||||||
MsLangId::convertLanguageToLocale( nFormatLang ) );
|
MsLangId::convertLanguageToLocale( nFormatLang ) );
|
||||||
aDecSep = aLocaleData.getNumDecimalSep();
|
aDecSep = aLocaleData.getNumDecimalSep();
|
||||||
}
|
}
|
||||||
@ -2520,7 +2520,7 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, const rtl::OUStri
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
ScXMLImport::MutexGuard aGuard(*this);
|
ScXMLImport::MutexGuard aGuard(*this);
|
||||||
LocaleDataWrapper aLocaleData( GetDocument()->GetServiceManager(), aLocale );
|
LocaleDataWrapper aLocaleData( comphelper::getComponentContext(GetDocument()->GetServiceManager()), aLocale );
|
||||||
rtl::OUStringBuffer aBuffer(15);
|
rtl::OUStringBuffer aBuffer(15);
|
||||||
aBuffer.appendAscii("#");
|
aBuffer.appendAscii("#");
|
||||||
aBuffer.append( aLocaleData.getNumThousandSep() );
|
aBuffer.append( aLocaleData.getNumThousandSep() );
|
||||||
|
@ -136,7 +136,7 @@ void ScDocShell::InitItems()
|
|||||||
if (aLocales.getLength())
|
if (aLocales.getLength())
|
||||||
{
|
{
|
||||||
rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable =
|
rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable =
|
||||||
new SvxForbiddenCharactersTable( aDocument.GetServiceManager() );
|
new SvxForbiddenCharactersTable( comphelper::getComponentContext(aDocument.GetServiceManager()) );
|
||||||
|
|
||||||
const lang::Locale* pLocales = aLocales.getConstArray();
|
const lang::Locale* pLocales = aLocales.getConstArray();
|
||||||
for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
|
for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
|
||||||
|
@ -47,7 +47,7 @@ static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell*
|
|||||||
// create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
|
// create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
|
||||||
// so changes can be stored.
|
// so changes can be stored.
|
||||||
|
|
||||||
xRet = new SvxForbiddenCharactersTable( pDoc->GetServiceManager() );
|
xRet = new SvxForbiddenCharactersTable( comphelper::getComponentContext(pDoc->GetServiceManager()) );
|
||||||
pDoc->SetForbiddenCharacters( xRet );
|
pDoc->SetForbiddenCharacters( xRet );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
|
|||||||
if( xHyphenator.is() )
|
if( xHyphenator.is() )
|
||||||
rOutliner.SetHyphenator( xHyphenator );
|
rOutliner.SetHyphenator( xHyphenator );
|
||||||
|
|
||||||
SetForbiddenCharsTable( new SvxForbiddenCharactersTable( ::comphelper::getProcessServiceFactory() ) );
|
SetForbiddenCharsTable( new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() ) );
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
|
@ -712,7 +712,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
|
|||||||
|
|
||||||
void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
|
void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
const sal_uInt16 *pRanges = rSet.GetRanges();
|
const sal_uInt16 *pRanges = rSet.GetRanges();
|
||||||
DBG_ASSERT(pRanges && *pRanges, "Set without range");
|
DBG_ASSERT(pRanges && *pRanges, "Set without range");
|
||||||
while ( *pRanges )
|
while ( *pRanges )
|
||||||
|
@ -724,7 +724,7 @@ namespace
|
|||||||
{
|
{
|
||||||
String GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime )
|
String GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime )
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aWrapper( Application::GetSettings().GetLocale() );
|
||||||
|
|
||||||
Date aDate( _nDate );
|
Date aDate( _nDate );
|
||||||
Time aTime( _nTime );
|
Time aTime( _nTime );
|
||||||
@ -878,7 +878,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl)
|
|||||||
String aName;
|
String aName;
|
||||||
if ( bEnableUseUserData && aUseUserDataCB.IsChecked() )
|
if ( bEnableUseUserData && aUseUserDataCB.IsChecked() )
|
||||||
aName = SvtUserOptions().GetFullName();
|
aName = SvtUserOptions().GetFullName();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
DateTime now( DateTime::SYSTEM );
|
DateTime now( DateTime::SYSTEM );
|
||||||
util::DateTime uDT(
|
util::DateTime uDT(
|
||||||
now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
|
now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
|
||||||
@ -1148,7 +1148,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
|
|||||||
|
|
||||||
// handle access data
|
// handle access data
|
||||||
sal_Bool m_bUseUserData = pInfoItem->IsUseUserData();
|
sal_Bool m_bUseUserData = pInfoItem->IsUseUserData();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(),
|
aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(),
|
||||||
pInfoItem->getCreationDate(), aLocaleWrapper ) );
|
pInfoItem->getCreationDate(), aLocaleWrapper ) );
|
||||||
util::DateTime aTime( pInfoItem->getModificationDate() );
|
util::DateTime aTime( pInfoItem->getModificationDate() );
|
||||||
|
@ -316,8 +316,7 @@ void SfxVersionDialog::RecalcDateColumn()
|
|||||||
{
|
{
|
||||||
// recalculate the datetime column width
|
// recalculate the datetime column width
|
||||||
DateTime aNow( DateTime::SYSTEM );
|
DateTime aNow( DateTime::SYSTEM );
|
||||||
mpLocaleWrapper = new LocaleDataWrapper(
|
mpLocaleWrapper = new LocaleDataWrapper( Application::GetSettings().GetLocale() );
|
||||||
::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
|
||||||
String sDateTime = ConvertDateTime_Impl( aNow, *mpLocaleWrapper );
|
String sDateTime = ConvertDateTime_Impl( aNow, *mpLocaleWrapper );
|
||||||
long nWidth = aVersionBox.GetTextWidth( sDateTime );
|
long nWidth = aVersionBox.GetTextWidth( sDateTime );
|
||||||
nWidth += 15; // a little offset
|
nWidth += 15; // a little offset
|
||||||
@ -451,7 +450,7 @@ SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl ( Window *pParent, SfxVersi
|
|||||||
{
|
{
|
||||||
FreeResource();
|
FreeResource();
|
||||||
|
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreationDate, aLocaleWrapper )) );
|
aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreationDate, aLocaleWrapper )) );
|
||||||
aSavedByText.SetText( aSavedByText.GetText().Append(pInfo->aAuthor) );
|
aSavedByText.SetText( aSavedByText.GetText().Append(pInfo->aAuthor) );
|
||||||
aEdit.SetText( rInfo.aComment );
|
aEdit.SetText( rInfo.aComment );
|
||||||
|
@ -953,8 +953,7 @@ sal_Int32 SAL_CALL SmModel::getRendererCount(
|
|||||||
static Size lcl_GuessPaperSize()
|
static Size lcl_GuessPaperSize()
|
||||||
{
|
{
|
||||||
Size aRes;
|
Size aRes;
|
||||||
Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() );
|
LocaleDataWrapper aLocWrp( AllSettings().GetLocale() );
|
||||||
LocaleDataWrapper aLocWrp( xMgr, AllSettings().GetLocale() );
|
|
||||||
if( MEASURE_METRIC == aLocWrp.getMeasurementSystemEnum() )
|
if( MEASURE_METRIC == aLocWrp.getMeasurementSystemEnum() )
|
||||||
{
|
{
|
||||||
// in 100th mm
|
// in 100th mm
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
class OnDemandLocaleDataWrapper
|
class OnDemandLocaleDataWrapper
|
||||||
{
|
{
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
SvtSysLocale aSysLocale;
|
SvtSysLocale aSysLocale;
|
||||||
LanguageType eCurrentLanguage;
|
LanguageType eCurrentLanguage;
|
||||||
LanguageType eLastAnyLanguage;
|
LanguageType eLastAnyLanguage;
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
eCurrentLanguage = LANGUAGE_SYSTEM;
|
eCurrentLanguage = LANGUAGE_SYSTEM;
|
||||||
}
|
}
|
||||||
OnDemandLocaleDataWrapper(
|
OnDemandLocaleDataWrapper(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
|
||||||
::com::sun::star::lang::Locale& rLocale,
|
::com::sun::star::lang::Locale& rLocale,
|
||||||
LanguageType eLang
|
LanguageType eLang
|
||||||
)
|
)
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
, bInitialized(false)
|
, bInitialized(false)
|
||||||
{
|
{
|
||||||
pSystem = aSysLocale.GetLocaleDataPtr();
|
pSystem = aSysLocale.GetLocaleDataPtr();
|
||||||
init( rxSMgr, rLocale, eLang );
|
init( rxContext, rLocale, eLang );
|
||||||
}
|
}
|
||||||
~OnDemandLocaleDataWrapper()
|
~OnDemandLocaleDataWrapper()
|
||||||
{
|
{
|
||||||
@ -98,12 +98,12 @@ public:
|
|||||||
bool is() const { return pCurrent != NULL; }
|
bool is() const { return pCurrent != NULL; }
|
||||||
|
|
||||||
void init(
|
void init(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
|
||||||
::com::sun::star::lang::Locale& rLocale,
|
::com::sun::star::lang::Locale& rLocale,
|
||||||
LanguageType eLang
|
LanguageType eLang
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
xSMgr = rxSMgr;
|
m_xContext = rxContext;
|
||||||
changeLocale( rLocale, eLang );
|
changeLocale( rLocale, eLang );
|
||||||
bInitialized = true;
|
bInitialized = true;
|
||||||
}
|
}
|
||||||
@ -117,13 +117,13 @@ public:
|
|||||||
break;
|
break;
|
||||||
case LANGUAGE_ENGLISH_US :
|
case LANGUAGE_ENGLISH_US :
|
||||||
if ( !pEnglish )
|
if ( !pEnglish )
|
||||||
pEnglish = new LocaleDataWrapper( xSMgr, rLocale );
|
pEnglish = new LocaleDataWrapper( m_xContext, rLocale );
|
||||||
pCurrent = pEnglish;
|
pCurrent = pEnglish;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ( !pAny )
|
if ( !pAny )
|
||||||
{
|
{
|
||||||
pAny = new LocaleDataWrapper( xSMgr, rLocale );
|
pAny = new LocaleDataWrapper( m_xContext, rLocale );
|
||||||
eLastAnyLanguage = eLang;
|
eLastAnyLanguage = eLang;
|
||||||
}
|
}
|
||||||
else if ( eLastAnyLanguage != eLang )
|
else if ( eLastAnyLanguage != eLang )
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
{
|
{
|
||||||
if ( !pAny )
|
if ( !pAny )
|
||||||
{
|
{
|
||||||
pAny = new LocaleDataWrapper( xSMgr, pCurrent->getLocale() );
|
pAny = new LocaleDataWrapper( m_xContext, pCurrent->getLocale() );
|
||||||
eLastAnyLanguage = eCurrentLanguage;
|
eLastAnyLanguage = eCurrentLanguage;
|
||||||
}
|
}
|
||||||
else if ( pCurrent != pAny )
|
else if ( pCurrent != pAny )
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
class OnDemandTransliterationWrapper
|
class OnDemandTransliterationWrapper
|
||||||
{
|
{
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
LanguageType eLanguage;
|
LanguageType eLanguage;
|
||||||
::com::sun::star::i18n::TransliterationModules nType;
|
::com::sun::star::i18n::TransliterationModules nType;
|
||||||
mutable ::utl::TransliterationWrapper* pPtr;
|
mutable ::utl::TransliterationWrapper* pPtr;
|
||||||
@ -255,14 +255,14 @@ public:
|
|||||||
, bInitialized(false)
|
, bInitialized(false)
|
||||||
{}
|
{}
|
||||||
OnDemandTransliterationWrapper(
|
OnDemandTransliterationWrapper(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
|
||||||
LanguageType eLang,
|
LanguageType eLang,
|
||||||
::com::sun::star::i18n::TransliterationModules nTypeP
|
::com::sun::star::i18n::TransliterationModules nTypeP
|
||||||
)
|
)
|
||||||
: bValid(false)
|
: bValid(false)
|
||||||
, bInitialized(false)
|
, bInitialized(false)
|
||||||
{
|
{
|
||||||
init( rxSMgr, eLang, nTypeP );
|
init( rxContext, eLang, nTypeP );
|
||||||
}
|
}
|
||||||
~OnDemandTransliterationWrapper()
|
~OnDemandTransliterationWrapper()
|
||||||
{
|
{
|
||||||
@ -274,12 +274,12 @@ public:
|
|||||||
bool is() const { return pPtr != NULL; }
|
bool is() const { return pPtr != NULL; }
|
||||||
|
|
||||||
void init(
|
void init(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
|
||||||
LanguageType eLang,
|
LanguageType eLang,
|
||||||
::com::sun::star::i18n::TransliterationModules nTypeP
|
::com::sun::star::i18n::TransliterationModules nTypeP
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
xSMgr = rxSMgr;
|
m_xContext = rxContext;
|
||||||
nType = nTypeP;
|
nType = nTypeP;
|
||||||
changeLocale( eLang );
|
changeLocale( eLang );
|
||||||
if ( pPtr )
|
if ( pPtr )
|
||||||
@ -301,7 +301,7 @@ public:
|
|||||||
if ( !bValid )
|
if ( !bValid )
|
||||||
{
|
{
|
||||||
if ( !pPtr )
|
if ( !pPtr )
|
||||||
pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType );
|
pPtr = new ::utl::TransliterationWrapper( m_xContext, nType );
|
||||||
pPtr->loadModuleIfNeeded( eLanguage );
|
pPtr->loadModuleIfNeeded( eLanguage );
|
||||||
bValid = true;
|
bValid = true;
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ public:
|
|||||||
const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const
|
const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const
|
||||||
{
|
{
|
||||||
if ( !pPtr )
|
if ( !pPtr )
|
||||||
pPtr = new ::utl::TransliterationWrapper( comphelper::getComponentContext(xSMgr), nType );
|
pPtr = new ::utl::TransliterationWrapper( m_xContext, nType );
|
||||||
pPtr->loadModuleByImplName( rModule, eLang );
|
pPtr->loadModuleByImplName( rModule, eLang );
|
||||||
bValid = false; // reforce settings change in get()
|
bValid = false; // reforce settings change in get()
|
||||||
return pPtr;
|
return pPtr;
|
||||||
|
@ -235,9 +235,9 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
|
|||||||
|
|
||||||
aLocale = MsLangId::convertLanguageToLocale( eLang );
|
aLocale = MsLangId::convertLanguageToLocale( eLang );
|
||||||
pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), aLocale );
|
pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), aLocale );
|
||||||
xLocaleData.init( xServiceManager, aLocale, eLang );
|
xLocaleData.init( comphelper::getComponentContext(xServiceManager), aLocale, eLang );
|
||||||
xCalendar.init( comphelper::getComponentContext(xServiceManager), aLocale );
|
xCalendar.init( comphelper::getComponentContext(xServiceManager), aLocale );
|
||||||
xTransliteration.init( xServiceManager, eLang,
|
xTransliteration.init( comphelper::getComponentContext(xServiceManager), eLang,
|
||||||
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE );
|
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE );
|
||||||
xNatNum.init( xServiceManager );
|
xNatNum.init( xServiceManager );
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage )
|
|||||||
pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) );
|
pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) );
|
||||||
|
|
||||||
// append new system additional formats
|
// append new system additional formats
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
|
NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager), GetLocale() );
|
||||||
ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, true );
|
ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,7 +744,7 @@ bool SvNumberFormatter::Load( SvStream& rStream )
|
|||||||
|
|
||||||
// generate additional i18n standard formats for all used locales
|
// generate additional i18n standard formats for all used locales
|
||||||
LanguageType eOldLanguage = ActLnge;
|
LanguageType eOldLanguage = ActLnge;
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
|
NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager), GetLocale() );
|
||||||
std::vector<sal_uInt16> aList;
|
std::vector<sal_uInt16> aList;
|
||||||
GetUsedLanguages( aList );
|
GetUsedLanguages( aList );
|
||||||
for ( std::vector<sal_uInt16>::const_iterator it(aList.begin()); it != aList.end(); ++it )
|
for ( std::vector<sal_uInt16>::const_iterator it(aList.begin()); it != aList.end(); ++it )
|
||||||
@ -2163,7 +2163,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
|
|||||||
if (bOldConvertMode)
|
if (bOldConvertMode)
|
||||||
pFormatScanner->SetConvertMode(false); // switch off for this function
|
pFormatScanner->SetConvertMode(false); // switch off for this function
|
||||||
|
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
|
NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager), GetLocale() );
|
||||||
|
|
||||||
xub_StrLen nCheckPos = 0;
|
xub_StrLen nCheckPos = 0;
|
||||||
SvNumberformat* pNewFormat = NULL;
|
SvNumberformat* pNewFormat = NULL;
|
||||||
@ -3546,7 +3546,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
|
|||||||
|
|
||||||
LanguageType eSysLang = SvtSysLocale().GetLanguage();
|
LanguageType eSysLang = SvtSysLocale().GetLanguage();
|
||||||
LocaleDataWrapper* pLocaleData = new LocaleDataWrapper(
|
LocaleDataWrapper* pLocaleData = new LocaleDataWrapper(
|
||||||
::comphelper::getProcessServiceFactory(),
|
::comphelper::getProcessComponentContext(),
|
||||||
MsLangId::convertLanguageToLocale( eSysLang ) );
|
MsLangId::convertLanguageToLocale( eSysLang ) );
|
||||||
// get user configured currency
|
// get user configured currency
|
||||||
String aConfiguredCurrencyAbbrev;
|
String aConfiguredCurrencyAbbrev;
|
||||||
|
@ -223,7 +223,7 @@ void ImpSvNumberformatScan::SetDependentKeywords()
|
|||||||
// requested Locale, otherwise number format codes might not match
|
// requested Locale, otherwise number format codes might not match
|
||||||
lang::Locale aLoadedLocale = pLocaleData->getLoadedLocale();
|
lang::Locale aLoadedLocale = pLocaleData->getLoadedLocale();
|
||||||
LanguageType eLang = MsLangId::convertLocaleToLanguage( aLoadedLocale );
|
LanguageType eLang = MsLangId::convertLocaleToLanguage( aLoadedLocale );
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( pFormatter->GetServiceManager(), aLoadedLocale );
|
NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(pFormatter->GetServiceManager()), aLoadedLocale );
|
||||||
|
|
||||||
i18n::NumberFormatCode aFormat = aNumberFormatCode.getFormatCode( NF_NUMBER_STANDARD );
|
i18n::NumberFormatCode aFormat = aNumberFormatCode.getFormatCode( NF_NUMBER_STANDARD );
|
||||||
sNameStandardFormat = lcl_extractStandardGeneralName( aFormat.Code);
|
sNameStandardFormat = lcl_extractStandardGeneralName( aFormat.Code);
|
||||||
|
@ -164,9 +164,7 @@ void ODocumentInfoPreview::insertDateTime(
|
|||||||
Time(
|
Time(
|
||||||
value.Hours, value.Minutes, value.Seconds, value.HundredthSeconds));
|
value.Hours, value.Minutes, value.Seconds, value.HundredthSeconds));
|
||||||
if (aToolsDT.IsValidAndGregorian()) {
|
if (aToolsDT.IsValidAndGregorian()) {
|
||||||
LocaleDataWrapper aLocaleWrapper(
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
comphelper::getProcessServiceFactory(),
|
|
||||||
Application::GetSettings().GetLocale());
|
|
||||||
rtl::OUStringBuffer buf(aLocaleWrapper.getDate(aToolsDT));
|
rtl::OUStringBuffer buf(aLocaleWrapper.getDate(aToolsDT));
|
||||||
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
|
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
|
||||||
buf.append(aLocaleWrapper.getTime(aToolsDT));
|
buf.append(aLocaleWrapper.getTime(aToolsDT));
|
||||||
|
@ -257,7 +257,7 @@ void Calendar::ImplInitSettings()
|
|||||||
|
|
||||||
Calendar::Calendar( Window* pParent, WinBits nWinStyle ) :
|
Calendar::Calendar( Window* pParent, WinBits nWinStyle ) :
|
||||||
Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ),
|
Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ),
|
||||||
maCalendarWrapper( comphelper::getComponentContext(Application::GetAppLocaleDataWrapper().getServiceFactory()) ),
|
maCalendarWrapper( Application::GetAppLocaleDataWrapper().getComponentContext() ),
|
||||||
maOldFormatFirstDate( 0, 0, 1900 ),
|
maOldFormatFirstDate( 0, 0, 1900 ),
|
||||||
maOldFormatLastDate( 0, 0, 1900 ),
|
maOldFormatLastDate( 0, 0, 1900 ),
|
||||||
maFirstDate( 0, 0, 1900 ),
|
maFirstDate( 0, 0, 1900 ),
|
||||||
|
@ -1146,7 +1146,7 @@ void DoubleNumericField::ResetConformanceTester()
|
|||||||
{
|
{
|
||||||
Locale aLocale;
|
Locale aLocale;
|
||||||
MsLangId::convertLanguageToLocale( pFormatEntry->GetLanguage(), aLocale );
|
MsLangId::convertLanguageToLocale( pFormatEntry->GetLanguage(), aLocale );
|
||||||
LocaleDataWrapper aLocaleInfo(::comphelper::getProcessServiceFactory(), aLocale);
|
LocaleDataWrapper aLocaleInfo( aLocale );
|
||||||
|
|
||||||
String sSeparator = aLocaleInfo.getNumThousandSep();
|
String sSeparator = aLocaleInfo.getNumThousandSep();
|
||||||
if (sSeparator.Len())
|
if (sSeparator.Len())
|
||||||
@ -1238,7 +1238,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
|
|||||||
// build a new format string with the base class' and my own settings
|
// build a new format string with the base class' and my own settings
|
||||||
Locale aLocale;
|
Locale aLocale;
|
||||||
MsLangId::convertLanguageToLocale( eLanguage, aLocale );
|
MsLangId::convertLanguageToLocale( eLanguage, aLocale );
|
||||||
LocaleDataWrapper aLocaleInfo(::comphelper::getProcessServiceFactory(), aLocale);
|
LocaleDataWrapper aLocaleInfo( aLocale );
|
||||||
|
|
||||||
XubString sNewFormat;
|
XubString sNewFormat;
|
||||||
if (bThSep)
|
if (bThSep)
|
||||||
|
@ -568,7 +568,7 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd )
|
|||||||
String aStr;
|
String aStr;
|
||||||
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
||||||
const Point& rMousePos = pWnd->GetMousePos();
|
const Point& rMousePos = pWnd->GetMousePos();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
|
|
||||||
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
|
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
|
||||||
@ -585,7 +585,7 @@ IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd )
|
|||||||
String aStr;
|
String aStr;
|
||||||
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
||||||
const Size& rSize = pWnd->GetGraphicSize();
|
const Size& rSize = pWnd->GetGraphicSize();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
|
|
||||||
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
|
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
|
||||||
|
@ -106,7 +106,7 @@ CompressGraphicsDialog::~CompressGraphicsDialog()
|
|||||||
void CompressGraphicsDialog::Update()
|
void CompressGraphicsDialog::Update()
|
||||||
{
|
{
|
||||||
const FieldUnit eFieldUnit = m_rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
|
const FieldUnit eFieldUnit = m_rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
|
|
||||||
VirtualDevice* pDummyVDev = new VirtualDevice();
|
VirtualDevice* pDummyVDev = new VirtualDevice();
|
||||||
|
@ -665,7 +665,7 @@ IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd )
|
|||||||
String aStr;
|
String aStr;
|
||||||
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
||||||
const Point& rMousePos = pWnd->GetMousePos();
|
const Point& rMousePos = pWnd->GetMousePos();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
|
|
||||||
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
|
aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) );
|
||||||
@ -682,7 +682,7 @@ IMPL_LINK( SvxIMapDlg, GraphSizeHdl, IMapWindow*, pWnd )
|
|||||||
String aStr;
|
String aStr;
|
||||||
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit();
|
||||||
const Size& rSize = pWnd->GetGraphicSize();
|
const Size& rSize = pWnd->GetGraphicSize();
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
|
LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLocale() );
|
||||||
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
|
|
||||||
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
|
aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) );
|
||||||
|
@ -3172,7 +3172,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
|
|||||||
Reference< XNumberFormatter> xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
|
Reference< XNumberFormatter> xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
|
||||||
xFormatter->attachNumberFormatsSupplier(xFormatSupplier);
|
xFormatter->attachNumberFormatsSupplier(xFormatSupplier);
|
||||||
Locale aAppLocale = Application::GetSettings().GetUILocale();
|
Locale aAppLocale = Application::GetSettings().GetUILocale();
|
||||||
LocaleDataWrapper aLocaleWrapper( m_aContext.getLegacyServiceFactory(), aAppLocale );
|
LocaleDataWrapper aLocaleWrapper( m_aContext.getUNOContext(), aAppLocale );
|
||||||
|
|
||||||
// retrieving the filter
|
// retrieving the filter
|
||||||
const Sequence < PropertyValue >* pRow = aFilterRows.getConstArray();
|
const Sequence < PropertyValue >* pRow = aFilterRows.getConstArray();
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <com/sun/star/uno/Reference.h>
|
#include <com/sun/star/uno/Reference.h>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||||
#include <com/sun/star/i18n/XBreakIterator.hpp>
|
#include <com/sun/star/i18n/XBreakIterator.hpp>
|
||||||
#include <com/sun/star/i18n/XScriptTypeDetector.hpp>
|
#include <com/sun/star/i18n/XScriptTypeDetector.hpp>
|
||||||
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
|
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
class SW_DLLPUBLIC SwBreakIt : private ::boost::noncopyable
|
class SW_DLLPUBLIC SwBreakIt : private ::boost::noncopyable
|
||||||
{
|
{
|
||||||
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF;
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xBreak;
|
mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xBreak;
|
||||||
|
|
||||||
com::sun::star::lang::Locale * m_pLocale;
|
com::sun::star::lang::Locale * m_pLocale;
|
||||||
@ -61,13 +61,13 @@ class SW_DLLPUBLIC SwBreakIt : private ::boost::noncopyable
|
|||||||
|
|
||||||
// private (see @ _Create, _Delete).
|
// private (see @ _Create, _Delete).
|
||||||
explicit SwBreakIt(
|
explicit SwBreakIt(
|
||||||
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rxMSF);
|
const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext);
|
||||||
~SwBreakIt();
|
~SwBreakIt();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// private (see @ source/core/bastyp/init.cxx).
|
// private (see @ source/core/bastyp/init.cxx).
|
||||||
static void _Create(
|
static void _Create(
|
||||||
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rxMSF);
|
const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext);
|
||||||
static void _Delete();
|
static void _Delete();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -43,9 +43,9 @@ using namespace com::sun::star;
|
|||||||
|
|
||||||
SwBreakIt* pBreakIt = 0;
|
SwBreakIt* pBreakIt = 0;
|
||||||
|
|
||||||
void SwBreakIt::_Create( const uno::Reference<lang::XMultiServiceFactory> & rxMSF )
|
void SwBreakIt::_Create( const uno::Reference<uno::XComponentContext> & rxContext )
|
||||||
{
|
{
|
||||||
delete pBreakIt, pBreakIt = new SwBreakIt( rxMSF );
|
delete pBreakIt, pBreakIt = new SwBreakIt( rxContext );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwBreakIt::_Delete()
|
void SwBreakIt::_Delete()
|
||||||
@ -58,14 +58,14 @@ SwBreakIt * SwBreakIt::Get()
|
|||||||
return pBreakIt;
|
return pBreakIt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwBreakIt::SwBreakIt( const uno::Reference<lang::XMultiServiceFactory> & rxMSF )
|
SwBreakIt::SwBreakIt( const uno::Reference<uno::XComponentContext> & rxContext )
|
||||||
: m_xMSF( rxMSF ),
|
: m_xContext( rxContext ),
|
||||||
m_pLocale( NULL ),
|
m_pLocale( NULL ),
|
||||||
m_pForbidden( NULL ),
|
m_pForbidden( NULL ),
|
||||||
aLast( LANGUAGE_DONTKNOW ),
|
aLast( LANGUAGE_DONTKNOW ),
|
||||||
aForbiddenLang( LANGUAGE_DONTKNOW )
|
aForbiddenLang( LANGUAGE_DONTKNOW )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
|
OSL_ENSURE( m_xContext.is(), "SwBreakIt: no MultiServiceFactory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
SwBreakIt::~SwBreakIt()
|
SwBreakIt::~SwBreakIt()
|
||||||
@ -76,8 +76,8 @@ SwBreakIt::~SwBreakIt()
|
|||||||
|
|
||||||
void SwBreakIt::createBreakIterator() const
|
void SwBreakIt::createBreakIterator() const
|
||||||
{
|
{
|
||||||
if ( m_xMSF.is() && !xBreak.is() )
|
if ( m_xContext.is() && !xBreak.is() )
|
||||||
xBreak.set( i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF)) );
|
xBreak.set( i18n::BreakIterator::create(m_xContext) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwBreakIt::_GetLocale( const LanguageType aLang )
|
void SwBreakIt::_GetLocale( const LanguageType aLang )
|
||||||
@ -89,7 +89,7 @@ void SwBreakIt::_GetLocale( const LanguageType aLang )
|
|||||||
|
|
||||||
void SwBreakIt::_GetForbidden( const LanguageType aLang )
|
void SwBreakIt::_GetForbidden( const LanguageType aLang )
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aWrap( m_xMSF, GetLocale( aLang ) );
|
LocaleDataWrapper aWrap( m_xContext, GetLocale( aLang ) );
|
||||||
|
|
||||||
aForbiddenLang = aLang;
|
aForbiddenLang = aLang;
|
||||||
delete m_pForbidden;
|
delete m_pForbidden;
|
||||||
|
@ -258,10 +258,8 @@ SwCalc::SwCalc( SwDoc& rD )
|
|||||||
eLang != SvxLocaleToLanguage( pCharClass->getLocale() ) )
|
eLang != SvxLocaleToLanguage( pCharClass->getLocale() ) )
|
||||||
{
|
{
|
||||||
::com::sun::star::lang::Locale aLocale( SvxCreateLocale( eLang ));
|
::com::sun::star::lang::Locale aLocale( SvxCreateLocale( eLang ));
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF(
|
|
||||||
::comphelper::getProcessServiceFactory() );
|
|
||||||
pCharClass = new CharClass( ::comphelper::getProcessComponentContext(), aLocale );
|
pCharClass = new CharClass( ::comphelper::getProcessComponentContext(), aLocale );
|
||||||
pLclData = new LocaleDataWrapper( xMSF, aLocale );
|
pLclData = new LocaleDataWrapper( aLocale );
|
||||||
}
|
}
|
||||||
|
|
||||||
sCurrSym = comphelper::string::strip(pLclData->getCurrSymbol(), ' ');
|
sCurrSym = comphelper::string::strip(pLclData->getCurrSymbol(), ' ');
|
||||||
@ -1543,9 +1541,7 @@ bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
|
|||||||
if (eLang !=
|
if (eLang !=
|
||||||
SvxLocaleToLanguage(aSysLocale.GetLocaleData().getLocale()))
|
SvxLocaleToLanguage(aSysLocale.GetLocaleData().getLocale()))
|
||||||
{
|
{
|
||||||
pLclD.reset( new LocaleDataWrapper(
|
pLclD.reset( new LocaleDataWrapper( SvxCreateLocale( eLang ) ) );
|
||||||
::comphelper::getProcessServiceFactory(),
|
|
||||||
SvxCreateLocale( eLang ) ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,9 +701,7 @@ void _InitCore()
|
|||||||
for ( i = 38; i <= 136; ++i )
|
for ( i = 38; i <= 136; ++i )
|
||||||
SwAttrPool::pVersionMap6[ i-1 ] = i + 3;
|
SwAttrPool::pVersionMap6[ i-1 ] = i + 3;
|
||||||
|
|
||||||
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
|
SwBreakIt::_Create( ::comphelper::getProcessComponentContext() );
|
||||||
|
|
||||||
SwBreakIt::_Create( xMSF );
|
|
||||||
pCheckIt = NULL;
|
pCheckIt = NULL;
|
||||||
|
|
||||||
_FrmInit();
|
_FrmInit();
|
||||||
|
@ -425,10 +425,7 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
|
|||||||
{
|
{
|
||||||
if( !xForbiddenCharsTable.is() )
|
if( !xForbiddenCharsTable.is() )
|
||||||
{
|
{
|
||||||
uno::Reference<
|
xForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
|
||||||
lang::XMultiServiceFactory > xMSF =
|
|
||||||
::comphelper::getProcessServiceFactory();
|
|
||||||
xForbiddenCharsTable = new SvxForbiddenCharactersTable( xMSF );
|
|
||||||
}
|
}
|
||||||
xForbiddenCharsTable->SetForbiddenCharacters( nLang, rFChars );
|
xForbiddenCharsTable->SetForbiddenCharacters( nLang, rFChars );
|
||||||
if( pDrawModel )
|
if( pDrawModel )
|
||||||
@ -453,10 +450,7 @@ rtl::Reference<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
|
|||||||
{
|
{
|
||||||
if( !xForbiddenCharsTable.is() )
|
if( !xForbiddenCharsTable.is() )
|
||||||
{
|
{
|
||||||
uno::Reference<
|
xForbiddenCharsTable = new SvxForbiddenCharactersTable( ::comphelper::getProcessComponentContext() );
|
||||||
lang::XMultiServiceFactory > xMSF =
|
|
||||||
::comphelper::getProcessServiceFactory();
|
|
||||||
xForbiddenCharsTable = new SvxForbiddenCharactersTable( xMSF );
|
|
||||||
}
|
}
|
||||||
return xForbiddenCharsTable;
|
return xForbiddenCharsTable;
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,7 @@ SwSortElement::~SwSortElement()
|
|||||||
double SwSortElement::StrToDouble( const String& rStr ) const
|
double SwSortElement::StrToDouble( const String& rStr ) const
|
||||||
{
|
{
|
||||||
if( !pLclData )
|
if( !pLclData )
|
||||||
pLclData = new LocaleDataWrapper(
|
pLclData = new LocaleDataWrapper( *pLocale );
|
||||||
::comphelper::getProcessServiceFactory(), *pLocale );
|
|
||||||
|
|
||||||
rtl_math_ConversionStatus eStatus;
|
rtl_math_ConversionStatus eStatus;
|
||||||
sal_Int32 nEnd;
|
sal_Int32 nEnd;
|
||||||
|
@ -895,7 +895,6 @@ static void lcl_GetLocalDataWrapper( sal_uLong nLang,
|
|||||||
*ppLocalData = *ppAppLocalData;
|
*ppLocalData = *ppAppLocalData;
|
||||||
if( nLang != SvxLocaleToLanguage( (*ppLocalData)->getLocale() ) )
|
if( nLang != SvxLocaleToLanguage( (*ppLocalData)->getLocale() ) )
|
||||||
*ppLocalData = new LocaleDataWrapper(
|
*ppLocalData = new LocaleDataWrapper(
|
||||||
::comphelper::getProcessServiceFactory(),
|
|
||||||
SvxCreateLocale( static_cast<LanguageType>(nLang) ) );
|
SvxCreateLocale( static_cast<LanguageType>(nLang) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,9 +470,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
|
|||||||
if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() )
|
if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
LocaleDataWrapper aLocaleData(
|
LocaleDataWrapper aLocaleData( SvxCreateLocale( GetLanguage() ) );
|
||||||
::comphelper::getProcessServiceFactory(),
|
|
||||||
SvxCreateLocale( GetLanguage() ) );
|
|
||||||
|
|
||||||
// erstmal ein "Kurz" - Test - falls beide im selben
|
// erstmal ein "Kurz" - Test - falls beide im selben
|
||||||
// Node stehen!
|
// Node stehen!
|
||||||
|
@ -2342,7 +2342,7 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr)
|
|||||||
if( pNumFmt )
|
if( pNumFmt )
|
||||||
{
|
{
|
||||||
sal_uInt16 nLng = rFld.GetLanguage();
|
sal_uInt16 nLng = rFld.GetLanguage();
|
||||||
LocaleDataWrapper aLocDat(pNFmtr->GetServiceManager(),
|
LocaleDataWrapper aLocDat(comphelper::getComponentContext(pNFmtr->GetServiceManager()),
|
||||||
MsLangId::convertLanguageToLocale(nLng));
|
MsLangId::convertLanguageToLocale(nLng));
|
||||||
|
|
||||||
String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
|
String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
|
||||||
|
@ -5590,7 +5590,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer)
|
|||||||
|
|
||||||
Locale aTempLocale;
|
Locale aTempLocale;
|
||||||
SvxLanguageToLocale( aTempLocale, lid );
|
SvxLanguageToLocale( aTempLocale, lid );
|
||||||
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
|
LocaleDataWrapper aLocaleWrapper( aTempLocale );
|
||||||
nNumDecimalSep = aLocaleWrapper.getNumDecimalSep()[0];
|
nNumDecimalSep = aLocaleWrapper.getNumDecimalSep()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
|
|||||||
aLocale.Country = sDefaultCurrency.copy( nSepPos + 1 );
|
aLocale.Country = sDefaultCurrency.copy( nSepPos + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
LocaleDataWrapper aLocaleInfo( maContext.getLegacyServiceFactory(), aLocale );
|
LocaleDataWrapper aLocaleInfo( maContext.getUNOContext(), aLocale );
|
||||||
if ( sBankSymbol.isEmpty() )
|
if ( sBankSymbol.isEmpty() )
|
||||||
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
|
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
#include "unotools/unotoolsdllapi.h"
|
#include "unotools/unotoolsdllapi.h"
|
||||||
|
|
||||||
namespace com { namespace sun { namespace star {
|
namespace com { namespace sun { namespace star {
|
||||||
namespace lang {
|
namespace uno {
|
||||||
class XMultiServiceFactory;
|
class XComponentContext;
|
||||||
}
|
}
|
||||||
}}}
|
}}}
|
||||||
class Date;
|
class Date;
|
||||||
@ -56,7 +56,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable
|
|||||||
{
|
{
|
||||||
static sal_uInt8 nLocaleDataChecking; // 0:=dontknow, 1:=yes, 2:=no
|
static sal_uInt8 nLocaleDataChecking; // 0:=dontknow, 1:=yes, 2:=no
|
||||||
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 > xLD;
|
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4 > xLD;
|
||||||
::com::sun::star::lang::Locale aLocale;
|
::com::sun::star::lang::Locale aLocale;
|
||||||
::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > xDefaultCalendar;
|
::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > xDefaultCalendar;
|
||||||
@ -111,7 +111,10 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper : private boost::noncopyable
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
LocaleDataWrapper(
|
LocaleDataWrapper(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
|
||||||
|
const ::com::sun::star::lang::Locale& rLocale
|
||||||
|
);
|
||||||
|
LocaleDataWrapper(
|
||||||
const ::com::sun::star::lang::Locale& rLocale
|
const ::com::sun::star::lang::Locale& rLocale
|
||||||
);
|
);
|
||||||
~LocaleDataWrapper();
|
~LocaleDataWrapper();
|
||||||
@ -122,8 +125,8 @@ public:
|
|||||||
lives "on the grassland". The CalendarWrapper ctor can handle that
|
lives "on the grassland". The CalendarWrapper ctor can handle that
|
||||||
though. */
|
though. */
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::lang::XMultiServiceFactory > & getServiceFactory()
|
::com::sun::star::uno::XComponentContext > & getComponentContext()
|
||||||
const { return xSMgr; }
|
const { return m_xContext; }
|
||||||
|
|
||||||
/// set a new Locale to request
|
/// set a new Locale to request
|
||||||
void setLocale( const ::com::sun::star::lang::Locale& rLocale );
|
void setLocale( const ::com::sun::star::lang::Locale& rLocale );
|
||||||
|
@ -24,15 +24,14 @@
|
|||||||
#include "unotools/unotoolsdllapi.h"
|
#include "unotools/unotoolsdllapi.h"
|
||||||
|
|
||||||
namespace com { namespace sun { namespace star {
|
namespace com { namespace sun { namespace star {
|
||||||
namespace lang {
|
namespace uno {
|
||||||
class XMultiServiceFactory;
|
class XComponentContext;
|
||||||
}
|
}
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
|
||||||
class UNOTOOLS_DLLPUBLIC NumberFormatCodeWrapper
|
class UNOTOOLS_DLLPUBLIC NumberFormatCodeWrapper
|
||||||
{
|
{
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNumberFormatCode > xNFC;
|
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNumberFormatCode > xNFC;
|
||||||
::com::sun::star::lang::Locale aLocale;
|
::com::sun::star::lang::Locale aLocale;
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ class UNOTOOLS_DLLPUBLIC NumberFormatCodeWrapper
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
NumberFormatCodeWrapper(
|
NumberFormatCodeWrapper(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
|
||||||
const ::com::sun::star::lang::Locale& rLocale
|
const ::com::sun::star::lang::Locale& rLocale
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "unotools/intlwrapper.hxx"
|
#include "unotools/intlwrapper.hxx"
|
||||||
#include <com/sun/star/i18n/CollatorOptions.hpp>
|
#include <com/sun/star/i18n/CollatorOptions.hpp>
|
||||||
#include <i18npool/mslangid.hxx>
|
#include <i18npool/mslangid.hxx>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
|
|
||||||
IntlWrapper::IntlWrapper(
|
IntlWrapper::IntlWrapper(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
|
||||||
@ -60,7 +61,7 @@ IntlWrapper::~IntlWrapper()
|
|||||||
|
|
||||||
void IntlWrapper::ImplNewLocaleData() const
|
void IntlWrapper::ImplNewLocaleData() const
|
||||||
{
|
{
|
||||||
((IntlWrapper*)this)->pLocaleData = new LocaleDataWrapper( xSMgr, aLocale );
|
((IntlWrapper*)this)->pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(xSMgr), aLocale );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,18 +66,29 @@ namespace
|
|||||||
sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0;
|
sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0;
|
||||||
|
|
||||||
LocaleDataWrapper::LocaleDataWrapper(
|
LocaleDataWrapper::LocaleDataWrapper(
|
||||||
const Reference< lang::XMultiServiceFactory > & xSF,
|
const Reference< uno::XComponentContext > & rxContext,
|
||||||
const lang::Locale& rLocale
|
const lang::Locale& rLocale
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
xSMgr( xSF ),
|
m_xContext( rxContext ),
|
||||||
xLD( LocaleData::create(comphelper::getComponentContext(xSMgr)) ),
|
xLD( LocaleData::create(rxContext) ),
|
||||||
bLocaleDataItemValid( sal_False ),
|
bLocaleDataItemValid( sal_False ),
|
||||||
bReservedWordValid( sal_False )
|
bReservedWordValid( sal_False )
|
||||||
{
|
{
|
||||||
setLocale( rLocale );
|
setLocale( rLocale );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocaleDataWrapper::LocaleDataWrapper(
|
||||||
|
const lang::Locale& rLocale
|
||||||
|
)
|
||||||
|
:
|
||||||
|
m_xContext( comphelper::getProcessComponentContext() ),
|
||||||
|
xLD( LocaleData::create(m_xContext) ),
|
||||||
|
bLocaleDataItemValid( sal_False ),
|
||||||
|
bReservedWordValid( sal_False )
|
||||||
|
{
|
||||||
|
setLocale( rLocale );
|
||||||
|
}
|
||||||
|
|
||||||
LocaleDataWrapper::~LocaleDataWrapper()
|
LocaleDataWrapper::~LocaleDataWrapper()
|
||||||
{
|
{
|
||||||
@ -240,7 +251,7 @@ void LocaleDataWrapper::invalidateData()
|
|||||||
|
|
||||||
if ( !rInstalledLocales.getLength() )
|
if ( !rInstalledLocales.getLength() )
|
||||||
{
|
{
|
||||||
LocaleDataWrapper aLDW( ::comphelper::getProcessServiceFactory(), lang::Locale() );
|
LocaleDataWrapper aLDW( ::comphelper::getProcessComponentContext(), lang::Locale() );
|
||||||
aLDW.getAllInstalledLocaleNames();
|
aLDW.getAllInstalledLocaleNames();
|
||||||
}
|
}
|
||||||
return rInstalledLocales;
|
return rInstalledLocales;
|
||||||
@ -698,7 +709,7 @@ void LocaleDataWrapper::scanCurrFormatImpl( const rtl::OUString& rCode,
|
|||||||
|
|
||||||
void LocaleDataWrapper::getCurrFormatsImpl()
|
void LocaleDataWrapper::getCurrFormatsImpl()
|
||||||
{
|
{
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( xSMgr, getLocale() );
|
NumberFormatCodeWrapper aNumberFormatCode( m_xContext, getLocale() );
|
||||||
uno::Sequence< NumberFormatCode > aFormatSeq
|
uno::Sequence< NumberFormatCode > aFormatSeq
|
||||||
= aNumberFormatCode.getAllFormatCode( KNumberFormatUsage::CURRENCY );
|
= aNumberFormatCode.getAllFormatCode( KNumberFormatUsage::CURRENCY );
|
||||||
sal_Int32 nCnt = aFormatSeq.getLength();
|
sal_Int32 nCnt = aFormatSeq.getLength();
|
||||||
@ -955,7 +966,7 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const rtl::OUString& rCode )
|
|||||||
|
|
||||||
void LocaleDataWrapper::getDateFormatsImpl()
|
void LocaleDataWrapper::getDateFormatsImpl()
|
||||||
{
|
{
|
||||||
NumberFormatCodeWrapper aNumberFormatCode( xSMgr, getLocale() );
|
NumberFormatCodeWrapper aNumberFormatCode( m_xContext, getLocale() );
|
||||||
uno::Sequence< NumberFormatCode > aFormatSeq
|
uno::Sequence< NumberFormatCode > aFormatSeq
|
||||||
= aNumberFormatCode.getAllFormatCode( KNumberFormatUsage::DATE );
|
= aNumberFormatCode.getAllFormatCode( KNumberFormatUsage::DATE );
|
||||||
sal_Int32 nCnt = aFormatSeq.getLength();
|
sal_Int32 nCnt = aFormatSeq.getLength();
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <unotools/numberformatcodewrapper.hxx>
|
#include <unotools/numberformatcodewrapper.hxx>
|
||||||
|
#include <com/sun/star/i18n/NumberFormatMapper.hpp>
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include "instance.hxx"
|
|
||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
using namespace ::com::sun::star::i18n;
|
using namespace ::com::sun::star::i18n;
|
||||||
@ -28,17 +28,12 @@ using namespace ::com::sun::star::uno;
|
|||||||
|
|
||||||
|
|
||||||
NumberFormatCodeWrapper::NumberFormatCodeWrapper(
|
NumberFormatCodeWrapper::NumberFormatCodeWrapper(
|
||||||
const Reference< lang::XMultiServiceFactory > & xSF,
|
const Reference< uno::XComponentContext > & rxContext,
|
||||||
const lang::Locale& rLocale
|
const lang::Locale& rLocale
|
||||||
)
|
)
|
||||||
:
|
|
||||||
xSMgr( xSF )
|
|
||||||
{
|
{
|
||||||
setLocale( rLocale );
|
setLocale( rLocale );
|
||||||
xNFC = Reference< XNumberFormatCode > (
|
xNFC = i18n::NumberFormatMapper::create( rxContext );
|
||||||
intl_createInstance( xSMgr, "com.sun.star.i18n.NumberFormatMapper",
|
|
||||||
"NumberFormatCodeWrapper" ), uno::UNO_QUERY );
|
|
||||||
DBG_ASSERT( xNFC.is(), "NumberFormatCodeWrapper: no NumberFormatMapper" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -58,8 +53,7 @@ NumberFormatCodeWrapper::getFormatCode( sal_Int16 formatIndex ) const
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( xNFC.is() )
|
return xNFC->getFormatCode( formatIndex, aLocale );
|
||||||
return xNFC->getFormatCode( formatIndex, aLocale );
|
|
||||||
}
|
}
|
||||||
catch ( const Exception& )
|
catch ( const Exception& )
|
||||||
{
|
{
|
||||||
@ -74,8 +68,7 @@ NumberFormatCodeWrapper::getAllFormatCode( sal_Int16 formatUsage ) const
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( xNFC.is() )
|
return xNFC->getAllFormatCode( formatUsage, aLocale );
|
||||||
return xNFC->getAllFormatCode( formatUsage, aLocale );
|
|
||||||
}
|
}
|
||||||
catch ( const Exception& )
|
catch ( const Exception& )
|
||||||
{
|
{
|
||||||
@ -90,8 +83,7 @@ NumberFormatCodeWrapper::getAllFormatCodes() const
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( xNFC.is() )
|
return xNFC->getAllFormatCodes( aLocale );
|
||||||
return xNFC->getAllFormatCodes( aLocale );
|
|
||||||
}
|
}
|
||||||
catch ( const Exception& )
|
catch ( const Exception& )
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ private:
|
|||||||
|
|
||||||
SvtSysLocale_Impl::SvtSysLocale_Impl() : pCharClass(NULL)
|
SvtSysLocale_Impl::SvtSysLocale_Impl() : pCharClass(NULL)
|
||||||
{
|
{
|
||||||
pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aSysLocaleOptions.GetRealLocale() );
|
pLocaleData = new LocaleDataWrapper( aSysLocaleOptions.GetRealLocale() );
|
||||||
setDateAcceptancePatternsConfig();
|
setDateAcceptancePatternsConfig();
|
||||||
|
|
||||||
// listen for further changes
|
// listen for further changes
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
namespace com {
|
namespace com {
|
||||||
namespace sun {
|
namespace sun {
|
||||||
namespace star {
|
namespace star {
|
||||||
namespace lang {
|
namespace uno {
|
||||||
class XMultiServiceFactory;
|
class XComponentContext;
|
||||||
}
|
}
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ class VCL_DLLPUBLIC I18nHelper
|
|||||||
private:
|
private:
|
||||||
::osl::Mutex maMutex;
|
::osl::Mutex maMutex;
|
||||||
::com::sun::star::lang::Locale maLocale;
|
::com::sun::star::lang::Locale maLocale;
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
||||||
|
|
||||||
LocaleDataWrapper* mpLocaleDataWrapper;
|
LocaleDataWrapper* mpLocaleDataWrapper;
|
||||||
utl::TransliterationWrapper* mpTransliterationWrapper;
|
utl::TransliterationWrapper* mpTransliterationWrapper;
|
||||||
@ -67,7 +67,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
I18nHelper( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF, const ::com::sun::star::lang::Locale& rLocale );
|
I18nHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::lang::Locale& rLocale );
|
||||||
~I18nHelper();
|
~I18nHelper();
|
||||||
|
|
||||||
sal_Int32 CompareString( const rtl::OUString& rStr1, const rtl::OUString& rStr2 ) const;
|
sal_Int32 CompareString( const rtl::OUString& rStr1, const rtl::OUString& rStr2 ) const;
|
||||||
|
@ -33,9 +33,9 @@
|
|||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
|
|
||||||
vcl::I18nHelper::I18nHelper( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF, const ::com::sun::star::lang::Locale& rLocale )
|
vcl::I18nHelper::I18nHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::lang::Locale& rLocale )
|
||||||
{
|
{
|
||||||
mxMSF = rxMSF;
|
m_xContext = rxContext;
|
||||||
maLocale = rLocale;
|
maLocale = rLocale;
|
||||||
mpLocaleDataWrapper = NULL;
|
mpLocaleDataWrapper = NULL;
|
||||||
mpTransliterationWrapper= NULL;
|
mpTransliterationWrapper= NULL;
|
||||||
@ -64,7 +64,7 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co
|
|||||||
if ( mbTransliterateIgnoreCase )
|
if ( mbTransliterateIgnoreCase )
|
||||||
nModules |= i18n::TransliterationModules_IGNORE_CASE;
|
nModules |= i18n::TransliterationModules_IGNORE_CASE;
|
||||||
|
|
||||||
((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( comphelper::getComponentContext(mxMSF), (i18n::TransliterationModules)nModules );
|
((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( m_xContext, (i18n::TransliterationModules)nModules );
|
||||||
((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( MsLangId::convertLocaleToLanguage( maLocale ) );
|
((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( MsLangId::convertLocaleToLanguage( maLocale ) );
|
||||||
}
|
}
|
||||||
return *mpTransliterationWrapper;
|
return *mpTransliterationWrapper;
|
||||||
@ -74,7 +74,7 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const
|
|||||||
{
|
{
|
||||||
if ( !mpLocaleDataWrapper )
|
if ( !mpLocaleDataWrapper )
|
||||||
{
|
{
|
||||||
((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( mxMSF, maLocale );
|
((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( m_xContext, maLocale );
|
||||||
}
|
}
|
||||||
return *mpLocaleDataWrapper;
|
return *mpLocaleDataWrapper;
|
||||||
}
|
}
|
||||||
|
@ -1579,7 +1579,7 @@ LanguageType AllSettings::GetUILanguage() const
|
|||||||
const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
|
const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
|
||||||
{
|
{
|
||||||
if ( !mpData->mpLocaleDataWrapper )
|
if ( !mpData->mpLocaleDataWrapper )
|
||||||
((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
|
((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetLocale() );
|
||||||
return *mpData->mpLocaleDataWrapper;
|
return *mpData->mpLocaleDataWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1588,7 +1588,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
|
|||||||
const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
|
const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
|
||||||
{
|
{
|
||||||
if ( !mpData->mpUILocaleDataWrapper )
|
if ( !mpData->mpUILocaleDataWrapper )
|
||||||
((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetUILocale() );
|
((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetUILocale() );
|
||||||
return *mpData->mpUILocaleDataWrapper;
|
return *mpData->mpUILocaleDataWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,8 +1597,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
|
|||||||
const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
|
const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
|
||||||
{
|
{
|
||||||
if ( !mpData->mpI18nHelper ) {
|
if ( !mpData->mpI18nHelper ) {
|
||||||
::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory());
|
((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetLocale() );
|
||||||
((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( aFactory, GetLocale() );
|
|
||||||
}
|
}
|
||||||
return *mpData->mpI18nHelper;
|
return *mpData->mpI18nHelper;
|
||||||
}
|
}
|
||||||
@ -1608,8 +1607,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
|
|||||||
const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
|
const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
|
||||||
{
|
{
|
||||||
if ( !mpData->mpUII18nHelper ) {
|
if ( !mpData->mpUII18nHelper ) {
|
||||||
::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory());
|
((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetUILocale() );
|
||||||
((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( aFactory, GetUILocale() );
|
|
||||||
}
|
}
|
||||||
return *mpData->mpUII18nHelper;
|
return *mpData->mpUII18nHelper;
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const
|
|||||||
{
|
{
|
||||||
if ( !mpLocaleDataWrapper )
|
if ( !mpLocaleDataWrapper )
|
||||||
{
|
{
|
||||||
((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
|
((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( GetLocale() );
|
||||||
}
|
}
|
||||||
return *mpLocaleDataWrapper;
|
return *mpLocaleDataWrapper;
|
||||||
}
|
}
|
||||||
|
@ -2970,7 +2970,7 @@ void TextEngine::SetLocale( const ::com::sun::star::lang::Locale& rLocale )
|
|||||||
LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
|
LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
|
||||||
{
|
{
|
||||||
if ( !mpLocaleDataWrapper )
|
if ( !mpLocaleDataWrapper )
|
||||||
mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
|
mpLocaleDataWrapper = new LocaleDataWrapper( GetLocale() );
|
||||||
|
|
||||||
return mpLocaleDataWrapper;
|
return mpLocaleDataWrapper;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,10 @@ class SvXMLStylesContext;
|
|||||||
struct SvXMLNumberInfo;
|
struct SvXMLNumberInfo;
|
||||||
class SvNumberFormatter;
|
class SvNumberFormatter;
|
||||||
class SvtSysLocale;
|
class SvtSysLocale;
|
||||||
|
namespace com { namespace sun { namespace star { namespace lang {
|
||||||
|
class XMultiServiceFactory;
|
||||||
|
}}}}
|
||||||
|
|
||||||
|
|
||||||
// use SvXMLNumFmtHelper in the context for <office:styles> to create
|
// use SvXMLNumFmtHelper in the context for <office:styles> to create
|
||||||
// child contexts for data styles
|
// child contexts for data styles
|
||||||
|
@ -247,7 +247,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
|
|||||||
{
|
{
|
||||||
pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
||||||
pFormatter->GetLocale() );
|
pFormatter->GetLocale() );
|
||||||
pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
|
pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
||||||
pFormatter->GetLocale() );
|
pFormatter->GetLocale() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -255,7 +255,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
|
|||||||
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
|
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
|
||||||
|
|
||||||
pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
||||||
pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
|
pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
||||||
}
|
}
|
||||||
|
|
||||||
pUsedList = new SvXMLNumUsedList_Impl;
|
pUsedList = new SvXMLNumUsedList_Impl;
|
||||||
@ -282,7 +282,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
|
|||||||
{
|
{
|
||||||
pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
||||||
pFormatter->GetLocale() );
|
pFormatter->GetLocale() );
|
||||||
pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
|
pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
|
||||||
pFormatter->GetLocale() );
|
pFormatter->GetLocale() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -290,7 +290,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
|
|||||||
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
|
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
|
||||||
|
|
||||||
pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
||||||
pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
|
pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
|
||||||
}
|
}
|
||||||
|
|
||||||
pUsedList = new SvXMLNumUsedList_Impl;
|
pUsedList = new SvXMLNumUsedList_Impl;
|
||||||
|
@ -609,8 +609,8 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
|
|||||||
{
|
{
|
||||||
if ( !pLocaleData )
|
if ( !pLocaleData )
|
||||||
pLocaleData = new LocaleDataWrapper(
|
pLocaleData = new LocaleDataWrapper(
|
||||||
(pFormatter ? pFormatter->GetServiceManager() :
|
comphelper::getComponentContext(
|
||||||
mxServiceFactory),
|
pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory),
|
||||||
MsLangId::convertLanguageToLocale( nLang ) );
|
MsLangId::convertLanguageToLocale( nLang ) );
|
||||||
else
|
else
|
||||||
pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) );
|
pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user