diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-04 17:34:00 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-04 17:34:00 +0200 |
| commit | f70c0d4c92f16eece847004ee3488dc15d23db98 (patch) | |
| tree | 1ca1fdf62df564af81cb2e36009ce3a8b41c02aa /lib | |
| parent | 086e78d0d1f0896b6ca5f48b4873e861212f94aa (diff) | |
| download | caxlsx-f70c0d4c92f16eece847004ee3488dc15d23db98.tar.gz caxlsx-f70c0d4c92f16eece847004ee3488dc15d23db98.zip | |
Fix Layout/HeredocIndentation offenses
Also use `XML` as delimiter to highlight syntax in supported editors
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/drawing/vml_drawing.rb | 26 | ||||
| -rw-r--r-- | lib/axlsx/drawing/vml_shape.rb | 40 |
2 files changed, 33 insertions, 33 deletions
diff --git a/lib/axlsx/drawing/vml_drawing.rb b/lib/axlsx/drawing/vml_drawing.rb index 4e9c5b0d..63c42457 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -19,19 +19,19 @@ module Axlsx # @param [String] str # @return [String] def to_xml_string(str = '') - str << <<BAD_PROGRAMMER -<xml xmlns:v="urn:schemas-microsoft-com:vml" - xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:x="urn:schemas-microsoft-com:office:excel"> - <o:shapelayout v:ext="edit"> - <o:idmap v:ext="edit" data="#{@comments.worksheet.index + 1}"/> - </o:shapelayout> - <v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" - path="m0,0l0,21600,21600,21600,21600,0xe"> - <v:stroke joinstyle="miter"/> - <v:path gradientshapeok="t" o:connecttype="rect"/> - </v:shapetype> -BAD_PROGRAMMER + str << <<~XML + <xml xmlns:v="urn:schemas-microsoft-com:vml" + xmlns:o="urn:schemas-microsoft-com:office:office" + xmlns:x="urn:schemas-microsoft-com:office:excel"> + <o:shapelayout v:ext="edit"> + <o:idmap v:ext="edit" data="#{@comments.worksheet.index + 1}"/> + </o:shapelayout> + <v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" + path="m0,0l0,21600,21600,21600,21600,0xe"> + <v:stroke joinstyle="miter"/> + <v:path gradientshapeok="t" o:connecttype="rect"/> + </v:shapetype> + XML @comments.each { |comment| comment.vml_shape.to_xml_string str } str << "</xml>" end diff --git a/lib/axlsx/drawing/vml_shape.rb b/lib/axlsx/drawing/vml_shape.rb index fd335d95..7f196974 100644 --- a/lib/axlsx/drawing/vml_shape.rb +++ b/lib/axlsx/drawing/vml_shape.rb @@ -36,28 +36,28 @@ module Axlsx # @param [String] str # @return [String] def to_xml_string(str = '') - str << <<SHAME_ON_YOU + str << <<~XML -<v:shape id="#{@id}" type="#_x0000_t202" fillcolor="#ffffa1 [80]" o:insetmode="auto" - style="visibility:#{@visible ? 'visible' : 'hidden'}"> - <v:fill color2="#ffffa1 [80]"/> - <v:shadow on="t" obscured="t"/> - <v:path o:connecttype="none"/> - <v:textbox style='mso-fit-text-with-word-wrap:t'> - <div style='text-align:left'></div> - </v:textbox> + <v:shape id="#{@id}" type="#_x0000_t202" fillcolor="#ffffa1 [80]" o:insetmode="auto" + style="visibility:#{@visible ? 'visible' : 'hidden'}"> + <v:fill color2="#ffffa1 [80]"/> + <v:shadow on="t" obscured="t"/> + <v:path o:connecttype="none"/> + <v:textbox style='mso-fit-text-with-word-wrap:t'> + <div style='text-align:left'></div> + </v:textbox> - <x:ClientData ObjectType="Note"> - <x:MoveWithCells/> - <x:SizeWithCells/> - <x:Anchor>#{left_column}, #{left_offset}, #{top_row}, #{top_offset}, #{right_column}, #{right_offset}, #{bottom_row}, #{bottom_offset}</x:Anchor> - <x:AutoFill>False</x:AutoFill> - <x:Row>#{row}</x:Row> - <x:Column>#{column}</x:Column> - #{@visible ? '<x:Visible/>' : ''} - </x:ClientData> - </v:shape> -SHAME_ON_YOU + <x:ClientData ObjectType="Note"> + <x:MoveWithCells/> + <x:SizeWithCells/> + <x:Anchor>#{left_column}, #{left_offset}, #{top_row}, #{top_offset}, #{right_column}, #{right_offset}, #{bottom_row}, #{bottom_offset}</x:Anchor> + <x:AutoFill>False</x:AutoFill> + <x:Row>#{row}</x:Row> + <x:Column>#{column}</x:Column> + #{@visible ? '<x:Visible/>' : ''} + </x:ClientData> + </v:shape> + XML end end end |
