summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2023-04-20 23:31:20 +0300
committerSarper Akdemir <sarper.akdemir@collabora.com>2023-05-12 12:19:12 +0200
commita8277723f6d7a8978ac3be07df37cd90bdc88cdb (patch)
treebcead57c7639fae3991bc7ee8b02d4f6e720a99b /oox
parent8b8d6eb7f08a65d000d43c1fac53d85316c13b96 (diff)
related tdf#154501: pptx import: push cell's RotateAngle after text
It appears to matter whether "RotateAngle" property is set before or after insertion of the text for cells. It only renders correctly when it is pushed after the text insertion. RotateAngle appears to end up in the property set either way with correct values, so I don't really know why this is the case. Adds a unit test that covers rendering of vertical text in table cells on import from an example pptx file. Change-Id: Ifb8caa0b74920758fea2815b16dae7fd60587cc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150712 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com> (cherry picked from commit 4232907e0a8a5bd87c673afd9df0031dce74d798) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151529 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/table/tablecell.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index b0849b7002f3..9d16bce09d17 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -569,7 +569,24 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
{
xPropSet->setPropertyValue("TextWritingMode", Any(css::text::WritingMode_TB_RL));
}
- else if ( getVertToken() == XML_vert )
+
+ getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle );
+
+ // tdf#144092 For empty cells push character styles & endParaRPr to the Cell's properties
+ const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
+ if (rParagraphs.size() == 1)
+ {
+ const auto pFirstParagraph = rParagraphs.at(0);
+ if (pFirstParagraph->getRuns().empty())
+ {
+ TextCharacterProperties aTextCharacterProps{ pFirstParagraph->getCharacterStyle(
+ aTextStyleProps, *pMasterTextListStyle, getTextBody()->getTextListStyle()) };
+ aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
+ aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+ }
+ }
+
+ if ( getVertToken() == XML_vert )
{
xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
}
@@ -577,7 +594,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
{
xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
}
- else if ( getVertToken() != XML_horz )
+ else if ( getVertToken() != XML_horz && getVertToken() != XML_eaVert )
{
// put the vert value in the grab bag for roundtrip
const Sequence<sal_Int8>& aTokenNameSeq = StaticTokenMap().getUtf8TokenName(getVertToken());
@@ -599,22 +616,6 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
}
xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
}
-
- getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle );
-
- // tdf#144092 For empty cells push character styles & endParaRPr to the Cell's properties
- const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
- if (rParagraphs.size() == 1)
- {
- const auto pFirstParagraph = rParagraphs.at(0);
- if (pFirstParagraph->getRuns().empty())
- {
- TextCharacterProperties aTextCharacterProps{ pFirstParagraph->getCharacterStyle(
- aTextStyleProps, *pMasterTextListStyle, getTextBody()->getTextListStyle()) };
- aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
- aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
- }
- }
}
}