android/qa/sc/Makefile | 4 - sal/inc/sal/log-areas.dox | 1 sc/source/ui/vba/testvba/runTests.pl | 1 solenv/bin/linkoo | 1 solenv/gbuild/AllLangResTarget.mk | 11 +++- solenv/gbuild/CppunitTest.mk | 1 solenv/gbuild/TargetLocations.mk | 2 tools/source/rc/resmgr.cxx | 89 +++++++++++------------------------ vcl/aqua/source/app/salinst.cxx | 48 ------------------ 9 files changed, 42 insertions(+), 116 deletions(-)
New commits: commit e63bfb3035cd01983600a23ab289601dd9b2cf11 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Jan 30 13:41:53 2013 +0100 Get rid of STAR_RESOURCEPATH ...the only remaining use was for CppunitTest to find the .res files in $(OUTDIR)/bin/. Get that solved by delivering the .res files also to $(OUTDIR)/unittest/install/program/resource/ (new gb_ResTarget_get_unittest_target). Change-Id: I370e7cab4223256356c7511b88ae63d9c0dbf215 diff --git a/android/qa/sc/Makefile b/android/qa/sc/Makefile index e52b589..da40618 100644 --- a/android/qa/sc/Makefile +++ b/android/qa/sc/Makefile @@ -177,8 +177,8 @@ copy-stuff: mkdir -p assets/unpack/etc/fonts cp fonts.conf assets/unpack/etc/fonts # The indirect command lines... - echo "SAL_LOG=+WARN+INFO STAR_RESOURCEPATH=/assets/bin $(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/ucalc.cmdline - echo "SAL_LOG=+WARN+INFO STAR_RESOURCEPATH=/assets/bin $(APP_DATA_PATH)/lib/libtest_sc_filters_test.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/filters_test.cmdline + echo "SAL_LOG=+WARN+INFO $(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/ucalc.cmdline + echo "SAL_LOG=+WARN+INFO $(APP_DATA_PATH)/lib/libtest_sc_filters_test.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/filters_test.cmdline # # Then gdbserver and gdb.setup so that we can debug with ndk-gdb. cp $(ANDROID_NDK_GDBSERVER) $(SODEST) diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox index eeb1d60..5971aee 100644 --- a/sal/inc/sal/log-areas.dox +++ b/sal/inc/sal/log-areas.dox @@ -153,6 +153,7 @@ certain functionality. @section tools @li @c tools.debug +@li @c tools.rc - resource manager @li @c tools.stream - SvStream class @section ucb diff --git a/sc/source/ui/vba/testvba/runTests.pl b/sc/source/ui/vba/testvba/runTests.pl index 5f32015..4f85abe 100644 --- a/sc/source/ui/vba/testvba/runTests.pl +++ b/sc/source/ui/vba/testvba/runTests.pl @@ -101,7 +101,6 @@ if ( !$failed && open(UNAME, "uname -a|") ) { print "$testPath\n"; $testPath = $ENV{"PATH"}; print "$testPath\n"; - $ENV{"STAR_RESOURCEPATH"} = "$officepath/basis3.0/program/resource"; $ENV{"SAL_ALLOW_LINKOO_SYMLINKS"} = "1"; $testPath = $ENV{"LANG"}; print "$testPath\n"; diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo index 6f6e096..61726f4 100755 --- a/solenv/bin/linkoo +++ b/solenv/bin/linkoo @@ -41,7 +41,6 @@ export LD_LIBRARY_PATH="$thisdir:$java_path:' . $moz_lib . '$LD_LIBRARY_PATH" ulimit -c unlimited export PATH="$thisdir:$thisdir/../ure-link/bin:$PATH" export GNOME_DISABLE_CRASH_DIALOG=1 -export STAR_RESOURCEPATH=$thisdir/resource # debugging assistance export SAL_DISABLE_FLOATGRAB=1 export G_SLICE=always-malloc diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index 9e348e7..c211b1c 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -359,7 +359,7 @@ gb_ResTarget_DEFIMAGESLOCATION := $(SRCDIR)/icon-themes/galaxy/ $(call gb_ResTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),RES,2) $(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*)) + rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*) $(call gb_ResTarget_get_unittest_target,$*)) $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) \ $(gb_ResTarget_RSCDEPS) @@ -390,17 +390,24 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) \ $(call gb_ResTarget_get_outdir_target,%) : $(call gb_Deliver_deliver,$<,$@) +$(call gb_ResTarget_get_unittest_target,%) : + $(call gb_Helper_abbreviate_dirs,mkdir -p $(dir $@)) + $(call gb_Deliver_deliver,$<,$@) + define gb_ResTarget_ResTarget $(call gb_ResTarget_get_target,$(1)) : LIBRARY = $(2) $(call gb_ResTarget_get_target,$(1)) : LANGUAGE = $(3) $(call gb_ResTarget_get_target,$(1)) : RESLOCATION = $(2) -$(call gb_AllLangResTarget_get_target,$(2)) : $(call gb_ResTarget_get_outdir_target,$(1)) +$(call gb_AllLangResTarget_get_target,$(2)) : $(call gb_ResTarget_get_outdir_target,$(1)) $(call gb_ResTarget_get_unittest_target,$(1)) $(call gb_AllLangResTarget_get_clean_target,$(2)) : $(call gb_ResTarget_get_clean_target,$(1)) $(call gb_ResTarget_get_imagelist_target,$(1)) : $(call gb_ResTarget_get_target,$(1)) $(call gb_ResTarget_get_outdir_target,$(1)) : $(call gb_ResTarget_get_target,$(1)) $(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_target,$(1)),$(call gb_ResTarget_get_target,$(1)),$(1)) +$(call gb_ResTarget_get_unittest_target,$(1)) : $(call gb_ResTarget_get_target,$(1)) +$(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_unittest_target,$(1)),$(call gb_ResTarget_get_target,$(1)),$(1)) + endef define gb_ResTarget_add_file diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index e578dc03..e883ade 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -91,7 +91,6 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) $(if $(DBGSV_ERROR_OUT),DBGSV_ERROR_OUT=$(DBGSV_ERROR_OUT)) \ DISABLE_SAL_DBGBOX=t \ $(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \ - STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) \ $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \ $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) \ $(call gb_CppunitTest__make_args) \ diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index d24818e..3887b53 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -55,6 +55,8 @@ gb_PackagePart_get_target = $(OUTDIR)/$(1) gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb gb_Rdb_get_outdir_target_for_build = $(OUTDIR_FOR_BUILD)/xml/$(1).rdb gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res +gb_ResTarget_get_unittest_target = \ + $(OUTDIR)/unittest/install/program/resource/$(1).res gb_UnoApi_get_target = $(OUTDIR)/bin/$(1).rdb gb_UnoApiMerge_get_target = $(OUTDIR)/bin/$(1).rdb gb_UnoApiMerge_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1).rdb diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 17b75ee..4d578f3 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + +#include <cassert> + #include <string.h> #include <stdio.h> #include <stdlib.h> @@ -176,77 +180,40 @@ void ResMgrContainer::release() void ResMgrContainer::init() { - // get resource path - std::list< OUString > aDirs; - sal_Int32 nIndex = 0; + assert( m_aResFiles.empty() ); - // 1. fixed locations + // get resource path rtl::OUString uri( - RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/resource")); - rtl::Bootstrap::expandMacros(uri); - aDirs.push_back(uri); - - // 2. in STAR_RESOURCEPATH - const sal_Char* pEnv = getenv( "STAR_RESOURCEPATH" ); - if( pEnv ) - { - OUString aEnvPath( OStringToOUString( OString( pEnv ), osl_getThreadTextEncoding() ) ); - nIndex = 0; - while( nIndex >= 0 ) - { - OUString aPathElement( aEnvPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ) ); - if( !aPathElement.isEmpty() ) - { - OUString aFileURL; - File::getFileURLFromSystemPath( aPathElement, aFileURL ); - aDirs.push_back( aFileURL); - } - } - } + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/resource/")); + rtl::Bootstrap::expandMacros(uri); //TODO: detect failure // collect all possible resource files - for( std::list< OUString >::const_iterator dir_it = aDirs.begin(); dir_it != aDirs.end(); ++dir_it ) + Directory aDir( uri ); + if( aDir.open() == FileBase::E_None ) { - Directory aDir( *dir_it ); - if( aDir.open() == FileBase::E_None ) + DirectoryItem aItem; + while( aDir.getNextItem( aItem ) == FileBase::E_None ) { - DirectoryItem aItem; - while( aDir.getNextItem( aItem ) == FileBase::E_None ) + FileStatus aStatus(osl_FileStatus_Mask_FileName); + if( aItem.getFileStatus( aStatus ) == FileBase::E_None ) { - FileStatus aStatus(osl_FileStatus_Mask_FileName); - if( aItem.getFileStatus( aStatus ) == FileBase::E_None ) - { - OUString aFileName = aStatus.getFileName(); - if( aFileName.getLength() < 5 ) - continue; - if( ! aFileName.endsWithIgnoreAsciiCaseAsciiL( ".res", 4 ) ) - continue; - OUString aResName = aFileName.copy( 0, aFileName.getLength()-4 ); - if( m_aResFiles.find( aResName ) != m_aResFiles.end() ) - continue; - OUStringBuffer aURL( dir_it->getLength() + aFileName.getLength() + 1 ); - aURL.append( *dir_it ); - if( !dir_it->endsWithIgnoreAsciiCaseAsciiL( "/", 1 ) ) - aURL.append( sal_Unicode('/') ); - aURL.append( aFileName ); - m_aResFiles[ aResName ].aFileURL = aURL.makeStringAndClear(); - } + OUString aFileName = aStatus.getFileName(); + if( ! aFileName.endsWithIgnoreAsciiCase( ".res" ) ) + continue; + OUString aResName = aFileName.copy( 0, aFileName.getLength() - strlen(".res") ); + if( aResName.isEmpty() ) + continue; + assert( m_aResFiles.find( aResName ) == m_aResFiles.end() ); + m_aResFiles[ aResName ].aFileURL = uri + aFileName; + SAL_INFO( + "tools.rc", + "ResMgrContainer: " << aResName << " -> " + << m_aResFiles[ aResName ].aFileURL ); } } - #if OSL_DEBUG_LEVEL > 1 - else - OSL_TRACE( "opening dir %s failed", OUStringToOString( *dir_it, osl_getThreadTextEncoding() ).getStr() ); - #endif } - #if OSL_DEBUG_LEVEL > 1 - for( boost::unordered_map< OUString, ContainerElement, OUStringHash >::const_iterator it = - m_aResFiles.begin(); it != m_aResFiles.end(); ++it ) - { - OSL_TRACE( "ResMgrContainer: %s -> %s", - OUStringToOString( it->first, osl_getThreadTextEncoding() ).getStr(), - OUStringToOString( it->second.aFileURL, osl_getThreadTextEncoding() ).getStr() ); - } - #endif + else + SAL_WARN( "tools.rc", "opening dir " << uri << " failed" ); // set default language LanguageType nLang = MsLangId::getSystemUILanguage(); commit 53927349241643abc2a083f1983c46ec793e6ff1 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Jan 30 13:32:41 2013 +0100 Setting env vars in aqua's InitSalMain should long be unnecessary ...see the comment at the start of InitSalMain in 95548c7b5ad2b388f077bf9bf2031ac5f6121d0e "Implemented InitSalMain() and DeInitSalMain() functions" for why this was relevant back in 2001. Change-Id: I2b2e5f261065d3b801ef20cca592009fa6b3f558 diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx index cb715ca..7c3009f 100644 --- a/vcl/aqua/source/app/salinst.cxx +++ b/vcl/aqua/source/app/salinst.cxx @@ -20,8 +20,6 @@ #include <stdio.h> -#include "tools/fsys.hxx" -#include "tools/getprocessworkingdir.hxx" #include <tools/solarmutex.hxx> #include "osl/process.h" @@ -295,52 +293,6 @@ extern "C" { void InitSalMain() { - rtl::OUString urlWorkDir; - rtl_uString *sysWorkDir = NULL; - if (tools::getProcessWorkingDir(urlWorkDir)) - { - oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir); - if (err2 == osl_File_E_None) - { - rtl::OString aPath( getenv( "PATH" ) ); - rtl::OString aResPath( getenv( "STAR_RESOURCEPATH" ) ); - rtl::OString aLibPath( getenv( "DYLD_LIBRARY_PATH" ) ); - rtl::OString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() ); - // Get absolute path of command's directory - if ( !aCmdPath.isEmpty() ) { - DirEntry aCmdDirEntry( aCmdPath ); - aCmdDirEntry.ToAbs(); - aCmdPath = rtl::OUStringToOString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); - } - // Assign to PATH environment variable - if ( !aCmdPath.isEmpty() ) - { - rtl::OString aTmpPath( aCmdPath ); - if ( !aPath.isEmpty() ) - aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); - aTmpPath += aPath; - setenv( "PATH", aTmpPath.getStr(), 1 ); - } - // Assign to STAR_RESOURCEPATH environment variable - if ( !aCmdPath.isEmpty() ) - { - rtl::OString aTmpPath( aCmdPath ); - if ( !aResPath.isEmpty() ) - aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); - aTmpPath += aResPath; - setenv( "STAR_RESOURCEPATH", aTmpPath.getStr(), 1 ); - } - // Assign to DYLD_LIBRARY_PATH environment variable - if ( !aCmdPath.isEmpty() ) - { - rtl::OString aTmpPath( aCmdPath ); - if ( !aLibPath.isEmpty() ) - aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); - aTmpPath += aLibPath; - setenv( "DYLD_LIBRARY_PATH", aTmpPath.getStr(), 1 ); - } - } - } } // ----------------------------------------------------------------------- _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits