Kaydet (Commit) 40ffaa4f authored tarafından Balazs Varga's avatar Balazs Varga Kaydeden (comit) László Németh

Related: tdf#108021 Fix text break of X axis labels

Recalculate the nLimitedSpaceForText in case of 90
and 270 degree if the X axis label's text break is true.
The first part of the fix: https://gerrit.libreoffice.org/65165

Change-Id: I5d78be6ed83dd195bbc34185d5f6b7e44f555d9b
Reviewed-on: https://gerrit.libreoffice.org/65937
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 392729c7
...@@ -727,6 +727,21 @@ bool VCartesianAxis::createTextShapes( ...@@ -727,6 +727,21 @@ bool VCartesianAxis::createTextShapes(
nReduce = 1; nReduce = 1;
nLimitedSpaceForText -= nReduce; nLimitedSpaceForText -= nReduce;
} }
// recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the text break is true
if ( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 )
{
if ( rAxisLabelProperties.m_aFontReferenceSize.Height - rAxisLabelProperties.m_aMaximumSpaceForLabels.Height > 2 * rAxisLabelProperties.m_aMaximumSpaceForLabels.Y )
{
const sal_Int32 nFullHeight = rAxisLabelProperties.m_aFontReferenceSize.Height;
sal_Int32 nMaxLabelsHeight = nFullHeight - ( rAxisLabelProperties.m_aMaximumSpaceForLabels.Height + rAxisLabelProperties.m_aMaximumSpaceForLabels.Y );
nLimitedSpaceForText = nMaxLabelsHeight;
}
else
{
nLimitedSpaceForText = -1;
}
}
} }
// Stores an array of text label strings in case of a normal // Stores an array of text label strings in case of a normal
......
...@@ -2391,7 +2391,7 @@ void SwLayoutWriter::testTdf108021() ...@@ -2391,7 +2391,7 @@ void SwLayoutWriter::testTdf108021()
assertXPath( assertXPath(
pXmlDoc, pXmlDoc,
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[@length='17']", "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[@length='22']",
8); 8);
// This failed, if the textarray length of the first axis label not 17. // This failed, if the textarray length of the first axis label not 17.
} }
......
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