diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-18 17:13:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-19 13:42:07 +0200 |
commit | 2b83e73fd7b059c4ad224e3163f9d57c6cc6e1c7 (patch) | |
tree | eb160ecdcaf9ba8c114eeef82261d9ad199d5b40 /rsc | |
parent | 31aac86f14d088628979c7809588f14bef643feb (diff) |
remove freshly unused menu support from src files
Change-Id: I038711a0c4d440d452d5b2ae1bfcba5c9305815b
Reviewed-on: https://gerrit.libreoffice.org/36646
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/Executable_rsc.mk | 1 | ||||
-rw-r--r-- | rsc/inc/rscall.h | 7 | ||||
-rw-r--r-- | rsc/inc/rscarray.hxx | 2 | ||||
-rw-r--r-- | rsc/inc/rscclass.hxx | 3 | ||||
-rw-r--r-- | rsc/inc/rscconst.hxx | 1 | ||||
-rw-r--r-- | rsc/inc/rsccont.hxx | 1 | ||||
-rw-r--r-- | rsc/inc/rscdb.hxx | 8 | ||||
-rw-r--r-- | rsc/inc/rscflag.hxx | 104 | ||||
-rw-r--r-- | rsc/inc/rscrange.hxx | 97 | ||||
-rw-r--r-- | rsc/inc/rscstr.hxx | 1 | ||||
-rw-r--r-- | rsc/inc/rsctop.hxx | 4 | ||||
-rw-r--r-- | rsc/source/parser/rscdb.cxx | 11 | ||||
-rw-r--r-- | rsc/source/parser/rscibas.cxx | 1 | ||||
-rw-r--r-- | rsc/source/parser/rscicpx.cxx | 128 | ||||
-rw-r--r-- | rsc/source/parser/rscinit.cxx | 21 | ||||
-rw-r--r-- | rsc/source/parser/rscyacc.y | 1 | ||||
-rw-r--r-- | rsc/source/res/rscarray.cxx | 14 | ||||
-rw-r--r-- | rsc/source/res/rscclass.cxx | 18 | ||||
-rw-r--r-- | rsc/source/res/rscconst.cxx | 5 | ||||
-rw-r--r-- | rsc/source/res/rsccont.cxx | 5 | ||||
-rw-r--r-- | rsc/source/res/rscflag.cxx | 347 | ||||
-rw-r--r-- | rsc/source/res/rscrange.cxx | 276 | ||||
-rw-r--r-- | rsc/source/res/rscstr.cxx | 5 | ||||
-rw-r--r-- | rsc/source/res/rsctop.cxx | 6 |
24 files changed, 3 insertions, 1064 deletions
diff --git a/rsc/Executable_rsc.mk b/rsc/Executable_rsc.mk index 18030f5302c4..970550ed2f1e 100644 --- a/rsc/Executable_rsc.mk +++ b/rsc/Executable_rsc.mk @@ -57,7 +57,6 @@ $(eval $(call gb_Executable_add_exception_objects,rsc,\ rsc/source/res/rscclobj \ rsc/source/res/rscconst \ rsc/source/res/rsccont \ - rsc/source/res/rscflag \ rsc/source/res/rscmgr \ rsc/source/res/rscrange \ rsc/source/res/rscstr \ diff --git a/rsc/inc/rscall.h b/rsc/inc/rscall.h index 1591d1f114e3..d8222b7c1d31 100644 --- a/rsc/inc/rscall.h +++ b/rsc/inc/rscall.h @@ -62,13 +62,6 @@ namespace o3tl { template<> struct typed_flags<CommandFlags> : is_typed_flags<CommandFlags, 0x327f> {}; } - -/******************* T y p e s *******************************************/ -enum RSCCLASS_TYPE { RSCCLASS_BOOL, RSCCLASS_STRING, RSCCLASS_NUMBER, - RSCCLASS_CONST, RSCCLASS_COMPLEX, RSCCLASS_ENUMARRAY }; - -typedef void (* VarEnumCallbackProc)( void * pData, RSCCLASS_TYPE, Atom ); - /******************* S t r u c t s ***************************************/ struct RSCINST { diff --git a/rsc/inc/rscarray.hxx b/rsc/inc/rscarray.hxx index 32d138675fe0..01a5ddf8795e 100644 --- a/rsc/inc/rscarray.hxx +++ b/rsc/inc/rscarray.hxx @@ -62,7 +62,6 @@ public: RscArray( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuper, RscEnum * pTypeClass ); virtual ~RscArray() override; - virtual RSCCLASS_TYPE GetClassType() const override; virtual RscTop * GetTypeClass() const override; RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override; @@ -96,7 +95,6 @@ class RscLangArray : public RscArray public: RscLangArray( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuper, RscEnum * pTypeClass ); - virtual RSCCLASS_TYPE GetClassType() const override; }; #endif // INCLUDED_RSC_INC_RSCARRAY_HXX diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx index 59b3980c33e5..2e81aa24ac6a 100644 --- a/rsc/inc/rscclass.hxx +++ b/rsc/inc/rscclass.hxx @@ -57,14 +57,11 @@ public: RscClass( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuperCl ); virtual ~RscClass() override; - virtual RSCCLASS_TYPE GetClassType() const override; - void Pre_dtor() override; ERRTYPE SetVariable( Atom nVarName, RscTop * pClass, RSCINST * pDflt = nullptr, RSCVAR nVarType = RSCVAR::NONE, sal_uInt32 nMask = 0, Atom nDataBaseName = InvalidAtom ) override; - virtual void EnumVariables( void * pData, VarEnumCallbackProc ) override; RSCINST GetVariable( const RSCINST & rInst, Atom nVarName, const RSCINST & rInitInst, bool bInitDflt = false, diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx index 1b65f60e509a..b9678751e452 100644 --- a/rsc/inc/rscconst.hxx +++ b/rsc/inc/rscconst.hxx @@ -38,7 +38,6 @@ protected: public: RscConst( Atom nId, RESOURCE_TYPE nTypId ); virtual ~RscConst() override; - virtual RSCCLASS_TYPE GetClassType() const override; // sets the allowed values void SetConstant( Atom nVarName, sal_Int32 lValue ); bool GetConstValue( Atom nConstId, sal_Int32 * pVal ) const; diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx index 005daa44856f..c1cf83700a11 100644 --- a/rsc/inc/rsccont.hxx +++ b/rsc/inc/rsccont.hxx @@ -56,7 +56,6 @@ public: RscBaseCont( Atom nId, RESOURCE_TYPE nTypId, bool bNoId ); virtual ~RscBaseCont() override; - virtual RSCCLASS_TYPE GetClassType() const override; void SetTypeClass( RscTop * pClass ) { pTypeClass = pClass; diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 0da0a6dbaac2..f56ba91f122f 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -23,7 +23,6 @@ #include <rscall.h> #include <rsckey.hxx> #include <rscconst.hxx> -#include <rscflag.hxx> #include <rscrange.hxx> #include <rscstr.hxx> #include <rscarray.hxx> @@ -89,17 +88,10 @@ class RscTypCont RscTop * InitClassMgr(); RscTop * InitClassString( RscTop * pSuper ); RscTop * InitClassBitmap( RscTop * pSuper ); - RscTop * InitClassMenuItem( RscTop * pSuper ); - RscTop * InitClassMenu( RscTop * pSuper, RscTop * pMenuItem ); public: - RscBool aBool; - RscRange aShort; - RscRange aUShort; RscLongEnumRange aEnumLong; - RscIdRange aIdNoZeroUShort; RscString aString; - RscString aStringLiteral; RscLangEnum aLangType; RscLangArray aLangString; diff --git a/rsc/inc/rscflag.hxx b/rsc/inc/rscflag.hxx deleted file mode 100644 index de006bf2dee2..000000000000 --- a/rsc/inc/rscflag.hxx +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_RSC_INC_RSCFLAG_HXX -#define INCLUDED_RSC_INC_RSCFLAG_HXX - -#include <rscall.h> -#include <rscerror.h> -#include <rschash.hxx> -#include <rscconst.hxx> - -/******************* R s c F l a g ***************************************/ -class RscFlag : public RscConst -{ - struct RscFlagInst - { - sal_uInt32 nFlags; - sal_uInt32 nDfltFlags; - }; - RSCINST CreateBasic( RSCINST * pInst ); -public: - RscFlag( Atom nId, RESOURCE_TYPE nTypId ); - RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override; - RSCINST CreateClient( RSCINST * pInst, const RSCINST & rDflt, - bool bOwnClass, Atom nConsId ); - sal_uInt32 Size() const override; - - virtual void SetToDefault( const RSCINST & rInst ) override; - bool IsDefault( const RSCINST & rInst ) override; - bool IsDefault( const RSCINST & rInst, Atom nConstId ); - - // whether the flag is set - bool IsSet( const RSCINST & rInst, Atom nConstId ); - - // sets as default - bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) override; - bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef, - Atom nConstId ); - - ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, - sal_Int32 nValue ) override; - ERRTYPE SetNotConst( const RSCINST & rInst, Atom nConstId ) override; - void WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; - ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, - RscTypCont * pTC, sal_uInt32 ) override; -}; - -/******************* R s c C l i e n t ***********************************/ -class RscClient : public RscTop -{ - RscFlag * pRefClass; // class which is used as server - Atom nConstId; // id of the value to set -public: - RscClient( Atom nId, RESOURCE_TYPE nTypId, RscFlag * pClass, - Atom nConstantId ); - virtual RSCCLASS_TYPE GetClassType() const override; - RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override; - sal_uInt32 Size() const override { return pRefClass->Size(); } - - // an assignment to a variable - bool IsDefault( const RSCINST & rInst ) override { - return pRefClass->IsDefault( rInst, nConstId ); - }; - // sets as default - bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) override - { - return pRefClass->IsValueDefault( rInst, - pDef, nConstId ); - } - ERRTYPE SetBool( const RSCINST & rInst, bool bValue ) override - { - if( bValue ) - return pRefClass->SetConst( rInst, nConstId, sal_Int32(bValue) ); - else - return pRefClass->SetNotConst( rInst, nConstId ); - } - ERRTYPE GetBool( const RSCINST & rInst, bool * pB ) override - { - *pB = pRefClass->IsSet( rInst, nConstId ); - return ERR_OK; - } - void WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; -}; - -#endif // INCLUDED_RSC_INC_RSCFLAG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/inc/rscrange.hxx b/rsc/inc/rscrange.hxx index bed213f8c80f..202b86f98e08 100644 --- a/rsc/inc/rscrange.hxx +++ b/rsc/inc/rscrange.hxx @@ -24,43 +24,6 @@ #include <rschash.hxx> #include <rsctop.hxx> -class RscRange : public RscTop -{ -protected: - struct RscRangeInst - { - sal_uInt16 nValue; // nValue = output value - nMin - bool bDflt; // is default - }; - sal_Int32 nMin; // range minimum value - sal_Int32 nMax; // range maximum value -public: - RscRange( Atom nId, RESOURCE_TYPE nTypId ); - virtual RSCCLASS_TYPE GetClassType() const override; - RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; - // sets the allowed range - void SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ); - // returns the class size in bytes - sal_uInt32 Size() const override { return ALIGNED_SIZE(sizeof(RscRangeInst)); } - // an assignment to a variable - virtual void SetToDefault( const RSCINST & rInst ) override - { - reinterpret_cast<RscRangeInst*>(rInst.pData)->bDflt = true; - } - bool IsDefault( const RSCINST & rInst) override - { - return reinterpret_cast<RscRangeInst*>(rInst.pData)->bDflt; - }; - // sets as default - bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) override; - ERRTYPE SetNumber( const RSCINST &, sal_Int32 ) override; - ERRTYPE GetNumber( const RSCINST &, sal_Int32 * ) override; - void WriteSrc( const RSCINST &, FILE * fOutput, - RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; - ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, - RscTypCont * pTC, sal_uInt32 ) override; -}; - class RscLongRange : public RscTop { protected: @@ -73,7 +36,6 @@ protected: sal_Int32 nMax; // range maximum value public: RscLongRange( Atom nId, RESOURCE_TYPE nTypId ); - virtual RSCCLASS_TYPE GetClassType() const override; RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; // sets the allowed range void SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ); @@ -108,65 +70,6 @@ public: sal_Int32 nValue ) override; }; -class RscIdRange : public RscTop -{ -protected: - sal_Int32 nMin; // range minimum value - sal_Int32 nMax; // range maximum value -public: - RscIdRange( Atom nId, RESOURCE_TYPE nTypId ); - virtual RSCCLASS_TYPE GetClassType() const override; - // sets the allowed range - void SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) - { - nMin = nMinimum; - nMax = nMaximum; - } - RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; - void Destroy( const RSCINST & rInst ) override; - sal_uInt32 Size() const override { return ALIGNED_SIZE(sizeof(RscId)); } - virtual void SetToDefault( const RSCINST & rInst ) override - { - reinterpret_cast<RscId*>(rInst.pData)->aExp.cUnused = true; - } - bool IsDefault( const RSCINST & rInst) override - { - //cUnused is used as default identifier - return reinterpret_cast<RscId*>(rInst.pData)->aExp.cUnused; - } - // sets as default - bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) override; - ERRTYPE SetNumber( const RSCINST &, sal_Int32 ) override; - ERRTYPE GetNumber( const RSCINST &, sal_Int32 * ) override; - ERRTYPE SetRef( const RSCINST &, const RscId & rRscId ) override; - ERRTYPE GetRef( const RSCINST & rInst, RscId * ) override; - void WriteSrc( const RSCINST &, FILE * fOutput, - RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; - ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, - RscTypCont * pTC, sal_uInt32 ) override; - bool IsConsistent( const RSCINST & rInst ) override; -}; - -class RscBool : public RscRange -{ -public: - RscBool( Atom nId, RESOURCE_TYPE nTypId ); - virtual RSCCLASS_TYPE GetClassType() const override; - ERRTYPE SetBool( const RSCINST & rInst, bool b ) override - { - return SetNumber( rInst, (sal_Int32)b ); - }; - ERRTYPE GetBool( const RSCINST & rInst, bool * pB) override - { - sal_Int32 l; - GetNumber( rInst, &l ); - *pB = (0 != l); - return ERR_OK; - }; - void WriteSrc( const RSCINST &, FILE * fOutput, - RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; -}; - #endif // INCLUDED_RSC_INC_RSCRANGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/inc/rscstr.hxx b/rsc/inc/rscstr.hxx index 322eedb3be8f..5ae1d17aa92d 100644 --- a/rsc/inc/rscstr.hxx +++ b/rsc/inc/rscstr.hxx @@ -35,7 +35,6 @@ class RscString : public RscTop }; public: RscString( Atom nId, RESOURCE_TYPE nTypId ); - virtual RSCCLASS_TYPE GetClassType() const override; void SetRefClass( RscTop * pClass ) { pRefClass = pClass; } RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx index 43f118ed98d5..e9dab39dbf1c 100644 --- a/rsc/inc/rsctop.hxx +++ b/rsc/inc/rsctop.hxx @@ -66,7 +66,6 @@ public: void SetCallPar( const OString& rPar1, const OString& rPar2, const OString& rParType ); RscTop* GetRefClass() const { return pRefClass; } - virtual RSCCLASS_TYPE GetClassType() const = 0; RSCINST const & GetDefault(); // preparation fro the destructor call @@ -92,9 +91,6 @@ public: RSCVAR nVarType = RSCVAR::NONE, sal_uInt32 nMask = 0, Atom nDataBaseName = InvalidAtom ); - // enumerate all variables - virtual void EnumVariables( void * pData, VarEnumCallbackProc ); - // returns variable instance // returned pData, pClass may be NULL virtual RSCINST GetVariable( const RSCINST & rInst, Atom nVarName, diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index 1b76102351e2..e61532613769 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -21,11 +21,11 @@ #include <stdio.h> #include <string.h> -#include <tools/rc.h> #include <i18nlangtag/languagetag.hxx> #include <rtl/strbuf.hxx> #include <sal/log.hxx> #include <sal/macros.h> +#include <tools/rcid.h> #include <rsctree.hxx> #include <rsctop.hxx> @@ -44,13 +44,8 @@ RscTypCont::RscTypCont( RscError * pErrHdl, , nUniqueId(256) , nFilePos( 0 ) , nPMId(RSC_VERSIONCONTROL + RESOURCE_TYPE(1)) // at least one more - , aBool( pHS->getID( "sal_Bool" ), RSC_NOTYPE ) - , aShort( pHS->getID( "short" ), RSC_NOTYPE ) - , aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE ) , aEnumLong( pHS->getID( "enum_long" ), RSC_NOTYPE ) - , aIdNoZeroUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE ) , aString( pHS->getID( "Chars" ), RSC_NOTYPE ) - , aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ) , aLangType() , aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ) , pEH(pErrHdl) @@ -171,10 +166,6 @@ RscTypCont::~RscTypCont() for (RscTop* pItem : aBaseLst) pItem->Pre_dtor(); - aBool.Pre_dtor(); - aShort.Pre_dtor(); - aUShort.Pre_dtor(); - aIdNoZeroUShort.Pre_dtor(); aString.Pre_dtor(); aVersion.pClass->Pre_dtor(); // sub-types diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 7b58d6885d77..8aea89f93937 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -29,7 +29,6 @@ #include <tools/fldunit.hxx> #include <tools/gen.hxx> #include <tools/mapunit.hxx> -#include <tools/rc.h> #include <tools/wintypes.hxx> #include <rsc/rsc-vcl-shared-types.hxx> diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 69651c7cdd49..929ed89be284 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -21,7 +21,7 @@ #include <stdlib.h> #include <stdio.h> -#include <tools/rc.h> +#include <tools/rcid.h> #include <tools/wintypes.hxx> #include <rsc/rsc-vcl-shared-types.hxx> @@ -88,130 +88,4 @@ RscTop * RscTypCont::InitClassBitmap( RscTop * pSuper ) return pClassBitmap; } -RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper ) -{ - Atom nId; - RscTop * pClassMenuItem; - - // initialize class - nId = pHS->getID( "MenuItem" ); - pClassMenuItem = new RscClass( nId, RSC_MENUITEM, pSuper ); - aNmTb.Put( nId, CLASSNAME, pClassMenuItem ); - - // initialize variables - nId = aNmTb.Put( "Separator", VARNAME ); - pClassMenuItem->SetVariable( nId, &aBool, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::Separator ); - nId = aNmTb.Put( "Identifier", VARNAME ); - pClassMenuItem->SetVariable( nId, &aIdNoZeroUShort, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::Id ); - { - RscFlag * pFlag; - RscClient * pClient; - Atom nVarId, nAutoCheckId, nRadioCheckId; - Atom nCheckableId, nAboutId, nHelpId; - - aBaseLst.push_back( pFlag = new RscFlag( pHS->getID( "FlagMenuState" ), RSC_NOTYPE ) ); - - // set constants in table - nCheckableId = pHS->getID( "MIB_CHECKABLE" ); - SETCONST( pFlag, nCheckableId, MenuItemBits::CHECKABLE ); - nAutoCheckId = pHS->getID( "MIB_AUTOCHECK" ); - SETCONST( pFlag, nAutoCheckId, MenuItemBits::AUTOCHECK ); - nRadioCheckId = pHS->getID( "MIB_RADIOCHECK" ); - SETCONST( pFlag, nRadioCheckId, MenuItemBits::RADIOCHECK ); - nAboutId = pHS->getID( "MIB_ABOUT" ); - SETCONST( pFlag, nAboutId, MenuItemBits::ABOUT ); - nHelpId = pHS->getID( "MIB_HELP" ); - SETCONST( pFlag, nHelpId, MenuItemBits::HELP ); - - // add variable - nVarId = aNmTb.Put( "_MenuItemFlags", VARNAME ); - pClassMenuItem->SetVariable( nVarId, pFlag, nullptr, - RSCVAR::Hidden | RSCVAR::NoEnum, - (sal_uInt32)RscMenuItem::Status ); - - // add client variables - aBaseLst.push_back( - pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nCheckableId ) - ); - nId = aNmTb.Put( "Checkable", VARNAME ); - pClassMenuItem->SetVariable( nId, pClient, nullptr, - RSCVAR::NoDataInst, 0, nVarId ); - - aBaseLst.push_back( - pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAutoCheckId ) - ); - nId = aNmTb.Put( "AutoCheck", VARNAME ); - pClassMenuItem->SetVariable( nId, pClient, nullptr, - RSCVAR::NoDataInst, 0, nVarId ); - - aBaseLst.push_back( - pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nRadioCheckId ) - ); - nId = aNmTb.Put( "RadioCheck", VARNAME ); - pClassMenuItem->SetVariable( nId, pClient, nullptr, - RSCVAR::NoDataInst, 0, nVarId ); - - aBaseLst.push_back( - pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAboutId ) - ); - nId = aNmTb.Put( "About", VARNAME ); - pClassMenuItem->SetVariable( nId, pClient, nullptr, - RSCVAR::NoDataInst, 0, nVarId ); - - aBaseLst.push_back( - pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nHelpId ) - ); - nId = aNmTb.Put( "Help", VARNAME ); - pClassMenuItem->SetVariable( nId, pClient, nullptr, - RSCVAR::NoDataInst, 0, nVarId ); - - } - nId = aNmTb.Put( "Text", VARNAME ); - pClassMenuItem->SetVariable( nId, &aLangString, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::Text ); - nId = aNmTb.Put( "HelpText", VARNAME ); - pClassMenuItem->SetVariable( nId, &aLangString, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::HelpText ); - nId = aNmTb.Put( "HelpID", VARNAME ); - pClassMenuItem->SetVariable( nId, &aStringLiteral, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::HelpId ); - nId = aNmTb.Put( "Disable", VARNAME ); - pClassMenuItem->SetVariable( nId, &aBool, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::Disable ); - nId = aNmTb.Put( "Command", VARNAME ); - pClassMenuItem->SetVariable( nId, &aString, nullptr, RSCVAR::NONE, - (sal_uInt32)RscMenuItem::Command ); - - return pClassMenuItem; -} - -RscTop * RscTypCont::InitClassMenu( RscTop * pSuper, - RscTop * pClassMenuItem ) -{ - Atom nId; - RscTop * pClassMenu; - - // initialize class - nId = pHS->getID( "Menu" ); - pClassMenu = new RscClass( nId, RSC_MENU, pSuper ); - pClassMenu->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); - aNmTb.Put( nId, CLASSNAME, pClassMenu ); - - // initialize variables - { - RscCont * pCont; - - aBaseLst.push_back( pCont = new RscCont( pHS->getID( "ContMenuItem" ), RSC_NOTYPE ) ); - pCont->SetTypeClass( pClassMenuItem ); - nId = aNmTb.Put( "ItemList", VARNAME ); - pClassMenu->SetVariable( nId, pCont, nullptr, RSCVAR::NONE, (sal_uInt32)RscMenu::Items ); - } - nId = aNmTb.Put( "Text", VARNAME ); - pClassMenu->SetVariable( nId, &aLangString, nullptr, RSCVAR::NONE, (sal_uInt32)RscMenu::Text ); - - return pClassMenu; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx index 4ecf9f657fdd..a330f739fe2d 100644 --- a/rsc/source/parser/rscinit.cxx +++ b/rsc/source/parser/rscinit.cxx @@ -21,14 +21,13 @@ #include <stdlib.h> #include <stdio.h> -#include <tools/rc.h> +#include <tools/rcid.h> #include <tools/wintypes.hxx> #include <rsctree.hxx> #include <rsctop.hxx> #include <rscrange.hxx> #include <rscconst.hxx> -#include <rscflag.hxx> #include <rscstr.hxx> #include <rsccont.hxx> #include <rscmgr.hxx> @@ -67,13 +66,7 @@ void RscTypCont::Init() aNmTb.Put( "FALSE", BOOLEAN, (sal_IntPtr)false ); } { - aShort.SetRange( -32768, 32767 ); - - aUShort.SetRange( 0, 0xFFFF ); - aEnumLong.SetRange( SAL_MIN_INT32, SAL_MAX_INT32 ); - - aIdNoZeroUShort.SetRange( 1, 0xFFFF ); } { aLangType.Init( aNmTb ); @@ -111,18 +104,6 @@ void RscTypCont::Init() pRoot->Insert( pClassBitmap ); } -{ - RscTop* pClassMenuItem = InitClassMenuItem(pClassMgr); - pRoot->Insert( pClassMenuItem ); - - RscTop* pClassMenu = InitClassMenu( pClassMgr, pClassMenuItem ); - pRoot->Insert( pClassMenu ); - - // pClassMenu is only completely defined here - nId = aNmTb.Put( "SubMenu", VARNAME ); - pClassMenuItem->SetVariable( nId, pClassMenu, nullptr, RSCVAR::SvDynamic, - (sal_uInt32)RscMenuItem::Menu ); -} aNmTb.SetSort(); } diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index d4cad7f1103c..6fd4eda414ef 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -25,7 +25,6 @@ #include <string.h> #include <rtl/strbuf.hxx> -#include <tools/rc.h> #include <rscerror.h> #include <rsctools.hxx> #include <rscclass.hxx> diff --git a/rsc/source/res/rscarray.cxx b/rsc/source/res/rscarray.cxx index 0b86f75a73b3..3efd01a3dad0 100644 --- a/rsc/source/res/rscarray.cxx +++ b/rsc/source/res/rscarray.cxx @@ -56,11 +56,6 @@ RscArray::~RscArray() { } -RSCCLASS_TYPE RscArray::GetClassType() const -{ - return RSCCLASS_ENUMARRAY; -} - RscTop * RscArray::GetTypeClass() const { return pTypeClass; @@ -428,13 +423,4 @@ RscLangArray::RscLangArray( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper, { } -RSCCLASS_TYPE RscLangArray::GetClassType() const -{ - if( GetSuperClass() ) - return GetSuperClass()->GetClassType(); - else - return RscArray::GetClassType(); - -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index 1bbac234094c..a6922310308f 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -26,7 +26,6 @@ #include <rscclass.hxx> #include <tools/rcid.h> -#include <tools/rc.h> RscClass::RscClass( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuperCl ) : RscTop( nId, nTypeId, pSuperCl ) @@ -61,11 +60,6 @@ RscClass::~RscClass() rtl_freeMemory( static_cast<void *>(pVarTypeList) ); } -RSCCLASS_TYPE RscClass::GetClassType() const -{ - return RSCCLASS_COMPLEX; -} - RSCINST RscClass::GetInstData ( CLASS_DATA pData, @@ -262,18 +256,6 @@ ERRTYPE RscClass::SetVariable( Atom nVarName, return ERR_OK; } -void RscClass::EnumVariables( void * pData, VarEnumCallbackProc pProc ) -{ - sal_uInt32 i; - - RscTop::EnumVariables( pData, pProc ); - for( i = 0; i < nEntries; i ++ ) - { - if( !(pVarTypeList[ i ].nVarType & RSCVAR::NoEnum) ) - (*pProc)( pData, pVarTypeList[ i ].pClass->GetClassType(), pVarTypeList[ i ].nVarName ); - } -} - RSCINST RscClass::GetVariable( const RSCINST & rInst, Atom nVarName, const RSCINST & rInitInst, diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx index 81c9010572df..281c8b02ad3b 100644 --- a/rsc/source/res/rscconst.cxx +++ b/rsc/source/res/rscconst.cxx @@ -38,11 +38,6 @@ RscConst::~RscConst() rtl_freeMemory( static_cast<void *>(pVarArray) ); } -RSCCLASS_TYPE RscConst::GetClassType() const -{ - return RSCCLASS_CONST; -} - void RscConst::SetConstant( Atom nVarName, sal_Int32 lValue ) { if( pVarArray ) diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx index 636cbe4e4feb..dad3aa9db830 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -49,11 +49,6 @@ RscBaseCont::~RscBaseCont() { } -RSCCLASS_TYPE RscBaseCont::GetClassType() const -{ - return RSCCLASS_COMPLEX; -} - void RscBaseCont::DestroyElements( RscBaseContInst * pClassData ) { if( pClassData->nEntries ) diff --git a/rsc/source/res/rscflag.cxx b/rsc/source/res/rscflag.cxx deleted file mode 100644 index 10661816092f..000000000000 --- a/rsc/source/res/rscflag.cxx +++ /dev/null @@ -1,347 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include <rscflag.hxx> - -RscFlag::RscFlag( Atom nId, RESOURCE_TYPE nTypeId ) - : RscConst( nId, nTypeId ) -{ -} - -sal_uInt32 RscFlag::Size() const -{ - return ALIGNED_SIZE( sizeof( RscFlagInst ) * - ( 1 + (nEntries -1) / (sizeof( sal_uInt32 ) * 8) ) ); -} - -ERRTYPE RscFlag::SetNotConst( const RSCINST & rInst, Atom nConst ) -{ - sal_uInt32 i = 0; - - if( nEntries != (i = GetConstPos( nConst )) ) - { - sal_uInt32 nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - - i = i / (sizeof( sal_uInt32 ) * 8); - reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nFlags &= ~nFlag; - reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nDfltFlags &= ~nFlag; - return ERR_OK; - } - - return ERR_RSCFLAG; -} - -ERRTYPE RscFlag::SetConst( const RSCINST & rInst, Atom nConst, sal_Int32 /*nVal*/ ) -{ - sal_uInt32 i = 0; - - if( nEntries != (i = GetConstPos( nConst )) ) - { - sal_uInt32 nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - - i = i / (sizeof( sal_uInt32 ) * 8); - reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nFlags |= nFlag; - reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nDfltFlags &= ~nFlag; - return ERR_OK; - } - - return ERR_RSCFLAG; -} - -RSCINST RscFlag::CreateBasic( RSCINST * pInst ) -{ - RSCINST aInst; - - if( !pInst ) - { - aInst.pClass = this; - aInst.pData = static_cast<CLASS_DATA>(rtl_allocateMemory( Size() )); - } - else - aInst = *pInst; - - return aInst; -} - -RSCINST RscFlag::Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass ) -{ - RSCINST aInst = CreateBasic( pInst ); - - if( !bOwnClass && rDflt.IsInst() ) - bOwnClass = rDflt.pClass->InHierarchy( this ); - - if( bOwnClass ) - memmove( aInst.pData, rDflt.pData, Size() ); - else - { - for( sal_uInt32 i = 0; i < Size() / sizeof( RscFlagInst ); i++ ) - { - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nFlags = 0; - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nDfltFlags = 0xFFFFFFFF; - } - } - - return aInst; -} - -RSCINST RscFlag::CreateClient( RSCINST * pInst, const RSCINST & rDfltI, - bool bOwnClass, Atom nConstId ) -{ - RSCINST aInst = CreateBasic( pInst ); - sal_uInt32 i = 0; - - if( !bOwnClass && rDfltI.IsInst() ) - bOwnClass = rDfltI.pClass->InHierarchy( this ); - - if( nEntries != (i = GetConstPos( nConstId )) ) - { - sal_uInt32 nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - i = i / (sizeof( sal_uInt32 ) * 8); - if( bOwnClass ) - { - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nFlags &= - ~nFlag | reinterpret_cast<RscFlagInst *>(rDfltI.pData)[ i ].nFlags; - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nDfltFlags &= - ~nFlag | reinterpret_cast<RscFlagInst *>(rDfltI.pData)[ i ].nDfltFlags; - } - else - { - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nFlags &= ~nFlag; - reinterpret_cast<RscFlagInst *>(aInst.pData)[ i ].nDfltFlags |= nFlag; - } - } - - return aInst; -} - -void RscFlag::SetToDefault( const RSCINST & rInst ) -{ - sal_uInt32 i = 0; - - for( i = 0; i < Size() / sizeof( RscFlagInst ); i++ ) - reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nDfltFlags = 0xFFFFFFFF; -} - -bool RscFlag::IsDefault( const RSCINST & rInst ) -{ - sal_uInt32 i = 0; - - for( i = 0; i < Size() / sizeof( RscFlagInst ); i++ ) - { - if( reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nDfltFlags != 0xFFFFFFFF ) - return false; - } - return true; -} - -bool RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId ) -{ - sal_uInt32 i = 0, nFlag = 0; - - if( nEntries != (i = GetConstPos( nConstId )) ) - { - nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - i = i / (sizeof( sal_uInt32 ) * 8); - - if( reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nDfltFlags & nFlag ) - return true ; - else - return false; - } - return true; -} - -bool RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef, - Atom nConstId ) -{ - sal_uInt32 i = 0, nFlag = 0; - - if( nEntries != (i = GetConstPos( nConstId )) ) - { - nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - i = i / (sizeof( sal_uInt32 ) * 8); - - if( pDef ) - { - if( (reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nFlags & nFlag) == - (reinterpret_cast<RscFlagInst *>(pDef)[ i ].nFlags & nFlag) ) - { - return true; - } - } - } - - return false; -} - -bool RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) -{ - if( pDef ) - { - sal_uInt32 Flag = 0, nIndex = 0; - - Flag = 1; - for( sal_uInt32 i = 0; i < nEntries; i++ ) - { - nIndex = i / (sizeof( sal_uInt32 ) * 8); - - if( (reinterpret_cast<RscFlagInst *>(rInst.pData)[ nIndex ].nFlags & Flag) != - (reinterpret_cast<RscFlagInst *>(pDef)[ nIndex ].nFlags & Flag) ) - { - return false; - } - Flag <<= 1; - if( !Flag ) - Flag = 1; - } - } - else - return false; - - return true; -} - -bool RscFlag::IsSet( const RSCINST & rInst, Atom nConstId ) -{ - sal_uInt32 i = 0, nFlag = 0; - - if( nEntries != (i = GetConstPos( nConstId )) ) - { - nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) ); - i = i / (sizeof( sal_uInt32 ) * 8); - - if( reinterpret_cast<RscFlagInst *>(rInst.pData)[ i ].nFlags & nFlag ) - return true; - else - return false; - } - return true; -} - -void RscFlag::WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont *, sal_uInt32, const char * ) -{ - sal_uInt32 i = 0, Flag = 0, nIndex = 0; - bool bComma = false; - - Flag = 1; - for( i = 0; i < nEntries; i++ ) - { - nIndex = i / (sizeof( sal_uInt32 ) * 8); - if( !( reinterpret_cast<RscFlagInst *>(rInst.pData)[ nIndex ].nDfltFlags & Flag) ) - { - if( bComma ) - fprintf( fOutput, ", " ); - - if( reinterpret_cast<RscFlagInst *>(rInst.pData)[ nIndex ].nFlags & Flag ) - fprintf( fOutput, "%s", pHS->getString( pVarArray[ i ].nId ).getStr() ); - else - { - fprintf( fOutput, "not " ); - fprintf( fOutput, "%s", pHS->getString( pVarArray[ i ].nId ).getStr() ); - } - bComma = true; - } - Flag <<= 1; - if( !Flag ) - Flag = 1; - } -} - -ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, - RscTypCont *, sal_uInt32 ) -{ - sal_Int32 lVal = 0; - sal_uInt32 i = 0, Flag = 0, nIndex = 0; - - Flag = 1; - for( i = 0; i < nEntries; i++ ) - { - nIndex = i / (sizeof( sal_uInt32 ) * 8); - - if( reinterpret_cast<RscFlagInst *>(rInst.pData)[ nIndex ].nFlags & Flag ) - lVal |= pVarArray[ i ].lValue; - - Flag <<= 1; - if( !Flag ) - Flag = 1; - } - - aMem.Put( lVal ); - return ERR_OK; -} - -RscClient::RscClient( Atom nId, RESOURCE_TYPE nTypeId, RscFlag * pClass, - Atom nConstantId ) - : RscTop(nId, nTypeId), pRefClass(pClass), nConstId(nConstantId) -{ -} - -RSCCLASS_TYPE RscClient::GetClassType() const -{ - return RSCCLASS_BOOL; -} - -void RscClient::WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont *, sal_uInt32, const char * ) -{ - if( pRefClass->IsSet( rInst, nConstId ) ) - fprintf( fOutput, "TRUE" ); - else - fprintf( fOutput, "FALSE" ); -} - -RSCINST RscClient::Create( RSCINST * pInst, const RSCINST & rDflt, - bool bOwnClass ) -{ - RSCINST aTmpI, aDfltI; - - if( pInst ) - { - aTmpI.pClass = pRefClass; - aTmpI.pData = pInst->pData; - } - - if( !bOwnClass && rDflt.IsInst() ) - { - bOwnClass = rDflt.pClass->InHierarchy( this ); - if( bOwnClass ) - { - aDfltI.pClass = pRefClass; - aDfltI.pData = rDflt.pData; - } - } - - if( pInst ) - aTmpI = pRefClass->CreateClient( &aTmpI, aDfltI, - bOwnClass, nConstId ); - else - aTmpI = pRefClass->CreateClient( nullptr, aDfltI, - bOwnClass, nConstId ); - aTmpI.pClass = this; - - return aTmpI; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx index a5ef683b7ee0..db7957d07644 100644 --- a/rsc/source/res/rscrange.cxx +++ b/rsc/source/res/rscrange.cxx @@ -24,128 +24,12 @@ #include <rscrange.hxx> -RscRange::RscRange( Atom nId, RESOURCE_TYPE nTypeId ) - : RscTop( nId, nTypeId ) - , nMin(0), nMax(0) -{ -} - -RSCCLASS_TYPE RscRange::GetClassType() const -{ - return RSCCLASS_NUMBER; -} - -void RscRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) -{ - if( nMinimum > nMaximum ) - { - nMin = nMaximum; - nMax = nMinimum; - } - else - { - nMax = nMaximum; - nMin = nMinimum; - } -} - -bool RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) -{ - if( pDef ) - { - if( reinterpret_cast<RscRangeInst*>(rInst.pData)->nValue == - reinterpret_cast<RscRangeInst*>(pDef)->nValue ) - { - return true; - } - } - - return false; -} - -ERRTYPE RscRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue ) -{ - if( nMax < nValue || nMin > nValue ) - return ERR_RSCRANGE_OUTDEFSET; - - reinterpret_cast<RscRangeInst *>(rInst.pData)->nValue = (sal_uInt16)( nValue - nMin ); - reinterpret_cast<RscRangeInst *>(rInst.pData)->bDflt = false; - return ERR_OK; -} - -ERRTYPE RscRange::GetNumber( const RSCINST & rInst, sal_Int32 * pN ) -{ - *pN = reinterpret_cast<RscRangeInst *>(rInst.pData)->nValue + nMin; - return ERR_OK; -} - -RSCINST RscRange::Create( RSCINST * pInst, const RSCINST & rDflt, - bool bOwnClass ) -{ - RSCINST aInst; - - if( !pInst ) - { - aInst.pClass = this; - aInst.pData = static_cast<CLASS_DATA>(rtl_allocateMemory( sizeof( RscRangeInst ) )); - } - else - aInst = *pInst; - - if( !bOwnClass && rDflt.IsInst() ) - bOwnClass = rDflt.pClass->InHierarchy( this ); - - if( bOwnClass ) - memmove( aInst.pData, rDflt.pData, sizeof( RscRangeInst ) ); - else - { - if( 0 >= nMin && 0 <= nMax ) - reinterpret_cast<RscRangeInst *>(aInst.pData)->nValue = (sal_uInt16)(0 - nMin); - else - reinterpret_cast<RscRangeInst *>(aInst.pData)->nValue = 0; - - reinterpret_cast<RscRangeInst *>(aInst.pData)->bDflt = true; - } - - return aInst; -} - -void RscRange::WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont *, sal_uInt32, const char * ) -{ - fprintf( fOutput, "%ld", long( reinterpret_cast<RscRangeInst *>(rInst.pData)->nValue + nMin ) ); -} - -ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, - RscTypCont *, sal_uInt32 ) -{ - if( nMin >= 0 ) - { - sal_uInt16 n; - n = (sal_uInt16)(reinterpret_cast<RscRangeInst *>(rInst.pData)->nValue + nMin); - aMem.Put( n ); - } - else - { - sal_Int16 n; - n = (sal_Int16)(reinterpret_cast<RscRangeInst *>(rInst.pData)->nValue + nMin); - aMem.Put( n ); - } - - return ERR_OK; -} - RscLongRange::RscLongRange( Atom nId, RESOURCE_TYPE nTypeId ) : RscTop( nId, nTypeId ) , nMin(0), nMax(0) { } -RSCCLASS_TYPE RscLongRange::GetClassType() const -{ - return RSCCLASS_NUMBER; -} - void RscLongRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) { if( nMinimum > nMaximum ) @@ -252,164 +136,4 @@ ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/, return SetNumber( rInst, nValue ); } -RscIdRange::RscIdRange( Atom nId, RESOURCE_TYPE nTypeId ) - : RscTop( nId, nTypeId ) - , nMin(0), nMax(0) -{ -} - -RSCCLASS_TYPE RscIdRange::GetClassType() const -{ - return RSCCLASS_NUMBER; -} - -RSCINST RscIdRange::Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass ) -{ - RSCINST aInst; - RscId * pClassData; - - if( !pInst ) - { - aInst.pClass = this; - aInst.pData = static_cast<CLASS_DATA>(rtl_allocateMemory( sizeof( RscId ) )); - } - else - aInst = *pInst; - - - if( !bOwnClass && rDflt.IsInst() ) - bOwnClass = rDflt.pClass->InHierarchy( this ); - - pClassData = reinterpret_cast<RscId *>(aInst.pData); - - pClassData->Create(); - - if( bOwnClass ) - *pClassData = *reinterpret_cast<RscId *>(rDflt.pData); - else - { - *pClassData = RscId(); - if( 0 >= nMin && 0 <= nMax ) - *pClassData = RscId( (sal_Int32)0 ); - else - *pClassData = RscId( nMin ); - - //cUnusedi is used as default identifier - reinterpret_cast<RscId *>(aInst.pData)->aExp.cUnused = true; - } - - return aInst; -} - -void RscIdRange::Destroy( const RSCINST & rInst ) -{ - reinterpret_cast<RscId *>(rInst.pData)->Destroy(); -} - -bool RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) -{ - if( pDef ) - { - if( reinterpret_cast<RscId*>(rInst.pData)->aExp.IsNumber() && - reinterpret_cast<RscId*>(pDef)->aExp.IsNumber() ) - { - if( reinterpret_cast<RscId*>(rInst.pData)->GetNumber() == - reinterpret_cast<RscId*>(pDef)->GetNumber() ) - { - return true; - } - } - } - - return false; -} - -ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue ) -{ - if( nMax < nValue || nMin > nValue ) - return ERR_RSCRANGE_OUTDEFSET; - - *reinterpret_cast<RscId *>(rInst.pData) = RscId( nValue ); - reinterpret_cast<RscId *>(rInst.pData)->aExp.cUnused = false; - return ERR_OK; -} - -ERRTYPE RscIdRange::GetNumber( const RSCINST & rInst, sal_Int32 * plValue ) -{ - *plValue = reinterpret_cast<RscId *>(rInst.pData)->GetNumber(); - return ERR_OK; -} - -ERRTYPE RscIdRange::SetRef( const RSCINST & rInst, const RscId & rRscId ) -{ - ERRTYPE aError; - if( rRscId.IsId() ) - { - aError = SetNumber( rInst, rRscId.GetNumber() ); - if( aError.IsOk() ) - { - *reinterpret_cast<RscId *>(rInst.pData) = rRscId; - reinterpret_cast<RscId *>(rInst.pData)->aExp.cUnused = false; - } - } - else - aError = ERR_RSCRANGE_OUTDEFSET; - - return aError; -} - -ERRTYPE RscIdRange::GetRef( const RSCINST & rInst, RscId * pRscId ) -{ - *pRscId = *reinterpret_cast<RscId *>(rInst.pData); - - return ERR_OK; -} - -void RscIdRange::WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont *, sal_uInt32, const char * ) -{ - fprintf( fOutput, "%s", reinterpret_cast<RscId *>(rInst.pData)->GetName().getStr() ); -} - -ERRTYPE RscIdRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, - RscTypCont *, sal_uInt32 ) -{ - sal_Int32 lVal = reinterpret_cast<RscId*>(rInst.pData)->GetNumber(); - - aMem.Put( lVal ); - - return ERR_OK; -} - -bool RscIdRange::IsConsistent( const RSCINST & rInst ) -{ - long nValue = reinterpret_cast<RscId *>(rInst.pData)->GetNumber(); - - return (nMax >= nValue) && (nMin <= nValue); - -} - -RscBool::RscBool( Atom nId, RESOURCE_TYPE nTypeId ) - : RscRange( nId, nTypeId ) -{ - RscRange::SetRange( 0, 1 ); -} - -RSCCLASS_TYPE RscBool::GetClassType() const -{ - return RSCCLASS_BOOL; -} - -void RscBool::WriteSrc( const RSCINST & rInst, FILE * fOutput, - RscTypCont *, sal_uInt32, const char * ) -{ - sal_Int32 l; - - GetNumber( rInst, &l ); - if( l ) - fprintf( fOutput, "TRUE" ); - else - fprintf( fOutput, "FALSE" ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx index 90213085743a..918fb5ab1afb 100644 --- a/rsc/source/res/rscstr.cxx +++ b/rsc/source/res/rscstr.cxx @@ -34,11 +34,6 @@ RscString::RscString( Atom nId, RESOURCE_TYPE nTypeId ) { } -RSCCLASS_TYPE RscString::GetClassType() const -{ - return RSCCLASS_STRING; -} - ERRTYPE RscString::SetString( const RSCINST & rInst, const char * pStr ) { char * pTmp; diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx index 3d447796b89d..adc61de5a086 100644 --- a/rsc/source/res/rsctop.cxx +++ b/rsc/source/res/rsctop.cxx @@ -102,12 +102,6 @@ ERRTYPE RscTop::SetVariable( Atom nVarName, RscTop * pClass, return ERR_UNKNOWN_METHOD; } -void RscTop::EnumVariables( void * pData, VarEnumCallbackProc pProc ) -{ - if( pSuperClass ) - pSuperClass->EnumVariables( pData, pProc ); -} - RSCINST RscTop::GetVariable( const RSCINST & rInst, Atom nVarName, const RSCINST & rInitInst, |