20#include <com/sun/star/text/WritingMode.hpp>
21#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
23#include <oox/token/properties.hxx>
24#include <oox/token/tokens.hxx>
41 , meVA( TextVerticalAdjust_TOP )
48 sal_Int32 tVert =
moVert.value_or( XML_horz );
49 if( !(tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert) )
56 if(
meVA != TextVerticalAdjust_CENTER )
58 (tVert == XML_vert270) ? TextHorizontalAdjust_RIGHT : TextHorizontalAdjust_LEFT);
59 if( tVert == XML_vert270 )
61 if( ( tVert == XML_vert &&
meVA == TextVerticalAdjust_TOP ) ||
62 ( tVert == XML_vert270 &&
meVA == TextVerticalAdjust_BOTTOM ) )
64 else if(
meVA == TextVerticalAdjust_CENTER )
75 static constexpr const std::array<sal_Int32, 4> aProps {
84 case 90*1*60000: nOff = 3;
break;
85 case 90*2*60000: nOff = 2;
break;
86 case 90*3*60000: nOff = 1;
break;
91 nOff = (nOff + 3) % aProps.size();
93 nOff = (nOff + 1) % aProps.size();
95 for (
size_t i = 0;
i < aProps.size();
i++)
114 sal_Int32 nTextOffsetValue = nVal;
128 nOff = (nOff + 1) % aProps.size();
134 double nHeight = rTextAreaSize.
getHeight();
141 if (nTop + nBottom >= nHeight)
143 double diffFactor = (nTop + nBottom - nHeight) / 2.0;
150 for (
size_t i = 0;
i < aProps.size();
i++)
166 sal_Int32 nUpper = pCustomShape->GetTextUpperDistance();
172 pCustomShape->TakeTextAnchorRect(aAnchorRect);
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
tools::Long GetTextLowerDistance() const
constexpr tools::Long getHeight() const
bool setProperty(sal_Int32 nPropId, Type &&rValue)
Sets the specified property to the passed value.
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
PropertyMap maPropertyMap
std::optional< sal_Int32 > moTextOffLower
std::optional< sal_Int32 > moVert
css::drawing::TextVerticalAdjust meVA
std::array< std::optional< sal_Int32 >, 4 > moInsets
std::optional< sal_Int32 > moTextOffUpper
void readjustTextDistances(css::uno::Reference< css::drawing::XShape > const &xShape)
void pushTextDistances(Size const &rShapeSize)
std::optional< sal_Int32 > moTextOffLeft
std::array< std::optional< sal_Int32 >, 4 > maTextDistanceValues
void pushVertSimulation()
std::optional< sal_Int32 > moTextOffRight
std::optional< sal_Int32 > moTextPreRotation
constexpr OUStringLiteral PROP_TextLeftDistance
constexpr OUStringLiteral PROP_TextHorizontalAdjust
constexpr OUStringLiteral PROP_TextUpperDistance
constexpr OUStringLiteral PROP_TextLowerDistance
constexpr OUStringLiteral PROP_TextRightDistance
constexpr OUStringLiteral PROP_TextWritingMode
constexpr OUStringLiteral PROP_TextVerticalAdjust