From: Georg Baum Date: Tue, 13 Mar 2007 10:22:10 +0000 (+0000) Subject: Don't use the char version of uppercase X-Git-Tag: 1.6.10~10604 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ac7ee5b85e7b2eceef4d3ad5ca642df6a657e805;p=lyx.git Don't use the char version of uppercase git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17430 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/filetools.C b/src/support/filetools.C index 4e6224a1ba..bc0e1db2dc 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -678,7 +678,9 @@ string const makeRelPath(string const & abspath, string const & basepath) string::size_type const abslen = abspath.length(); string::size_type const baselen = basepath.length(); - string::size_type i = os::common_path(abspath, basepath); + // FIXME UNICODE + docstring::size_type i = + os::common_path(from_utf8(abspath), from_utf8(basepath)); if (i == 0) { // actually no match - cannot make it relative diff --git a/src/support/os.h b/src/support/os.h index c42cfedbff..f0333a633d 100644 --- a/src/support/os.h +++ b/src/support/os.h @@ -16,8 +16,6 @@ #include "support/docstring.h" -#include - namespace lyx { namespace support { @@ -45,7 +43,7 @@ std::string const python(); /// Extract the path common to both @c p1 and @c p2. DBCS aware! /// \p p1, \p p2 and the return value are encoded in utf8. -std::string::size_type common_path(std::string const & p1, std::string const & p2); +docstring::size_type common_path(docstring const & p1, docstring const & p2); /// Converts a unix style path to host OS style. /// \p p and the return value are encoded in utf8. diff --git a/src/support/os_cygwin.C b/src/support/os_cygwin.C index 6cb2f22590..fbf5f8be1a 100644 --- a/src/support/os_cygwin.C +++ b/src/support/os_cygwin.C @@ -188,11 +188,11 @@ string current_root() } -string::size_type common_path(string const & p1, string const & p2) +docstring::size_type common_path(docstring const & p1, docstring const & p2) { - string::size_type i = 0; - string::size_type p1_len = p1.length(); - string::size_type p2_len = p2.length(); + docstring::size_type i = 0; + docstring::size_type const p1_len = p1.length(); + docstring::size_type const p2_len = p2.length(); while (i < p1_len && i < p2_len && uppercase(p1[i]) == uppercase(p2[i])) ++i; if ((i < p1_len && i < p2_len) diff --git a/src/support/os_unix.C b/src/support/os_unix.C index aff294b7b4..6ccdf9e16e 100644 --- a/src/support/os_unix.C +++ b/src/support/os_unix.C @@ -38,11 +38,11 @@ string current_root() } -string::size_type common_path(string const & p1, string const & p2) +docstring::size_type common_path(docstring const & p1, docstring const & p2) { - string::size_type i = 0; - string::size_type p1_len = p1.length(); - string::size_type p2_len = p2.length(); + docstring::size_type i = 0; + docstring::size_type const p1_len = p1.length(); + docstring::size_type const p2_len = p2.length(); while (i < p1_len && i < p2_len && p1[i] == p2[i]) ++i; if ((i < p1_len && i < p2_len) diff --git a/src/support/os_win32.C b/src/support/os_win32.C index b5545b85e6..392921fb2a 100644 --- a/src/support/os_win32.C +++ b/src/support/os_win32.C @@ -181,11 +181,11 @@ string current_root() } -string::size_type common_path(string const & p1, string const & p2) +docstring::size_type common_path(docstring const & p1, docstring const & p2) { - string::size_type i = 0; - string::size_type p1_len = p1.length(); - string::size_type p2_len = p2.length(); + docstring::size_type i = 0; + docstring::size_type const p1_len = p1.length(); + docstring::size_type const p2_len = p2.length(); while (i < p1_len && i < p2_len && uppercase(p1[i]) == uppercase(p2[i])) ++i; if ((i < p1_len && i < p2_len)