build fix
[LibreOffice.git] / sw / source / filter / ww8 / fields.cxx
blob68a58d856f33f2ec1138876067c777a7d4adebb5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "fields.hxx"
21 #include <osl/diagnose.h>
22 #include <stddef.h>
24 namespace ww
26 const char *GetEnglishFieldName(eField eIndex) throw()
28 //0 Signifies the field names I can't find.
29 // #i43956# - field <eFOOTREF> = 5 should be mapped to "REF"
30 static const char *aFieldNames[] =
32 /* 0*/ nullptr,
33 /* 1*/ nullptr,
34 /* 2*/ nullptr,
35 /* 3*/ "REF",
36 /* 4*/ "XE",
37 /* 5*/ "REF",
38 /* 6*/ "SET",
39 /* 7*/ "IF",
40 /* 8*/ "INDEX",
41 /* 9*/ "TC",
42 /*10*/ "STYLEREF",
43 /*11*/ "RD",
44 /*12*/ "SEQ",
45 /*13*/ "TOC",
46 /*14*/ "INFO",
47 /*15*/ "TITLE",
48 /*16*/ "SUBJECT",
49 /*17*/ "AUTHOR",
50 /*18*/ "KEYWORDS",
51 /*19*/ "COMMENTS",
52 /*20*/ "LASTSAVEDBY",
53 /*21*/ "CREATEDATE",
54 /*22*/ "SAVEDATE",
55 /*23*/ "PRINTDATE",
56 /*24*/ "REVNUM",
57 /*25*/ "EDITTIME",
58 /*26*/ "NUMPAGES",
59 /*27*/ "NUMWORDS",
60 /*28*/ "NUMCHARS",
61 /*29*/ "FILENAME",
62 /*30*/ "TEMPLATE",
63 /*31*/ "DATE",
64 /*32*/ "TIME",
65 /*33*/ "PAGE",
66 /*34*/ "=",
67 /*35*/ "QUOTE",
68 /*36*/ nullptr,
69 /*37*/ "PAGEREF",
70 /*38*/ "ASK",
71 /*39*/ "FILLIN",
72 /*40*/ nullptr,
73 /*41*/ "NEXT",
74 /*42*/ "NEXTIF",
75 /*43*/ "SKIPIF",
76 /*44*/ "MERGEREC",
77 /*45*/ nullptr,
78 /*46*/ nullptr,
79 /*47*/ nullptr,
80 /*48*/ "PRINT",
81 /*49*/ "EQ",
82 /*50*/ "GOTOBUTTON",
83 /*51*/ "MACROBUTTON",
84 /*52*/ "AUTONUMOUT",
85 /*53*/ "AUTONUMLGL",
86 /*54*/ "AUTONUM",
87 /*55*/ nullptr,
88 /*56*/ "LINK",
89 /*57*/ "SYMBOL",
90 /*58*/ "EMBED",
91 /*59*/ "MERGEFIELD",
92 /*60*/ "USERNAME",
93 /*61*/ "USERINITIALS",
94 /*62*/ "USERADDRESS",
95 /*63*/ "BARCODE",
96 /*64*/ "DOCVARIABLE",
97 /*65*/ "SECTION",
98 /*66*/ "SECTIONPAGES",
99 /*67*/ "INCLUDEPICTURE",
100 /*68*/ "INCLUDETEXT",
101 /*69*/ "FILESIZE",
102 /*70*/ "FORMTEXT",
103 /*71*/ "FORMCHECKBOX",
104 /*72*/ "NOTEREF",
105 /*73*/ "TOA",
106 /*74*/ "TA",
107 /*75*/ "MERGESEQ",
108 /*76*/ nullptr,
109 /*77*/ "PRIVATE",
110 /*78*/ "DATABASE",
111 /*79*/ "AUTOTEXT",
112 /*80*/ "COMPARE",
113 /*81*/ nullptr,
114 /*82*/ nullptr,
115 /*83*/ "FORMDROPDOWN",
116 /*84*/ "ADVANCE",
117 /*85*/ "DOCPROPERTY",
118 /*86*/ nullptr,
119 /*87*/ "CONTROL",
120 /*88*/ "HYPERLINK",
121 /*89*/ "AUTOTEXTLIST",
122 /*90*/ "LISTNUM",
123 /*91*/ nullptr,
124 /*92*/ "BIDIOUTLINE",
125 /*93*/ "ADDRESSBLOCK",
126 /*94*/ "GREETINGLINE",
127 /*95*/ "SHAPE",
128 /*96*/ "BIBLIOGRAPHY",
129 /*97*/ "CITATION"
132 size_t nIndex = static_cast<size_t>(eIndex);
133 if (nIndex >= SAL_N_ELEMENTS(aFieldNames))
134 eIndex = eNONE;
135 OSL_ENSURE(eIndex != eNONE, "Unknown WinWord Field");
136 return aFieldNames[eIndex];
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */