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