]> git.lyx.org Git - features.git/commitdiff
popen tweaks; "no 0cm" patch from Herbert; fix disabled toggles in menus
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Feb 2002 14:32:17 +0000 (14:32 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Feb 2002 14:32:17 +0000 (14:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3511 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/Menubar_pimpl.C
src/support/ChangeLog
src/support/filetools.C
src/support/os.h
src/support/os_os2.C
src/support/os_unix.C
src/support/os_win32.C

index 3e6a4e3a2b11cf6e0d61de0627490985655117af..c6a41f503c5879a883f74181b830be02ca3255d7 100644 (file)
@@ -1041,10 +1041,16 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                }
        } else if (token == "\\added_space_top") {
                lex.nextToken();
-               par->params().spaceTop(VSpace(lex.getString()));
+               VSpace value = VSpace(lex.getString());
+               if ((value.length().len().value() != 0) ||
+                   (value.kind() != VSpace::LENGTH))
+                   par->params().spaceTop(value);
        } else if (token == "\\added_space_bottom") {
                lex.nextToken();
-               par->params().spaceBottom(VSpace(lex.getString()));
+               VSpace value = VSpace(lex.getString());
+               if ((value.length().len().value() != 0) ||
+                   (value.kind() != VSpace::LENGTH))
+                   par->params().spaceBottom(value);
 #ifndef NO_COMPABILITY
 #ifndef NO_PEXTRA_REALLY
        } else if (token == "\\pextra_type") {
index deb409581e0c67de2b97ee60502e8fc075830884..6084222652de715e6bf1b9b3f7c87ac8889c66db 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-08  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * Menubar_pimpl.C (create_submenu): work around an xforms bug (?)
+       where one could not have both toggleon and disabled.
 
 2002-02-08  Herbert Voss  <voss@lyx.org>
 
index 868554508e511f3cf729c7cc199e21a89f07920f..4f48be04aad09731417575226d81aa1cfde326e0 100644 (file)
@@ -436,9 +436,8 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
 
                switch (item.kind()) {
                case MenuItem::Command: {
-                       FuncStatus flag = 
+                       FuncStatus const flag = 
                                view->getLyXFunc()->getStatus(item.action()); 
-
                        // handle optional entries.
                        if (item.optional() 
                            && (flag.disabled())) {
@@ -467,12 +466,12 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
                        
                        // Modify the entry using the function status
                        string pupmode;
-                       if (flag.disabled() || flag.unknown())
-                               pupmode += "%i";
                        if (flag.onoff(true))
                                pupmode += "%B";
                        if (flag.onoff(false))
                                pupmode += "%b";
+                       if (flag.disabled() || flag.unknown())
+                               pupmode += "%i";
                        label += pupmode;
 
                        // Finally the menu shortcut
index 70ec20926e07baaa8ddc6443b9cb20086ec4b1b8..33a724dfb11307fe6abb0b99d206ed2009b52c1c 100644 (file)
@@ -1,5 +1,11 @@
 2002-02-08  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
+       * filetools.C (do_popen): use os::read_mode().
+
+       * os_win32.C (read_mode): 
+       * os_os2.C (read_mode): 
+       * os_unix.C (read_mode): new method
+
        * filetools.C (do_popen): fix for cygwin compatibility (from Claus
        Hentschel). This code should maybe be moved to os:: class.
 
index 37aab49fc7e617c97a0ef717f8779de2f631014a..fe1689aaf254778e4dba34a0acb3f585b8413194 100644 (file)
@@ -1135,12 +1135,7 @@ cmdret const do_popen(string const & cmd)
        // pstream (process stream), with the
        // variants ipstream, opstream
 
-       // CYGWIN needs 'b', but linux only works without it
-#ifdef __CYGWIN__
-       FILE * inf = ::popen(cmd.c_str(), "rb");
-#else
-        FILE * inf = ::popen(cmd.c_str(), "r");
-#endif
+       FILE * inf = ::popen(cmd.c_str(), os::read_mode());
 
        // (Claus Hentschel) Check if popen was succesful ;-)
        if (!inf)
index 855699a29dc9f26ee08e80f553fba42a1fec18b9..a7adba699094e4797dbfa4bb2203a5833bb29d90 100644 (file)
@@ -52,7 +52,9 @@ public:
        static string internal_path(string const &p);
        // is path absolute?
        static bool is_absolute_path(string const & p);
-       
+       // returns a string suitable to be passed to fopen/popen when
+       // reading a file
+       static char const * read_mode();
        //
        static void warn(string mesg);
 private:
index b61a5b9c552ec81a6a2887ee4536cd7347271ea5..a16620dff876b92ae7f64197fce1cedc3414b116 100644 (file)
@@ -172,3 +172,11 @@ bool os::is_absolute_path(string const & p)
                && isalpha(static_cast<unsigned char>(p[0]))
                && p[1] == ':');
 }
+
+
+// returns a string suitable to be passed to fopen/popen when
+// reading a file
+char const * os::read_mode()
+{
+       return "r";
+}
index 1cf91a34c5c9f498fc0c50cccaf46a4e7b148f62..e5ccd430d9959a1da95f7c3284a9f3edda60d274 100644 (file)
@@ -76,3 +76,10 @@ bool os::is_absolute_path(string const & p)
 {
        return (!p.empty() && p[0] == '/');
 }
+
+// returns a string suitable to be passed to fopen/popen when
+// reading a file
+char const * os::read_mode()
+{
+       return "r";
+}
index c0b13e16b570e00093533578d892ddacc6a6efd5..e02f0f5f6c00328f829d17e983ef816ea839f83f 100644 (file)
@@ -116,3 +116,10 @@ bool os::is_absolute_path(string const & p)
 
        return isDosPath | isUnixPath;
 }
+
+// returns a string suitable to be passed to fopen/popen when
+// reading a file
+char const * os::read_mode()
+{
+       return "rb";
+}