summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-05-10 19:49:05 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-05-11 01:54:39 -0400
commit328be2536f5911dabb2ae504dc2f4fc348fc994e (patch)
tree3b3858dd23ca3938d3b946344ae0e9ffd87792fc
parent89d8f039af90b7f8f4d616abcfbcf4e3874d874d (diff)
Return correct presentation strings for fields.
Change-Id: Icab3910f49639fff1551dfdb5be9341bd3ea70b1
-rw-r--r--editeng/source/uno/unofield.cxx62
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 )
166 } 166 }
167} 167}
168 168
169static sal_Char const* aFieldItemNameMap_Impl[] =
170{
171 "Date",
172 "URL",
173 "Page",
174 "Pages",
175 "Time",
176 "File",
177 "Table",
178 "ExtTime",
179 "ExtFile",
180 "Author",
181 "Measure",
182 "ExtDate",
183 "Header",
184 "Footer",
185 "DateTime"
186};
187
188/* conversion routines */ 169/* conversion routines */
189 170
190static sal_Int16 getFileNameDisplayFormat( SvxFileFormat nFormat ) 171static sal_Int16 getFileNameDisplayFormat( SvxFileFormat nFormat )
@@ -618,14 +599,43 @@ OUString SAL_CALL SvxUnoTextField::getPresentation( sal_Bool bShowCommand )
618 throw(uno::RuntimeException) 599 throw(uno::RuntimeException)
619{ 600{
620 SolarMutexGuard aGuard; 601 SolarMutexGuard aGuard;
621 602 if (bShowCommand)
622 if(bShowCommand)
623 { 603 {
624 DBG_ASSERT(mnServiceId >= 0, "Unknown field type"); 604 switch (mnServiceId)
625 if (isValidFieldId(mnServiceId)) 605 {
626 return OUString::createFromAscii(aFieldItemNameMap_Impl[mnServiceId]); 606 case text::textfield::Type::DATE:
627 else 607 return OUString("Date");
628 return OUString("Unknown"); 608 case text::textfield::Type::URL:
609 return OUString("URL");
610 case text::textfield::Type::PAGE:
611 return OUString("Page");
612 case text::textfield::Type::PAGES:
613 return OUString("Pages");
614 case text::textfield::Type::TIME:
615 return OUString("Time");
616 case text::textfield::Type::FILE:
617 return OUString("File");
618 case text::textfield::Type::TABLE:
619 return OUString("Table");
620 case text::textfield::Type::EXTENDED_TIME:
621 return OUString("ExtTime");
622 case text::textfield::Type::EXTENDED_FILE:
623 return OUString("ExtFile");
624 case text::textfield::Type::AUTHOR:
625 return OUString("Author");
626 case text::textfield::Type::MEASURE:
627 return OUString("Measure");
628 case text::textfield::Type::HEADER:
629 return OUString("Header");
630 case text::textfield::Type::FOOTER:
631 return OUString("Footer");
632 case text::textfield::Type::DATE_TIME:
633 return OUString("DateTime");
634 case text::textfield::Type::EXTENDED_DATE:
635 return OUString("ExtDate");
636 default:
637 return OUString("Unknown");
638 }
629 } 639 }
630 else 640 else
631 { 641 {