From e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:27:16 +0100 Subject: mostly the arrangement of conditionals --- lib/sisu/v0/sst_to_s_xml_node.rb | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v0/sst_to_s_xml_node.rb') diff --git a/lib/sisu/v0/sst_to_s_xml_node.rb b/lib/sisu/v0/sst_to_s_xml_node.rb index cbaf7672..38c025c0 100644 --- a/lib/sisu/v0/sst_to_s_xml_node.rb +++ b/lib/sisu/v0/sst_to_s_xml_node.rb @@ -228,9 +228,11 @@ WOK end if lv.to_s =~/^[1-6]/; @@current=lv end - if o.node == 1 or lv == 1 + if o.node == 1 \ + or lv == 1 @@parent[:node][o.node]=0 - elsif @@current == lv and @@current !=nil + elsif @@current == lv \ + and @@current !=nil if @node[:no][lv-1] != nil @@parent[:node][o.node]=@node[:no][lv-1] elsif @node[:no][lv-2] != nil @@ -240,12 +242,14 @@ WOK else puts 'error' end elsif lv == nil - if o.ocn.class == Fixnum and @@current + if o.ocn.class == Fixnum \ + and @@current @@parent[:node][o.node]=@node[:no][@@current] end else puts 'error' end - if @@current == lv and @@current !=nil + if @@current == lv \ + and @@current !=nil if @node[:ocn][lv-1] != nil @@parent[:ocn][o.ocn]=@node[:ocn][lv-1] elsif @node[:ocn][lv-2] != nil @@ -255,7 +259,8 @@ WOK else puts 'error' end elsif lv == nil - if o.ocn.class == Fixnum and @@current + if o.ocn.class == Fixnum \ + and @@current @@parent[:ocn][o.ocn]=@node[:ocn][@@current] end else puts 'error' @@ -418,8 +423,11 @@ WOK obj.each do |o| para=o.txt unless o.txt =~/^%% / #comments are lost, consider if para - @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/) + if @rcdc==false \ + and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/) if para !~/(^0~|^@\S+?:|^\s*$||)/ + @rcdc=true + end @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para unless @rcdc format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/ @@ -457,7 +465,11 @@ WOK obj.each do |o| para=o.txt unless o.txt =~/^%% / #comments are lost, consider if para - @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/) + if @rcdc==false \ + and (para =~/~metadata/ \ + or para =~/^1~meta\s+Document Information/) + @rcdc=true + end if para !~/(^0~|^@\S+?:|^\s*$||)/ @sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para unless @rcdc @@ -497,7 +509,10 @@ WOK else xml_structure(o,para,nil,nil) end end - para='' if para =~// and para =~/^(-\{{2}~\d+|)/ # -endnote + if para =~// \ + and para =~/^(-\{{2}~\d+|)/ # -endnote + para='' + end if para =~/.*<:#>.*$/ para=case para when /<:i1>/ -- cgit v1.2.3