LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/rsc/source/parser - rscibas.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 279 304 91.8 %
Date: 2013-07-09 Functions: 25 26 96.2 %
Legend: Lines: hit not hit

          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 <stdlib.h>
      22             : #include <stdio.h>
      23             : #include <string.h>
      24             : 
      25             : #include <comphelper/string.hxx>
      26             : #include <i18nlangtag/mslangid.hxx>
      27             : #include <i18nlangtag/languagetag.hxx>
      28             : #include <tools/color.hxx>
      29             : #include <tools/fldunit.hxx>
      30             : #include <tools/mapunit.hxx>
      31             : #include <tools/rc.h>
      32             : #include <tools/wintypes.hxx>
      33             : #include <rsc/rsc-vcl-shared-types.hxx>
      34             : 
      35             : #include <com/sun/star/awt/Key.hpp>
      36             : 
      37             : #include <rscconst.hxx>
      38             : #include <rscarray.hxx>
      39             : #include <rscclass.hxx>
      40             : #include <rsccont.hxx>
      41             : #include <rscdb.hxx>
      42             : #include <rsclex.hxx>
      43             : #include <rscyacc.hxx>
      44             : 
      45             : #include <boost/unordered_map.hpp>
      46             : 
      47      141476 : void RscTypCont::SETCONST( RscConst * pClass, const char * szString, sal_uInt32 nVal )
      48             : {
      49             : #if OSL_DEBUG_LEVEL > 2
      50             :     fprintf( stderr, "setconst : %s\n", szString );
      51             : #endif
      52             :     pClass->SetConstant( aNmTb.Put( szString,
      53      141476 :                          CONSTNAME, nVal ), nVal );
      54      141476 : }
      55             : 
      56       12520 : void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal )
      57             : {
      58             : #if OSL_DEBUG_LEVEL > 2
      59             :     fprintf( stderr, "setconst hash: %u\n", (unsigned int)nName );
      60             : #endif
      61             :     pClass->SetConstant( aNmTb.Put( nName,
      62       12520 :                          CONSTNAME, nVal ), nVal );
      63       12520 : }
      64             : 
      65             : 
      66             : typedef boost::unordered_map< OString, sal_uInt32, OStringHash > langmap;
      67         626 : static langmap ULong_Iso_map;
      68             : 
      69      514064 : sal_uInt32 GetLangId(const OString &rLang)
      70             : {
      71      514064 :     langmap::iterator pIter = ULong_Iso_map.find( rLang );
      72      514064 :     if ( pIter != ULong_Iso_map.end())
      73      112172 :         return pIter->second;
      74      401892 :     return 0;
      75             : }
      76             : 
      77         626 : void RscLangEnum::Init( RscNameTable& rNames )
      78             : {
      79         626 :     SetConstant( rNames.Put( "SYSTEM", CONSTNAME, (long)LANGUAGE_SYSTEM ), LANGUAGE_SYSTEM );
      80         626 :     SetConstant( rNames.Put( "DONTKNOW", CONSTNAME, LANGUAGE_DONTKNOW ), LANGUAGE_DONTKNOW );
      81             : 
      82         626 :     sal_Int32 nIndex = 0;
      83         626 :     mnLangId = 0x400; // stay away from selfdefined...
      84             :     const MsLangId::IsoLangEntry* pLangEntry;
      85             : 
      86      265424 :     while ( NULL != ( pLangEntry = MsLangId::getIsoLangEntry( nIndex )) && ( pLangEntry->mnLang != LANGUAGE_DONTKNOW ))
      87             :     {
      88             : #if OSL_DEBUG_LEVEL > 2
      89             :         fprintf( stderr, "ISO Language in : %d, 0x%04x, %s\n",
      90             :                 (int)nIndex,
      91             :                 (unsigned)pLangEntry->mnLang,
      92             :                 OUStringToOString( pLangEntry->getTagString(), RTL_TEXTENCODING_ASCII_US).getStr());
      93             :         fprintf( stderr, "ISO Language out:");
      94             : #endif
      95      264172 :         LanguageTag aLanguageTag( pLangEntry->getTagString());
      96      528344 :         ::std::vector< OUString > aFallbacks( aLanguageTag.getFallbackStrings());
      97      778118 :         for (::std::vector< OUString >::const_iterator it( aFallbacks.begin()); it != aFallbacks.end(); ++it)
      98             :         {
      99      513946 :             OString aLang( OUStringToOString( *it, RTL_TEXTENCODING_ASCII_US));
     100      513946 :             SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
     101      513946 :             bool bAdd = (GetLangId( aLang ) == 0);
     102      513946 :             if ( bAdd )
     103      401892 :                 ULong_Iso_map[ aLang ] = mnLangId;
     104             : #if OSL_DEBUG_LEVEL > 2
     105             :             fprintf( stderr, " %s 0x%lx (%s)", aLang.getStr(), mnLangId, (bAdd ? "added" : "exists") );
     106             : #endif
     107      513946 :             mnLangId++;
     108      513946 :         }
     109             : #if OSL_DEBUG_LEVEL > 2
     110             :         fprintf( stderr, "\n");
     111             : #endif
     112      264172 :         nIndex++;
     113      264172 :     }
     114             :     // hack - survive "x-no-translate"
     115             :     /* XXX: that ^^^ was the original comment, but we're adding "x-comment"
     116             :      * here? Which is good anyway. */
     117         626 :     SetConstant( rNames.Put( "x-comment", CONSTNAME, mnLangId ), mnLangId );
     118         626 :     mnLangId++;
     119             : 
     120         626 :     OString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
     121         626 :     if ( !aEnvIsoTokens.isEmpty() )
     122             :     {
     123           0 :         OString aIsoToken;
     124           0 :         sal_uInt16 nTokenCounter = 0;
     125           0 :         bool bOneMore = 1;
     126           0 :         while ( bOneMore )
     127             :         {
     128           0 :             aIsoToken = comphelper::string::getToken(aEnvIsoTokens, nTokenCounter, ' ');
     129           0 :             if ( !aIsoToken.isEmpty() )
     130             :             {
     131           0 :                 SetConstant( rNames.Put( aIsoToken.getStr(), CONSTNAME, mnLangId ), mnLangId );
     132           0 :                 bool bAdd = (GetLangId( aIsoToken ) == 0);
     133           0 :                 if ( bAdd )
     134           0 :                     ULong_Iso_map[ aIsoToken ] = mnLangId;
     135             : #if OSL_DEBUG_LEVEL > 2
     136             :                 fprintf( stderr, "Env ISO Language out: %s 0x%lx (%s)\n",
     137             :                         aIsoToken.getStr(), mnLangId, (bAdd ? "added" : "exists") );
     138             : #endif
     139           0 :                 mnLangId++;
     140             :             }
     141             :             else
     142           0 :                 bOneMore = 0;
     143             : 
     144           0 :             nTokenCounter++;
     145           0 :         }
     146         626 :     }
     147         626 : }
     148             : 
     149           0 : Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
     150             : {
     151           0 :     Atom nResult = 0;
     152           0 :     bool bAdd = false;
     153             :     KEY_STRUCT aStruct;
     154           0 :     if( ! rNames.Get( nResult = pHS->getID( pLang ), &aStruct ) )
     155             :     {
     156           0 :         SetConstant( nResult = rNames.Put( pLang, CONSTNAME, mnLangId ), mnLangId );
     157             :         // insert new lang to ULong_Iso_map
     158           0 :         OString aLang( pLang );
     159           0 :         bAdd = (GetLangId( aLang ) == 0);
     160           0 :         if ( bAdd )
     161           0 :             ULong_Iso_map[ aLang ] = mnLangId;
     162             :         // increase id counter
     163           0 :         mnLangId++;
     164             :     }
     165             : #if OSL_DEBUG_LEVEL > 2
     166             :     fprintf( stderr, "AddLanguage( '%s' ) = %d (%s)\n", pLang, nResult, (bAdd ? "added" : "exists") );
     167             : #endif
     168           0 :     return nResult;
     169             : }
     170             : 
     171         626 : RscEnum * RscTypCont::InitLangType()
     172             : {
     173         626 :     aLangType.Init( aNmTb );
     174         626 :     return &aLangType;
     175             : }
     176             : 
     177         626 : RscEnum * RscTypCont::InitFieldUnitsType()
     178             : {
     179             :     RscEnum * pFieldUnits;
     180         626 :     pFieldUnits = new RscEnum( pHS->getID( "EnumFieldUnit" ), RSC_NOTYPE );
     181             : 
     182         626 :     SETCONST( pFieldUnits, "FUNIT_NONE", FUNIT_NONE );
     183         626 :     SETCONST( pFieldUnits, "FUNIT_MM", FUNIT_MM );
     184         626 :     SETCONST( pFieldUnits, "FUNIT_CM", FUNIT_CM );
     185         626 :     SETCONST( pFieldUnits, "FUNIT_M", FUNIT_M );
     186         626 :     SETCONST( pFieldUnits, "FUNIT_KM", FUNIT_KM );
     187         626 :     SETCONST( pFieldUnits, "FUNIT_TWIP", FUNIT_TWIP );
     188         626 :     SETCONST( pFieldUnits, "FUNIT_POINT", FUNIT_POINT );
     189         626 :     SETCONST( pFieldUnits, "FUNIT_PICA", FUNIT_PICA );
     190         626 :     SETCONST( pFieldUnits, "FUNIT_INCH", FUNIT_INCH );
     191         626 :     SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT );
     192         626 :     SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE );
     193         626 :     SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM );
     194         626 :     SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR );
     195         626 :     SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE );
     196         626 :     SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT );
     197             : 
     198         626 :     return pFieldUnits;
     199             : }
     200             : 
     201         626 : RscEnum * RscTypCont::InitTimeFieldFormat()
     202             : {
     203             :     RscEnum * pTimeFieldFormat;
     204        1252 :     pTimeFieldFormat = new RscEnum( pHS->getID( "EnumTimeFieldFormat" ),
     205         626 :                                     RSC_NOTYPE );
     206             : 
     207         626 :     SETCONST( pTimeFieldFormat, "TIMEF_NONE", TIMEF_NONE );
     208         626 :     SETCONST( pTimeFieldFormat, "TIMEF_SEC", TIMEF_SEC );
     209         626 :     SETCONST( pTimeFieldFormat, "TIMEF_100TH_SEC", TIMEF_100TH_SEC );
     210             : 
     211         626 :     return pTimeFieldFormat;
     212             : }
     213             : 
     214         626 : RscEnum * RscTypCont::InitColor()
     215             : {
     216             :     RscEnum * pColor;
     217         626 :     pColor = new RscEnum( pHS->getID( "EnumColor" ), RSC_NOTYPE );
     218             : 
     219         626 :     SETCONST( pColor, "COL_BLACK",                  COL_BLACK );
     220         626 :     SETCONST( pColor, "COL_BLUE",                   COL_BLUE );
     221         626 :     SETCONST( pColor, "COL_GREEN",                  COL_GREEN );
     222         626 :     SETCONST( pColor, "COL_CYAN",                   COL_CYAN );
     223         626 :     SETCONST( pColor, "COL_RED",                    COL_RED );
     224         626 :     SETCONST( pColor, "COL_MAGENTA",                COL_MAGENTA );
     225         626 :     SETCONST( pColor, "COL_BROWN",                  COL_BROWN );
     226         626 :     SETCONST( pColor, "COL_GRAY",                   COL_GRAY );
     227         626 :     SETCONST( pColor, "COL_LIGHTGRAY",              COL_LIGHTGRAY );
     228         626 :     SETCONST( pColor, "COL_LIGHTBLUE",              COL_LIGHTBLUE );
     229         626 :     SETCONST( pColor, "COL_LIGHTGREEN",             COL_LIGHTGREEN );
     230         626 :     SETCONST( pColor, "COL_LIGHTCYAN",              COL_LIGHTCYAN );
     231         626 :     SETCONST( pColor, "COL_LIGHTRED",               COL_LIGHTRED );
     232         626 :     SETCONST( pColor, "COL_LIGHTMAGENTA",           COL_LIGHTMAGENTA );
     233         626 :     SETCONST( pColor, "COL_YELLOW",                 COL_YELLOW );
     234         626 :     SETCONST( pColor, "COL_WHITE",                  COL_WHITE );
     235             : 
     236         626 :     return pColor;
     237             : }
     238             : 
     239         626 : RscEnum * RscTypCont::InitMapUnit()
     240             : {
     241             :     RscEnum * pMapUnit;
     242         626 :     pMapUnit = new RscEnum( pHS->getID( "EnumMapUnit" ), RSC_NOTYPE );
     243             : 
     244         626 :     SETCONST( pMapUnit, "MAP_PIXEL",                  MAP_PIXEL );
     245         626 :     SETCONST( pMapUnit, "MAP_SYSFONT",                MAP_SYSFONT );
     246         626 :     SETCONST( pMapUnit, "MAP_100TH_MM",               MAP_100TH_MM );
     247         626 :     SETCONST( pMapUnit, "MAP_10TH_MM",                MAP_10TH_MM );
     248         626 :     SETCONST( pMapUnit, "MAP_MM",                     MAP_MM );
     249         626 :     SETCONST( pMapUnit, "MAP_CM",                     MAP_CM );
     250         626 :     SETCONST( pMapUnit, "MAP_1000TH_INCH",            MAP_1000TH_INCH );
     251         626 :     SETCONST( pMapUnit, "MAP_100TH_INCH",             MAP_100TH_INCH );
     252         626 :     SETCONST( pMapUnit, "MAP_10TH_INCH",              MAP_10TH_INCH );
     253         626 :     SETCONST( pMapUnit, "MAP_INCH",                   MAP_INCH );
     254         626 :     SETCONST( pMapUnit, "MAP_POINT",                  MAP_POINT );
     255         626 :     SETCONST( pMapUnit, "MAP_TWIP",                   MAP_TWIP );
     256         626 :     SETCONST( pMapUnit, "MAP_APPFONT",                MAP_APPFONT );
     257         626 :     SETCONST( pMapUnit, "MAP_SV",                     RSC_EXTRAMAPUNIT );
     258         626 :     return pMapUnit;
     259             : }
     260             : 
     261         626 : RscEnum * RscTypCont::InitKey()
     262             : {
     263             :     RscEnum * pKey;
     264         626 :     pKey = new RscEnum( pHS->getID( "EnumKey" ), RSC_NOTYPE );
     265             : 
     266         626 :     SETCONST( pKey, "KEY_0",                    com::sun::star::awt::Key::NUM0 );
     267         626 :     SETCONST( pKey, "KEY_1",                    com::sun::star::awt::Key::NUM1 );
     268         626 :     SETCONST( pKey, "KEY_2",                    com::sun::star::awt::Key::NUM2 );
     269         626 :     SETCONST( pKey, "KEY_3",                    com::sun::star::awt::Key::NUM3 );
     270         626 :     SETCONST( pKey, "KEY_4",                    com::sun::star::awt::Key::NUM4 );
     271         626 :     SETCONST( pKey, "KEY_5",                    com::sun::star::awt::Key::NUM5 );
     272         626 :     SETCONST( pKey, "KEY_6",                    com::sun::star::awt::Key::NUM6 );
     273         626 :     SETCONST( pKey, "KEY_7",                    com::sun::star::awt::Key::NUM7 );
     274         626 :     SETCONST( pKey, "KEY_8",                    com::sun::star::awt::Key::NUM8 );
     275         626 :     SETCONST( pKey, "KEY_9",                    com::sun::star::awt::Key::NUM9 );
     276             : 
     277         626 :     SETCONST( pKey, "KEY_A",                    com::sun::star::awt::Key::A );
     278         626 :     SETCONST( pKey, "KEY_B",                    com::sun::star::awt::Key::B );
     279         626 :     SETCONST( pKey, "KEY_C",                    com::sun::star::awt::Key::C );
     280         626 :     SETCONST( pKey, "KEY_D",                    com::sun::star::awt::Key::D );
     281         626 :     SETCONST( pKey, "KEY_E",                    com::sun::star::awt::Key::E );
     282         626 :     SETCONST( pKey, "KEY_F",                    com::sun::star::awt::Key::F );
     283         626 :     SETCONST( pKey, "KEY_G",                    com::sun::star::awt::Key::G );
     284         626 :     SETCONST( pKey, "KEY_H",                    com::sun::star::awt::Key::H );
     285         626 :     SETCONST( pKey, "KEY_I",                    com::sun::star::awt::Key::I );
     286         626 :     SETCONST( pKey, "KEY_J",                    com::sun::star::awt::Key::J );
     287         626 :     SETCONST( pKey, "KEY_K",                    com::sun::star::awt::Key::K );
     288         626 :     SETCONST( pKey, "KEY_L",                    com::sun::star::awt::Key::L );
     289         626 :     SETCONST( pKey, "KEY_M",                    com::sun::star::awt::Key::M );
     290         626 :     SETCONST( pKey, "KEY_N",                    com::sun::star::awt::Key::N );
     291         626 :     SETCONST( pKey, "KEY_O",                    com::sun::star::awt::Key::O );
     292         626 :     SETCONST( pKey, "KEY_P",                    com::sun::star::awt::Key::P );
     293         626 :     SETCONST( pKey, "KEY_Q",                    com::sun::star::awt::Key::Q );
     294         626 :     SETCONST( pKey, "KEY_R",                    com::sun::star::awt::Key::R );
     295         626 :     SETCONST( pKey, "KEY_S",                    com::sun::star::awt::Key::S );
     296         626 :     SETCONST( pKey, "KEY_T",                    com::sun::star::awt::Key::T );
     297         626 :     SETCONST( pKey, "KEY_U",                    com::sun::star::awt::Key::U );
     298         626 :     SETCONST( pKey, "KEY_V",                    com::sun::star::awt::Key::V );
     299         626 :     SETCONST( pKey, "KEY_W",                    com::sun::star::awt::Key::W );
     300         626 :     SETCONST( pKey, "KEY_X",                    com::sun::star::awt::Key::X );
     301         626 :     SETCONST( pKey, "KEY_Y",                    com::sun::star::awt::Key::Y );
     302         626 :     SETCONST( pKey, "KEY_Z",                    com::sun::star::awt::Key::Z );
     303             : 
     304         626 :     SETCONST( pKey, "KEY_F1",                   com::sun::star::awt::Key::F1 );
     305         626 :     SETCONST( pKey, "KEY_F2",                   com::sun::star::awt::Key::F2 );
     306         626 :     SETCONST( pKey, "KEY_F3",                   com::sun::star::awt::Key::F3 );
     307         626 :     SETCONST( pKey, "KEY_F4",                   com::sun::star::awt::Key::F4 );
     308         626 :     SETCONST( pKey, "KEY_F5",                   com::sun::star::awt::Key::F5 );
     309         626 :     SETCONST( pKey, "KEY_F6",                   com::sun::star::awt::Key::F6 );
     310         626 :     SETCONST( pKey, "KEY_F7",                   com::sun::star::awt::Key::F7 );
     311         626 :     SETCONST( pKey, "KEY_F8",                   com::sun::star::awt::Key::F8 );
     312         626 :     SETCONST( pKey, "KEY_F9",                   com::sun::star::awt::Key::F9 );
     313         626 :     SETCONST( pKey, "KEY_F10",                  com::sun::star::awt::Key::F10 );
     314         626 :     SETCONST( pKey, "KEY_F11",                  com::sun::star::awt::Key::F11 );
     315         626 :     SETCONST( pKey, "KEY_F12",                  com::sun::star::awt::Key::F12 );
     316         626 :     SETCONST( pKey, "KEY_F13",                  com::sun::star::awt::Key::F13 );
     317         626 :     SETCONST( pKey, "KEY_F14",                  com::sun::star::awt::Key::F14 );
     318         626 :     SETCONST( pKey, "KEY_F15",                  com::sun::star::awt::Key::F15 );
     319         626 :     SETCONST( pKey, "KEY_F16",                  com::sun::star::awt::Key::F16 );
     320         626 :     SETCONST( pKey, "KEY_F17",                  com::sun::star::awt::Key::F17 );
     321         626 :     SETCONST( pKey, "KEY_F18",                  com::sun::star::awt::Key::F18 );
     322         626 :     SETCONST( pKey, "KEY_F19",                  com::sun::star::awt::Key::F19 );
     323         626 :     SETCONST( pKey, "KEY_F20",                  com::sun::star::awt::Key::F20 );
     324         626 :     SETCONST( pKey, "KEY_F21",                  com::sun::star::awt::Key::F21 );
     325         626 :     SETCONST( pKey, "KEY_F22",                  com::sun::star::awt::Key::F22 );
     326         626 :     SETCONST( pKey, "KEY_F23",                  com::sun::star::awt::Key::F23 );
     327         626 :     SETCONST( pKey, "KEY_F24",                  com::sun::star::awt::Key::F24 );
     328         626 :     SETCONST( pKey, "KEY_F25",                  com::sun::star::awt::Key::F25 );
     329         626 :     SETCONST( pKey, "KEY_F26",                  com::sun::star::awt::Key::F26 );
     330             : 
     331         626 :     SETCONST( pKey, "KEY_DOWN",                 com::sun::star::awt::Key::DOWN );
     332         626 :     SETCONST( pKey, "KEY_UP",                   com::sun::star::awt::Key::UP );
     333         626 :     SETCONST( pKey, "KEY_LEFT",                 com::sun::star::awt::Key::LEFT );
     334         626 :     SETCONST( pKey, "KEY_RIGHT",                com::sun::star::awt::Key::RIGHT );
     335         626 :     SETCONST( pKey, "KEY_HOME",                 com::sun::star::awt::Key::HOME );
     336         626 :     SETCONST( pKey, "KEY_END",                  com::sun::star::awt::Key::END );
     337         626 :     SETCONST( pKey, "KEY_PAGEUP",               com::sun::star::awt::Key::PAGEUP );
     338         626 :     SETCONST( pKey, "KEY_PAGEDOWN",             com::sun::star::awt::Key::PAGEDOWN );
     339             : 
     340         626 :     SETCONST( pKey, "KEY_RETURN",               com::sun::star::awt::Key::RETURN );
     341         626 :     SETCONST( pKey, "KEY_ESCAPE",               com::sun::star::awt::Key::ESCAPE );
     342         626 :     SETCONST( pKey, "KEY_TAB",                  com::sun::star::awt::Key::TAB );
     343         626 :     SETCONST( pKey, "KEY_BACKSPACE",            com::sun::star::awt::Key::BACKSPACE );
     344         626 :     SETCONST( pKey, "KEY_SPACE",                com::sun::star::awt::Key::SPACE );
     345         626 :     SETCONST( pKey, "KEY_INSERT",               com::sun::star::awt::Key::INSERT );
     346         626 :     SETCONST( pKey, "KEY_DELETE",               com::sun::star::awt::Key::DELETE );
     347             : 
     348         626 :     SETCONST( pKey, "KEY_ADD",                  com::sun::star::awt::Key::ADD );
     349         626 :     SETCONST( pKey, "KEY_SUBTRACT",             com::sun::star::awt::Key::SUBTRACT );
     350         626 :     SETCONST( pKey, "KEY_MULTIPLY",             com::sun::star::awt::Key::MULTIPLY );
     351         626 :     SETCONST( pKey, "KEY_DIVIDE",               com::sun::star::awt::Key::DIVIDE );
     352         626 :     SETCONST( pKey, "KEY_POINT",                com::sun::star::awt::Key::POINT );
     353         626 :     SETCONST( pKey, "KEY_COMMA",                com::sun::star::awt::Key::COMMA );
     354         626 :     SETCONST( pKey, "KEY_LESS",                 com::sun::star::awt::Key::LESS );
     355         626 :     SETCONST( pKey, "KEY_GREATER",              com::sun::star::awt::Key::GREATER );
     356         626 :     SETCONST( pKey, "KEY_EQUAL",                com::sun::star::awt::Key::EQUAL );
     357             : 
     358         626 :     SETCONST( pKey, "KEY_OPEN",                 com::sun::star::awt::Key::OPEN );
     359         626 :     SETCONST( pKey, "KEY_CUT",                  com::sun::star::awt::Key::CUT );
     360         626 :     SETCONST( pKey, "KEY_COPY",                 com::sun::star::awt::Key::COPY );
     361         626 :     SETCONST( pKey, "KEY_PASTE",                com::sun::star::awt::Key::PASTE );
     362         626 :     SETCONST( pKey, "KEY_UNDO",                 com::sun::star::awt::Key::UNDO );
     363         626 :     SETCONST( pKey, "KEY_REPEAT",               com::sun::star::awt::Key::REPEAT );
     364         626 :     SETCONST( pKey, "KEY_FIND",                 com::sun::star::awt::Key::FIND );
     365         626 :     SETCONST( pKey, "KEY_PROPERTIES",           com::sun::star::awt::Key::PROPERTIES );
     366         626 :     SETCONST( pKey, "KEY_FRONT",                com::sun::star::awt::Key::FRONT );
     367         626 :     SETCONST( pKey, "KEY_CONTEXTMENU",          com::sun::star::awt::Key::CONTEXTMENU );
     368         626 :     SETCONST( pKey, "KEY_HELP",                 com::sun::star::awt::Key::HELP );
     369         626 :     SETCONST( pKey, "KEY_HANGUL_HANJA",         com::sun::star::awt::Key::HANGUL_HANJA );
     370         626 :     SETCONST( pKey, "KEY_DECIMAL",              com::sun::star::awt::Key::DECIMAL );
     371         626 :     SETCONST( pKey, "KEY_TILDE",                com::sun::star::awt::Key::TILDE );
     372         626 :     SETCONST( pKey, "KEY_QUOTELEFT",            com::sun::star::awt::Key::QUOTELEFT );
     373             : 
     374         626 :     return pKey;
     375             : }
     376             : 
     377         626 : RscEnum * RscTypCont::InitTriState()
     378             : {
     379             :     RscEnum * pTriState;
     380         626 :     pTriState = new RscEnum( pHS->getID( "EnumTriState" ), RSC_NOTYPE );
     381             : 
     382         626 :     SETCONST( pTriState, "STATE_NOCHECK",      STATE_NOCHECK  );
     383         626 :     SETCONST( pTriState, "STATE_CHECK",        STATE_CHECK    );
     384         626 :     SETCONST( pTriState, "STATE_DONTKNOW",     STATE_DONTKNOW );
     385             : 
     386         626 :     return pTriState;
     387             : }
     388             : 
     389         626 : RscEnum * RscTypCont::InitMessButtons()
     390             : {
     391             :     RscEnum * pMessButtons;
     392         626 :     pMessButtons = new RscEnum( pHS->getID( "EnumMessButtons" ), RSC_NOTYPE );
     393         626 :     SETCONST( pMessButtons, "WB_OK",                      sal::static_int_cast<sal_uInt32>(WB_OK) );
     394         626 :     SETCONST( pMessButtons, "WB_OK_CANCEL",               sal::static_int_cast<sal_uInt32>(WB_OK_CANCEL) );
     395         626 :     SETCONST( pMessButtons, "WB_YES_NO",                  sal::static_int_cast<sal_uInt32>(WB_YES_NO) );
     396         626 :     SETCONST( pMessButtons, "WB_YES_NO_CANCEL",           sal::static_int_cast<sal_uInt32>(WB_YES_NO_CANCEL) );
     397         626 :     SETCONST( pMessButtons, "WB_RETRY_CANCEL",            sal::static_int_cast<sal_uInt32>(WB_RETRY_CANCEL) );
     398         626 :     SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE",      sal::static_int_cast<sal_uInt32>(WB_ABORT_RETRY_IGNORE) );
     399         626 :     return pMessButtons;
     400             : }
     401             : 
     402         626 : RscEnum * RscTypCont::InitMessDefButton()
     403             : {
     404             :     RscEnum * pMessDefButton;
     405        1252 :     pMessDefButton = new RscEnum( pHS->getID( "EnumMessDefButton" ),
     406         626 :                                   RSC_NOTYPE );
     407             : 
     408         626 :     SETCONST( pMessDefButton, "WB_DEF_OK",                  sal::static_int_cast<sal_uInt32>(WB_DEF_OK) );
     409         626 :     SETCONST( pMessDefButton, "WB_DEF_CANCEL",              sal::static_int_cast<sal_uInt32>(WB_DEF_CANCEL) );
     410         626 :     SETCONST( pMessDefButton, "WB_DEF_RETRY",               sal::static_int_cast<sal_uInt32>(WB_DEF_RETRY) );
     411         626 :     SETCONST( pMessDefButton, "WB_DEF_YES",                 sal::static_int_cast<sal_uInt32>(WB_DEF_YES) );
     412         626 :     SETCONST( pMessDefButton, "WB_DEF_NO",                  sal::static_int_cast<sal_uInt32>(WB_DEF_NO) );
     413         626 :     SETCONST( pMessDefButton, "WB_DEF_IGNORE",              sal::static_int_cast<sal_uInt32>(WB_DEF_IGNORE) );
     414         626 :     return pMessDefButton;
     415             : }
     416             : 
     417         626 : RscTupel * RscTypCont::InitGeometry()
     418             : {
     419             :     RscTop *    pTupel;
     420             :     Atom        nId;
     421             : 
     422             :     // Clientvariablen einfuegen
     423        1252 :     pTupel = new RscTupel( pHS->getID( "TupelDeltaSystem" ),
     424         626 :                                 RSC_NOTYPE, NULL );
     425         626 :     nId = aNmTb.Put( "X", VARNAME );
     426         626 :     pTupel->SetVariable( nId, &aShort );
     427         626 :     nId = aNmTb.Put( "Y", VARNAME );
     428         626 :     pTupel->SetVariable( nId, &aShort );
     429         626 :     nId = aNmTb.Put( "WIDTH", VARNAME );
     430         626 :     pTupel->SetVariable( nId, &aShort );
     431         626 :     nId = aNmTb.Put( "HEIGHT", VARNAME );
     432         626 :     pTupel->SetVariable( nId, &aShort );
     433             : 
     434         626 :     return (RscTupel *)pTupel;
     435             : }
     436             : 
     437         626 : RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo )
     438             : {
     439         626 :     return new RscArray( pHS->getID( "Lang_TupelGeometry" ), RSC_NOTYPE, pGeo, &aLangType );
     440             : }
     441             : 
     442         626 : RscCont * RscTypCont::InitStringList()
     443             : {
     444             :     RscCont * pCont;
     445             : 
     446         626 :     pCont = new RscCont( pHS->getID( "Chars[]" ), RSC_NOTYPE );
     447         626 :     pCont->SetTypeClass( &aString );
     448             : 
     449         626 :     return pCont;
     450             : }
     451             : 
     452         626 : RscArray * RscTypCont::InitLangStringList( RscCont * pStrLst )
     453             : {
     454        1252 :     return new RscArray( pHS->getID( "Lang_CharsList" ),
     455        1252 :                          RSC_NOTYPE, pStrLst, &aLangType );
     456             : }
     457             : 
     458         626 : RscTupel * RscTypCont::InitStringTupel()
     459             : {
     460             :     RscTop *    pTupel;
     461             :     Atom        nId;
     462             : 
     463             :     // Clientvariablen einfuegen
     464         626 :     pTupel = new RscTupel( pHS->getID( "CharsTupel" ), RSC_NOTYPE, NULL );
     465         626 :     nId = aNmTb.Put( "FILTER", VARNAME );
     466         626 :     pTupel->SetVariable( nId, &aString );
     467         626 :     nId = aNmTb.Put( "MASK", VARNAME );
     468         626 :     pTupel->SetVariable( nId, &aString );
     469             : 
     470         626 :     return (RscTupel *)pTupel;
     471             : }
     472             : 
     473         626 : RscTupel * RscTypCont::InitStringLongTupel()
     474             : {
     475             :     RscTop *    pTupel;
     476             :     Atom        nId;
     477             : 
     478             :     // Clientvariablen einfuegen
     479         626 :     pTupel = new RscTupel( pHS->getID( "CharsLongTupel" ), RSC_NOTYPE, NULL );
     480         626 :     nId = aNmTb.Put( "ItemText", VARNAME );
     481         626 :     pTupel->SetVariable( nId, &aString );
     482         626 :     nId = aNmTb.Put( "ItemId", VARNAME );
     483         626 :     pTupel->SetVariable( nId, &aEnumLong );
     484             : 
     485         626 :     return (RscTupel *)pTupel;
     486             : }
     487             : 
     488         626 : RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString )
     489             : {
     490             :     RscCont * pCont;
     491             : 
     492         626 :     pCont = new RscCont( pHS->getID( "CharsCharsTupel[]" ), RSC_NOTYPE );
     493         626 :     pCont->SetTypeClass( pTupelString );
     494             : 
     495         626 :     return pCont;
     496             : }
     497             : 
     498         626 : RscCont * RscTypCont::InitStringLongTupelList( RscTupel * pStringLong )
     499             : {
     500             :     RscCont * pCont;
     501             : 
     502         626 :     pCont = new RscCont( pHS->getID( "CharsLongTupel[]" ), RSC_NOTYPE );
     503         626 :     pCont->SetTypeClass( pStringLong );
     504             : 
     505         626 :     return pCont;
     506             : }
     507             : 
     508         626 : RscArray * RscTypCont::InitLangStringTupelList( RscCont * pStrTupelLst )
     509             : {
     510        1252 :     return new RscArray( pHS->getID( "Lang_CharsCharsTupel" ),
     511        1252 :                          RSC_NOTYPE, pStrTupelLst, &aLangType );
     512             : }
     513             : 
     514         626 : RscArray * RscTypCont::InitLangStringLongTupelList( RscCont * pStrLongTupelLst )
     515             : {
     516        1252 :     return new RscArray( pHS->getID( "Lang_CharsLongTupelList" ),
     517        1252 :                          RSC_NOTYPE, pStrLongTupelLst, &aLangType );
     518        1878 : }
     519             : 
     520             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10