xref: /aoo4110/main/sw/source/filter/ww8/fields.cxx (revision b1cdbd2c)
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 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
28 #include "fields.hxx"
29 #include <errhdl.hxx>   //ASSERT (use our own ww header later for asserts)
30 
31 #include <stddef.h>
32 
33 namespace ww
34 {
GetEnglishFieldName(eField eIndex)35     const char *GetEnglishFieldName(eField eIndex) throw()
36     {
37         //0 Signifies the field names I can't find.
38         // --> OD 2005-06-08 #i43956#
39         // field <eFOOTREF> = 5 should be mapped to "REF"
40         static const char *aFieldNames[] =
41         {
42             /* 0*/  0,
43             /* 1*/  0,
44             /* 2*/  0,
45             /* 3*/  "REF",
46             /* 4*/  "XE",
47             /* 5*/  "REF",
48             /* 6*/  "SET",
49             /* 7*/  "IF",
50             /* 8*/  "INDEX",
51             /* 9*/  "TC",
52             /*10*/  "STYLEREF",
53             /*11*/  "RD",
54             /*12*/  "SEQ",
55             /*13*/  "TOC",
56             /*14*/  "INFO",
57             /*15*/  "TITLE",
58             /*16*/  "SUBJECT",
59             /*17*/  "AUTHOR",
60             /*18*/  "KEYWORDS",
61             /*19*/  "COMMENTS",
62             /*20*/  "LASTSAVEDBY",
63             /*21*/  "CREATEDATE",
64             /*22*/  "SAVEDATE",
65             /*23*/  "PRINTDATE",
66             /*24*/  "REVNUM",
67             /*25*/  "EDITTIME",
68             /*26*/  "NUMPAGES",
69             /*27*/  "NUMWORDS",
70             /*28*/  "NUMCHARS",
71             /*29*/  "FILENAME",
72             /*30*/  "TEMPLATE",
73             /*31*/  "DATE",
74             /*32*/  "TIME",
75             /*33*/  "PAGE",
76             /*34*/  "=",
77             /*35*/  "QUOTE",
78             /*36*/  0,
79             /*37*/  "PAGEREF",
80             /*38*/  "ASK",
81             /*39*/  "FILLIN",
82             /*40*/  0,
83             /*41*/  "NEXT",
84             /*42*/  "NEXTIF",
85             /*43*/  "SKIPIF",
86             /*44*/  "MERGEREC",
87             /*45*/  0,
88             /*46*/  0,
89             /*47*/  0,
90             /*48*/  "PRINT",
91             /*49*/  "EQ",
92             /*50*/  "GOTOBUTTON",
93             /*51*/  "MACROBUTTON",
94             /*52*/  "AUTONUMOUT",
95             /*53*/  "AUTONUMLGL",
96             /*54*/  "AUTONUM",
97             /*55*/  0,
98             /*56*/  "LINK",
99             /*57*/  "SYMBOL",
100             /*58*/  "EMBED",
101             /*59*/  "MERGEFIELD",
102             /*60*/  "USERNAME",
103             /*61*/  "USERINITIALS",
104             /*62*/  "USERADDRESS",
105             /*63*/  "BARCODE",
106             /*64*/  "DOCVARIABLE",
107             /*65*/  "SECTION",
108             /*66*/  "SECTIONPAGES",
109             /*67*/  "INCLUDEPICTURE",
110             /*68*/  "INCLUDETEXT",
111             /*69*/  "FILESIZE",
112             /*70*/  "FORMTEXT",
113             /*71*/  "FORMCHECKBOX",
114             /*72*/  "NOTEREF",
115             /*73*/  "TOA",
116             /*74*/  "TA",
117             /*75*/  "MERGESEQ",
118             /*76*/  0,
119             /*77*/  "PRIVATE",
120             /*78*/  "DATABASE",
121             /*79*/  "AUTOTEXT",
122             /*80*/  "COMPARE",
123             /*81*/  0,
124             /*82*/  0,
125             /*83*/  "FORMDROPDOWN",
126             /*84*/  "ADVANCE",
127             /*85*/  "DOCPROPERTY",
128             /*86*/  0,
129             /*87*/  "CONTROL",
130             /*88*/  "HYPERLINK",
131             /*89*/  "AUTOTEXTLIST",
132             /*90*/  "LISTNUM",
133             /*91*/  0,
134             /*92*/  "BIDIOUTLINE",
135             /*93*/  "ADDRESSBLOCK",
136             /*94*/  "GREETINGLINE",
137             /*95*/  "SHAPE"
138         };
139 
140         size_t nIndex = static_cast<size_t>(eIndex);
141         if (nIndex >= sizeof(aFieldNames) / sizeof(aFieldNames[0]))
142             eIndex = eNONE;
143         ASSERT(eIndex != eNONE, "Unknown WinWord Field, let cmc know");
144         return aFieldNames[eIndex];
145     }
146 }
147 
148 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
149