Garst R. Reese wrote: > At the time of the %t -> %text patch, something went weird with my > mini-pages. > Two minipages with 44%t separated by an hfil used to appear side by side > in lyx.
attached a patch also for compatibility to version < 1.1.6fix4 and "old" 1.2.0 files. > The %t went to pt, but changing it to %text made one appear under the > other and lost half of the minipages. This could also be related to the > isLineSeparator stuff. Definitely a regression. a minipage with 100text% is shown with full width of the workarea. Another topic: during testing this patch I had following output oldData= 40c% newData= 40col% oldData= 0pt newData= 0pt oldData= 100t% newData= 100text% oldData= -8mu <--- WHAT IS THIS??????? newData= -8mu oldData= -8mu newData= -8mu oldData= -6mu newData= -6mu I never used such length in my testdoc??? Herbert -- http://www.lyx.org/help/
Index: src/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.651 diff -u -r1.651 ChangeLog --- src/ChangeLog 27 Mar 2002 23:27:12 -0000 1.651 +++ src/ChangeLog 28 Mar 2002 07:59:18 -0000 @@ -1,3 +1,8 @@ +2002-03-28 Herbert Voss <[EMAIL PROTECTED]> + + * lyxlength.C: compatibility stuff for < 1.1.6fix4 and + "old" 1.2.0 files which use c%, l%, p% t% instead of text%, ... + 2002-03-27 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * lyxfunc.C (getStatus): return 'disabled' early for LFUN_NOACTION Index: src/lyxlength.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlength.C,v retrieving revision 1.13 diff -u -r1.13 lyxlength.C --- src/lyxlength.C 21 Mar 2002 17:25:14 -0000 1.13 +++ src/lyxlength.C 28 Mar 2002 07:59:19 -0000 @@ -18,6 +18,8 @@ #include "lengthcommon.h" #include "lyxrc.h" +#include "support/lstrings.h" + #include "Lsstream.h" #include <cstdlib> @@ -33,12 +35,43 @@ {} +// compatibility stuff < version 1.2.0pre and for +// "old" 1.2.0 files before the pre +namespace { +string const convertOldRelLength(string const & oldLength) +{ + // we can have only one or none of the following + if (oldLength.find("c%") != string::npos) { + return subst(oldLength,"c%","col%"); + + } else if (oldLength.find("t%") != string::npos) { + if (oldLength.find("text%") != string::npos) + return oldLength; + else + return subst(oldLength,"t%","text%"); + + } else if (oldLength.find("l%") != string::npos) { + if (oldLength.find("col%") != string::npos) + return oldLength; + else + return subst(oldLength,"l%","line%"); + + } else if (oldLength.find("p%") != string::npos) + return subst(oldLength,"p%","page%"); + + return oldLength; +} +} // end anon + + LyXLength::LyXLength(string const & data) : val_(0), unit_(LyXLength::PT) { LyXLength tmp; - if (!isValidLength (data, &tmp)) +// if (!isValidLength (data, &tmp)) + // only compatibilty stuff - can be deleted until 1.3 + if (!isValidLength (convertOldRelLength(data), &tmp)) return; // should raise an exception val_ = tmp.val_;