Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
68fac46e
Kaydet (Commit)
68fac46e
authored
Mar 27, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use LanguageTag instead of comphelper::Locale
Change-Id: I2c6d07bbdef62fa17e9c90ca87be6e742268c54f
üst
66a63c16
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
53 deletions
+62
-53
acceleratorconfiguration.cxx
framework/source/accelerators/acceleratorconfiguration.cxx
+10
-9
documentacceleratorconfiguration.cxx
.../source/accelerators/documentacceleratorconfiguration.cxx
+3
-2
globalacceleratorconfiguration.cxx
...rk/source/accelerators/globalacceleratorconfiguration.cxx
+5
-2
moduleacceleratorconfiguration.cxx
...rk/source/accelerators/moduleacceleratorconfiguration.cxx
+4
-1
presethandler.cxx
framework/source/accelerators/presethandler.cxx
+25
-24
acceleratorconfiguration.hxx
...work/source/inc/accelerators/acceleratorconfiguration.hxx
+5
-5
presethandler.hxx
framework/source/inc/accelerators/presethandler.hxx
+10
-10
No files found.
framework/source/accelerators/acceleratorconfiguration.cxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -53,6 +53,7 @@
#include <unotools/configpaths.hxx>
#include <rtl/logfile.hxx>
#include <svtools/acceleratorexecute.hxx>
#include <i18npool/languagetag.hxx>
#include <stdio.h>
...
...
@@ -607,7 +608,7 @@ AcceleratorCache& XMLBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bWriteA
}
//-----------------------------------------------
::
comphelper
::
Locale
XMLBasedAcceleratorConfiguration
::
impl_ts_getLocale
()
const
LanguageTag
XMLBasedAcceleratorConfiguration
::
impl_ts_getLocale
()
const
{
// SAFE -> ----------------------------------
ReadGuard
aReadLock
(
m_aLock
);
...
...
@@ -622,8 +623,8 @@ AcceleratorCache& XMLBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bWriteA
xProp
->
getPropertyValue
(
"ooLocale"
)
>>=
sISOLocale
;
if
(
sISOLocale
.
isEmpty
())
return
::
comphelper
::
Locale
::
EN_US
(
);
return
::
comphelper
::
Locale
(
sISOLocale
);
return
LanguageTag
(
LANGUAGE_ENGLISH_US
);
return
LanguageTag
(
sISOLocale
);
}
/*******************************************************************************
...
...
@@ -1263,7 +1264,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
xModules
->
getByName
(
m_sModuleCFG
)
>>=
xAccess
;
}
const
::
rtl
::
OUString
sIsoLang
=
impl_ts_getLocale
().
toISO
();
const
::
rtl
::
OUString
sIsoLang
=
impl_ts_getLocale
().
getBcp47
();
const
::
rtl
::
OUString
sDefaultLocale
(
"en-US"
);
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>
xKey
;
...
...
@@ -1491,7 +1492,7 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt:
xContainer
->
getByName
(
sKey
)
>>=
xKey
;
xKey
->
getByName
(
CFG_PROP_COMMAND
)
>>=
xCommand
;
::
rtl
::
OUString
sLocale
=
impl_ts_getLocale
().
toISO
();
::
rtl
::
OUString
sLocale
=
impl_ts_getLocale
().
getBcp47
();
if
(
!
xCommand
->
hasByName
(
sLocale
)
)
xCommand
->
insertByName
(
sLocale
,
css
::
uno
::
makeAny
(
sCommand
));
else
...
...
@@ -1573,7 +1574,7 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr
if
(
xContainer
->
hasByName
(
sKey
))
{
::
rtl
::
OUString
sLocale
=
impl_ts_getLocale
().
toISO
();
::
rtl
::
OUString
sLocale
=
impl_ts_getLocale
().
getBcp47
();
xContainer
->
getByName
(
sKey
)
>>=
xKey
;
xKey
->
getByName
(
CFG_PROP_COMMAND
)
>>=
xCommand
;
xCommand
->
getByName
(
sLocale
)
>>=
sCommand
;
...
...
@@ -1645,7 +1646,7 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer
}
//-----------------------------------------------
::
comphelper
::
Locale
XCUBasedAcceleratorConfiguration
::
impl_ts_getLocale
()
const
LanguageTag
XCUBasedAcceleratorConfiguration
::
impl_ts_getLocale
()
const
{
// SAFE -> ----------------------------------
ReadGuard
aReadLock
(
m_aLock
);
...
...
@@ -1660,8 +1661,8 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer
xProp
->
getPropertyValue
(
"ooLocale"
)
>>=
sISOLocale
;
if
(
sISOLocale
.
isEmpty
())
return
::
comphelper
::
Locale
::
EN_US
(
);
return
::
comphelper
::
Locale
(
sISOLocale
);
return
LanguageTag
(
LANGUAGE_ENGLISH_US
);
return
LanguageTag
(
sISOLocale
);
}
}
// namespace framework
...
...
framework/source/accelerators/documentacceleratorconfiguration.cxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -44,6 +44,7 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <comphelper/sequenceashashmap.hxx>
#include <i18npool/languagetag.hxx>
namespace
framework
...
...
@@ -156,7 +157,7 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache()
// get current office locale ... but dont cache it.
// Otherwise we must be listener on the configuration layer
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
impl_ts_getLocale
(
);
LanguageTag
aLanguageTag
(
impl_ts_getLocale
()
);
// May be the current document does not contain any
// accelerator config? Handle it gracefully :-)
...
...
@@ -171,7 +172,7 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache()
PresetHandler
::
RESOURCETYPE_ACCELERATOR
(),
::
rtl
::
OUString
(),
xDocumentRoot
,
aL
ocale
);
aL
anguageTag
);
DocumentAcceleratorConfiguration
::
reload
();
m_aPresetHandler
.
addStorageListener
(
this
);
...
...
framework/source/accelerators/globalacceleratorconfiguration.cxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -33,7 +33,7 @@
#include <com/sun/star/util/XChangesNotifier.hpp>
#include <vcl/svapp.hxx>
#include <
comphelper/locale
.hxx>
#include <
i18npool/languagetag
.hxx>
#include <comphelper/configurationhelper.hxx>
...
...
@@ -87,10 +87,13 @@ void SAL_CALL GlobalAcceleratorConfiguration::initialize(const css::uno::Sequenc
//-----------------------------------------------
void
GlobalAcceleratorConfiguration
::
impl_ts_fillCache
()
{
#if 0
// get current office locale ... but dont cache it.
// Otherwise we must be listener on the configuration layer
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
::
comphelper
::
Locale
(
m_sLocale
);
// XXX: what is this good for? it was a comphelper::Locale but unused
LanguageTag aLanguageTag(m_sLocale);
#endif
// May be there exists no accelerator config? Handle it gracefully :-)
try
...
...
framework/source/accelerators/moduleacceleratorconfiguration.cxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -118,10 +118,13 @@ void ModuleAcceleratorConfiguration::impl_ts_fillCache()
aReadLock
.
unlock
();
// <- SAFE ----------------------------------
#if 0
// get current office locale ... but dont cache it.
// Otherwise we must be listener on the configuration layer
// which seems to superflous for this small implementation .-)
::
comphelper
::
Locale
aLocale
=
::
comphelper
::
Locale
(
m_sLocale
);
// XXX: what is this good for? it was a comphelper::Locale but unused
LanguageTag aLanguageTag(m_sLocale);
#endif
// May be the current app module does not have any
// accelerator config? Handle it gracefully :-)
...
...
framework/source/accelerators/presethandler.cxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -38,6 +38,7 @@
#include <vcl/svapp.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/ustrbuf.hxx>
#include <i18npool/languagetag.hxx>
#define SUBSTORAGE_GLOBAL DECLARE_ASCII("global" )
...
...
@@ -103,13 +104,14 @@ PresetHandler::PresetHandler(const css::uno::Reference< css::lang::XMultiService
,
m_xSMGR
(
xSMGR
)
,
m_aSharedStorages
(
)
,
m_lDocumentStorages
()
,
m_aL
ocale
(
::
comphelper
::
Locale
::
X_NOTRANSLATE
()
)
,
m_aL
anguageTag
(
LANGUAGE_USER_PRIV_NOTRANSLATE
)
{
}
//-----------------------------------------------
PresetHandler
::
PresetHandler
(
const
PresetHandler
&
rCopy
)
:
ThreadHelpBase
(
&
Application
::
GetSolarMutex
()
)
,
m_aLanguageTag
(
rCopy
.
m_aLanguageTag
)
{
m_xSMGR
=
rCopy
.
m_xSMGR
;
m_eConfigType
=
rCopy
.
m_eConfigType
;
...
...
@@ -121,7 +123,6 @@ PresetHandler::PresetHandler(const PresetHandler& rCopy)
m_xWorkingStorageUser
=
rCopy
.
m_xWorkingStorageUser
;
m_lPresets
=
rCopy
.
m_lPresets
;
m_lTargets
=
rCopy
.
m_lTargets
;
m_aLocale
=
rCopy
.
m_aLocale
;
m_lDocumentStorages
=
rCopy
.
m_lDocumentStorages
;
m_sRelPathShare
=
rCopy
.
m_sRelPathShare
;
m_sRelPathNoLang
=
rCopy
.
m_sRelPathNoLang
;
...
...
@@ -371,7 +372,7 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
const
::
rtl
::
OUString
&
sResource
,
const
::
rtl
::
OUString
&
sModule
,
const
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>&
xDocumentRoot
,
const
::
comphelper
::
Locale
&
aLocale
)
const
LanguageTag
&
rLanguageTag
)
{
// TODO free all current open storages!
...
...
@@ -381,7 +382,7 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
m_eConfigType
=
eConfigType
;
m_sResourceType
=
sResource
;
m_sModule
=
sModule
;
m_aL
ocale
=
aLocale
;
m_aL
anguageTag
=
rLanguageTag
;
aWriteLock
.
unlock
();
// <- SAFE ----------------------------------
...
...
@@ -481,13 +482,13 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
sRelPathNoLang
=
sRelPathShare
;
if
(
(
aLocale
!=
::
comphelper
::
Locale
::
X_NOTRANSLATE
(
))
&&
// localized level?
(
rLanguageTag
!=
LanguageTag
(
LANGUAGE_USER_PRIV_NOTRANSLATE
))
&&
// localized level?
(
eConfigType
!=
E_DOCUMENT
)
// no localization in document mode!
)
{
// First try to find the right localized set inside share layer.
// Fallbacks are allowed there.
::
comphelper
::
Locale
aShareLocale
=
aLocale
;
LanguageTag
aShareLocale
(
rLanguageTag
)
;
::
rtl
::
OUString
sLocalizedSharePath
(
sRelPathShare
);
sal_Bool
bAllowFallbacks
=
sal_True
;
xShare
=
impl_openLocalizedPathIgnoringErrors
(
sLocalizedSharePath
,
eShareMode
,
sal_True
,
aShareLocale
,
bAllowFallbacks
);
...
...
@@ -495,7 +496,7 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
// The try to locate the right sub dir inside user layer ... without using fallbacks!
// Normaly the corresponding sub dir should be created matching the specified locale.
// Because we allow creation of storages inside user layer by default.
::
comphelper
::
Locale
aUserLocale
=
aLocale
;
LanguageTag
aUserLocale
(
rLanguageTag
)
;
::
rtl
::
OUString
sLocalizedUserPath
(
sRelPathUser
);
bAllowFallbacks
=
sal_False
;
xUser
=
impl_openLocalizedPathIgnoringErrors
(
sLocalizedUserPath
,
eUserMode
,
sal_False
,
aUserLocale
,
bAllowFallbacks
);
...
...
@@ -797,48 +798,48 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::impl_openPathIgnoring
}
//-----------------------------------------------
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
PresetHandler
::
impl_findMatchingLocalizedValue
(
const
::
std
::
vector
<
::
rtl
::
OUString
>&
lLocalizedValues
,
::
comphelper
::
Locale
&
aLocale
,
sal_Bool
bAllowFallbacks
)
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
PresetHandler
::
impl_findMatchingLocalizedValue
(
const
::
std
::
vector
<
::
rtl
::
OUString
>&
lLocalizedValues
,
LanguageTag
&
rLanguageTag
,
sal_Bool
bAllowFallbacks
)
{
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
pFound
=
lLocalizedValues
.
end
();
if
(
bAllowFallbacks
)
{
pFound
=
::
comphelper
::
Locale
::
getFallback
(
lLocalizedValues
,
aLocale
.
toISO
());
pFound
=
LanguageTag
::
getFallback
(
lLocalizedValues
,
rLanguageTag
.
getBcp47
());
}
else
{
OUString
aCheck
(
rLanguageTag
.
getBcp47
());
for
(
pFound
=
lLocalizedValues
.
begin
();
pFound
!=
lLocalizedValues
.
end
()
;
++
pFound
)
{
const
::
rtl
::
OUString
&
sCheckISO
=
*
pFound
;
::
comphelper
::
Locale
aCheckLocale
(
sCheckISO
);
if
(
aCheckLocale
.
equals
(
aLocale
))
if
(
*
pFound
==
aCheck
)
break
;
}
}
// if we found a valid locale ... take it over to our in/out parameter
aLocale
// if we found a valid locale ... take it over to our in/out parameter
rLanguageTag
if
(
pFound
!=
lLocalizedValues
.
end
())
{
const
::
rtl
::
OUString
&
sISOLocale
=
*
pFound
;
aLocale
.
fromISO
(
sISOLocale
);
rLanguageTag
.
reset
(
*
pFound
);
}
return
pFound
;
}
//-----------------------------------------------
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
PresetHandler
::
impl_openLocalizedPathIgnoringErrors
(
::
rtl
::
OUString
&
sPath
,
sal_Int32
eMode
,
sal_Bool
bShare
,
::
comphelper
::
Locale
&
aLocale
,
sal_Bool
bAllowFallback
)
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
PresetHandler
::
impl_openLocalizedPathIgnoringErrors
(
::
rtl
::
OUString
&
sPath
,
sal_Int32
eMode
,
sal_Bool
bShare
,
LanguageTag
&
rLanguageTag
,
sal_Bool
bAllowFallback
)
{
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xPath
=
impl_openPathIgnoringErrors
(
sPath
,
eMode
,
bShare
);
::
std
::
vector
<
::
rtl
::
OUString
>
lSubFolders
=
impl_getSubFolderNames
(
xPath
);
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
pLocaleFolder
=
impl_findMatchingLocalizedValue
(
lSubFolders
,
aLocale
,
bAllowFallback
);
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
pLocaleFolder
=
impl_findMatchingLocalizedValue
(
lSubFolders
,
rLanguageTag
,
bAllowFallback
);
// no fallback ... creation not allowed => no storage
if
(
...
...
@@ -856,7 +857,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::impl_openLocalizedPat
if
(
pLocaleFolder
!=
lSubFolders
.
end
())
sLocalizedPath
+=
*
pLocaleFolder
;
else
sLocalizedPath
+=
aLocale
.
toISO
();
sLocalizedPath
+=
rLanguageTag
.
getBcp47
();
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xLocalePath
=
impl_openPathIgnoringErrors
(
sLocalizedPath
,
eMode
,
bShare
);
...
...
framework/source/inc/accelerators/acceleratorconfiguration.hxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -48,7 +48,7 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/weak.hxx>
#include <
comphelper/locale
.hxx>
#include <
i18npool/languagetag
.hxx>
#include <salhelper/singletonref.hxx>
//__________________________________________
...
...
@@ -210,10 +210,10 @@ class XMLBasedAcceleratorConfiguration : protected ThreadHelpBase
@descr We does not cache this value, because we are not listen
for changes on the configuration layer ...
@return
::comphelper::Locale
@return
LanguageTag
The current office locale.
*/
::
comphelper
::
Locale
impl_ts_getLocale
()
const
;
LanguageTag
impl_ts_getLocale
()
const
;
//______________________________________
// helper
...
...
@@ -428,10 +428,10 @@ class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase
@descr We does not cache this value, because we are not listen
for changes on the configuration layer ...
@return
::comphelper::Locale
@return
LanguageTag
The current office locale.
*/
::
comphelper
::
Locale
impl_ts_getLocale
()
const
;
LanguageTag
impl_ts_getLocale
()
const
;
//______________________________________
// helper
...
...
framework/source/inc/accelerators/presethandler.hxx
Dosyayı görüntüle @
68fac46e
...
...
@@ -31,7 +31,7 @@
#include <comphelper/processfactory.hxx>
#include <salhelper/singletonref.hxx>
#include <
comphelper/locale
.hxx>
#include <
i18npool/languagetag
.hxx>
namespace
framework
{
...
...
@@ -203,9 +203,9 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
/** @short its the current office locale and will be used
to handle localized presets.
@descr Default is "x-notranslate" which disable any
@descr Default is "x-no
-
translate" which disable any
localized handling inside this class! */
::
comphelper
::
Locale
m_aLocale
;
LanguageTag
m_aLanguageTag
;
//---------------------------------------
/** @short knows the relative path from the root. */
...
...
@@ -306,7 +306,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
configuration files. Note: Thats not the real root of the document ...
its only a sub storage. But we interpret it as our root storage.
@param
aLocale
@param
rLanguageTag
in case this configuration supports localized entries,
the current locale must be set.
...
...
@@ -325,7 +325,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
const
::
rtl
::
OUString
&
sResourceType
,
const
::
rtl
::
OUString
&
sModule
,
const
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>&
xDocumentRoot
,
const
::
comphelper
::
Locale
&
aLocale
=
::
comphelper
::
Locale
(
::
comphelper
::
Locale
::
X_NOTRANSLATE
()
));
const
LanguageTag
&
rLanguageTag
=
LanguageTag
(
LANGUAGE_USER_PRIV_NOTRANSLATE
));
//---------------------------------------
/** @short try to copy the specified preset from the share
...
...
@@ -442,9 +442,9 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
b) search with using fallbacks
@param lLocalizedValues
list of
ISO
locale codes
list of
BCP47 language tags /
locale codes
@param
aLocale
@param
rLanguageTag
[IN ] the current office locale, which should be searched inside lLocalizedValues.
[OUT] in case fallbacks was allowed, it contains afterwards the fallback locale.
...
...
@@ -455,7 +455,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
As a negative result the special iterator lLocalizedValues.end() will be returned.
*/
::
std
::
vector
<
::
rtl
::
OUString
>::
const_iterator
impl_findMatchingLocalizedValue
(
const
::
std
::
vector
<
::
rtl
::
OUString
>&
lLocalizedValues
,
::
comphelper
::
Locale
&
aLocale
,
LanguageTag
&
rLanguageTag
,
sal_Bool
bAllowFallbacks
);
//---------------------------------------
...
...
@@ -477,7 +477,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
@param bShare
force using of the share layer instead of the user layer.
@param
aLocale
@param
rLanguageTag
[IN ] contains the start locale for searching localized sub dirs.
[OUT] contains the locale of a found localized sub dir
...
...
@@ -489,7 +489,7 @@ class PresetHandler : private ThreadHelpBase // attention! Must be the first bas
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
impl_openLocalizedPathIgnoringErrors
(
::
rtl
::
OUString
&
sPath
,
sal_Int32
eMode
,
sal_Bool
bShare
,
::
comphelper
::
Locale
&
aLocale
,
LanguageTag
&
rLanguageTag
,
sal_Bool
bAllowFallback
);
//---------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment