Module_tail_build.mk | 3 - cppuhelper/source/shlib.cxx | 46 ++++++++++++-------- ios/qa/sc/Makefile | 11 ++++ ios/qa/sc/filters-test.m | 26 ++++++++++- sal/Package_inc.mk | 1 sal/inc/osl/detail/ios-bootstrap.h | 60 ++++++++++++++++++++++++++ sc/source/filter/oox/biffcodec.cxx | 85 ------------------------------------- 7 files changed, 125 insertions(+), 107 deletions(-)
New commits: commit d25ef83c1293f1596d2d2d4d4643e3278959823a Author: Tor Lillqvist <t...@iki.fi> Date: Mon Apr 9 22:40:58 2012 +0300 Add the lo_get_libmap() for this test app diff --git a/ios/qa/sc/Makefile b/ios/qa/sc/Makefile index 5d3bcf5..d46e14e 100644 --- a/ios/qa/sc/Makefile +++ b/ios/qa/sc/Makefile @@ -15,6 +15,15 @@ APPDIR=build/Debug-$(PLATFORM)/$(APP).app # Stuff lifted from solenv/gbuild/platform/IOS_ARM_GCC.mk +gb_OSDEFS := \ + -D$(OS) \ + -D_PTHREADS \ + -DUNIX \ + -DUNX \ + -D_REENTRANT \ + -DNO_PTHREAD_PRIORITY \ + $(EXTRA_CDEFS) \ + gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -g gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS) gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS) @@ -36,7 +45,7 @@ all: $(APPDIR)/$(APP) stuff $(APPDIR)/$(APP): $(SRCS) mkdir -p $(APPDIR) - $(CXX) -Wl,-map,$(APP).map.mangled -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS) + $(CXX) -Wl,-map,$(APP).map.mangled -o $@ $(gb_OSDEFS) $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS) c++filt <$(APP).map.mangled >$(APP).map && rm $(APP).map.mangled stuff: diff --git a/ios/qa/sc/filters-test.m b/ios/qa/sc/filters-test.m index c6650ea..42b0816 100644 --- a/ios/qa/sc/filters-test.m +++ b/ios/qa/sc/filters-test.m @@ -35,11 +35,32 @@ #include "cppunit/plugin/TestPlugIn.h" //#include "cppunit/plugin/PlugInManager.h" +#include <osl/detail/ios-bootstrap.h> + +#ifdef __cplusplus extern "C" { - extern CppUnitTestPlugIn *cppunitTestPlugIn(void); - extern int lo_main(int argc, const char **argv); +#endif + +extern CppUnitTestPlugIn *cppunitTestPlugIn(void); +extern int lo_main(int argc, const char **argv); + +extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + +const lib_to_component_mapping * +lo_get_libmap(void) +{ + static lib_to_component_mapping map[] = { + { "libsclo.a", sc_component_getFactory }, + { NULL, NULL } + }; + + return map; } +#ifdef __cplusplus +} +#endif + int main(int argc, char ** argv) { @@ -160,4 +181,3 @@ didFinishLaunchingWithOptions: (NSDictionary *) launchOptions @end /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ - commit 0b67dd10f858caf46a1d55aff1de319d161f44cf Author: Tor Lillqvist <t...@iki.fi> Date: Mon Apr 9 22:40:17 2012 +0300 Use lo_get_libmap() diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index 8c12784..0627e30 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -46,6 +46,10 @@ #endif #include <vector> +#ifdef IOS +#include <osl/detail/ios-bootstrap.h> +#endif + #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) @@ -463,7 +467,6 @@ extern "C" extern void * configmgr_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); extern void * fwk_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); extern void * i18npool_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); - extern void * sc_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); extern void * ucb_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); extern void * ucpfile_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ); } @@ -523,24 +526,33 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( oslGenericFunction pSym = NULL; #ifdef DISABLE_DYNLOADING - if ( rLibName.equals( OUSTR("bootstrap.uno" SAL_DLLEXTENSION)) ) - pSym = (oslGenericFunction) bootstrap_component_getFactory; - else if ( rLibName.equals( OUSTR("libucb1.a")) ) - pSym = (oslGenericFunction) ucb_component_getFactory; - else if ( rLibName.equals( OUSTR("configmgr.uno.a")) ) - pSym = (oslGenericFunction) configmgr_component_getFactory; - else if ( rLibName.equals( OUSTR("libucpfile1.a")) ) - pSym = (oslGenericFunction) ucpfile_component_getFactory; - else if ( rLibName.equals( OUSTR("libsclo.a")) ) - pSym = (oslGenericFunction) sc_component_getFactory; - else if ( rLibName.equals( OUSTR("libfwklo.a")) ) - pSym = (oslGenericFunction) fwk_component_getFactory; - else if ( rLibName.equals( OUSTR("i18npool.uno.a")) ) - pSym = (oslGenericFunction) i18npool_component_getFactory; - else + // First test library names that aren't app-specific. + static lib_to_component_mapping non_app_specific_map[] = { + { "bootstrap.uno" SAL_DLLEXTENSION, bootstrap_component_getFactory }, + { "configmgr.uno.a", configmgr_component_getFactory }, + { "i18npool.uno.a", i18npool_component_getFactory }, + { "libfwklo.a", fwk_component_getFactory }, + { "libucb1.a", ucb_component_getFactory }, + { "libucpfile1.a", ucpfile_component_getFactory }, + { NULL, NULL } + }; + for (int i = 0; pSym == NULL && non_app_specific_map[i].lib != NULL; ++i) { + if ( rLibName.equalsAscii( non_app_specific_map[i].lib ) ) + pSym = (oslGenericFunction) non_app_specific_map[i].component_getFactory_function; + } + + if ( pSym == NULL) + { + const lib_to_component_mapping *map = lo_get_libmap(); + for (int i = 0; pSym == NULL && map[i].lib != NULL; ++i) + { + if ( rLibName.equalsAscii( map[i].lib ) ) + pSym = (oslGenericFunction) map[i].component_getFactory_function; + } #if OSL_DEBUG_LEVEL > 1 - OSL_TRACE( "attempting to load unknown library %s", OUStringToOString( rLibName, RTL_TEXTENCODING_ASCII_US ).getStr() ); + if ( pSym == NULL ) + OSL_TRACE( "attempting to load unknown library %s", OUStringToOString( rLibName, RTL_TEXTENCODING_ASCII_US ).getStr() ); #endif } #else commit 0b165a6e0a2eb79b2267810edb8cfaa34107ba94 Author: Tor Lillqvist <t...@iki.fi> Date: Mon Apr 9 22:38:26 2012 +0300 Add a header for iOS-specific low-level stuff diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk index 5350faf..1bce8ec 100644 --- a/sal/Package_inc.mk +++ b/sal/Package_inc.mk @@ -66,6 +66,7 @@ $(eval $(call gb_Package_add_file,sal_inc,inc/osl/util.h,osl/util.h)) $(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/file.h,osl/detail/file.h)) $(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android_native_app_glue.h,osl/detail/android_native_app_glue.h)) $(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android-bootstrap.h,osl/detail/android-bootstrap.h)) +$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/ios-bootstrap.h,osl/detail/ios-bootstrap.h)) $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/allocator.hxx,rtl/allocator.hxx)) $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/alloc.h,rtl/alloc.h)) $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/bootstrap.h,rtl/bootstrap.h)) diff --git a/sal/inc/osl/detail/ios-bootstrap.h b/sal/inc/osl/detail/ios-bootstrap.h new file mode 100644 index 0000000..ac8ccf6 --- /dev/null +++ b/sal/inc/osl/detail/ios-bootstrap.h @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http: *www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 Tor Lillqvist <t...@iki.fi> (initial developer) + * Copyright (C) 2011 SUSE Linux http://suse.com (initial developer's employer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef IOS_BOOSTRAP_H +#define IOS_BOOSTRAP_H + +#if defined(IOS) + +#ifdef __cplusplus +extern "C" { +#endif + +/* On iOS static linking is used. In order to get the needed UNO + * coponent linked in, the "main" code for an app needs to implement + * the lo_get_libmap() function to map UNO component library names as + * produced in a build for iOS (like configmgr.uno.a or libsclo.a) to + * the corresponding component_getFactory functions. + */ + +typedef struct { + const char *lib; + void * (*component_getFactory_function)(const char *, void *, void *); +} lib_to_component_mapping; + +const lib_to_component_mapping *lo_get_libmap(void); + +#ifdef __cplusplus +} +#endif + +#endif // IOS +#endif // IOS_BOOTSTRAP_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 78fbda359c1b745a271753a44b80512c040fac0f Author: Tor Lillqvist <t...@iki.fi> Date: Mon Apr 9 22:34:26 2012 +0300 No xmlhelp for non-desktop OSes diff --git a/Module_tail_build.mk b/Module_tail_build.mk index 44b8413..cd69300 100644 --- a/Module_tail_build.mk +++ b/Module_tail_build.mk @@ -92,7 +92,8 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\ writerfilter \ writerperfect \ xmerge \ - xmlhelp \ + $(if $(filter XMLHELP,$(BUILD_TYPE)), \ + xmlhelp) \ xmloff \ xmlscript \ xmlsecurity \ commit 4cc509293851d29ff5ed38cea11d47a27d09c05c Author: Tor Lillqvist <t...@iki.fi> Date: Mon Apr 9 21:50:40 2012 +0300 WaE: unused functions diff --git a/sc/source/filter/oox/biffcodec.cxx b/sc/source/filter/oox/biffcodec.cxx index 26fee95..c0f1498 100644 --- a/sc/source/filter/oox/biffcodec.cxx +++ b/sc/source/filter/oox/biffcodec.cxx @@ -257,91 +257,6 @@ void BiffDecoder_RCF::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcD } } -// ============================================================================ - -namespace { - -const sal_uInt16 BIFF_FILEPASS_XOR = 0; -const sal_uInt16 BIFF_FILEPASS_RCF = 1; - -const sal_uInt16 BIFF_FILEPASS_BIFF8_RCF = 1; -const sal_uInt16 BIFF_FILEPASS_BIFF8_CRYPTOAPI_2003 = 2; -const sal_uInt16 BIFF_FILEPASS_BIFF8_CRYPTOAPI_2007 = 3; - -// ---------------------------------------------------------------------------- - -BiffDecoderRef lclReadFilePass_XOR( BiffInputStream& rStrm ) -{ - BiffDecoderRef xDecoder; - OSL_ENSURE( rStrm.getRemaining() == 4, "lclReadFilePass_XOR - wrong record size" ); - if( rStrm.getRemaining() == 4 ) - { - sal_uInt16 nBaseKey, nHash; - rStrm >> nBaseKey >> nHash; - xDecoder.reset( new BiffDecoder_XOR( nBaseKey, nHash ) ); - } - return xDecoder; -} - -BiffDecoderRef lclReadFilePass_RCF( BiffInputStream& rStrm ) -{ - BiffDecoderRef xDecoder; - OSL_ENSURE( rStrm.getRemaining() == 48, "lclReadFilePass_RCF - wrong record size" ); - if( rStrm.getRemaining() == 48 ) - { - sal_uInt8 pnSalt[ 16 ]; - sal_uInt8 pnVerifier[ 16 ]; - sal_uInt8 pnVerifierHash[ 16 ]; - rStrm.readMemory( pnSalt, 16 ); - rStrm.readMemory( pnVerifier, 16 ); - rStrm.readMemory( pnVerifierHash, 16 ); - xDecoder.reset( new BiffDecoder_RCF( pnSalt, pnVerifier, pnVerifierHash ) ); - } - return xDecoder; -} - -BiffDecoderRef lclReadFilePass_CryptoApi( BiffInputStream& /*rStrm*/ ) -{ - // not supported - return BiffDecoderRef(); -} - -BiffDecoderRef lclReadFilePassBiff8( BiffInputStream& rStrm ) -{ - BiffDecoderRef xDecoder; - switch( rStrm.readuInt16() ) - { - case BIFF_FILEPASS_XOR: - xDecoder = lclReadFilePass_XOR( rStrm ); - break; - - case BIFF_FILEPASS_RCF: - { - sal_uInt16 nMajor = rStrm.readuInt16(); - rStrm.skip( 2 ); - switch( nMajor ) - { - case BIFF_FILEPASS_BIFF8_RCF: - xDecoder = lclReadFilePass_RCF( rStrm ); - break; - case BIFF_FILEPASS_BIFF8_CRYPTOAPI_2003: - case BIFF_FILEPASS_BIFF8_CRYPTOAPI_2007: - xDecoder = lclReadFilePass_CryptoApi( rStrm ); - break; - default: - OSL_FAIL( "lclReadFilePassBiff8 - unknown BIFF8 encryption sub mode" ); - } - } - break; - - default: - OSL_FAIL( "lclReadFilePassBiff8 - unknown encryption mode" ); - } - return xDecoder; -} - -} // namespace - // ---------------------------------------------------------------------------- BiffCodecHelper::BiffCodecHelper( const WorkbookHelper& rHelper ) : _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits