LCOV - code coverage report
Current view: top level - sw/source/filter/ww8 - fields.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 5 80.0 %
Date: 2012-08-25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

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

Generated by: LCOV version 1.10