diff options
Diffstat (limited to 'lib/sisu/v6/xml_odf_odt_format.rb')
-rw-r--r-- | lib/sisu/v6/xml_odf_odt_format.rb | 19 |
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 |