diff options
| author | Zsolt Kozaroczy <[email protected]> | 2023-05-05 11:42:56 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-05 11:42:56 +0200 |
| commit | 6fd844ebca61175f107ba3420453e8fe1a6f5046 (patch) | |
| tree | 7e5163de96da0e14eb8e958599f601bfb6ff22a9 /lib | |
| parent | fabe8cb2571c8865270247ca78ddc01d493a9ee1 (diff) | |
| parent | 3d10ac1e1b067de94e4344b25cbfeecd7bf4bdde (diff) | |
| download | caxlsx-6fd844ebca61175f107ba3420453e8fe1a6f5046.tar.gz caxlsx-6fd844ebca61175f107ba3420453e8fe1a6f5046.zip | |
Merge branch 'master' into frozenStrings
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 1da4e51a..322ec680 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -21,19 +21,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 5d225d2a..f1cd8951 100644 --- a/lib/axlsx/drawing/vml_shape.rb +++ b/lib/axlsx/drawing/vml_shape.rb @@ -38,28 +38,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 |
