for (size_t i = 0; i < aProps.size(); i++)
{
sal_Int32 nVal = 0;
// Hack for n#760986 // TODO: Preferred method would be to have a textbox on top // of the shape and the place it according to the (off,ext) if (nOff == 0 && moTextOffLeft)
nVal = *moTextOffLeft;
if (nOff == 1 && moTextOffUpper)
nVal = *moTextOffUpper;
if (nOff == 2 && moTextOffRight)
nVal = *moTextOffRight;
if (nOff == 3 && moTextOffLower)
nVal = *moTextOffLower;
sal_Int32 nTextOffsetValue = nVal;
if (moInsets[i])
{
nTextOffsetValue = *moInsets[i] + nVal;
}
// if inset is set, then always set the value // this prevents the default to be set (0 is a valid value) if (moInsets[i] || nTextOffsetValue)
{
maTextDistanceValues[nOff] = nTextOffsetValue;
}
nOff = (nOff + 1) % aProps.size();
}
// Check if bottom and top are set if (maTextDistanceValues[1] && maTextDistanceValues[3])
{ double nHeight = rTextAreaSize.getHeight();
// Check if top + bottom is more than text area height. // If yes, we need to adjust the values as defined in OOXML. if (nTop + nBottom >= nHeight)
{ double diffFactor = (nTop + nBottom - nHeight) / 2.0;
for (size_t i = 0; i < aProps.size(); i++)
{ if (maTextDistanceValues[i])
maPropertyMap.setProperty(aProps[i], *maTextDistanceValues[i]);
}
}
/* Readjust the text distances / insets if necessary to take
the text area into account, not just the shape area*/ void TextBodyProperties::readjustTextDistances(uno::Reference<drawing::XShape> const& xShape)
{ // Only for custom shapes (for now) auto* pCustomShape = dynamic_cast<SdrObjCustomShape*>(SdrObject::getSdrObjectFromXShape(xShape)); if (pCustomShape)
{
sal_Int32 nLower = pCustomShape->GetTextLowerDistance();
sal_Int32 nUpper = pCustomShape->GetTextUpperDistance();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.