summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/options/optgenrl.cxx58
-rw-r--r--include/unotools/useroptions.hxx45
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx4
-rw-r--r--sw/source/core/bastyp/calc.cxx8
-rw-r--r--sw/source/core/fields/docufld.cxx40
-rw-r--r--unotools/source/config/useroptions.cxx163
6 files changed, 149 insertions, 169 deletions
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 27052c736ebd..ad9ed8ba180b 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -107,50 +107,50 @@ struct
// id of the edit box
const char *pEditId;
// id for SvtUserOptions in unotools/useroptions.hxx
- int nUserOptionsId;
+ UserOptToken nUserOptionsId;
// id for settings the focus (defined in svx/optgenrl.hxx)
EditPosition nGrabFocusId;
}
const vFieldInfo[] =
{
// Company
- { Row_Company, "company", USER_OPT_COMPANY, EditPosition::COMPANY },
+ { Row_Company, "company", UserOptToken::Company, EditPosition::COMPANY },
// Name
- { Row_Name, "firstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
- { Row_Name, "lastname", USER_OPT_LASTNAME, EditPosition::LASTNAME },
- { Row_Name, "shortname", USER_OPT_ID, EditPosition::SHORTNAME },
+ { Row_Name, "firstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+ { Row_Name, "lastname", UserOptToken::LastName, EditPosition::LASTNAME },
+ { Row_Name, "shortname", UserOptToken::ID, EditPosition::SHORTNAME },
// Name (russian)
- { Row_Name_Russian, "ruslastname", USER_OPT_LASTNAME, EditPosition::LASTNAME },
- { Row_Name_Russian, "rusfirstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
- { Row_Name_Russian, "rusfathersname", USER_OPT_FATHERSNAME, EditPosition::UNKNOWN },
- { Row_Name_Russian, "russhortname", USER_OPT_ID, EditPosition::SHORTNAME },
+ { Row_Name_Russian, "ruslastname", UserOptToken::LastName, EditPosition::LASTNAME },
+ { Row_Name_Russian, "rusfirstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+ { Row_Name_Russian, "rusfathersname", UserOptToken::FathersName, EditPosition::UNKNOWN },
+ { Row_Name_Russian, "russhortname", UserOptToken::ID, EditPosition::SHORTNAME },
// Name (eastern: reversed name ord
- { Row_Name_Eastern, "eastlastname", USER_OPT_LASTNAME, EditPosition::LASTNAME },
- { Row_Name_Eastern, "eastfirstname", USER_OPT_FIRSTNAME, EditPosition::FIRSTNAME },
- { Row_Name_Eastern, "eastshortname", USER_OPT_ID, EditPosition::SHORTNAME },
+ { Row_Name_Eastern, "eastlastname", UserOptToken::LastName, EditPosition::LASTNAME },
+ { Row_Name_Eastern, "eastfirstname", UserOptToken::FirstName, EditPosition::FIRSTNAME },
+ { Row_Name_Eastern, "eastshortname", UserOptToken::ID, EditPosition::SHORTNAME },
// Street
- { Row_Street, "street", USER_OPT_STREET, EditPosition::STREET },
+ { Row_Street, "street", UserOptToken::Street, EditPosition::STREET },
// Street (russian)
- { Row_Street_Russian, "russtreet", USER_OPT_STREET, EditPosition::STREET },
- { Row_Street_Russian, "apartnum", USER_OPT_APARTMENT, EditPosition::UNKNOWN },
+ { Row_Street_Russian, "russtreet", UserOptToken::Street, EditPosition::STREET },
+ { Row_Street_Russian, "apartnum", UserOptToken::Apartment, EditPosition::UNKNOWN },
// City
- { Row_City, "izip", USER_OPT_ZIP, EditPosition::PLZ },
- { Row_City, "icity", USER_OPT_CITY, EditPosition::CITY },
+ { Row_City, "izip", UserOptToken::Zip, EditPosition::PLZ },
+ { Row_City, "icity", UserOptToken::City, EditPosition::CITY },
// City (US)
- { Row_City_US, "city", USER_OPT_CITY, EditPosition::CITY },
- { Row_City_US, "state", USER_OPT_STATE, EditPosition::STATE },
- { Row_City_US, "zip", USER_OPT_ZIP, EditPosition::PLZ },
+ { Row_City_US, "city", UserOptToken::City, EditPosition::CITY },
+ { Row_City_US, "state", UserOptToken::State, EditPosition::STATE },
+ { Row_City_US, "zip", UserOptToken::Zip, EditPosition::PLZ },
// Country
- { Row_Country, "country", USER_OPT_COUNTRY, EditPosition::COUNTRY },
+ { Row_Country, "country", UserOptToken::Country, EditPosition::COUNTRY },
// Title/Position
- { Row_TitlePos, "title", USER_OPT_TITLE, EditPosition::TITLE },
- { Row_TitlePos, "position", USER_OPT_POSITION, EditPosition::POSITION },
+ { Row_TitlePos, "title", UserOptToken::Title, EditPosition::TITLE },
+ { Row_TitlePos, "position", UserOptToken::Position, EditPosition::POSITION },
// Phone
- { Row_Phone, "home", USER_OPT_TELEPHONEHOME, EditPosition::TELPRIV },
- { Row_Phone, "work", USER_OPT_TELEPHONEWORK, EditPosition::TELCOMPANY },
+ { Row_Phone, "home", UserOptToken::TelephoneHome, EditPosition::TELPRIV },
+ { Row_Phone, "work", UserOptToken::TelephoneWork, EditPosition::TELCOMPANY },
// Fax/Mail
- { Row_FaxMail, "fax", USER_OPT_FAX, EditPosition::FAX },
- { Row_FaxMail, "email", USER_OPT_EMAIL, EditPosition::EMAIL },
+ { Row_FaxMail, "fax", UserOptToken::Fax, EditPosition::FAX },
+ { Row_FaxMail, "email", UserOptToken::Email, EditPosition::EMAIL },
};
@@ -278,7 +278,7 @@ void SvxGeneralTabPage::InitControls ()
vFields.push_back(boost::make_shared<Field>(
get<Edit>(vFieldInfo[iField].pEditId), iField));
// "short name" field?
- if (vFieldInfo[iField].nUserOptionsId == USER_OPT_ID)
+ if (vFieldInfo[iField].nUserOptionsId == UserOptToken::ID)
{
nNameRow = vRows.size() - 1;
nShortNameField = vFields.size() - 1;
@@ -420,7 +420,7 @@ void SvxGeneralTabPage::SetAddress_Impl()
{
Field& rField = *vFields[iField];
// updating content
- unsigned const nToken = vFieldInfo[rField.iField].nUserOptionsId;
+ UserOptToken const nToken = vFieldInfo[rField.iField].nUserOptionsId;
rField.pEdit->SetText(aUserOpt.GetToken(nToken));
// is enabled?
bool const bEnableEdit = !aUserOpt.IsTokenReadonly(nToken);
diff --git a/include/unotools/useroptions.hxx b/include/unotools/useroptions.hxx
index e518d9f2c0d9..0b3db72d4f31 100644
--- a/include/unotools/useroptions.hxx
+++ b/include/unotools/useroptions.hxx
@@ -26,24 +26,27 @@
#include <memory>
// define ----------------------------------------------------------------
-
-#define USER_OPT_CITY ((sal_uInt16)0)
-#define USER_OPT_COMPANY ((sal_uInt16)1)
-#define USER_OPT_COUNTRY ((sal_uInt16)2)
-#define USER_OPT_EMAIL ((sal_uInt16)3)
-#define USER_OPT_FAX ((sal_uInt16)4)
-#define USER_OPT_FIRSTNAME ((sal_uInt16)5)
-#define USER_OPT_LASTNAME ((sal_uInt16)6)
-#define USER_OPT_POSITION ((sal_uInt16)7)
-#define USER_OPT_STATE ((sal_uInt16)8)
-#define USER_OPT_STREET ((sal_uInt16)9)
-#define USER_OPT_TELEPHONEHOME ((sal_uInt16)10)
-#define USER_OPT_TELEPHONEWORK ((sal_uInt16)11)
-#define USER_OPT_TITLE ((sal_uInt16)12)
-#define USER_OPT_ID ((sal_uInt16)13)
-#define USER_OPT_ZIP ((sal_uInt16)14)
-#define USER_OPT_FATHERSNAME ((sal_uInt16)15)
-#define USER_OPT_APARTMENT ((sal_uInt16)16)
+enum class UserOptToken
+{
+ City = 0,
+ Company = 1,
+ Country = 2,
+ Email = 3,
+ Fax = 4,
+ FirstName = 5,
+ LastName = 6,
+ Position = 7,
+ State = 8,
+ Street = 9,
+ TelephoneHome = 10,
+ TelephoneWork = 11,
+ Title = 12,
+ ID = 13,
+ Zip = 14,
+ FathersName = 15,
+ Apartment = 16,
+ LAST = Apartment,
+};
// class SvtUserOptions --------------------------------------------------
@@ -74,9 +77,9 @@ public:
OUString GetFullName () const;
- bool IsTokenReadonly (sal_uInt16 nToken) const;
- OUString GetToken (sal_uInt16 nToken) const;
- void SetToken (sal_uInt16 nToken, OUString const& rNewToken);
+ bool IsTokenReadonly (UserOptToken nToken) const;
+ OUString GetToken (UserOptToken nToken) const;
+ void SetToken (UserOptToken nToken, OUString const& rNewToken);
private:
class Impl;
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 44947557920a..5271095b2f3f 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -1569,8 +1569,8 @@ void ScExportTest::testTrackChangesSimpleXLSX()
} aTest;
SvtUserOptions& rUserOpt = SC_MOD()->GetUserOptions();
- rUserOpt.SetToken(USER_OPT_FIRSTNAME, "Export");
- rUserOpt.SetToken(USER_OPT_LASTNAME, "Test");
+ rUserOpt.SetToken(UserOptToken::FirstName, "Export");
+ rUserOpt.SetToken(UserOptToken::LastName, "Test");
OUString aOwnerName = rUserOpt.GetFirstName() + " " + rUserOpt.GetLastName();
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index f6891656a2d1..be2939e8eec6 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -303,11 +303,11 @@ SwCalc::SwCalc( SwDoc& rD )
// those have two HashIds
11, 38
};
- static sal_uInt16 const aAdrToken[ 12 ] =
+ static UserOptToken const aAdrToken[ 12 ] =
{
- USER_OPT_COMPANY, USER_OPT_STREET, USER_OPT_COUNTRY, USER_OPT_ZIP,
- USER_OPT_CITY, USER_OPT_TITLE, USER_OPT_POSITION, USER_OPT_TELEPHONEWORK,
- USER_OPT_TELEPHONEHOME, USER_OPT_FAX, USER_OPT_EMAIL, USER_OPT_STATE
+ UserOptToken::Company, UserOptToken::Street, UserOptToken::Country, UserOptToken::Zip,
+ UserOptToken::City, UserOptToken::Title, UserOptToken::Position, UserOptToken::TelephoneWork,
+ UserOptToken::TelephoneHome, UserOptToken::Fax, UserOptToken::Email, UserOptToken::State
};
static sal_uInt16 SwDocStat::* const aDocStat1[ 3 ] =
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index b95df32bbe63..67d73562455f 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1848,30 +1848,30 @@ SwFieldType* SwExtUserFieldType::Copy() const
OUString SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 )
{
- sal_uInt16 nRet = USHRT_MAX;
+ UserOptToken nRet = static_cast<UserOptToken>(USHRT_MAX);
switch(nSub)
{
- case EU_FIRSTNAME: nRet = USER_OPT_FIRSTNAME; break;
- case EU_NAME: nRet = USER_OPT_LASTNAME; break;
- case EU_SHORTCUT: nRet = USER_OPT_ID; break;
-
- case EU_COMPANY: nRet = USER_OPT_COMPANY; break;
- case EU_STREET: nRet = USER_OPT_STREET; break;
- case EU_TITLE: nRet = USER_OPT_TITLE; break;
- case EU_POSITION: nRet = USER_OPT_POSITION; break;
- case EU_PHONE_PRIVATE: nRet = USER_OPT_TELEPHONEHOME; break;
- case EU_PHONE_COMPANY: nRet = USER_OPT_TELEPHONEWORK; break;
- case EU_FAX: nRet = USER_OPT_FAX; break;
- case EU_EMAIL: nRet = USER_OPT_EMAIL; break;
- case EU_COUNTRY: nRet = USER_OPT_COUNTRY; break;
- case EU_ZIP: nRet = USER_OPT_ZIP; break;
- case EU_CITY: nRet = USER_OPT_CITY; break;
- case EU_STATE: nRet = USER_OPT_STATE; break;
- case EU_FATHERSNAME: nRet = USER_OPT_FATHERSNAME; break;
- case EU_APARTMENT: nRet = USER_OPT_APARTMENT; break;
+ case EU_FIRSTNAME: nRet = UserOptToken::FirstName; break;
+ case EU_NAME: nRet = UserOptToken::LastName; break;
+ case EU_SHORTCUT: nRet = UserOptToken::ID; break;
+
+ case EU_COMPANY: nRet = UserOptToken::Company; break;
+ case EU_STREET: nRet = UserOptToken::Street; break;
+ case EU_TITLE: nRet = UserOptToken::Title; break;
+ case EU_POSITION: nRet = UserOptToken::Position; break;
+ case EU_PHONE_PRIVATE: nRet = UserOptToken::TelephoneHome; break;
+ case EU_PHONE_COMPANY: nRet = UserOptToken::TelephoneWork; break;
+ case EU_FAX: nRet = UserOptToken::Fax; break;
+ case EU_EMAIL: nRet = UserOptToken::Email; break;
+ case EU_COUNTRY: nRet = UserOptToken::Country; break;
+ case EU_ZIP: nRet = UserOptToken::Zip; break;
+ case EU_CITY: nRet = UserOptToken::City; break;
+ case EU_STATE: nRet = UserOptToken::State; break;
+ case EU_FATHERSNAME: nRet = UserOptToken::FathersName; break;
+ case EU_APARTMENT: nRet = UserOptToken::Apartment; break;
default: OSL_ENSURE( false, "Field unknown");
}
- if( USHRT_MAX != nRet )
+ if( static_cast<UserOptToken>(USHRT_MAX) != nRet )
{
SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions();
return rUserOpt.GetToken( nRet );
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 7dd5de2eef2e..1e0efb8817e3 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -41,37 +41,32 @@
#include <comphelper/configurationhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <i18nlangtag/mslangid.hxx>
+#include <o3tl/enumarray.hxx>
using namespace utl;
using namespace com::sun::star;
-namespace
-{
-
// vOptionNames[] -- names of the user option entries
// The order corresponds to the #define USER_OPT_* list in useroptions.hxx.
-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
+static o3tl::enumarray<UserOptToken, char const *> vOptionNames = {
+ "l", // UserOptToken::City
+ "o", // UserOptToken::Company
+ "c", // UserOptToken::Country
+ "mail", // UserOptToken::Email
+ "facsimiletelephonenumber", // UserOptToken::Fax
+ "givenname", // UserOptToken::FirstName
+ "sn", // UserOptToken::LastName
+ "position", // UserOptToken::Position
+ "st", // UserOptToken::State
+ "street", // UserOptToken::Street
+ "homephone", // UserOptToken::TelephoneHome
+ "telephonenumber", // UserOptToken::TelephoneWork
+ "title", // UserOptToken::Title
+ "initials", // UserOptToken::ID
+ "postalcode", // UserOptToken::Zip
+ "fathersname", // UserOptToken::FathersName
+ "apartment" // UserOptToken::Apartment
};
-const sal_uInt16 nOptionNameCount = SAL_N_ELEMENTS(vOptionNames);
-
-} // namespace
std::weak_ptr<SvtUserOptions::Impl> SvtUserOptions::xSharedImpl;
@@ -96,9 +91,9 @@ public:
OUString GetFullName () const;
- bool IsTokenReadonly (sal_uInt16 nToken) const;
- OUString GetToken (sal_uInt16 nToken) const;
- void SetToken (sal_uInt16 nToken, OUString const& rNewToken);
+ bool IsTokenReadonly (UserOptToken nToken) const;
+ OUString GetToken (UserOptToken nToken) const;
+ void SetToken (UserOptToken nToken, OUString const& rNewToken);
void Notify ();
private:
@@ -156,43 +151,33 @@ SvtUserOptions::Impl::Impl() :
}
}
-OUString SvtUserOptions::Impl::GetToken (sal_uInt16 nToken) const
+OUString SvtUserOptions::Impl::GetToken (UserOptToken nToken) const
{
OUString sToken;
- if (nToken < nOptionNameCount)
+ try
{
- try
- {
- if (m_xData.is())
- m_xData->getPropertyValue(OUString::createFromAscii(vOptionNames[nToken])) >>= sToken;
- }
- catch (uno::Exception const& ex)
- {
- SAL_WARN("unotools.config", "Caught unexpected: " << ex.Message);
- }
+ if (m_xData.is())
+ m_xData->getPropertyValue(OUString::createFromAscii(vOptionNames[nToken])) >>= sToken;
+ }
+ catch (uno::Exception const& ex)
+ {
+ SAL_WARN("unotools.config", "Caught unexpected: " << ex.Message);
}
- else
- SAL_WARN("unotools.config", "SvtUserOptions::Impl::GetToken(): invalid token");
return sToken;
}
-void SvtUserOptions::Impl::SetToken (sal_uInt16 nToken, OUString const& sToken)
+void SvtUserOptions::Impl::SetToken (UserOptToken nToken, OUString const& sToken)
{
- if (nToken < nOptionNameCount)
+ try
{
- try
- {
- if (m_xData.is())
- m_xData->setPropertyValue(OUString::createFromAscii(vOptionNames[nToken]), uno::makeAny(sToken));
- comphelper::ConfigurationHelper::flush(m_xCfg);
- }
- catch (uno::Exception const& ex)
- {
- SAL_WARN("unotools.config", "Caught unexpected: " << ex.Message);
- }
+ if (m_xData.is())
+ m_xData->setPropertyValue(OUString::createFromAscii(vOptionNames[nToken]), uno::makeAny(sToken));
+ comphelper::ConfigurationHelper::flush(m_xCfg);
+ }
+ catch (uno::Exception const& ex)
+ {
+ SAL_WARN("unotools.config", "Caught unexpected: " << ex.Message);
}
- else
- SAL_WARN("unotools.config", "SvtUserOptions::Impl::GetToken(): invalid token");
}
OUString SvtUserOptions::Impl::GetFullName () const
@@ -201,28 +186,28 @@ OUString SvtUserOptions::Impl::GetFullName () const
switch (LanguageType const eLang = SvtSysLocale().GetUILanguageTag().getLanguageType())
{
case LANGUAGE_RUSSIAN:
- sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
+ sFullName = GetToken(UserOptToken::FirstName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
- sFullName += GetToken(USER_OPT_FATHERSNAME).trim();
+ sFullName += GetToken(UserOptToken::FathersName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
- sFullName += GetToken(USER_OPT_LASTNAME).trim();
+ sFullName += GetToken(UserOptToken::LastName).trim();
break;
default:
if (MsLangId::isFamilyNameFirst(eLang))
{
- sFullName = GetToken(USER_OPT_LASTNAME).trim();
+ sFullName = GetToken(UserOptToken::LastName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
- sFullName += GetToken(USER_OPT_FIRSTNAME).trim();
+ sFullName += GetToken(UserOptToken::FirstName).trim();
}
else
{
- sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
+ sFullName = GetToken(UserOptToken::FirstName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
- sFullName += GetToken(USER_OPT_LASTNAME).trim();
+ sFullName += GetToken(UserOptToken::LastName).trim();
}
break;
}
@@ -235,21 +220,13 @@ void SvtUserOptions::Impl::Notify ()
NotifyListeners(0);
}
-bool SvtUserOptions::Impl::IsTokenReadonly (sal_uInt16 nToken) const
+bool SvtUserOptions::Impl::IsTokenReadonly (UserOptToken nToken) const
{
- if (nToken < nOptionNameCount)
- {
- uno::Reference<beans::XPropertySet> xData(m_xCfg, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySetInfo> xInfo = xData->getPropertySetInfo();
- beans::Property aProp = xInfo->getPropertyByName(OUString::createFromAscii(vOptionNames[nToken]));
- return ((aProp.Attributes & beans::PropertyAttribute::READONLY) ==
+ uno::Reference<beans::XPropertySet> xData(m_xCfg, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xInfo = xData->getPropertySetInfo();
+ beans::Property aProp = xInfo->getPropertyByName(OUString::createFromAscii(vOptionNames[nToken]));
+ return ((aProp.Attributes & beans::PropertyAttribute::READONLY) ==
beans::PropertyAttribute::READONLY);
- }
- else
- {
- SAL_WARN("unotools.config", "SvtUserOptions::Impl::IsTokenReadonly(): invalid token");
- return false;
- }
}
SvtUserOptions::SvtUserOptions ()
@@ -284,35 +261,35 @@ osl::Mutex& SvtUserOptions::GetInitMutex()
return theUserOptionsMutex::get();
}
-OUString SvtUserOptions::GetCompany () const { return GetToken(USER_OPT_COMPANY); }
-OUString SvtUserOptions::GetFirstName () const { return GetToken(USER_OPT_FIRSTNAME); }
-OUString SvtUserOptions::GetLastName () const { return GetToken(USER_OPT_LASTNAME); }
-OUString SvtUserOptions::GetID () const { return GetToken(USER_OPT_ID); }
-OUString SvtUserOptions::GetStreet () const { return GetToken(USER_OPT_STREET); }
-OUString SvtUserOptions::GetCity () const { return GetToken(USER_OPT_CITY); }
-OUString SvtUserOptions::GetState () const { return GetToken(USER_OPT_STATE); }
-OUString SvtUserOptions::GetZip () const { return GetToken(USER_OPT_ZIP); }
-OUString SvtUserOptions::GetCountry () const { return GetToken(USER_OPT_COUNTRY); }
-OUString SvtUserOptions::GetPosition () const { return GetToken(USER_OPT_POSITION); }
-OUString SvtUserOptions::GetTitle () const { return GetToken(USER_OPT_TITLE); }
-OUString SvtUserOptions::GetTelephoneHome () const { return GetToken(USER_OPT_TELEPHONEHOME); }
-OUString SvtUserOptions::GetTelephoneWork () const { return GetToken(USER_OPT_TELEPHONEWORK); }
-OUString SvtUserOptions::GetFax () const { return GetToken(USER_OPT_FAX); }
-OUString SvtUserOptions::GetEmail () const { return GetToken(USER_OPT_EMAIL); }
-
-bool SvtUserOptions::IsTokenReadonly (sal_uInt16 nToken) const
+OUString SvtUserOptions::GetCompany () const { return GetToken(UserOptToken::Company); }
+OUString SvtUserOptions::GetFirstName () const { return GetToken(UserOptToken::FirstName); }
+OUString SvtUserOptions::GetLastName () const { return GetToken(UserOptToken::LastName); }
+OUString SvtUserOptions::GetID () const { return GetToken(UserOptToken::ID); }
+OUString SvtUserOptions::GetStreet () const { return GetToken(UserOptToken::Street); }
+OUString SvtUserOptions::GetCity () const { return GetToken(UserOptToken::City); }
+OUString SvtUserOptions::GetState () const { return GetToken(UserOptToken::State); }
+OUString SvtUserOptions::GetZip () const { return GetToken(UserOptToken::Zip); }
+OUString SvtUserOptions::GetCountry () const { return GetToken(UserOptToken::Country); }
+OUString SvtUserOptions::GetPosition () const { return GetToken(UserOptToken::Position); }
+OUString SvtUserOptions::GetTitle () const { return GetToken(UserOptToken::Title); }
+OUString SvtUserOptions::GetTelephoneHome () const { return GetToken(UserOptToken::TelephoneHome); }
+OUString SvtUserOptions::GetTelephoneWork () const { return GetToken(UserOptToken::TelephoneWork); }
+OUString SvtUserOptions::GetFax () const { return GetToken(UserOptToken::Fax); }
+OUString SvtUserOptions::GetEmail () const { return GetToken(UserOptToken::Email); }
+
+bool SvtUserOptions::IsTokenReadonly (UserOptToken nToken) const
{
osl::MutexGuard aGuard(GetInitMutex());
return xImpl->IsTokenReadonly(nToken);
}
-OUString SvtUserOptions::GetToken (sal_uInt16 nToken) const
+OUString SvtUserOptions::GetToken (UserOptToken nToken) const
{
osl::MutexGuard aGuard(GetInitMutex());
return xImpl->GetToken(nToken);
}
-void SvtUserOptions::SetToken (sal_uInt16 nToken, OUString const& rNewToken)
+void SvtUserOptions::SetToken (UserOptToken nToken, OUString const& rNewToken)
{
osl::MutexGuard aGuard(GetInitMutex());
xImpl->SetToken(nToken, rNewToken);