merge the formfield patch from ooo-build
[ooovba.git] / sw / source / filter / ww8 / fields.cxx
blob4e73dae967632df13753a64e366f7d1b7b6073c0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fields.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
34 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
35 #include "fields.hxx"
36 #include <errhdl.hxx> //ASSERT (use our own ww header later for asserts)
38 #include <stddef.h>
40 namespace ww
42 const char *GetEnglishFieldName(eField eIndex) throw()
44 //0 Signifies the field names I can't find.
45 // --> OD 2005-06-08 #i43956#
46 // field <eFOOTREF> = 5 should be mapped to "REF"
47 static const char *aFieldNames[] =
49 /* 0*/ 0,
50 /* 1*/ 0,
51 /* 2*/ 0,
52 /* 3*/ "REF",
53 /* 4*/ "XE",
54 /* 5*/ "REF",
55 /* 6*/ "SET",
56 /* 7*/ "IF",
57 /* 8*/ "INDEX",
58 /* 9*/ "TC",
59 /*10*/ "STYLEREF",
60 /*11*/ "RD",
61 /*12*/ "SEQ",
62 /*13*/ "TOC",
63 /*14*/ "INFO",
64 /*15*/ "TITLE",
65 /*16*/ "SUBJECT",
66 /*17*/ "AUTHOR",
67 /*18*/ "KEYWORDS",
68 /*19*/ "COMMENTS",
69 /*20*/ "LASTSAVEDBY",
70 /*21*/ "CREATEDATE",
71 /*22*/ "SAVEDATE",
72 /*23*/ "PRINTDATE",
73 /*24*/ "REVNUM",
74 /*25*/ "EDITTIME",
75 /*26*/ "NUMPAGES",
76 /*27*/ "NUMWORDS",
77 /*28*/ "NUMCHARS",
78 /*29*/ "FILENAME",
79 /*30*/ "TEMPLATE",
80 /*31*/ "DATE",
81 /*32*/ "TIME",
82 /*33*/ "PAGE",
83 /*34*/ "=",
84 /*35*/ "QUOTE",
85 /*36*/ 0,
86 /*37*/ "PAGEREF",
87 /*38*/ "ASK",
88 /*39*/ "FILLIN",
89 /*40*/ 0,
90 /*41*/ "NEXT",
91 /*42*/ "NEXTIF",
92 /*43*/ "SKIPIF",
93 /*44*/ "MERGEREC",
94 /*45*/ 0,
95 /*46*/ 0,
96 /*47*/ 0,
97 /*48*/ "PRINT",
98 /*49*/ "EQ",
99 /*50*/ "GOTOBUTTON",
100 /*51*/ "MACROBUTTON",
101 /*52*/ "AUTONUMOUT",
102 /*53*/ "AUTONUMLGL",
103 /*54*/ "AUTONUM",
104 /*55*/ 0,
105 /*56*/ "LINK",
106 /*57*/ "SYMBOL",
107 /*58*/ "EMBED",
108 /*59*/ "MERGEFIELD",
109 /*60*/ "USERNAME",
110 /*61*/ "USERINITIALS",
111 /*62*/ "USERADDRESS",
112 /*63*/ "BARCODE",
113 /*64*/ "DOCVARIABLE",
114 /*65*/ "SECTION",
115 /*66*/ "SECTIONPAGES",
116 /*67*/ "INCLUDEPICTURE",
117 /*68*/ "INCLUDETEXT",
118 /*69*/ "FILESIZE",
119 /*70*/ "FORMTEXT",
120 /*71*/ "FORMCHECKBOX",
121 /*72*/ "NOTEREF",
122 /*73*/ "TOA",
123 /*74*/ "TA",
124 /*75*/ "MERGESEQ",
125 /*76*/ 0,
126 /*77*/ "PRIVATE",
127 /*78*/ "DATABASE",
128 /*79*/ "AUTOTEXT",
129 /*80*/ "COMPARE",
130 /*81*/ 0,
131 /*82*/ 0,
132 /*83*/ "FORMDROPDOWN",
133 /*84*/ "ADVANCE",
134 /*85*/ "DOCPROPERTY",
135 /*86*/ 0,
136 /*87*/ "CONTROL",
137 /*88*/ "HYPERLINK",
138 /*89*/ "AUTOTEXTLIST",
139 /*90*/ "LISTNUM",
140 /*91*/ 0,
141 /*92*/ "BIDIOUTLINE",
142 /*93*/ "ADDRESSBLOCK",
143 /*94*/ "GREETINGLINE",
144 /*95*/ "SHAPE"
147 size_t nIndex = static_cast<size_t>(eIndex);
148 if (nIndex >= sizeof(aFieldNames) / sizeof(aFieldNames[0]))
149 eIndex = eNONE;
150 ASSERT(eIndex != eNONE, "Unknown WinWord Field, let cmc know");
151 return aFieldNames[eIndex];
155 /* vi:set tabstop=4 shiftwidth=4 expandtab: */