Kaydet (Commit) 8a0b6117 authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

Import distributed text alignment settings correctly from orcus.

Change-Id: Id04e2bd19475d6d7b98560835bc5aaad4bb8addf
Reviewed-on: https://gerrit.libreoffice.org/49265Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst 71511459
...@@ -387,8 +387,10 @@ private: ...@@ -387,8 +387,10 @@ private:
size_t mnStyleXf; size_t mnStyleXf;
bool mbAlignment; bool mbAlignment;
SvxCellHorJustify meHor_alignment; SvxCellHorJustify meHorAlignment;
SvxCellVerJustify meVer_alignment; SvxCellVerJustify meVerAlignment;
SvxCellJustifyMethod meHorAlignMethod;
SvxCellJustifyMethod meVerAlignMethod;
xf(); xf();
}; };
......
...@@ -1263,8 +1263,10 @@ ScOrcusStyles::xf::xf(): ...@@ -1263,8 +1263,10 @@ ScOrcusStyles::xf::xf():
mnNumberFormatId(0), mnNumberFormatId(0),
mnStyleXf(0), mnStyleXf(0),
mbAlignment(false), mbAlignment(false),
meHor_alignment(SvxCellHorJustify::Right), meHorAlignment(SvxCellHorJustify::Standard),
meVer_alignment(SvxCellVerJustify::Bottom) meVerAlignment(SvxCellVerJustify::Standard),
meHorAlignMethod(SvxCellJustifyMethod::Auto),
meVerAlignMethod(SvxCellJustifyMethod::Auto)
{ {
} }
...@@ -1330,8 +1332,10 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf) ...@@ -1330,8 +1332,10 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
if(rXf.mbAlignment) if(rXf.mbAlignment)
{ {
rSet.Put(SvxHorJustifyItem(rXf.meHor_alignment, ATTR_HOR_JUSTIFY)); rSet.Put(SvxHorJustifyItem(rXf.meHorAlignment, ATTR_HOR_JUSTIFY));
rSet.Put(SvxVerJustifyItem(rXf.meVer_alignment, ATTR_VER_JUSTIFY)); rSet.Put(SvxVerJustifyItem(rXf.meVerAlignment, ATTR_VER_JUSTIFY));
rSet.Put(SvxJustifyMethodItem(rXf.meHorAlignMethod, ATTR_HOR_JUSTIFY_METHOD));
rSet.Put(SvxJustifyMethodItem(rXf.meVerAlignMethod, ATTR_VER_JUSTIFY_METHOD));
} }
} }
...@@ -1813,17 +1817,24 @@ void ScOrcusStyles::set_xf_horizontal_alignment(orcus::spreadsheet::hor_alignmen ...@@ -1813,17 +1817,24 @@ void ScOrcusStyles::set_xf_horizontal_alignment(orcus::spreadsheet::hor_alignmen
switch (align) switch (align)
{ {
case os::hor_alignment_t::left: case os::hor_alignment_t::left:
maCurrentXF.meHor_alignment = SvxCellHorJustify::Left; maCurrentXF.meHorAlignment = SvxCellHorJustify::Left;
break; break;
case os::hor_alignment_t::right: case os::hor_alignment_t::right:
maCurrentXF.meHor_alignment = SvxCellHorJustify::Right; maCurrentXF.meHorAlignment = SvxCellHorJustify::Right;
break; break;
case os::hor_alignment_t::center: case os::hor_alignment_t::center:
maCurrentXF.meHor_alignment = SvxCellHorJustify::Center; maCurrentXF.meHorAlignment = SvxCellHorJustify::Center;
break; break;
case os::hor_alignment_t::justified: case os::hor_alignment_t::justified:
maCurrentXF.meHor_alignment = SvxCellHorJustify::Standard; maCurrentXF.meHorAlignment = SvxCellHorJustify::Block;
break; break;
case os::hor_alignment_t::distributed:
maCurrentXF.meHorAlignment = SvxCellHorJustify::Block;
maCurrentXF.meHorAlignMethod = SvxCellJustifyMethod::Distribute;
break;
case os::hor_alignment_t::unknown:
maCurrentXF.meHorAlignment = SvxCellHorJustify::Standard;
break;
default: default:
; ;
} }
...@@ -1835,17 +1846,24 @@ void ScOrcusStyles::set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_ ...@@ -1835,17 +1846,24 @@ void ScOrcusStyles::set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_
switch (align) switch (align)
{ {
case os::ver_alignment_t::top: case os::ver_alignment_t::top:
maCurrentXF.meVer_alignment = SvxCellVerJustify::Top; maCurrentXF.meVerAlignment = SvxCellVerJustify::Top;
break; break;
case os::ver_alignment_t::bottom: case os::ver_alignment_t::bottom:
maCurrentXF.meVer_alignment = SvxCellVerJustify::Bottom; maCurrentXF.meVerAlignment = SvxCellVerJustify::Bottom;
break; break;
case os::ver_alignment_t::middle: case os::ver_alignment_t::middle:
maCurrentXF.meVer_alignment = SvxCellVerJustify::Center; maCurrentXF.meVerAlignment = SvxCellVerJustify::Center;
break; break;
case os::ver_alignment_t::justified: case os::ver_alignment_t::justified:
maCurrentXF.meVer_alignment = SvxCellVerJustify::Standard; maCurrentXF.meVerAlignment = SvxCellVerJustify::Block;
break; break;
case os::ver_alignment_t::distributed:
maCurrentXF.meVerAlignment = SvxCellVerJustify::Block;
maCurrentXF.meVerAlignMethod = SvxCellJustifyMethod::Distribute;
break;
case os::ver_alignment_t::unknown:
maCurrentXF.meVerAlignment = SvxCellVerJustify::Standard;
break;
default: default:
; ;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment