summaryrefslogtreecommitdiff
path: root/patches/dev300/sfx-check-real-help-path.diff
blob: 131b6d29ee9843cc84c9c50af4092f4b1e778ee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
 sfx2/source/appl/sfxhelp.cxx           |   19 +++++++++----------
 unotools/source/config/pathoptions.cxx |    6 +++++-
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git sfx2/source/appl/sfxhelp.cxx sfx2/source/appl/sfxhelp.cxx
index d5e6f24..df94b19 100644
--- sfx2/source/appl/sfxhelp.cxx
+++ sfx2/source/appl/sfxhelp.cxx
@@ -53,10 +53,10 @@
 #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
 #include <unotools/configmgr.hxx>
 #include <unotools/configitem.hxx>
+#include <unotools/localfilehelper.hxx>
 #include <svtools/helpopt.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <tools/urlobj.hxx>
-#include <unotools/configmgr.hxx>
 #include <ucbhelper/content.hxx>
 #include <unotools/pathoptions.hxx>
 #include <rtl/ustring.hxx>
@@ -126,13 +126,13 @@ rtl::OUString HelpLocaleString()
             aLocaleStr = aEnglish;
         else
         {
-            rtl::OUString aBaseInstallPath;
-            // utl::Bootstrap::PathStatus aBaseLocateResult =
-            utl::Bootstrap::locateBaseInstallation(aBaseInstallPath);
-            static const char *szHelpPath = "/help/";
+            String sBaseHelpPathString;
+            ::utl::LocalFileHelper::ConvertPhysicalNameToURL( SvtPathOptions().GetHelpPath(), sBaseHelpPathString );
+
+            rtl::OUString sBaseHelpPath( sBaseHelpPathString );
+            sBaseHelpPath += rtl::OUString::createFromAscii("/");
 
-            rtl::OUString sHelpPath = aBaseInstallPath +
-                rtl::OUString::createFromAscii(szHelpPath) + aLocaleStr;
+            rtl::OUString sHelpPath = sBaseHelpPath + aLocaleStr;
             osl::DirectoryItem aDirItem;
 
             if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None)
@@ -143,9 +143,8 @@ rtl::OUString HelpLocaleString()
                 if (nSepPos != STRING_NOTFOUND)
                 {
                     bOk = true;
-                    sLang = sLang.Copy( 0, nSepPos );
-                    sHelpPath = aBaseInstallPath +
-                        rtl::OUString::createFromAscii(szHelpPath) + sLang;
+                        sLang = sLang.Copy( 0, nSepPos );
+                    sHelpPath = sBaseHelpPath + sLang;
                     if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None)
                         bOk = false;
                 }
diff --git unotools/source/config/pathoptions.cxx unotools/source/config/pathoptions.cxx
index b02f912..f16e68f 100644
--- unotools/source/config/pathoptions.cxx
+++ unotools/source/config/pathoptions.cxx
@@ -299,7 +299,11 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
         {
             // These office paths have to be converted to system pathes
             utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult );
-            aPathValue = aResult;
+            // FIXME: The initial value (not modified by SetPath) is just a path, so the URL-conversion fails.
+            //        The best solution is to fix the module xmlhelp to accept the URL. Then we could remove
+            //        all these ugly conversions.
+            if ( aResult.Len() != 0 )
+                aPathValue = aResult;
         }
 
         m_aPathArray[ ePath ] = aPathValue;
-- 
1.7.0.1