diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-10 19:49:05 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-11 01:54:39 -0400 |
commit | 328be2536f5911dabb2ae504dc2f4fc348fc994e (patch) | |
tree | 3b3858dd23ca3938d3b946344ae0e9ffd87792fc /editeng/source/uno | |
parent | 89d8f039af90b7f8f4d616abcfbcf4e3874d874d (diff) |
Return correct presentation strings for fields.
Change-Id: Icab3910f49639fff1551dfdb5be9341bd3ea70b1
Diffstat (limited to 'editeng/source/uno')
-rw-r--r-- | editeng/source/uno/unofield.cxx | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index a530c6b93d96..975ab1506ee5 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -166,25 +166,6 @@ const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId ) } } -static sal_Char const* aFieldItemNameMap_Impl[] = -{ - "Date", - "URL", - "Page", - "Pages", - "Time", - "File", - "Table", - "ExtTime", - "ExtFile", - "Author", - "Measure", - "ExtDate", - "Header", - "Footer", - "DateTime" -}; - /* conversion routines */ static sal_Int16 getFileNameDisplayFormat( SvxFileFormat nFormat ) @@ -618,14 +599,43 @@ OUString SAL_CALL SvxUnoTextField::getPresentation( sal_Bool bShowCommand ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - - if(bShowCommand) + if (bShowCommand) { - DBG_ASSERT(mnServiceId >= 0, "Unknown field type"); - if (isValidFieldId(mnServiceId)) - return OUString::createFromAscii(aFieldItemNameMap_Impl[mnServiceId]); - else - return OUString("Unknown"); + switch (mnServiceId) + { + case text::textfield::Type::DATE: + return OUString("Date"); + case text::textfield::Type::URL: + return OUString("URL"); + case text::textfield::Type::PAGE: + return OUString("Page"); + case text::textfield::Type::PAGES: + return OUString("Pages"); + case text::textfield::Type::TIME: + return OUString("Time"); + case text::textfield::Type::FILE: + return OUString("File"); + case text::textfield::Type::TABLE: + return OUString("Table"); + case text::textfield::Type::EXTENDED_TIME: + return OUString("ExtTime"); + case text::textfield::Type::EXTENDED_FILE: + return OUString("ExtFile"); + case text::textfield::Type::AUTHOR: + return OUString("Author"); + case text::textfield::Type::MEASURE: + return OUString("Measure"); + case text::textfield::Type::HEADER: + return OUString("Header"); + case text::textfield::Type::FOOTER: + return OUString("Footer"); + case text::textfield::Type::DATE_TIME: + return OUString("DateTime"); + case text::textfield::Type::EXTENDED_DATE: + return OUString("ExtDate"); + default: + return OUString("Unknown"); + } } else { |