summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorochko <[email protected]>2012-03-14 13:01:58 +0900
committerochko <[email protected]>2012-03-14 13:01:58 +0900
commit5c680582c20a2f976daeceaaab5b326f70d5f466 (patch)
tree081eab1224185ac781a6a1ae1e85822af577bc78
parentf9f5f3c9486a8202f1639dfe91e4e3410b1ee857 (diff)
downloadcaxlsx-5c680582c20a2f976daeceaaab5b326f70d5f466.tar.gz
caxlsx-5c680582c20a2f976daeceaaab5b326f70d5f466.zip
include applyAlignment attribute when adding style
-rw-r--r--lib/axlsx/stylesheet/styles.rb1
-rw-r--r--test/stylesheet/tc_styles.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index 955a8b1e..1c59bcfd 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -230,6 +230,7 @@ module Axlsx
if options[:alignment]
xf.alignment = CellAlignment.new(options[:alignment])
+ xf.applyAlignment = true
end
if applyProtection
diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb
index df180b61..1b7365b2 100644
--- a/test/stylesheet/tc_styles.rb
+++ b/test/stylesheet/tc_styles.rb
@@ -49,8 +49,8 @@ class TestStyles < Test::Unit::TestCase
assert_equal(xf.applyProtection, 1, "protection applied")
assert_equal(xf.applyBorder, true, "border applied")
- assert_equal(xf.applyNumberFormat, true, "border applied")
-
+ assert_equal(xf.applyNumberFormat, true, "number format applied")
+ assert_equal(xf.applyAlignment, true, "alignment applied")
end
end