[Libreoffice-commits] .: 2 commits - tools/inc tools/source unotools/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Dec 16 02:02:13 PST 2010


 tools/inc/tools/getprocessworkingdir.hxx   |    8 ++++----
 tools/source/misc/getprocessworkingdir.cxx |   23 +++++++++++++----------
 unotools/source/config/bootstrap.cxx       |    2 +-
 3 files changed, 18 insertions(+), 15 deletions(-)

New commits:
commit 9bf6971b763175112bdaee0be6f296f3193f5c09
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 16 09:49:42 2010 +0000

    tidy tools::getProcessWorkingDir

diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index d1c8f09..d370a87 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -261,7 +261,7 @@ bool implEnsureAbsolute(OUString & _rsURL) // also strips embedded dots !!
     using osl::File;
 
     OUString sBasePath;
-    OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
+    OSL_VERIFY(tools::getProcessWorkingDir(sBasePath));
 
     OUString sAbsolute;
     if ( File::E_None == File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
commit 0c670815e7ac545fa02570a471f65901c69b4d5b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 16 09:49:11 2010 +0000

    tidy tools::getProcessWorkingDir

diff --git a/tools/inc/tools/getprocessworkingdir.hxx b/tools/inc/tools/getprocessworkingdir.hxx
index b27e40e..aa1d68e 100644
--- a/tools/inc/tools/getprocessworkingdir.hxx
+++ b/tools/inc/tools/getprocessworkingdir.hxx
@@ -39,10 +39,10 @@ namespace tools {
 
 // get the process's current working directory, taking OOO_CWD into account
 //
-// @param url
-// a non-null pointer that receives the directory URL (with or without a final
-// slash) upon successful return, and the empty string upon unsuccessful return
-TOOLS_DLLPUBLIC bool getProcessWorkingDir(rtl::OUString * url);
+// @param rUrl
+// Receives the directory URL (with or without a final slash) upon successful
+// return, and the empty string upon unsuccessful return
+TOOLS_DLLPUBLIC bool getProcessWorkingDir(rtl::OUString& rUrl);
 
 }
 
diff --git a/tools/source/misc/getprocessworkingdir.cxx b/tools/source/misc/getprocessworkingdir.cxx
index 9cd5131..b5cd7e9 100644
--- a/tools/source/misc/getprocessworkingdir.cxx
+++ b/tools/source/misc/getprocessworkingdir.cxx
@@ -41,24 +41,27 @@
 
 namespace tools {
 
-bool getProcessWorkingDir(rtl::OUString * url) {
-    OSL_ASSERT(url != NULL);
+bool getProcessWorkingDir(rtl::OUString &rUrl)
+{
+    rUrl = rtl::OUString();
     rtl::OUString s(RTL_CONSTASCII_USTRINGPARAM("$OOO_CWD"));
     rtl::Bootstrap::expandMacros(s);
-    if (s.getLength() == 0) {
-        if (osl_getProcessWorkingDir(&url->pData) == osl_Process_E_None) {
+    if (s.getLength() == 0)
+    {
+        if (osl_getProcessWorkingDir(&rUrl.pData) == osl_Process_E_None)
             return true;
-        }
-    } else if (s[0] == '1') {
-        *url = s.copy(1);
+    }
+    else if (s[0] == '1')
+    {
+        rUrl = s.copy(1);
         return true;
-    } else if (s[0] == '2' &&
-               (osl::FileBase::getFileURLFromSystemPath(s.copy(1), *url) ==
+    }
+    else if (s[0] == '2' &&
+               (osl::FileBase::getFileURLFromSystemPath(s.copy(1), rUrl) ==
                 osl::FileBase::E_None))
     {
         return true;
     }
-    *url = rtl::OUString();
     return false;
 }
 


More information about the Libreoffice-commits mailing list