summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
authorSzabolcs Toth <szabolcs450@gmail.com>2019-10-08 11:21:50 +0200
committerLászló Németh <nemeth@numbertext.org>2019-10-08 20:56:46 +0200
commit10c85f825f1fb5989490ec731fdba036c0b8e247 (patch)
tree5418f1762065c6660b1acdc64154df306236f9ea /sc/source/filter/oox
parentbef96f7a7b4d1dc7bcb01c949e0ae296c969dcee (diff)
tdf#123339 XLSX: fix horizontal alignment in comments
Import and export of VML element TextHAlign weren't supported by Calc, losing horizontal aligment of the comments assigned to the spreadsheet cells. Change-Id: I41766d3004dd07ab34a2619e28532281366bf235 Reviewed-on: https://gerrit.libreoffice.org/79963 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r--sc/source/filter/oox/commentsbuffer.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx
index 00045842c9fd..c3c60c3f5a6d 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -77,6 +77,21 @@ static sal_Int32 lcl_ToVertAlign( sal_Int32 nAlign )
}
}
+static sal_Int16 lcl_ToParaAlign(sal_Int32 nAlign)
+{
+ switch ( nAlign )
+ {
+ case XML_Left:
+ return sal_Int16(css::style::ParagraphAdjust_LEFT);
+ case XML_Right:
+ return sal_Int16(css::style::ParagraphAdjust_RIGHT);
+ case XML_Center:
+ return sal_Int16(css::style::ParagraphAdjust_CENTER);
+ default:
+ return sal_Int16(css::style::ParagraphAdjust_BLOCK);
+ }
+}
+
CommentModel::CommentModel()
: mnAuthorId(-1)
, mbAutoFill(false)
@@ -171,6 +186,7 @@ void Comment::finalizeImport()
// Setting comment text alignment
const ::oox::vml::ClientData* xClientData = pNoteShape->getClientData();
aCommentPr.setProperty(PROP_TextVerticalAdjust, lcl_ToVertAlign(xClientData->mnTextVAlign));
+ aCommentPr.setProperty(PROP_ParaAdjust, lcl_ToParaAlign(xClientData->mnTextHAlign));
}
xAnno->setIsVisible( bVisible );