merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0028-testtool-more-defaults.diff
blobf368e65d97eded905d16fb627a2ba40449a08d7e
1 Make testtool run out-of-the-box in ooenv-ed env
3 From: Thorsten Behrens <thb@openoffice.org>
6 ---
8 automation/source/testtool/objtest.cxx | 63 +++++++++++++++++++++++++++++++
9 automation/source/testtool/testtool.ini | 1
10 solenv/bin/linkoo | 1
11 3 files changed, 64 insertions(+), 1 deletions(-)
14 diff --git automation/source/testtool/objtest.cxx automation/source/testtool/objtest.cxx
15 index dceb0fa..f3f6e33 100644
16 --- automation/source/testtool/objtest.cxx
17 +++ automation/source/testtool/objtest.cxx
18 @@ -531,6 +531,68 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die durch den
19 GetHostConfig();
20 GetTTPortConfig();
21 GetUnoPortConfig();
23 + aConf.SetGroup("Crashreporter");
25 + String aUP;
26 + GETSET( aUP, "UseProxy", "false" );
27 + String aPS;
28 + GETSET( aPS, "ProxyServer", "" );
29 + String aPP;
30 + GETSET( aPP, "ProxyPort", "" );
31 + String aAC;
32 + GETSET( aAC, "AllowContact", "false" );
33 + String aRA;
34 + GETSET( aRA, "ReturnAddress", "" );
36 + OUString sPath;
37 + if( osl_getExecutableFile( (rtl_uString**)&sPath ) == osl_Process_E_None)
38 + {
39 + sPath = sPath.copy(7); // strip file://
41 + int i = sPath.lastIndexOf('/');
42 + if (i >= 0)
43 + i = sPath.lastIndexOf('/', i-1 );
45 + if (i >= 0)
46 + {
47 + sPath = sPath.copy(0, i);
48 + ByteString bsPath( sPath.getStr(), sPath.getLength(),
49 + RTL_TEXTENCODING_UTF8 );
51 + aConf.SetGroup( "OOoProgramDir" );
52 + String aOPD;
53 + // testtool is installed in Basis3.x/program/ dir nowadays
54 + bsPath += "/../program";
55 + GETSET( aOPD, "Current", bsPath);
57 + ByteString aSrcRoot(getenv("SRC_ROOT"));
58 + aConf.SetGroup( "_profile_Default" );
59 + if (aSrcRoot.Len())
60 + {
61 + String aPBD;
62 + aSrcRoot += "/testautomation";
63 + GETSET( aPBD, "BaseDir", aSrcRoot );
65 + String aPHD;
66 + aSrcRoot += "/global/hid";
67 + GETSET( aPHD, "HIDDir", aSrcRoot );
68 + }
69 + else
70 + {
71 + String aPBD;
72 + bsPath += "/qatesttool";
73 + GETSET( aPBD, "BaseDir", bsPath );
75 + String aPHD;
76 + bsPath += "/global/hid";
77 + GETSET( aPHD, "HIDDir", bsPath );
78 + }
80 + String aLD;
81 + GETSET( aLD, "LogBaseDir", ByteString( "/tmp" ) );
82 + }
83 + }
86 #define MAKE_TT_KEYWORD( cName, aType, aResultType, nID ) \
87 diff --git automation/source/testtool/testtool.ini automation/source/testtool/testtool.ini
88 index bf1b54c..58fa92e 100644
89 --- automation/source/testtool/testtool.ini
90 +++ automation/source/testtool/testtool.ini
91 @@ -9,7 +9,6 @@ CurrentProfile=_profile_Default
93 [OOoProgramDir]
94 Type=Path
95 -Current=.
97 [Crashreporter]
98 UseProxy=false
99 diff --git solenv/bin/linkoo solenv/bin/linkoo
100 index 659d473..a4615d5 100755
101 --- solenv/bin/linkoo
102 +++ solenv/bin/linkoo
103 @@ -372,6 +372,7 @@ if (!-f "$OOO_INSTALL/" . $brand_program_dir . "/ooenv") {
104 print "Creating '$OOO_INSTALL/", $brand_program_dir, "/ooenv'\n";
105 open ($ooenv, ">$OOO_INSTALL/" . $brand_program_dir . "/ooenv") || die "Can't open $OOO_INSTALL/" . $brand_program_dir . "/ooenv: $!";
106 print $ooenv $env_script;
107 + print $ooenv "# testtool\nexport SRC_ROOT=$OOO_BUILD\n";
108 close ($ooenv);