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