]> git.lyx.org Git - lyx.git/commitdiff
Don't use the char version of uppercase
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 13 Mar 2007 10:22:10 +0000 (10:22 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 13 Mar 2007 10:22:10 +0000 (10:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17430 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/filetools.C
src/support/os.h
src/support/os_cygwin.C
src/support/os_unix.C
src/support/os_win32.C

index 4e6224a1ba9ac53c8f30cbc7ff6bb12a007d52bf..bc0e1db2dca97c6b7b65b878fcbdeb56bd36c621 100644 (file)
@@ -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
index c42cfedbff89bda470a9862aebae92f13b577267..f0333a633dad1a16f418acdd0b694471df2a224e 100644 (file)
@@ -16,8 +16,6 @@
 
 #include "support/docstring.h"
 
-#include <string>
-
 
 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.
index 6cb2f22590d845b525cf67b41f2df618db674006..fbf5f8be1af1b0c8b2367de2ee5ed19a7109853c 100644 (file)
@@ -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)
index aff294b7b4b6ade31fb64ed57972215047877008..6ccdf9e16e6442d45fc815ab212719da7c303c60 100644 (file)
@@ -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)
index b5545b85e689db5926d21b8a7ac7e8198d2c6f10..392921fb2a71b3af4f0b5dd371c2f4240091107c 100644 (file)
@@ -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)