def get_align_properties
      align = []    # Attributes to return

      # Check if any alignment options in the format have been changed.
      if @text_h_align != 0 || @text_v_align != 0 || @indent != 0 ||
         @rotation != 0 || @text_wrap != 0 || @shrink != 0 || @reading_order != 0
        changed = 1
      else
        return
      end

      # Indent is only allowed for horizontal left, right and distributed. If it
      # is defined for any other alignment or no alignment has been set then
      # default to left alignment.
      @text_h_align = 1 if @indent != 0 && ![1, 3, 7].include?(@text_h_align)

      # Check for properties that are mutually exclusive.
      @shrink       = 0 if @text_wrap != 0
      @shrink       = 0 if @text_h_align == 4    # Fill
      @shrink       = 0 if @text_h_align == 5    # Justify
      @shrink       = 0 if @text_h_align == 7    # Distributed
      @just_distrib = 0 if @text_h_align != 7    # Distributed
      @just_distrib = 0 if @indent != 0

      continuous = 'centerContinuous'

      align << ['horizontal', 'left']        if @text_h_align == 1
      align << ['horizontal', 'center']      if @text_h_align == 2
      align << ['horizontal', 'right']       if @text_h_align == 3
      align << ['horizontal', 'fill']        if @text_h_align == 4
      align << ['horizontal', 'justify']     if @text_h_align == 5
      align << ['horizontal', continuous]    if @text_h_align == 6
      align << ['horizontal', 'distributed'] if @text_h_align == 7

      align << ['justifyLastLine', 1] if @just_distrib != 0

      # Property 'vertical' => 'bottom' is a default. It sets applyAlignment
      # without an alignment sub-element.
      align << ['vertical', 'top']         if @text_v_align == 1
      align << ['vertical', 'center']      if @text_v_align == 2
      align << ['vertical', 'justify']     if @text_v_align == 4
      align << ['vertical', 'distributed'] if @text_v_align == 5

      align << ['indent',       @indent]   if @indent   != 0
      align << ['textRotation', @rotation] if @rotation != 0

      align << ['wrapText',     1] if @text_wrap != 0
      align << ['shrinkToFit',  1] if @shrink    != 0

      align << ['readingOrder', 1] if @reading_order == 1
      align << ['readingOrder', 2] if @reading_order == 2

      return changed, align
    end
def get_align_properties
      align = []    # Attributes to return

      # Check if any alignment options in the format have been changed.
      if @text_h_align != 0 || @text_v_align != 0 || @indent != 0 ||
         @rotation != 0 || @text_wrap != 0 || @shrink != 0 || @reading_order != 0
        changed = 1
      else
        return
      end

      # Indent is only allowed for horizontal left, right and distributed. If it
      # is defined for any other alignment or no alignment has been set then
      # default to left alignment.
      @text_h_align = 1 if @indent != 0 && ![1, 3, 7].include?(@text_h_align)

      # Check for properties that are mutually exclusive.
      @shrink       = 0 if @text_wrap != 0
      @shrink       = 0 if @text_h_align == 4    # Fill
      @shrink       = 0 if @text_h_align == 5    # Justify
      @shrink       = 0 if @text_h_align == 7    # Distributed
      @just_distrib = 0 if @text_h_align != 7    # Distributed
      @just_distrib = 0 if @indent != 0

      continuous = 'centerContinuous'

      align << ['horizontal', 'left']        if @text_h_align == 1
      align << ['horizontal', 'center']      if @text_h_align == 2
      align << ['horizontal', 'right']       if @text_h_align == 3
      align << ['horizontal', 'fill']        if @text_h_align == 4
      align << ['horizontal', 'justify']     if @text_h_align == 5
      align << ['horizontal', continuous]    if @text_h_align == 6
      align << ['horizontal', 'distributed'] if @text_h_align == 7

      align << ['justifyLastLine', 1] if @just_distrib != 0

      # Property 'vertical' => 'bottom' is a default. It sets applyAlignment
      # without an alignment sub-element.
      align << ['vertical', 'top']         if @text_v_align == 1
      align << ['vertical', 'center']      if @text_v_align == 2
      align << ['vertical', 'justify']     if @text_v_align == 4
      align << ['vertical', 'distributed'] if @text_v_align == 5

      align << ['indent',       @indent]   if @indent   != 0
      align << ['textRotation', @rotation] if @rotation != 0

      align << ['wrapText',     1] if @text_wrap != 0
      align << ['shrinkToFit',  1] if @shrink    != 0

      align << ['readingOrder', 1] if @reading_order == 1
      align << ['readingOrder', 2] if @reading_order == 2

      return changed, align
    end
Return properties for an Style xf <alignment> sub-element.