aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/xml_odf_odt.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/xml_odf_odt.rb')
-rw-r--r--lib/sisu/xml_odf_odt.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/sisu/xml_odf_odt.rb b/lib/sisu/xml_odf_odt.rb
index 4d670a92..1f1c69b7 100644
--- a/lib/sisu/xml_odf_odt.rb
+++ b/lib/sisu/xml_odf_odt.rb
@@ -215,7 +215,8 @@ module SiSU_XML_ODF_ODT
end
unless @@docstart
breakpage=if (@md.pagenew || @md.pagebreak) \
- and (@md.pagenew =~m or @md.pagebreak =~m)
+ and (@md.pagenew.to_s =~m \
+ or @md.pagebreak.to_s =~m)
'<text:p text:style-name="P_normal_page_new"> </text:p>'
elsif @md.pageline \
and @md.pageline =~m #fix
@@ -612,7 +613,7 @@ module SiSU_XML_ODF_ODT
if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/
if @make.build.odt_ocn?
if defined? dob.ocn \
- and dob.ocn.is_a?(Fixnum)
+ and dob.ocn.is_a?(Integer)
p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn).set_bookmark_and_display
end
end
@@ -670,7 +671,7 @@ module SiSU_XML_ODF_ODT
word=dob.obj.scan(/\S+|\n/)
if word
word.each do |w| # _ - / # | : ! ^ ~
- unless dob =~/^(?:#{Rx[:meta]}|%+ )/m
+ unless dob.obj =~/^(?:#{Rx[:meta]}|%+ )/m
w=w.gsub(/&#(?:126|152);/,'~'). #126 usual
gsub(/&nbsp;/,'&#160;')
if w !~/(?:&\S{2,7}?;)+/
@@ -735,9 +736,9 @@ module SiSU_XML_ODF_ODT
dob.obj=tidywords(wordlist).join(' ').strip
@rcdc=true if @rcdc==false \
and (dob.obj =~/~metadata/ \
- or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]
+ or dob.obj =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]
if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check
- if defined? dob.ocn and dob.ocn =~/\d+/
+ if defined? dob.ocn and dob.ocn.to_s =~/\d+/
@p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn)
end
if dob.is ==:heading \
@@ -859,7 +860,7 @@ WOK
env.make_path(@md.file.output_path.odt.dir)
filename="#{@env.processing_path.odt}/content.xml"
od=File.new(filename,'w+')
- @content.compact.each do |para| # this is a hack
+ @content.flatten.compact.each do |para| # this is a hack, check change does not alter behavior
od.puts para unless para =~/\A\s*\Z/
end
od.close