On 10/12/2010 08:34 AM, Pavel Sanda wrote:
hi,

1) short resume for things we need before releasing beta
- Richard has some pending work on lyx2lyx which will finish some JMarc work.

I've lost track, I'm afraid, of which patch set is which. Here's what I've got.

One thing I remember is a question about converting frm the CharStyle:Whatever name format for InsetFlex to some other format. I have some lyx2lyx stuff for that, which I'll attach, so perhaps it will ring some bells.

I also remember there was something about passthru layouts and paragraph breaks. I don't quite recall what that was, but it should be fairly easy, if someone can remind me what I was supposed to do. ;-)

btw i have looked on the thread dealing with #4624. Richard, is there some 
reason
why that patch was not committed?
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg158287.html

I think we never decided quite what to do about multiple or sectioned bibliographies.

Richard

Index: lib/lyx2lyx/lyx_2_0.py
===================================================================
--- lib/lyx2lyx/lyx_2_0.py	(revision 35375)
+++ lib/lyx2lyx/lyx_2_0.py	(working copy)
@@ -2057,6 +2057,26 @@
       i += 1
 
 
+def convert_flexnames(document):
+    "Convert  \\begin_inset Flex Custom:Style to \\begin_inset Flex Style and similarly for CharStyle and Element."
+    
+    i = 0
+    rx = re.compile(r'^\\begin_inset Flex (Custom|CharStyle|Element):(.+)$')
+    while True:
+      i = find_token(document.body, "\\begin_inset Flex", i)
+      if i == -1:
+        return
+      m = rx.match(document.body[i])
+      if m:
+        document.body[i] = "\\begin_inset Flex " + m.group(2)
+        document.body.insert(i+1, "legacy " + m.group(1))
+      i += 1
+
+
+def revert_flexnames(document):
+    pass
+
+
 def convert_mathdots(document):
     " Load mathdots automatically "
     while True:
@@ -2221,10 +2241,13 @@
            [397, [remove_Nameref]],
            [398, []],
            [399, [convert_mathdots]],
-           [400, [convert_rule]]
+           [399, [convert_mathdots]],
+           [400, [convert_rule]],
+           [401, [convert_flexnames]]
           ]
 
-revert =  [[399, [revert_rule]],
+revert =  [[400, [revert_flexnames]],
+           [399, [revert_rule]],
            [398, [revert_mathdots]],
            [397, [revert_mathrsfs]],
            [396, []],
Index: lib/scripts/layout2layout.py
===================================================================
--- lib/scripts/layout2layout.py	(revision 35375)
+++ lib/scripts/layout2layout.py	(working copy)
@@ -100,6 +100,10 @@
 # Incremented to format 28, 6 August 2010 by lasgouttes
 # Added ParbreakIsNewline tag for Layout and InsetLayout.
 
+# Incremented to format 29, 10 August 2010 by rgh
+# Changed Custom:Style, CharStyle:Style, and Element:Style
+# uniformly to Flex:Style.
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -107,7 +111,7 @@
 # development/tools/updatelayouts.sh script to update all
 # layout files to the new format.
 
-currentFormat = 28
+currentFormat = 29
 
 
 def usage(prog_name):
@@ -191,6 +195,9 @@
     re_Type = re.compile(r'\s*Type\s+(\w+)', re.IGNORECASE)
     re_Builtin = re.compile(r'^(\s*)LaTeXBuiltin\s+(\w*)', re.IGNORECASE)
     re_True = re.compile(r'^\s*(?:true|1)\s*$', re.IGNORECASE)
+    re_InsetLayout = re.compile(r'^\s*InsetLayout\s+(?:Custom|CharStyle|Element):(\S+)\s*$')
+    # with quotes
+    re_QInsetLayout = re.compile(r'^\s*InsetLayout\s+"(?:Custom|CharStyle|Element):([^"]+)"\s*$')
 
     # counters for sectioning styles (hardcoded in 1.3)
     counters = {"part"          : "\\Roman{part}",
@@ -279,10 +286,21 @@
                 i += 1
             continue
         
+        if format == 28:
+          match = re_InsetLayout.match(lines[i])
+          if match:
+            lines[i] = "InsetLayout Flex:" + match.group(1)
+          else:
+            match = re_QInsetLayout.match(lines[i])
+            if match:
+              lines[i] = "InsetLayout \"Flex:" + match.group(1) + "\""
+          i += 1
+          continue
+        
         # Only new features
         if format >= 24 and format <= 27:
-            i += 1
-            continue
+          i += 1
+          continue
 
         if format == 23:
           match = re_Float.match(lines[i])
Index: src/Buffer.cpp
===================================================================
--- src/Buffer.cpp	(revision 35375)
+++ src/Buffer.cpp	(working copy)
@@ -127,7 +127,7 @@
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 400; // uwestoehr: support for \rule
+int const LYX_FORMAT = 401; // rgh: Dummy format for InsetFlex name conversion
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(revision 35375)
+++ src/Paragraph.cpp	(working copy)
@@ -1295,6 +1295,21 @@
 		// we have to provide all the optional arguments here, even though
 		// the last one is the only one we care about.
 		owner_->latex(bp, f, ods, tr, features.runparams(), 0, -1, true);
+		
+		/*
+		FIXME
+				
+		// Separate handling of optional argument inset.
+		if (style.optargs != 0 || style.reqargs != 0) {
+			int ret = latexArgInsets(*pit, os, runparams, style.reqargs, style.optargs);
+			while (ret > 0) {
+				texrow.newline();
+				--ret;
+			}
+		}
+		else
+			os << from_ascii(style.latexparam());
+			*/	
 		docstring const d = ods.str();
 		if (!d.empty()) {
 			// this will have "{" at the beginning, but not at the end
Index: src/TextClass.cpp
===================================================================
--- src/TextClass.cpp	(revision 35375)
+++ src/TextClass.cpp	(working copy)
@@ -60,7 +60,7 @@
 // development/updatelayouts.sh script, to update the format of 
 // all of our layout files.
 //
-int const LAYOUT_FORMAT = 28;
+int const LAYOUT_FORMAT = 29;
 	
 namespace {
 

Reply via email to