From 1016353a5ee2d92d7594b8caaaef07183fcbd9e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Tue, 21 Jul 2009 12:02:48 +0000 Subject: [PATCH] lyx_2_0.py: add comments git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30725 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_2_0.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 98d644e350..5e8246444a 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -179,6 +179,10 @@ def latex_length(string): 'Convert lengths to their LaTeX representation.' i = 0 percent = False + # the string has always the form + # ValueUnit+ValueUnit-ValueUnit + # the + and - lengths are optional + # the + is always before the - i = string.find("text%") if i > -1: percent = True @@ -1054,8 +1058,6 @@ def revert_hspace_glue_lengths(document): i = j else: star = False - # only revert when a custom length was set and when - # it used a percent length o = document.body[i+1].find("\\length") if o == -1: document.warning("Error: Cannot find lenght for \\hspace!") @@ -1063,7 +1065,7 @@ def revert_hspace_glue_lengths(document): # search for the beginning of the value via the space k = document.body[i+1].find(" ") length = document.body[i+1][k+1:] - # check if the length contains a plus or minus + # only revert when the length contains a plus or minus l = length.find("+") if l == -1: l = length.find("-") -- 2.39.5