]> git.lyx.org Git - features.git/commitdiff
small fixes
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 25 Oct 2000 13:10:04 +0000 (13:10 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 25 Oct 2000 13:10:04 +0000 (13:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1154 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/FontInfo.C
src/FontLoader.C
src/frontends/ButtonPolicies.h
src/support/filetools.C

index 4b14490c92e942e56689ba63b75b1c04b4a38f6b..c8274e4d294695c6275a0a8a42af5c6e5b73a563 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2000-10-25  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/support/filetools.C (MakeRelPath): change some types to
+       string::size_type 
+
+       * src/frontends/ButtonPolicies.h (operator<<): new operator for
+       ButtonPolicy::SMInput and ButtonPolicy::State.
+
+       * src/FontLoader.C (reset): small cleanup
+       (unload): small cleanup
+
+       * src/FontInfo.C (getFontname): initialize error to 10000.0
+
 2000-10-24  Angus Leeming <a.leeming@ic.ac.uk>
        
        * src/frontends/xforms/FormPreferences.[Ch]:
index 406c8859027b721c1f36357dd5dd6693f7b6d5eb..db2b5b6e9a2155a1fe41b3c57a606acc24b4594e 100644 (file)
@@ -32,7 +32,7 @@ string const FontInfo::getFontname(int size)
                return string();
 
        int closestind = -1;
-       double error = 100000;
+       double error = 100000.0;
 
        for (int i = 0; i < matches; ++i) {
                if (sizes[i] == 0) {
index 2ad5688af0f8f6a99518acfcdadc5cab48419a1d..fafb7110b96fd9801d0f8f95e2637301417bb5ae 100644 (file)
@@ -58,11 +58,11 @@ void FontLoader::update()
 void FontLoader::reset()
 {
        // Clear font infos, font structs and font metrics
-       for (int i1 = 0; i1<4; i1++)
-               for (int i2 = 0; i2<2; i2++)
-                       for (int i3 = 0; i3<4; i3++) {
+       for (int i1 = 0; i1 < 4; ++i1)
+               for (int i2 = 0; i2 < 2; ++i2)
+                       for (int i3 = 0; i3 < 4; ++i3) {
                                fontinfo[i1][i2][i3] = 0;
-                               for (int i4 = 0; i4<10; i4++) {
+                               for (int i4 = 0; i4<10; ++i4) {
                                        fontstruct[i1][i2][i3][i4] = 0;
                                }
                        }
@@ -72,14 +72,14 @@ void FontLoader::reset()
 void FontLoader::unload() 
 {
        // Unload all fonts
-       for (int i1 = 0; i1<4; i1++)
-               for (int i2 = 0; i2<2; i2++)
-                       for (int i3 = 0; i3<4; i3++) {
+       for (int i1 = 0; i1 < 4; ++i1)
+               for (int i2 = 0; i2 < 2; ++i2)
+                       for (int i3 = 0; i3 < 4; ++i3) {
                                if (fontinfo[i1][i2][i3]) {
                                        delete fontinfo[i1][i2][i3];
                                        fontinfo[i1][i2][i3] = 0;
                                }
-                               for (int i4 = 0; i4<10; i4++) {
+                               for (int i4 = 0; i4 < 10; ++i4) {
                                        if (fontstruct[i1][i2][i3][i4]) {
                                                XFreeFont(fl_get_display(), fontstruct[i1][i2][i3][i4]);
                                                fontstruct[i1][i2][i3][i4] = 0;
index d4d48534bdda89bb0841318ef4bb3690033b1249..047d680ec4cdd2d6fb71c39b047b7b99c11526ed 100644 (file)
@@ -159,6 +159,20 @@ public:
 };
 
 
+inline
+ostream & operator<<(ostream & os, ButtonPolicy::SMInput smi) 
+{
+       os << int(smi);
+       return os;
+}
+
+inline
+ostream & operator<<(ostream & os, ButtonPolicy::State st)
+{
+       os << int(st);
+       return os;
+}
+
 //--------------------- Actual Policy Classes -----------------------------
 
 /** Ok and Cancel buttons for dialogs with read-only operation.
index fdd8bef9e82ca60cee7131ea5f2578fb22a751ad..9a5d52474bf69fe82b4bbb338e5e7ca0e4a4a307 100644 (file)
@@ -857,7 +857,7 @@ string const MakeRelPath(string const & abspath0, string const & basepath0)
        string::size_type const baselen = basepath.length();
        
        // Find first different character
-       int i = 0;
+       string::size_type i = 0;
        while (i < abslen && i < baselen && abspath[i] == basepath[i]) ++i;
 
        // Go back to last /
@@ -877,7 +877,7 @@ string const MakeRelPath(string const & abspath0, string const & basepath0)
        // Count how many dirs there are in basepath above match
        // and append as many '..''s into relpath
        string buf;
-       int j = i;
+       string::size_type j = i;
        while (j < baselen) {
                if (basepath[j] == '/') {
                        if (j + 1 == baselen) break;