xref: /AOO42X/main/sw/source/filter/ww8/fields.cxx (revision b1c5455db1639c48e26c568e4fa7ee78ca5d60ee)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 #include "fields.hxx"
28 #include <errhdl.hxx>   //ASSERT (use our own ww header later for asserts)
29 
30 #include <stddef.h>
31 
32 namespace ww
33 {
GetEnglishFieldName(eField eIndex)34     const char *GetEnglishFieldName(eField eIndex) throw()
35     {
36         //0 Signifies the field names I can't find.
37         // --> OD 2005-06-08 #i43956#
38         // field <eFOOTREF> = 5 should be mapped to "REF"
39         static const char *aFieldNames[] =
40         {
41             /* 0*/  0,
42             /* 1*/  0,
43             /* 2*/  0,
44             /* 3*/  "REF",
45             /* 4*/  "XE",
46             /* 5*/  "REF",
47             /* 6*/  "SET",
48             /* 7*/  "IF",
49             /* 8*/  "INDEX",
50             /* 9*/  "TC",
51             /*10*/  "STYLEREF",
52             /*11*/  "RD",
53             /*12*/  "SEQ",
54             /*13*/  "TOC",
55             /*14*/  "INFO",
56             /*15*/  "TITLE",
57             /*16*/  "SUBJECT",
58             /*17*/  "AUTHOR",
59             /*18*/  "KEYWORDS",
60             /*19*/  "COMMENTS",
61             /*20*/  "LASTSAVEDBY",
62             /*21*/  "CREATEDATE",
63             /*22*/  "SAVEDATE",
64             /*23*/  "PRINTDATE",
65             /*24*/  "REVNUM",
66             /*25*/  "EDITTIME",
67             /*26*/  "NUMPAGES",
68             /*27*/  "NUMWORDS",
69             /*28*/  "NUMCHARS",
70             /*29*/  "FILENAME",
71             /*30*/  "TEMPLATE",
72             /*31*/  "DATE",
73             /*32*/  "TIME",
74             /*33*/  "PAGE",
75             /*34*/  "=",
76             /*35*/  "QUOTE",
77             /*36*/  0,
78             /*37*/  "PAGEREF",
79             /*38*/  "ASK",
80             /*39*/  "FILLIN",
81             /*40*/  0,
82             /*41*/  "NEXT",
83             /*42*/  "NEXTIF",
84             /*43*/  "SKIPIF",
85             /*44*/  "MERGEREC",
86             /*45*/  0,
87             /*46*/  0,
88             /*47*/  0,
89             /*48*/  "PRINT",
90             /*49*/  "EQ",
91             /*50*/  "GOTOBUTTON",
92             /*51*/  "MACROBUTTON",
93             /*52*/  "AUTONUMOUT",
94             /*53*/  "AUTONUMLGL",
95             /*54*/  "AUTONUM",
96             /*55*/  0,
97             /*56*/  "LINK",
98             /*57*/  "SYMBOL",
99             /*58*/  "EMBED",
100             /*59*/  "MERGEFIELD",
101             /*60*/  "USERNAME",
102             /*61*/  "USERINITIALS",
103             /*62*/  "USERADDRESS",
104             /*63*/  "BARCODE",
105             /*64*/  "DOCVARIABLE",
106             /*65*/  "SECTION",
107             /*66*/  "SECTIONPAGES",
108             /*67*/  "INCLUDEPICTURE",
109             /*68*/  "INCLUDETEXT",
110             /*69*/  "FILESIZE",
111             /*70*/  "FORMTEXT",
112             /*71*/  "FORMCHECKBOX",
113             /*72*/  "NOTEREF",
114             /*73*/  "TOA",
115             /*74*/  "TA",
116             /*75*/  "MERGESEQ",
117             /*76*/  0,
118             /*77*/  "PRIVATE",
119             /*78*/  "DATABASE",
120             /*79*/  "AUTOTEXT",
121             /*80*/  "COMPARE",
122             /*81*/  0,
123             /*82*/  0,
124             /*83*/  "FORMDROPDOWN",
125             /*84*/  "ADVANCE",
126             /*85*/  "DOCPROPERTY",
127             /*86*/  0,
128             /*87*/  "CONTROL",
129             /*88*/  "HYPERLINK",
130             /*89*/  "AUTOTEXTLIST",
131             /*90*/  "LISTNUM",
132             /*91*/  0,
133             /*92*/  "BIDIOUTLINE",
134             /*93*/  "ADDRESSBLOCK",
135             /*94*/  "GREETINGLINE",
136             /*95*/  "SHAPE"
137         };
138 
139         size_t nIndex = static_cast<size_t>(eIndex);
140         if (nIndex >= sizeof(aFieldNames) / sizeof(aFieldNames[0]))
141             eIndex = eNONE;
142         ASSERT(eIndex != eNONE, "Unknown WinWord Field, let cmc know");
143         return aFieldNames[eIndex];
144     }
145 }
146 
147 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
148