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

Generated by: LCOV version 1.10