diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-07-14 17:07:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-15 13:15:10 +0000 |
commit | 7da80de2c75e048a08ea6e923a9f433a638a9f12 (patch) | |
tree | f442a30ea1f23d27a68de23f17aa39be25cc84ef /sc/source/filter/oox/formulabase.cxx | |
parent | bb8d731c1a5d1acbab95b2db0dcf7ce09e0a1df3 (diff) |
sc: remove FUNC* and OOX_XLS_IS_LIBNAME macros
FUNCLIB_TO_FUNCFLAGS is odd because the only FunctionLibraryType
is FUNCLIB_EUROTOOL = 1, left shifted 12 times gives 0x1000
same as FUNCFLAG_BIFFEXPORTONLY.
remove the FUNC macros.
create a new FUNCFLAG_EUROTOOL value for the euro tool lib
and map it to FUNCLIB_EUROTOOL.
inline OOX_XLS_IS_LIBNAME macro.
Change-Id: Ia5d1f634ae4dfa5fd8cc5109e47113b2a5b95d7d
Reviewed-on: https://gerrit.libreoffice.org/27221
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/filter/oox/formulabase.cxx')
-rw-r--r-- | sc/source/filter/oox/formulabase.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 232d569f4220..80c277cc1209 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -220,11 +220,7 @@ const sal_uInt16 FUNCFLAG_MACROCALL_NEW = FUNCFLAG_MACROCALL | FUNCFLAG_MACR const sal_uInt16 FUNCFLAG_BIFFIMPORTONLY = 0x0800; /// Only used in BIFF binary import filter. const sal_uInt16 FUNCFLAG_BIFFEXPORTONLY = 0x1000; /// Only used in BIFF binary export filter. const sal_uInt16 FUNCFLAG_INTERNAL = 0x2000; /// Function is internal in Calc. - -/// Converts a function library index (value of enum FunctionLibraryType) to function flags. -#define FUNCLIB_TO_FUNCFLAGS( funclib_index ) static_cast< sal_uInt16 >( static_cast< sal_uInt8 >( funclib_index ) << 12 ) -/// Extracts a function library index (value of enum FunctionLibraryType) from function flags. -#define FUNCFLAGS_TO_FUNCLIB( func_flags ) extractValue< FunctionLibraryType >( func_flags, 12, 4 ) +const sal_uInt16 FUNCFLAG_EUROTOOL = 0x4000; /// function of euro tool lib, FUNCLIB_EUROTOOL typedef std::shared_ptr< FunctionInfo > FunctionInfoRef; @@ -679,8 +675,7 @@ static const FunctionData saFuncTableBiff5[] = { "ROMAN", "ROMAN", 354, 354, 1, 2, V, { VR }, 0 }, // *** EuroTool add-in *** - - { "EUROCONVERT", "EUROCONVERT", NOID, NOID, 3, 5, V, { VR }, FUNCLIB_TO_FUNCFLAGS( FUNCLIB_EUROTOOL ) }, + { "EUROCONVERT", "EUROCONVERT", NOID, NOID, 3, 5, V, { VR }, FUNCFLAG_EUROTOOL }, // *** macro sheet commands *** @@ -1117,8 +1112,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM OSL_ENSURE( !xFuncInfo->maOdfFuncName.isEmpty(), "FunctionProviderImpl::initFunc - missing ODF function name" ); xFuncInfo->maBiffMacroName = "_xlfnodf." + xFuncInfo->maOdfFuncName; } - - xFuncInfo->meFuncLibType = FUNCFLAGS_TO_FUNCLIB( rFuncData.mnFlags ); + xFuncInfo->meFuncLibType = (rFuncData.mnFlags & FUNCFLAG_EUROTOOL) ? FUNCLIB_EUROTOOL : FUNCLIB_UNKNOWN; xFuncInfo->mnApiOpCode = -1; xFuncInfo->mnBiff12FuncId = rFuncData.mnBiff12FuncId; xFuncInfo->mnBiffFuncId = rFuncData.mnBiffFuncId; @@ -1189,14 +1183,11 @@ const FunctionInfo* FunctionProvider::getFuncInfoFromMacroName( const OUString& FunctionLibraryType FunctionProvider::getFuncLibTypeFromLibraryName( const OUString& rLibraryName ) { -#define OOX_XLS_IS_LIBNAME( libname, basename ) (libname.equalsIgnoreAsciiCase( basename ".XLA" ) || libname.equalsIgnoreAsciiCase( basename ".XLAM" )) - // the EUROTOOL add-in containing the EUROCONVERT function - if( OOX_XLS_IS_LIBNAME( rLibraryName, "EUROTOOL" ) ) + if( rLibraryName.equalsIgnoreAsciiCase("EUROTOOL.XLA") + || rLibraryName.equalsIgnoreAsciiCase("EUROTOOL.XLAM")) return FUNCLIB_EUROTOOL; -#undef OOX_XLS_IS_LIBNAME - // default: unknown library return FUNCLIB_UNKNOWN; } |