normalize resource locale ctor construction mechanisms

make them all the same and share std::locales more

various OModuleClient, etc, classes go away

Change-Id: I7e3ff01a69332eeacd22e3078f66a60318de62d5
Reviewed-on: https://gerrit.libreoffice.org/40634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2017-08-01 13:50:45 +01:00
parent 13cadf3fe3
commit 13fac4894f
96 changed files with 166 additions and 909 deletions

View file

@ -22,41 +22,7 @@
#include <rtl/ustring.hxx>
#define TK_RES_STRING(id) ::accessibility::TkResMgr::loadString(id)
// TkResMgr
namespace accessibility
{
class TkResMgr
{
static std::locale* m_pImpl;
private:
// no instantiation allowed
TkResMgr() = delete;
~TkResMgr() { }
// we'll instantiate one static member of the following class,
// which in its dtor ensures that m_pImpl will be deleted
class EnsureDelete
{
public:
EnsureDelete() { }
~EnsureDelete();
};
friend class EnsureDelete;
protected:
static void ensureImplExists();
public:
// loads the string with the specified resource id
static OUString loadString(const char *pResId);
};
}
OUString AccResId(const char* pId);
#endif // INCLUDED_ACCESSIBILITY_INC_HELPER_ACCRESMGR_HXX

View file

@ -113,8 +113,8 @@ namespace accessibility
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
return TK_RES_STRING(RID_STR_ACC_COLUMN_NUM).replaceAll("%COLUMNNUMBER", OUString::number(getColumnPos()-1)) + ", "
+ TK_RES_STRING(RID_STR_ACC_ROW_NUM).replaceAll("%ROWNUMBER", OUString::number(getRowPos()));
return AccResId(RID_STR_ACC_COLUMN_NUM).replaceAll("%COLUMNNUMBER", OUString::number(getColumnPos()-1)) + ", "
+ AccResId(RID_STR_ACC_ROW_NUM).replaceAll("%ROWNUMBER", OUString::number(getRowPos()));
}
css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL EditBrowseBoxTableCell::getAccessibleRelationSet()

View file

@ -822,8 +822,8 @@ namespace accessibility
{
if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
return getListBox()->IsExpanded( pEntry ) ?
TK_RES_STRING(STR_SVT_ACC_ACTION_COLLAPSE) :
TK_RES_STRING(STR_SVT_ACC_ACTION_EXPAND);
AccResId(STR_SVT_ACC_ACTION_COLLAPSE) :
AccResId(STR_SVT_ACC_ACTION_EXPAND);
return OUString();
}

View file

@ -20,40 +20,10 @@
#include <helper/accresmgr.hxx>
#include <unotools/resmgr.hxx>
using namespace accessibility;
// TkResMgr
std::locale* TkResMgr::m_pImpl = nullptr;
TkResMgr::EnsureDelete::~EnsureDelete()
OUString AccResId(const char* pId)
{
delete TkResMgr::m_pImpl;
}
void TkResMgr::ensureImplExists()
{
if (m_pImpl)
return;
m_pImpl = new std::locale(Translate::Create("acc"));
if (m_pImpl)
{
// now that we have a impl class, make sure it's deleted on unloading the library
static TkResMgr::EnsureDelete s_aDeleteTheImplClass;
}
}
OUString TkResMgr::loadString(const char *pResId)
{
OUString sReturn;
ensureImplExists();
if (m_pImpl)
sReturn = Translate::get(pResId, *m_pImpl);
return sReturn;
static std::locale loc = Translate::Create("acc");
return Translate::get(pId, loc);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -149,7 +149,7 @@ OUString VCLXAccessibleButton::getAccessibleName( )
if ( nLength == 3 )
{
// it's a browse button
aName = TK_RES_STRING( RID_STR_ACC_NAME_BROWSEBUTTON );
aName = AccResId( RID_STR_ACC_NAME_BROWSEBUTTON );
}
else
{

View file

@ -218,9 +218,9 @@ OUString VCLXAccessibleCheckBox::getAccessibleActionDescription ( sal_Int32 nInd
throw IndexOutOfBoundsException();
if(IsChecked())
return TK_RES_STRING( RID_STR_ACC_ACTION_UNCHECK );
return AccResId( RID_STR_ACC_ACTION_UNCHECK );
else
return TK_RES_STRING( RID_STR_ACC_ACTION_CHECK );
return AccResId( RID_STR_ACC_ACTION_CHECK );
}

View file

@ -265,9 +265,9 @@ OUString VCLXAccessibleScrollBar::getAccessibleName( )
if ( pVCLXScrollBar )
{
if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::HORIZONTAL )
aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL );
aName = AccResId( RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL );
else if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::VERTICAL )
aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_VERTICAL );
aName = AccResId( RID_STR_ACC_SCROLLBAR_NAME_VERTICAL );
}
return aName;
}

View file

@ -359,7 +359,7 @@ OUString SAL_CALL VCLXAccessibleToolBoxItem::getAccessibleDescription( )
if (m_nRole == AccessibleRole::PANEL && getAccessibleChildCount() > 0)
{
return TK_RES_STRING( RID_STR_ACC_PANEL_DESCRIPTION );
return AccResId( RID_STR_ACC_PANEL_DESCRIPTION );
}
else
{

View file

@ -1,27 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_BASIC_INC_BASRID_HXX
#define INCLUDED_BASIC_INC_BASRID_HXX
OUString BasResId(const char* pId);
#endif // INCLUDED_BASIC_INC_BASRID_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -35,7 +35,6 @@
#include "stdobj.hxx"
#include "filefmt.hxx"
#include "basic.hrc"
#include <basrid.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XCloseBroadcaster.hpp>

View file

@ -35,13 +35,11 @@ struct BasicDLL::Impl
bool bDebugMode;
bool bBreakEnabled;
std::locale aBasResLocale;
std::unique_ptr<SbxAppData> xSbxAppData;
Impl()
: bDebugMode(false)
, bBreakEnabled(true)
, aBasResLocale(Translate::Create("sb"))
, xSbxAppData(new SbxAppData)
{ }
};
@ -52,11 +50,6 @@ BasicDLL * BASIC_DLL;
}
OUString BasResId(const char* pId)
{
return Translate::get(pId, BASIC_DLL->GetBasResLocale());
}
BasicDLL::BasicDLL()
: m_xImpl(new Impl)
{
@ -67,8 +60,6 @@ BasicDLL::~BasicDLL()
{
}
const std::locale& BasicDLL::GetBasResLocale() const { return m_xImpl->aBasResLocale; }
void BasicDLL::EnableBreak( bool bEnable )
{
BasicDLL* pThis = BASIC_DLL;

View file

@ -579,21 +579,20 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
}
}
namespace
{
const std::locale& implGetResLocale()
const std::locale& BasResLocale()
{
static std::locale loc(Translate::Create("sb"));
return loc;
}
OUString SbxValueFormatResId(const char *pId)
OUString BasResId(const char *pId)
{
return Translate::get(pId, implGetResLocale());
return Translate::get(pId, BasResLocale());
}
namespace
{
enum class VbaFormatType
{
Offset, // standard number format
@ -820,13 +819,13 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
// initialize the Basic-formater help object:
// get resources for predefined output
// of the Format()-command, e. g. for "On/Off"
OUString aOnStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_ON);
OUString aOffStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_OFF);
OUString aYesStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_YES);
OUString aNoStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_NO);
OUString aTrueStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_TRUE);
OUString aFalseStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_FALSE);
OUString aCurrencyFormatStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_CURRENCY);
OUString aOnStrg = BasResId(STR_BASICKEY_FORMAT_ON);
OUString aOffStrg = BasResId(STR_BASICKEY_FORMAT_OFF);
OUString aYesStrg = BasResId(STR_BASICKEY_FORMAT_YES);
OUString aNoStrg = BasResId(STR_BASICKEY_FORMAT_NO);
OUString aTrueStrg = BasResId(STR_BASICKEY_FORMAT_TRUE);
OUString aFalseStrg = BasResId(STR_BASICKEY_FORMAT_FALSE);
OUString aCurrencyFormatStrg = BasResId(STR_BASICKEY_FORMAT_CURRENCY);
rAppData.pBasicFormater = o3tl::make_unique<SbxBasicFormater>(
cComma,c1000,aOnStrg,aOffStrg,

View file

@ -794,10 +794,6 @@ include/svtools/editsyntaxhighlighter.hxx:42
void MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight(class vcl::Window *,long,enum HighlighterLanguage)
enum HighlighterLanguage aLanguage
1
include/svtools/ehdl.hxx:36
void SfxErrorContext::SfxErrorContext(unsigned short,class vcl::Window *,unsigned short,class ResMgr *)
class ResMgr * pMgrP
0
include/svtools/fileview.hxx:176
void SvtFileView::EnableDelete(_Bool)
_Bool bEnable

View file

@ -78,28 +78,22 @@ namespace connectivity
SQLException
impl_buildSQLException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext,
const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
/// initializes our resource bundle
bool impl_initResources();
private:
::osl::Mutex m_aMutex;
std::unique_ptr<std::locale> m_xResources;
bool m_bAttemptedInit;
std::locale m_aResources;
};
SQLError_Impl::SQLError_Impl() : m_bAttemptedInit( false )
SQLError_Impl::SQLError_Impl()
: m_aResources(Translate::Create("cnr"))
{
}
const OUString& SQLError_Impl::getMessagePrefix()
{
static const OUString s_sMessagePrefix( "[OOoBase]" );
return s_sMessagePrefix;
}
namespace
{
@ -239,12 +233,9 @@ namespace connectivity
{
OUStringBuffer aMessage;
if ( impl_initResources() )
{
OUString sResMessage(Translate::get(lcl_getResourceErrorID(_eCondition), *m_xResources));
OSL_ENSURE( !sResMessage.isEmpty(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" );
aMessage.append( getMessagePrefix() ).append( " " ).append( sResMessage );
}
OUString sResMessage(Translate::get(lcl_getResourceErrorID(_eCondition), m_aResources));
OSL_ENSURE( !sResMessage.isEmpty(), "SQLError_Impl::impl_getErrorMessage: illegal error condition, or invalid resource!" );
aMessage.append( getMessagePrefix() ).append( " " ).append( sResMessage );
return aMessage.makeStringAndClear();
}
@ -257,20 +248,6 @@ namespace connectivity
return sState;
}
bool SQLError_Impl::impl_initResources()
{
if (m_xResources.get())
return true;
if (m_bAttemptedInit)
return false;
::osl::MutexGuard aGuard( m_aMutex );
m_bAttemptedInit = true;
m_xResources.reset(new std::locale(Translate::Create("cnr")));
return m_xResources.get() != nullptr;
}
SQLError::SQLError()
:m_pImpl( new SQLError_Impl )
{

View file

@ -177,7 +177,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
xNewDic = nullptr;
// error: couldn't create new dictionary
SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
this, getRID_SVXERRCTX(), &SvxResLocale() );
this, getRID_SVXERRCTX(), SvxResLocale() );
ErrorHandler::HandleError( *new StringErrorInfo(
ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
EndDialog();

View file

@ -822,7 +822,7 @@ void SvxBackgroundTabPage::RaiseLoadError_Impl()
OUString(),
this,
getRID_SVXERRCTX(),
&SvxResLocale() );
SvxResLocale() );
ErrorHandler::HandleError(
*new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,

View file

@ -32,22 +32,11 @@ namespace dbaccess
// handling resources within the DBA-Core library
class OOO_DLLPUBLIC_DBA ResourceManager
{
friend class OModuleClient;
static sal_Int32 s_nClients; /// number of registered clients
static std::locale* m_pImpl;
private:
// no instantiation allowed
ResourceManager() = delete;
~ResourceManager() { }
protected:
static void ensureImplExists();
/// register a client for the module
static void registerClient();
/// revoke a client for the module
static void revokeClient();
public:
/** loads the string with the specified resource id
*/
@ -89,16 +78,6 @@ namespace dbaccess
const OUString& _rReplace2
);
};
// OModuleClient
/** base class for objects which uses any global module-specific resources
*/
class OModuleClient
{
public:
OModuleClient() { ResourceManager::registerClient(); }
~OModuleClient() { ResourceManager::revokeClient(); }
};
}
#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CORE_RESOURCE_HXX

View file

@ -73,7 +73,6 @@ namespace dbaccess
public ::comphelper::OPropertyStateContainer,
public ::comphelper::OPropertyArrayUsageHelper<ORowSetBase> // this class hold the static property info
{
OModuleClient m_aModuleClient;
protected:
typedef std::vector<ORowSetDataColumn*> TDataColumns;
::osl::Mutex* m_pMutex; // this the mutex form the rowset itself

View file

@ -165,7 +165,6 @@ public:
};
private:
OModuleClient m_aModuleClient;
css::uno::WeakReference< css::frame::XModel > m_xModel;
css::uno::WeakReference< css::sdbc::XDataSource > m_xDataSource;

View file

@ -27,7 +27,6 @@
namespace dbaccess
{
// ResourceManager
namespace
{
@ -35,26 +34,10 @@ namespace dbaccess
struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
}
sal_Int32 ResourceManager::s_nClients = 0;
std::locale* ResourceManager::m_pImpl = nullptr;
void ResourceManager::ensureImplExists()
{
if (m_pImpl)
return;
m_pImpl = new std::locale(Translate::Create("dba"));
}
OUString ResourceManager::loadString(const char* pResId)
{
OUString sReturn;
ensureImplExists();
if (m_pImpl)
sReturn = Translate::get(pResId, *m_pImpl);
return sReturn;
static std::locale loc = Translate::Create("dba");
return Translate::get(pResId, loc);
}
OUString ResourceManager::loadString(const char* pResId, const sal_Char* _pPlaceholderAscii, const OUString& _rReplace)
@ -71,22 +54,6 @@ namespace dbaccess
sString = sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii2), _rReplace2 );
return sString;
}
void ResourceManager::registerClient()
{
::osl::MutexGuard aGuard(theResourceManagerMutex::get());
++s_nClients;
}
void ResourceManager::revokeClient()
{
::osl::MutexGuard aGuard(theResourceManagerMutex::get());
if (!--s_nClients && m_pImpl)
{
delete m_pImpl;
m_pImpl = nullptr;
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -94,7 +94,6 @@ namespace dbaui
css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
dbaccess::OModuleClient m_aModuleClient;
TransferableDataHelper m_aSystemClipboard; // content of the clipboard
css::uno::Reference< css::beans::XPropertySet >
m_xDataSource;

View file

@ -30,7 +30,6 @@ namespace dbaui
class OPropColumnEditCtrl : public OSQLNameEdit
{
dbaccess::OModuleClient m_aModuleClient;
short m_nPos;
OUString m_strHelpText;
public:
@ -44,7 +43,6 @@ namespace dbaui
class OPropEditCtrl : public Edit
{
dbaccess::OModuleClient m_aModuleClient;
short m_nPos;
OUString m_strHelpText;

View file

@ -29,8 +29,6 @@ namespace dbaui
class OCommentUndoAction : public SfxUndoAction
{
dbaccess::OModuleClient m_aModuleClient;
protected:
OUString m_strComment; // undo, redo comment

View file

@ -43,7 +43,6 @@ namespace dbaui
class OJoinController : public OJoinController_BASE
{
dbaccess::OModuleClient m_aModuleClient;
protected:
TTableConnectionData m_vTableConnectionData;
TTableWindowData m_vTableData;

View file

@ -35,7 +35,6 @@ namespace dbaui
class ORelationDialog : public ModalDialog
,public IRelationControlInterface
{
dbaccess::OModuleClient m_aModuleClient;
std::unique_ptr<OTableListBoxControl> m_xTableControl;
OJoinTableView::OTableWindowMap* m_pTableMap;

View file

@ -38,7 +38,6 @@ namespace dbaui
class OTableController : public OTableController_BASE
{
private:
dbaccess::OModuleClient m_aModuleClient;
std::vector< std::shared_ptr<OTableRow> > m_vRowList;
OTypeInfoMap m_aTypeInfo;
std::vector<OTypeInfoMap::iterator> m_aTypeInfoIndex;

View file

@ -43,8 +43,6 @@ class OTableGrantControl : public ::svt::EditBrowseBox
typedef std::map<OUString, TPrivileges> TTablePrivilegeMap;
dbaccess::OModuleClient m_aModuleClient;
css::uno::Reference< css::container::XNameAccess > m_xUsers;
css::uno::Reference< css::container::XNameAccess > m_xTables;
css::uno::Reference< css::uno::XComponentContext> m_xContext;

View file

@ -183,7 +183,6 @@ namespace dbaui
class ORowSetImportExport : public ODatabaseImportExport
{
dbaccess::OModuleClient m_aModuleClient;
std::vector<sal_Int32> m_aColumnMapping;
std::vector<sal_Int32> m_aColumnTypes;
css::uno::Reference< css::sdbc::XResultSetUpdate > m_xTargetResultSetUpdate;

View file

@ -43,9 +43,8 @@ namespace dbaui
/** implements the user admin dialog
*/
class OUserAdminDlg : public SfxTabDialog, public IItemSetHelper, public IDatabaseSettingsDialog, public dbaccess::OModuleClient
class OUserAdminDlg : public SfxTabDialog, public IItemSetHelper, public IDatabaseSettingsDialog
{
dbaccess::OModuleClient m_aModuleClient;
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
SfxItemSet* m_pItemSet;
css::uno::Reference< css::sdbc::XConnection> m_xConnection;

View file

@ -38,7 +38,6 @@ namespace dbaui
,public IItemSetHelper
,public IDatabaseSettingsDialog
{
dbaccess::OModuleClient m_aModuleClient;
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
protected:

View file

@ -76,7 +76,6 @@ namespace dbaui
// for implementing the XFormController
class FormControllerImpl;
friend class FormControllerImpl;
dbaccess::OModuleClient m_aModuleClient;
css::uno::Reference< css::sdbc::XRowSet > m_xRowSet; // our rowset
css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xColumnsSupplier; // queried from the rowset member

View file

@ -51,7 +51,6 @@ namespace dbaui
class IContextMenuProvider;
class DBTreeListBox :public SvTreeListBox
{
dbaccess::OModuleClient m_aModuleClient;
OScrollHelper m_aScrollHelper;
Timer m_aTimer; // is needed for table updates
Point m_aMousePos;

View file

@ -52,10 +52,9 @@ class OGeneralPage;
class ODbDataSourceAdministrationHelper;
/** tab dialog for administrating the office wide registered data sources
*/
class ODbTypeWizDialog : public svt::OWizardMachine , public IItemSetHelper, public IDatabaseSettingsDialog, public dbaccess::OModuleClient
class ODbTypeWizDialog : public svt::OWizardMachine , public IItemSetHelper, public IDatabaseSettingsDialog
{
private:
dbaccess::OModuleClient m_aModuleClient;
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
SfxItemSet* m_pOutSet;
::dbaccess::ODsnTypeCollection*

View file

@ -56,10 +56,9 @@ class ODbDataSourceAdministrationHelper;
class OMySQLIntroPageSetup;
class OFinalDBPageSetup;
class ODbTypeWizDialogSetup : public svt::RoadmapWizard , public IItemSetHelper, public IDatabaseSettingsDialog, public dbaccess::OModuleClient
class ODbTypeWizDialogSetup : public svt::RoadmapWizard , public IItemSetHelper, public IDatabaseSettingsDialog
{
private:
dbaccess::OModuleClient m_aModuleClient;
std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl;
SfxItemSet* m_pOutSet;
OUString m_sURL;

View file

@ -46,7 +46,6 @@ namespace dbaui
,public ::utl::OEventListenerAdapter
{
protected:
dbaccess::OModuleClient m_aModuleClient;
::osl::Mutex m_aMutex;
VclPtr<MultiLineEditSyntaxHighlight> m_pSQL;

View file

@ -120,7 +120,6 @@ namespace dbaui
,public SbaXFormAdapter_BASE3
{
private:
dbaccess::OModuleClient m_aModuleClient;
css::uno::Reference< css::sdbc::XRowSet > m_xMainForm;
::osl::Mutex m_aMutex;

View file

@ -33,7 +33,6 @@ namespace dbaui
// IndexFieldsControl
class IndexFieldsControl : public ::svt::EditBrowseBox
{
dbaccess::OModuleClient m_aModuleClient;
protected:
IndexFields m_aSavedValue;

View file

@ -37,7 +37,6 @@ typedef ::svt::OGenericUnoDialog ODatabaseAdministrationDialogBase;
class ODatabaseAdministrationDialog
:public ODatabaseAdministrationDialogBase
{
dbaccess::OModuleClient m_aModuleClient;
protected:
SfxItemSet* m_pDatasourceItems; // item set for the dialog
SfxItemPool* m_pItemPool; // item pool for the item set for the dialog

View file

@ -32,7 +32,6 @@ class OSQLMessageDialog
:public OSQLMessageDialogBase
,public ::comphelper::OPropertyArrayUsageHelper< OSQLMessageDialog >
{
dbaccess::OModuleClient m_aModuleClient;
protected:
// <properties>
css::uno::Any m_aException;

View file

@ -125,7 +125,6 @@ namespace dbaui
::boost::optional< bool > m_aDocScriptSupport;
public:
dbaccess::OModuleClient m_aModuleClient;
::dbtools::SQLExceptionInfo m_aCurrentError;
::comphelper::OInterfaceContainerHelper2

View file

@ -41,7 +41,6 @@ namespace dbaui
:public svt::OGenericUnoDialog
,public ComposerDialog_PBASE
{
dbaccess::OModuleClient m_aModuleClient;
protected:
// <properties>
css::uno::Reference< css::sdb::XSingleSelectQueryComposer >

View file

@ -62,7 +62,6 @@ namespace dbaui
class BasicInteractionHandler
:public BasicInteractionHandler_Base
{
const dbaccess::OModuleClient m_aModuleClient;
const css::uno::Reference< css::uno::XComponentContext >
m_xContext;
const bool m_bFallbackToGeneric;

View file

@ -63,7 +63,6 @@ namespace dbaui
,public OTextConnectionSettingsDialog_PBASE
,public ::cppu::WeakImplHelper< css::sdb::XTextConnectionSettings >
{
dbaccess::OModuleClient m_aModuleClient;
PropertyValues m_aPropertyValues;
protected:

View file

@ -40,7 +40,6 @@ namespace dbaui
:public ODirectSQLDialog_BASE
,public ODirectSQLDialog_PBASE
{
dbaccess::OModuleClient m_aModuleClient;
OUString m_sInitialSelection;
css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection;
protected:

View file

@ -886,7 +886,8 @@ Reference< XInterface > SAL_CALL T602ImportFilter_createInstance( const Referenc
}
T602ImportFilterDialog::T602ImportFilterDialog()
: mpResLocale(nullptr)
: maLocale(SvtSysLocale().GetUILanguageTag())
, maResLocale(Translate::Create("flt"))
{
}
@ -896,15 +897,19 @@ T602ImportFilterDialog::~T602ImportFilterDialog()
// XLocalizable
void SAL_CALL T602ImportFilterDialog::setLocale( const Locale& eLocale )
void SAL_CALL T602ImportFilterDialog::setLocale(const Locale& rLocale)
{
meLocale = eLocale;
initLocale();
LanguageTag aLocale(rLocale);
if (maLocale != aLocale)
{
maLocale = aLocale;
maResLocale = Translate::Create("flt", maLocale);
}
}
Locale SAL_CALL T602ImportFilterDialog::getLocale()
{
return meLocale;
return maLocale.getLocale(false);
}
bool T602ImportFilterDialog::OptionsDlg()
@ -1088,18 +1093,6 @@ bool T602ImportFilterDialog::OptionsDlg()
return ret;
}
void T602ImportFilterDialog::initLocale()
{
mpResLocale.reset(new std::locale(Translate::Create("flt", LanguageTag(meLocale))));
}
const std::locale* T602ImportFilterDialog::getResLocale()
{
if (!mpResLocale)
initLocale();
return mpResLocale.get();
}
void SAL_CALL T602ImportFilterDialog::setTitle( const OUString& )
{
}
@ -1114,7 +1107,7 @@ sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
OUString T602ImportFilterDialog::getResStr(const char* resid)
{
return Translate::get(resid, *getResLocale());
return Translate::get(resid, maResLocale);
}
uno::Sequence<beans::PropertyValue> SAL_CALL T602ImportFilterDialog::getPropertyValues()

View file

@ -33,6 +33,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <cppuhelper/implbase.hxx>
#include <xmloff/attrlist.hxx>
#include <i18nlangtag/languagetag.hxx>
namespace T602ImportFilter {
@ -82,12 +83,10 @@ class T602ImportFilterDialog : public cppu::WeakImplHelper <
css::beans::XPropertyAccess
>
{
css::lang::Locale meLocale;
std::unique_ptr<std::locale> mpResLocale;
LanguageTag maLocale;
std::locale maResLocale;
bool OptionsDlg();
const std::locale* getResLocale();
OUString getResStr(const char* resid);
void initLocale();
virtual ~T602ImportFilterDialog() override;

View file

@ -82,6 +82,7 @@ struct application_info_impl
extern std::vector< application_info_impl* >& getApplicationInfos();
extern OUString getApplicationUIName( const OUString& rServiceName );
extern const application_info_impl* getApplicationInfo( const OUString& rServiceName );
OUString XsltResId(const char* pId);
#endif

View file

@ -58,36 +58,10 @@ using namespace com::sun::star::util;
using ::rtl::Uri;
namespace {
static std::locale* pXSLTResLocale = nullptr;
const std::locale* getXSLTDialogResLocale()
{
return pXSLTResLocale;
}
}
EnsureResLocale::EnsureResLocale()
OUString XsltResId(const char* pId)
{
if (!pXSLTResLocale)
{
m_xResLocale.reset(new std::locale(Translate::Create("flt")));
pXSLTResLocale = m_xResLocale.get();
}
}
EnsureResLocale::~EnsureResLocale()
{
if (m_xResLocale)
pXSLTResLocale = nullptr;
}
namespace
{
OUString XsltResId(const char* pId)
{
return Translate::get(pId, *getXSLTDialogResLocale());
}
static std::locale loc = Translate::Create("flt");
return Translate::get(pId, loc);
}
XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent,
@ -263,7 +237,7 @@ void XMLFilterSettingsDialog::onNew()
aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";
// execute XML Filter Dialog
ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResLocale(), mxContext, &aTempInfo );
ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, mxContext, &aTempInfo );
if ( aDlg->Execute() == RET_OK )
{
// insert the new filter
@ -282,7 +256,7 @@ void XMLFilterSettingsDialog::onEdit()
filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
// execute XML Filter Dialog
ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResLocale(), mxContext, pOldInfo );
ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, mxContext, pOldInfo );
if ( aDlg->Execute() == RET_OK )
{
filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();

View file

@ -55,20 +55,11 @@ public:
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
};
class EnsureResLocale
{
std::unique_ptr<std::locale> m_xResLocale;
public:
EnsureResLocale();
~EnsureResLocale();
};
class HeaderBar;
class XMLFilterListBox : public SvTabListBox
{
private:
EnsureResLocale m_aEnsureResLocale;
VclPtr<HeaderBar> m_pHeaderBar;
DECL_LINK( TabBoxScrollHdl_Impl, SvTreeListBox*, void );
@ -127,7 +118,6 @@ private:
OUString createUniqueInterfaceName( const OUString& rInterfaceName );
private:
EnsureResLocale maEnsureResLocale;
css::uno::Reference< css::uno::XComponentContext > mxContext;
css::uno::Reference< css::container::XNameContainer > mxFilterContainer;
css::uno::Reference< css::container::XNameContainer > mxTypeDetection;

View file

@ -36,11 +36,10 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent, const std::locale& rResLocale,
XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent,
const Reference< XComponentContext >& rxContext, const filter_info_impl* pInfo)
: TabDialog(pParent, "XSLTFilterDialog","filter/ui/xsltfilterdialog.ui")
, mxContext(rxContext)
, mrResLocale(rResLocale)
{
get(m_pOKBtn, "ok");
get(m_pTabCtrl, "tabcontrol");
@ -250,7 +249,7 @@ bool XMLFilterTabDialog::onOk()
m_pTabCtrl->SetCurPageId(nErrorPage);
ActivatePageHdl(nullptr, m_pTabCtrl);
OUString aMessage(Translate::get(pErrorId, mrResLocale));
OUString aMessage(XsltResId(pErrorId));
if( aReplace2.getLength() )
{

View file

@ -33,7 +33,7 @@ class XMLFilterTabPageXSLT;
class XMLFilterTabDialog: public TabDialog
{
public:
XMLFilterTabDialog(vcl::Window *pParent, const std::locale& rResLocale, const css::uno::Reference< css::uno::XComponentContext >& rxContext, const filter_info_impl* pInfo);
XMLFilterTabDialog(vcl::Window *pParent, const css::uno::Reference< css::uno::XComponentContext >& rxContext, const filter_info_impl* pInfo);
virtual ~XMLFilterTabDialog() override;
virtual void dispose() override;
@ -47,8 +47,6 @@ private:
DECL_STATIC_LINK( XMLFilterTabDialog, ActivatePageHdl, TabControl*, void );
DECL_LINK(OkHdl, Button*, void);
const std::locale& mrResLocale;
const filter_info_impl* mpOldInfo;
filter_info_impl* mpNewInfo;

View file

@ -12,7 +12,6 @@ $(eval $(call gb_Library_Library,for))
$(eval $(call gb_Library_set_include,for,\
$$(INCLUDE) \
-I$(SRCDIR)/formula/inc \
-I$(SRCDIR)/formula/source/core/inc \
))
$(eval $(call gb_Library_add_defs,for,\

View file

@ -12,7 +12,6 @@ $(eval $(call gb_Library_Library,forui))
$(eval $(call gb_Library_set_include,forui,\
$$(INCLUDE) \
-I$(SRCDIR)/formula/inc \
-I$(SRCDIR)/formula/source/ui/inc \
))
$(eval $(call gb_Library_add_defs,forui,\
@ -43,10 +42,8 @@ $(eval $(call gb_Library_add_exception_objects,forui,\
formula/source/ui/dlg/FormulaHelper \
formula/source/ui/dlg/funcpage \
formula/source/ui/dlg/funcutl \
formula/source/ui/dlg/omoduleclient \
formula/source/ui/dlg/parawin \
formula/source/ui/dlg/structpg \
formula/source/ui/resource/ModuleHelper \
))
# vim: set noet sw=4 ts=4:

View file

@ -17,15 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SVL_SOURCE_MISC_GETSTRINGRESOURCE_HXX
#define INCLUDED_SVL_SOURCE_MISC_GETSTRINGRESOURCE_HXX
#ifndef INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
#define INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include <formula/formuladllapi.h>
#include <sal/types.h>
FORMULA_DLLPUBLIC OUString ForResId(const char *pId);
OUString SvlResId(const char* id);
#endif
#endif // INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -235,7 +235,7 @@ void OpCodeList::putDefaultOpCode( const FormulaCompiler::NonConstOpCodeMapPtr&
}
if (!pKey)
return;
OUString sKey = !mbLocalized ? OUString::createFromAscii(pKey) : Translate::get(pKey, ResourceManager::getResLocale());
OUString sKey = !mbLocalized ? OUString::createFromAscii(pKey) : ForResId(pKey);
xMap->putOpCode(sKey, OpCode(nOp), pCharClass);
}
@ -853,7 +853,6 @@ void lcl_fillNativeSymbols( FormulaCompiler::NonConstOpCodeMapPtr& xMap, bool bD
aSymbolMap.mxSymbolMap.reset(
new FormulaCompiler::OpCodeMap(
SC_OPCODE_LAST_OPCODE_ID + 1, true, FormulaGrammar::GRAM_NATIVE_UI));
OModuleClient aModuleClient;
OpCodeList aOpCodeListSymbols(false, RID_STRLIST_FUNCTION_NAMES_SYMBOLS, aSymbolMap.mxSymbolMap);
OpCodeList aOpCodeListNative(true, RID_STRLIST_FUNCTION_NAMES, aSymbolMap.mxSymbolMap);
// No AddInMap for native core mapping.
@ -949,7 +948,6 @@ void FormulaCompiler::loadSymbols(const std::pair<const char*, int>* pSymbols, F
{
// not Core
rxMap.reset( new OpCodeMap( SC_OPCODE_LAST_OPCODE_ID + 1, eGrammar != FormulaGrammar::GRAM_ODFF, eGrammar ));
OModuleClient aModuleClient;
OpCodeList aOpCodeList(false, pSymbols, rxMap, eSepType);
fillFromAddInMap( rxMap, eGrammar);

View file

@ -1,72 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
#define INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
#include <rtl/ustring.hxx>
namespace formula
{
//= ResourceManager
//= handling resources within the FORMULA-Core library
class ResourceManager
{
friend class OModuleClient;
static sal_Int32 s_nClients; /// number of registered clients
static std::locale* m_pImpl;
private:
// no instantiation allowed
ResourceManager() = delete;
~ResourceManager() { }
protected:
static void ensureImplExists();
/// register a client for the module
static void registerClient();
/// revoke a client for the module
static void revokeClient();
public:
static const std::locale& getResLocale();
};
//= OModuleClient
/** base class for objects which uses any global module-specific resources
*/
class OModuleClient
{
public:
OModuleClient() { ResourceManager::registerClient(); }
~OModuleClient() { ResourceManager::revokeClient(); }
};
} // formula
#endif // INCLUDED_FORMULA_SOURCE_CORE_INC_CORE_RESOURCE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -16,63 +16,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <unotools/resmgr.hxx>
#include "core_resource.hxx"
#include <unotools/resmgr.hxx>
// ---- needed as long as we have no contexts for components ---
#include <rtl/instance.hxx>
#include <svl/solar.hrc>
namespace formula
OUString ForResId(const char *pId)
{
//= ResourceManager
namespace
{
// access safety
struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {};
}
sal_Int32 ResourceManager::s_nClients = 0;
std::locale* ResourceManager::m_pImpl = nullptr;
void ResourceManager::ensureImplExists()
{
if (m_pImpl)
return;
m_pImpl = new std::locale(Translate::Create("for"));
}
void ResourceManager::registerClient()
{
::osl::MutexGuard aGuard(theResourceManagerMutex::get());
++s_nClients;
}
void ResourceManager::revokeClient()
{
::osl::MutexGuard aGuard(theResourceManagerMutex::get());
if (!--s_nClients && m_pImpl)
{
delete m_pImpl;
m_pImpl = nullptr;
}
}
const std::locale& ResourceManager::getResLocale()
{
ensureImplExists();
return *m_pImpl;
}
} // formula
static std::locale loc = Translate::Create("for");
return Translate::get(pId, loc);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -50,8 +50,8 @@
#include "formula/formulahelper.hxx"
#include "structpg.hxx"
#include "parawin.hxx"
#include "ModuleHelper.hxx"
#include "strings.hrc"
#include "core_resource.hxx"
#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/sheet/FormulaLanguage.hpp>
#include <com/sun/star/sheet/FormulaMapGroup.hpp>
@ -236,8 +236,8 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
m_pTheRefButton (nullptr),
m_pMEdit (nullptr),
m_bUserMatrixFlag(false),
m_aTitle1 ( ModuleRes( STR_TITLE1 ) ),
m_aTitle2 ( ModuleRes( STR_TITLE2 ) ),
m_aTitle1 ( ForResId( STR_TITLE1 ) ),
m_aTitle2 ( ForResId( STR_TITLE2 ) ),
m_aFormulaHelper(_pFunctionMgr),
m_bIsShutDown (false),
m_bMakingTree (false),

View file

@ -25,7 +25,6 @@
#include "formula/IFunctionDescription.hxx"
#include "funcpage.hxx"
#include "ModuleHelper.hxx"
#include <unotools/syslocale.hxx>
#include <unotools/charclass.hxx>

View file

@ -30,7 +30,6 @@
#include <svtools/treelistbox.hxx>
#include <vector>
#include "formula/omoduleclient.hxx"
namespace formula
{
@ -58,7 +57,6 @@ typedef const IFunctionDescription* TFunctionDesc;
class FuncPage : public TabPage
{
private:
OModuleClient m_aModuleClient;
Link<FuncPage&,void> aDoubleClickLink;
Link<FuncPage&,void> aSelectionLink;
VclPtr<ListBox> m_pLbCategory;

View file

@ -26,9 +26,9 @@
#include "formula/funcutl.hxx"
#include "formula/IControlReferenceHandler.hxx"
#include "ControlHelper.hxx"
#include "ModuleHelper.hxx"
#include "strings.hrc"
#include "bitmaps.hlst"
#include "core_resource.hxx"
#include "com/sun/star/accessibility/AccessibleRole.hpp"
namespace formula
@ -521,8 +521,8 @@ RefButton::RefButton( vcl::Window* _pParent, WinBits nStyle ) :
ImageButton(_pParent, nStyle),
aImgRefStart(BitmapEx(RID_BMP_REFBTN1)),
aImgRefDone(BitmapEx(RID_BMP_REFBTN2)),
aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ) ),
aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ) ),
aShrinkQuickHelp( ForResId( RID_STR_SHRINK ) ),
aExpandQuickHelp( ForResId( RID_STR_EXPAND ) ),
pAnyRefDlg( nullptr ),
pRefEdit( nullptr )
{

View file

@ -1,34 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sal/config.h"
#include "formula/omoduleclient.hxx"
#include "ModuleHelper.hxx"
formula::OModuleClient::OModuleClient() {
OModule::registerClient();
}
formula::OModuleClient::~OModuleClient() {
OModule::revokeClient();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -26,9 +26,9 @@
#include "formula/formdata.hxx"
#include "formula/IFunctionDescription.hxx"
#include <formula/funcvarargs.h>
#include "ModuleHelper.hxx"
#include "strings.hrc"
#include "bitmaps.hlst"
#include "core_resource.hxx"
namespace formula
{
@ -38,8 +38,8 @@ ParaWin::ParaWin(vcl::Window* pParent,IControlReferenceHandler* _pDlg):
TabPage (pParent, "ParameterPage", "formula/ui/parameter.ui"),
pFuncDesc ( nullptr ),
pMyParent (_pDlg),
m_sOptional ( ModuleRes( STR_OPTIONAL ) ),
m_sRequired ( ModuleRes( STR_REQUIRED ) )
m_sOptional ( ForResId( STR_OPTIONAL ) ),
m_sRequired ( ForResId( STR_REQUIRED ) )
{
get(m_pFtEditDesc, "editdesc");
get(m_pFtArgName, "parname");

View file

@ -30,7 +30,6 @@
#include <vector>
#include "formula/funcutl.hxx"
#include "formula/omoduleclient.hxx"
#include "ControlHelper.hxx"
namespace formula
@ -44,7 +43,6 @@ class IControlReferenceHandler;
class ParaWin : public TabPage
{
private:
OModuleClient m_aModuleClient;
Link<ParaWin&,void> aFxLink;
Link<ParaWin&,void> aArgModifiedLink;

View file

@ -25,7 +25,6 @@
#include "structpg.hxx"
#include "formula/formdata.hxx"
#include "formula/formula.hxx"
#include "ModuleHelper.hxx"
#include "formula/IFunctionDescription.hxx"
#include "bitmaps.hlst"

View file

@ -27,8 +27,6 @@
#include <vcl/tabctrl.hxx>
#include <svtools/treelistbox.hxx>
#include "formula/IFunctionDescription.hxx"
#include "formula/omoduleclient.hxx"
namespace formula
{
@ -65,7 +63,6 @@ public:
class StructPage : public TabPage
{
private:
OModuleClient m_aModuleClient;
Link<StructPage&,void> aSelLink;
VclPtr<StructListBox> m_pTlbStruct;

View file

@ -1,66 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_FORMULA_SOURCE_UI_INC_MODULEHELPER_HXX
#define INCLUDED_FORMULA_SOURCE_UI_INC_MODULEHELPER_HXX
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <unotools/resmgr.hxx>
namespace formula
{
//= OModule
class OModuleClient;
class OModuleImpl;
class OModule
{
friend class OModuleClient;
private:
OModule() = delete; //TODO: get rid of this class
protected:
static sal_Int32 s_nClients; /// number of registered clients
static OModuleImpl* s_pImpl; /// impl class. lives as long as at least one client for the module is registered
public:
/// get the vcl res manager of the module
static const std::locale& getResLocale();
protected:
/// register a client for the module
static void registerClient();
/// revoke a client for the module
static void revokeClient();
private:
/** ensure that the impl class exists
@precond m_aMutex is guarded when this method gets called
*/
static void ensureImpl();
};
//= ModuleRes
OUString ModuleRes(const char *pId);
} // namespace formula
#endif // INCLUDED_FORMULA_SOURCE_UI_INC_MODULEHELPER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -1,123 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <memory>
#include "ModuleHelper.hxx"
#include <comphelper/processfactory.hxx>
#include <osl/thread.h>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/instance.hxx>
#include <rtl/uri.hxx>
#include <svl/solar.hrc>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#define ENTER_MOD_METHOD() \
::osl::MutexGuard aGuard(theOModuleMutex::get()); \
ensureImpl()
namespace formula
{
using namespace ::com::sun::star;
//= OModuleImpl
/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by its owner
*/
class OModuleImpl
{
std::unique_ptr<std::locale> m_xResources;
public:
/// ctor
OModuleImpl();
/// get the manager for the resources of the module
const std::locale& getResLocale();
};
OModuleImpl::OModuleImpl()
{
}
const std::locale& OModuleImpl::getResLocale()
{
// note that this method is not threadsafe, which counts for the whole class !
if (!m_xResources)
{
// create a manager with a fixed prefix
m_xResources.reset(new std::locale(Translate::Create("for")));
}
return *m_xResources;
}
//= OModule
namespace
{
// access safety
struct theOModuleMutex : public rtl::Static< osl::Mutex, theOModuleMutex > {};
}
sal_Int32 OModule::s_nClients = 0;
OModuleImpl* OModule::s_pImpl = nullptr;
const std::locale& OModule::getResLocale()
{
ENTER_MOD_METHOD();
return s_pImpl->getResLocale();
}
void OModule::registerClient()
{
::osl::MutexGuard aGuard(theOModuleMutex::get());
++s_nClients;
}
void OModule::revokeClient()
{
::osl::MutexGuard aGuard(theOModuleMutex::get());
if (!--s_nClients && s_pImpl)
{
delete s_pImpl;
s_pImpl = nullptr;
}
}
void OModule::ensureImpl()
{
if (s_pImpl)
return;
s_pImpl = new OModuleImpl();
}
OUString ModuleRes(const char *pId)
{
return Translate::get(pId, OModule::getResLocale());
};
} // namespace formula
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -32,7 +32,6 @@ $(eval $(call gb_Library_use_libraries,fps_aqua,\
i18nlangtag \
sal \
utl \
tl \
vcl \
))

View file

@ -9,34 +9,12 @@
#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_FPSOFFICERESMGR_HXX
#define INCLUDED_FPICKER_SOURCE_OFFICE_FPSOFFICERESMGR_HXX
#include <rtl/instance.hxx>
#include <osl/getglobalmutex.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
namespace fpicker
{
struct ResLocaleHolder
{
std::locale* operator ()()
{
return new std::locale(Translate::Create("fps"));
}
static std::locale* getOrCreate()
{
return rtl_Instance<
std::locale, ResLocaleHolder,
osl::MutexGuard, osl::GetGlobalMutex >::create (
ResLocaleHolder(), osl::GetGlobalMutex());
}
};
}
inline OUString FpsResId(const char* pId)
{
return Translate::get(pId, *fpicker::ResLocaleHolder::getOrCreate());
static std::locale loc = Translate::Create("fps");
return Translate::get(pId, loc);
};
#endif

View file

@ -98,7 +98,6 @@ using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::sdbc;
using namespace ::fpicker;
using namespace ::utl;
using namespace ::svt;

View file

@ -37,6 +37,7 @@
#include "svtools/imagemgr.hxx"
#include <unotools/localfilehelper.hxx>
#include "unotools/useroptions.hxx"
#include <svl/svlresid.hxx>
#include <svl/svl.hrc>
using namespace ::com::sun::star::uno;
@ -144,8 +145,7 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu )
if ( nCount == 1 )
{
// adjust the title of the top level entry (the workspace)
std::locale loc = Translate::Create("svl");
_pMenu->SetItemText(--nItemId, Translate::get(STR_SVT_MIMETYPE_CNT_FSYSBOX, loc));
_pMenu->SetItemText(--nItemId, SvlResId(STR_SVT_MIMETYPE_CNT_FSYSBOX));
}
--nCount;
}

View file

@ -33,8 +33,6 @@ public:
BasicDLL();
~BasicDLL();
const std::locale& GetBasResLocale() const;
static void BasicBreak();
static void EnableBreak( bool bEnable );

View file

@ -69,6 +69,8 @@ enum class PropertyMode
};
BASIC_DLLPUBLIC const ErrMsgCode* getRID_BASIC_START();
BASIC_DLLPUBLIC const std::locale& BasResLocale();
BASIC_DLLPUBLIC OUString BasResId(const char* pId);
#endif

View file

@ -24,7 +24,6 @@
#include <utility>
#include <formula/formuladllapi.h>
#include <formula/omoduleclient.hxx>
#include <formula/IFunctionDescription.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
@ -88,7 +87,7 @@ protected:
};
class FORMULA_DLLPUBLIC FormulaDlg:
private OModuleClient, public SfxModelessDialog, public IFormulaEditorHelper
public SfxModelessDialog, public IFormulaEditorHelper
{
friend class FormulaDlg_Impl;
public:

View file

@ -1,44 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_FORMULA_OMODULECLIENT_HXX
#define INCLUDED_FORMULA_OMODULECLIENT_HXX
#include <sal/config.h>
#include <formula/formuladllapi.h>
namespace formula {
/** Base class for objects which use any global module-specific resources.
*/
class FORMULA_DLLPUBLIC OModuleClient
{
OModuleClient(const OModuleClient&) = delete;
OModuleClient& operator=( const OModuleClient& ) = delete;
public:
OModuleClient();
~OModuleClient();
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -23,12 +23,6 @@
#include <rtl/ustring.hxx>
#include <locale>
struct SFX2_DLLPUBLIC SfxResLocale
{
static std::locale* GetResLocale();
static void DeleteResLocale();
};
SFX2_DLLPUBLIC OUString SfxResId(const char* pId);
#endif

21
include/svl/svlresid.hxx Normal file
View file

@ -0,0 +1,21 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SVL_SVTRESID_HXX
#define INCLUDED_SVL_SVTRESID_HXX
#include <svl/svldllapi.h>
#include <rtl/ustring.hxx>
#include <locale>
SVL_DLLPUBLIC OUString SvlResId(const char* pId);
#endif // INCLUDED_SVL_SVTRESID_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -22,7 +22,7 @@
#include <memory>
#include <svtools/svtdllapi.h>
#include <svtools/svtresid.hxx>
#include <vcl/errinf.hxx>
typedef std::pair<const char*, ErrCode> ErrMsgCode;
@ -36,23 +36,23 @@ class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
public:
SfxErrorContext(
sal_uInt16 nCtxIdP, vcl::Window *pWin=nullptr,
const ErrMsgCode* pIds = nullptr, const std::locale* pResLocaleP = nullptr);
const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale());
SfxErrorContext(
sal_uInt16 nCtxIdP, const OUString &aArg1, vcl::Window *pWin=nullptr,
const ErrMsgCode* pIds = nullptr, const std::locale* pResLocaleP = nullptr);
const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale());
bool GetString(ErrCode nErrId, OUString &rStr) override;
private:
sal_uInt16 nCtxId;
const ErrMsgCode* pIds;
const std::locale *pResLocale;
const std::locale& rResLocale;
OUString aArg1;
};
class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
{
public:
SfxErrorHandler(const ErrMsgCode* pIds, ErrCode lStart, ErrCode lEnd, const std::locale* pResLocale = nullptr);
SfxErrorHandler(const ErrMsgCode* pIds, ErrCode lStart, ErrCode lEnd, const std::locale& rResLocale = SvtResLocale());
virtual ~SfxErrorHandler() override;
protected:
@ -63,8 +63,7 @@ private:
ErrCode lStart;
ErrCode lEnd;
const ErrMsgCode* pIds;
const std::locale* pResLocale;
std::unique_ptr<std::locale> xFreeLocale;
const std::locale& rResLocale;
SVT_DLLPRIVATE static void GetClassString(sal_uLong lErrId, OUString &);
virtual bool CreateString(const ErrorInfo *, OUString &) const override;

View file

@ -21,14 +21,10 @@
#define INCLUDED_SVTOOLS_SVTRESID_HXX
#include <svtools/svtdllapi.h>
#include <com/sun/star/lang/Locale.hpp>
struct SVT_DLLPUBLIC SvtResLocale
{
static std::locale* GetResLocale();
static void DeleteResLocale();
};
#include <rtl/ustring.hxx>
#include <locale>
SVT_DLLPUBLIC const std::locale& SvtResLocale();
SVT_DLLPUBLIC OUString SvtResId(const char* pId);
#endif // INCLUDED_SVTOOLS_SVTRESID_HXX

View file

@ -182,7 +182,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
pErrorHdl = new SfxErrorHandler(RID_ERRHDLSC,
ErrCode(ERRCODE_AREA_SC),
ErrCode(ERRCODE_AREA_APP2-1),
&GetResLocale());
GetResLocale());
aSpellIdle.SetInvokeHandler( LINK( this, ScModule, SpellTimerHdl ) );
aSpellIdle.SetDebugName( "sc::ScModule aSpellIdle" );

View file

@ -71,7 +71,7 @@ OUString AnalysisAddIn::GetFuncDescrStr(const char** pResId, sal_uInt16 nStrInde
void AnalysisAddIn::InitData()
{
aResLocale = Translate::Create("analysis", LanguageTag(aFuncLoc));
aResLocale = Translate::Create("sca", LanguageTag(aFuncLoc));
delete pFD;
pFD = new FuncDataList;

View file

@ -82,7 +82,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
pSearchItem->SetAppFlag(SvxSearchApp::DRAW);
StartListening( *SfxGetpApp() );
SvxErrorHandler::ensure();
mpErrorHdl = new SfxErrorHandler(RID_SD_ERRHDL, ErrCode(ERRCODE_AREA_SD), ErrCode(ERRCODE_AREA_SD_END), &GetResLocale());
mpErrorHdl = new SfxErrorHandler(RID_SD_ERRHDL, ErrCode(ERRCODE_AREA_SD), ErrCode(ERRCODE_AREA_SD_END), GetResLocale());
// Create a new ref device and (by calling SetReferenceDevice())
// set its resolution to 600 DPI. This leads to a visually better

View file

@ -67,7 +67,7 @@ rtl::Reference<FuPoor> FuThesaurus::Create( ViewShell* pViewSh, ::sd::Window* pW
void FuThesaurus::DoExecute( SfxRequest& )
{
SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(),
mpWindow, getRID_SVXERRCTX(), &SvxResLocale());
mpWindow, getRID_SVXERRCTX(), SvxResLocale());
if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr)
{

View file

@ -214,16 +214,11 @@ void SfxApplication::Initialize_Impl()
pImpl->m_pToolsErrorHdl = new SfxErrorHandler(
getRID_ERRHDL(), ErrCode(ERRCODE_AREA_IO), ErrCode(ERRCODE_AREA_SVX));
#if HAVE_FEATURE_SCRIPTING
pImpl->aBasicResLocale = Translate::Create("sb");
#endif
pImpl->aSvtResLocale = Translate::Create("svt");
pImpl->m_pSoErrorHdl = new SfxErrorHandler(
getRID_SO_ERROR_HANDLER(), ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), &(pImpl->aSvtResLocale));
getRID_SO_ERROR_HANDLER(), ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), SvtResLocale());
#if HAVE_FEATURE_SCRIPTING
pImpl->m_pSbxErrorHdl = new SfxErrorHandler(
getRID_BASIC_START(), ErrCode(ERRCODE_AREA_SBX), ErrCode(ERRCODE_AREA_SBX_END), &(pImpl->aBasicResLocale));
getRID_BASIC_START(), ErrCode(ERRCODE_AREA_SBX), ErrCode(ERRCODE_AREA_SBX_END), BasResLocale());
#endif
if (!utl::ConfigManager::IsAvoidConfig())

View file

@ -101,8 +101,6 @@ void SfxApplication::Deinitialize()
// free administration managers
DELETEZ(pImpl->pAppDispat);
SfxResLocale::DeleteResLocale();
SvtResLocale::DeleteResLocale();
// from here no SvObjects have to exists
DELETEZ(pImpl->pMatcher);

View file

@ -696,13 +696,7 @@ OUString ShutdownIcon::getShortcutName()
#else
#ifdef _WIN32
OUString aShortcutName( "StarOffice 6.0" );
std::locale* pResLocale = SfxResLocale::GetResLocale();
if (pResLocale)
{
::SolarMutexGuard aGuard;
aShortcutName = SfxResId(STR_QUICKSTART_LNKNAME);
}
OUString aShortcutName(SfxResId(STR_QUICKSTART_LNKNAME));
aShortcutName += ".lnk";
OUString aShortcut(GetAutostartFolderNameW32());

View file

@ -19,29 +19,12 @@
#include <sfx2/sfxresid.hxx>
#include <tools/solar.h>
#include "unotools/resmgr.hxx"
static std::locale* pResLocale = nullptr;
std::locale* SfxResLocale::GetResLocale()
{
if (!pResLocale)
{
pResLocale = new std::locale(Translate::Create("sfx"));
}
return pResLocale;
}
void SfxResLocale::DeleteResLocale()
{
DELETEZ(pResLocale);
}
OUString SfxResId(const char* pId)
{
return Translate::get(pId, *SfxResLocale::GetResLocale());
static std::locale loc = Translate::Create("sfx");
return Translate::get(pId, loc);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -82,10 +82,6 @@ public:
// application members
SfxFilterMatcher* pMatcher;
#if HAVE_FEATURE_SCRIPTING
std::locale aBasicResLocale;
#endif
std::locale aSvtResLocale;
SfxErrorHandler *m_pToolsErrorHdl;
SfxErrorHandler *m_pSoErrorHdl;
#if HAVE_FEATURE_SCRIPTING

View file

@ -23,10 +23,9 @@
#include <i18nlangtag/languagetag.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <svl/svlresid.hxx>
#include <unotools/resmgr.hxx>
#include "getstringresource.hxx"
OUString SvlResId(const char* id)
{
static std::locale loc = Translate::Create("svl");

View file

@ -27,10 +27,9 @@
#include <rtl/instance.hxx>
#include <osl/diagnose.h>
#include <svl/inettype.hxx>
#include <svl/svlresid.hxx>
#include <svl/svl.hrc>
#include "getstringresource.hxx"
namespace
{

View file

@ -139,15 +139,10 @@ static DialogMask aWndFunc(
return nRet;
}
SfxErrorHandler::SfxErrorHandler(const ErrMsgCode* pIdPs, ErrCode lStartP, ErrCode lEndP, const std::locale* pLocale)
: lStart(lStartP), lEnd(lEndP), pIds(pIdPs), pResLocale(pLocale)
SfxErrorHandler::SfxErrorHandler(const ErrMsgCode* pIdPs, ErrCode lStartP, ErrCode lEndP, const std::locale& rLocale)
: lStart(lStartP), lEnd(lEndP), pIds(pIdPs), rResLocale(rLocale)
{
ErrorRegistry::RegisterDisplay(&aWndFunc);
if (!pResLocale)
{
xFreeLocale.reset(new std::locale(Translate::Create("svt")));
pResLocale = xFreeLocale.get();
}
}
SfxErrorHandler::~SfxErrorHandler()
@ -197,12 +192,11 @@ void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr)
*/
{
std::locale loc(Translate::Create("svt"));
for (const ErrMsgCode* pItem = getRID_ERRHDL(); pItem->second; ++pItem)
{
if (sal_uInt32(pItem->second) == lClassId)
{
rStr = Translate::get(pItem->first, loc);
rStr = SvtResId(pItem->first);
break;
}
}
@ -227,7 +221,7 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, OUString &rStr) const
{
if (pItem->second == nErrId)
{
rStr = rStr.replaceAll("$(ERROR)", Translate::get(pItem->first, *pResLocale));
rStr = rStr.replaceAll("$(ERROR)", Translate::get(pItem->first, rResLocale));
bRet = true;
break;
}
@ -247,8 +241,8 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, OUString &rStr) const
}
SfxErrorContext::SfxErrorContext(
sal_uInt16 nCtxIdP, vcl::Window *pWindow, const ErrMsgCode* pIdsP, const std::locale* pResLocaleP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), pResLocale(pResLocaleP)
sal_uInt16 nCtxIdP, vcl::Window *pWindow, const ErrMsgCode* pIdsP, const std::locale& rResLocaleP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), rResLocale(rResLocaleP)
{
if (!pIds)
pIds = getRID_ERRCTX();
@ -257,8 +251,8 @@ SfxErrorContext::SfxErrorContext(
SfxErrorContext::SfxErrorContext(
sal_uInt16 nCtxIdP, const OUString &aArg1P, vcl::Window *pWindow,
const ErrMsgCode* pIdsP, const std::locale* pResLocaleP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), pResLocale(pResLocaleP),
const ErrMsgCode* pIdsP, const std::locale& rResLocaleP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), rResLocale(rResLocaleP),
aArg1(aArg1P)
{
if (!pIds)
@ -274,46 +268,32 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr)
{
bool bRet = false;
std::locale* pFreeLocale = nullptr;
if (!pResLocale)
for (const ErrMsgCode* pItem = pIds; pItem->second; ++pItem)
{
pFreeLocale = new std::locale(Translate::Create("svt"));
pResLocale = pFreeLocale;
}
if (pResLocale)
{
for (const ErrMsgCode* pItem = pIds; pItem->second; ++pItem)
if (sal_uInt32(pItem->second) == nCtxId)
{
if (sal_uInt32(pItem->second) == nCtxId)
rStr = Translate::get(pItem->first, rResLocale);
rStr = rStr.replaceAll("$(ARG1)", aArg1);
bRet = true;
break;
}
}
SAL_WARN_IF(!bRet, "svtools.misc", "ErrorContext cannot find the resource");
if ( bRet )
{
sal_uInt16 nId = nErrId.IsWarning() ? ERRCTX_WARNING : ERRCTX_ERROR;
for (const ErrMsgCode* pItem = getRID_ERRCTX(); pItem->second; ++pItem)
{
if (sal_uInt32(pItem->second) == nId)
{
rStr = Translate::get(pItem->first, *pResLocale);
rStr = rStr.replaceAll("$(ARG1)", aArg1);
bRet = true;
rStr = rStr.replaceAll("$(ERR)", Translate::get(pItem->first, rResLocale));
break;
}
}
SAL_WARN_IF(!bRet, "svtools.misc", "ErrorContext cannot find the resource");
if ( bRet )
{
sal_uInt16 nId = nErrId.IsWarning() ? ERRCTX_WARNING : ERRCTX_ERROR;
for (const ErrMsgCode* pItem = getRID_ERRCTX(); pItem->second; ++pItem)
{
if (sal_uInt32(pItem->second) == nId)
{
rStr = rStr.replaceAll("$(ERR)", Translate::get(pItem->first, *pResLocale));
break;
}
}
}
}
if (pFreeLocale)
{
delete pFreeLocale;
pResLocale = nullptr;
}
return bRet;
}

View file

@ -18,26 +18,17 @@
*/
#include <unotools/resmgr.hxx>
#include <tools/solar.h>
#include <svtools/svtresid.hxx>
static std::locale* pResLocale=nullptr;
std::locale* SvtResLocale::GetResLocale()
const std::locale& SvtResLocale()
{
if (!pResLocale)
pResLocale = new std::locale(Translate::Create("svt"));
return pResLocale;
}
void SvtResLocale::DeleteResLocale()
{
DELETEZ(pResLocale);
static std::locale loc = Translate::Create("svt");
return loc;
}
OUString SvtResId(const char* pId)
{
return Translate::get(pId, *SvtResLocale::GetResLocale());
return Translate::get(pId, SvtResLocale());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -25,7 +25,7 @@
SvxErrorHandler::SvxErrorHandler() :
SfxErrorHandler(
getRID_SVXERRCODE(), ErrCode(ERRCODE_AREA_SVX), ErrCode(ERRCODE_AREA_SVX_END), &SvxResLocale())
getRID_SVXERRCODE(), ErrCode(ERRCODE_AREA_SVX), ErrCode(ERRCODE_AREA_SVX_END), SvxResLocale())
{
}

View file

@ -174,7 +174,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
m_pErrorHandler = new SfxErrorHandler( RID_SW_ERRHDL,
ErrCode(ERRCODE_AREA_SW),
ErrCode(ERRCODE_AREA_SW_END),
&GetResLocale() );
GetResLocale() );
m_pModuleConfig = new SwModuleOptions;

View file

@ -423,7 +423,7 @@ void SwView::HyphenateDocument()
}
SfxErrorContext aContext( ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin,
getRID_SVXERRCTX(), &SvxResLocale() );
getRID_SVXERRCTX(), SvxResLocale() );
Reference< XHyphenator > xHyph( ::GetHyphenator() );
if (!xHyph.is())
@ -545,7 +545,7 @@ void SwView::StartThesaurus()
return;
SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin,
getRID_SVXERRCTX(), &SvxResLocale() );
getRID_SVXERRCTX(), SvxResLocale() );
// Determine language
LanguageType eLang = m_pWrtShell->GetCurLang();