26#include <osl/diagnose.h>
34struct ScDisplayNameMap
44 if (
nType == SfxStyleFamily::Para )
46 static ScDisplayNameMap
const aCellMap[]
53 {
ScResId( STR_STYLENAME_HEADING ),
"Heading" },
54 {
ScResId( STR_STYLENAME_HEADING_1 ),
"Heading 1" },
55 {
ScResId( STR_STYLENAME_HEADING_2 ),
"Heading 2" },
56 {
ScResId( STR_STYLENAME_TEXT ),
"Text" },
57 {
ScResId( STR_STYLENAME_NOTE ),
"Note" },
58 {
ScResId( STR_STYLENAME_FOOTNOTE ),
"Footnote" },
59 {
ScResId( STR_STYLENAME_HYPERLINK ),
"Hyperlink" },
60 {
ScResId( STR_STYLENAME_STATUS ),
"Status" },
61 {
ScResId( STR_STYLENAME_GOOD ),
"Good" },
62 {
ScResId( STR_STYLENAME_NEUTRAL ),
"Neutral" },
63 {
ScResId( STR_STYLENAME_BAD ),
"Bad" },
64 {
ScResId( STR_STYLENAME_WARNING ),
"Warning" },
65 {
ScResId( STR_STYLENAME_ERROR ),
"Error" },
66 {
ScResId( STR_STYLENAME_ACCENT ),
"Accent" },
67 {
ScResId( STR_STYLENAME_ACCENT_1 ),
"Accent 1" },
68 {
ScResId( STR_STYLENAME_ACCENT_2 ),
"Accent 2" },
69 {
ScResId( STR_STYLENAME_ACCENT_3 ),
"Accent 3" },
70 {
ScResId( STR_STYLENAME_RESULT ),
"Result" },
85 { OUString(), OUString() },
89 else if (
nType == SfxStyleFamily::Page )
91 static ScDisplayNameMap
const aPageMap[]
96 { OUString(), OUString() },
100 else if (
nType == SfxStyleFamily::Frame )
102 static ScDisplayNameMap
const aGraphicMap[]
105 {
ScResId( STR_STYLENAME_NOTE ),
"Note" },
107 { OUString(), OUString() },
111 OSL_FAIL(
"invalid family");
127 bool bDisplayIsProgrammatic =
false;
134 if (pNames->aDispName == rDispName)
135 return pNames->aProgName;
136 else if (pNames->aProgName == rDispName)
137 bDisplayIsProgrammatic =
true;
139 while( !(++pNames)->aDispName.isEmpty() );
157 return rProgName.copy( 0, rProgName.getLength() -
SC_SUFFIX_USER.getLength() );
165 if (pNames->aProgName == rProgName)
166 return pNames->aDispName;
168 while( !(++pNames)->aDispName.isEmpty() );
static SC_DLLPUBLIC OUString ProgrammaticToDisplayName(const OUString &rProgName, SfxStyleFamily nType)
static OUString DisplayToProgrammaticName(const OUString &rDispName, SfxStyleFamily nType)
constexpr bool ends_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
OUString ScResId(TranslateId aId)
static const ScDisplayNameMap * lcl_GetStyleNameMap(SfxStyleFamily nType)
static bool lcl_EndsWithUser(std::u16string_view rString)
constexpr OUStringLiteral SC_SUFFIX_USER
constexpr OUStringLiteral SC_STYLE_PROG_HEADING1
constexpr OUStringLiteral SC_STYLE_PROG_RESULT1
constexpr OUStringLiteral SC_STYLE_PROG_STANDARD
constexpr OUStringLiteral SC_STYLE_PROG_HEADING
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_TOP
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_INNER
constexpr OUStringLiteral SC_STYLE_PROG_REPORT
constexpr OUStringLiteral SC_STYLE_PROG_RESULT
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_CATEGORY
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_FIELDNAME
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_TITLE
constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_RESULT