summaryrefslogtreecommitdiff
path: root/unotools/source/config/useroptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/useroptions.cxx')
-rw-r--r--unotools/source/config/useroptions.cxx48
1 files changed, 23 insertions, 25 deletions
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 8af1121f9e42..5da601831adb 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -51,29 +51,27 @@ using rtl::OUString;
namespace
{
-OUString const sData = "org.openoffice.UserProfile/Data";
-
// vOptionNames[] -- names of the user option entries
// The order corresponds to the #define USER_OPT_* list in useroptions.hxx.
-OUString const vOptionNames[] = {
- OUString("l"), // USER_OPT_CITY
- OUString("o"), // USER_OPT_COMPANY
- OUString("c"), // USER_OPT_COUNTRY
- OUString("mail"), // USER_OPT_EMAIL
- OUString("facsimiletelephonenumber"), // USER_OPT_FAX
- OUString("givenname"), // USER_OPT_FIRSTNAME
- OUString("sn"), // USER_OPT_LASTNAME
- OUString("position"), // USER_OPT_POSITION
- OUString("st"), // USER_OPT_STATE
- OUString("street"), // USER_OPT_STREET
- OUString("homephone"), // USER_OPT_TELEPHONEHOME
- OUString("telephonenumber"), // USER_OPT_TELEPHONEWORK
- OUString("title"), // USER_OPT_TITLE
- OUString("initials"), // USER_OPT_ID
- OUString("postalcode"), // USER_OPT_ZIP
- OUString("fathersname"), // USER_OPT_FATHERSNAME
- OUString("apartment"), // USER_OPT_APARTMENT
- OUString("customernumber") // USER_OPT_CUSTOMERNUMBER
+char const * const vOptionNames[] = {
+ "l", // USER_OPT_CITY
+ "o", // USER_OPT_COMPANY
+ "c", // USER_OPT_COUNTRY
+ "mail", // USER_OPT_EMAIL
+ "facsimiletelephonenumber", // USER_OPT_FAX
+ "givenname", // USER_OPT_FIRSTNAME
+ "sn", // USER_OPT_LASTNAME
+ "position", // USER_OPT_POSITION
+ "st", // USER_OPT_STATE
+ "street", // USER_OPT_STREET
+ "homephone", // USER_OPT_TELEPHONEHOME
+ "telephonenumber", // USER_OPT_TELEPHONEWORK
+ "title", // USER_OPT_TITLE
+ "initials", // USER_OPT_ID
+ "postalcode", // USER_OPT_ZIP
+ "fathersname", // USER_OPT_FATHERSNAME
+ "apartment", // USER_OPT_APARTMENT
+ "customernumber" // USER_OPT_CUSTOMERNUMBER
};
const sal_uInt16 nOptionNameCount = SAL_N_ELEMENTS(vOptionNames);
@@ -147,7 +145,7 @@ SvtUserOptions::Impl::Impl() :
m_xCfg = uno::Reference<container::XNameAccess>(
comphelper::ConfigurationHelper::openConfig(
comphelper::getProcessComponentContext(),
- sData,
+ "org.openoffice.UserProfile/Data",
comphelper::ConfigurationHelper::E_STANDARD
),
uno::UNO_QUERY
@@ -180,7 +178,7 @@ OUString SvtUserOptions::Impl::GetToken (sal_uInt16 nToken) const
try
{
if (m_xData.is())
- m_xData->getPropertyValue(vOptionNames[nToken]) >>= sToken;
+ m_xData->getPropertyValue(OUString::createFromAscii(vOptionNames[nToken])) >>= sToken;
}
catch (uno::Exception const& ex)
{
@@ -201,7 +199,7 @@ void SvtUserOptions::Impl::SetToken (sal_uInt16 nToken, OUString const& sToken)
try
{
if (m_xData.is())
- m_xData->setPropertyValue(vOptionNames[nToken], uno::makeAny(sToken));
+ m_xData->setPropertyValue(OUString::createFromAscii(vOptionNames[nToken]), uno::makeAny(sToken));
comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch (uno::Exception const& ex)
@@ -240,7 +238,7 @@ sal_Bool SvtUserOptions::Impl::IsTokenReadonly (sal_uInt16 nToken) const
{
uno::Reference<beans::XPropertySet> xData(m_xCfg, uno::UNO_QUERY);
uno::Reference<beans::XPropertySetInfo> xInfo = xData->getPropertySetInfo();
- beans::Property aProp = xInfo->getPropertyByName(vOptionNames[nToken]);
+ beans::Property aProp = xInfo->getPropertyByName(OUString::createFromAscii(vOptionNames[nToken]));
return ((aProp.Attributes & beans::PropertyAttribute::READONLY) ==
beans::PropertyAttribute::READONLY);
}