aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/xml_odf_odt_format.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-02-05 01:28:30 -0500
committerRalph Amissah <ralph@amissah.com>2014-02-05 01:28:30 -0500
commitba017314c06829b8d8a92a85d2111a8582c4e1cc (patch)
treeae413a3c2eacce20422b238e0a57c16d5632adf8 /lib/sisu/v6/xml_odf_odt_format.rb
parentdebian/changelog (5.3.0-1) (diff)
parentREADME & manpage (sisu.1) update (diff)
Merge tag 'sisu_5.3.1' into debian/sid
SiSU 5.3.1
Diffstat (limited to 'lib/sisu/v6/xml_odf_odt_format.rb')
-rw-r--r--lib/sisu/v6/xml_odf_odt_format.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/sisu/v6/xml_odf_odt_format.rb b/lib/sisu/v6/xml_odf_odt_format.rb
index bc7fadea..b2539dfd 100644
--- a/lib/sisu/v6/xml_odf_odt_format.rb
+++ b/lib/sisu/v6/xml_odf_odt_format.rb
@@ -65,17 +65,26 @@ module SiSU_XML_ODF_ODT_Format
include SiSU_Param
include SiSU_Viz
class ParagraphNumber
- def initialize(paranum)
+ def initialize(make,paranum)
+ @make=make
@paranum=/(\d+)/m.match(paranum.to_s)[1]
end
def set_ref_and_display
- set_ref=@paranum.gsub(/(\d+)/,' <text:span text:style-name="Span_subscript"><text:reference-mark-start text:name="\1"/><text:reference-mark-end text:name="\1"/></text:span>')
- disp=@paranum.gsub(/(\d+)/,%{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>})
+ set_ref=@paranum.gsub(/(\d+)/,
+ ' <text:span text:style-name="Span_subscript"><text:reference-mark-start text:name="\1"/><text:reference-mark-end text:name="\1"/></text:span>')
+ disp=@paranum.gsub(/(\d+)/,
+ (@make.build.odt_ocn?) \
+ ? %{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>}
+ : '')
{ display: disp, set_ref: set_ref }
end
def set_bookmark_and_display
- set_ref=@paranum.gsub(/(\d+)/,' <text:span text:style-name="Span_subscript"><text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/></text:span>')
- disp=@paranum.gsub(/(\d+)/,%{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>})
+ set_ref=@paranum.gsub(/(\d+)/,
+ ' <text:span text:style-name="Span_subscript"><text:bookmark-start text:name="\1"/><text:bookmark-end text:name="\1"/></text:span>')
+ disp=@paranum.gsub(/(\d+)/,
+ (@make.build.odt_ocn?) \
+ ? %{ <text:span text:style-name="Span_subscript">#{Dx[:ocn_o]}\\1#{Dx[:ocn_c]}</text:span>}
+ : '')
{ display: disp, set_ref: set_ref }
end
def name