summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/view/axes/Tickmarks.cxx5
-rw-r--r--chart2/source/view/axes/Tickmarks.hxx1
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx15
-rw-r--r--sw/qa/extras/layout/data/tdf128996.docxbin0 -> 26061 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx16
5 files changed, 26 insertions, 11 deletions
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
index 45e311ce3cfa..e1dc3953bd11 100644
--- a/chart2/source/view/axes/Tickmarks.cxx
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -204,6 +204,11 @@ sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter )
return pFirstTickInfo->getScreenDistanceBetweenTicks( *pSecondTickInfo );
}
+B2DVector TickFactory2D::getXaxisStartPos() const
+{
+ return m_aAxisStartScreenPosition2D;
+}
+
B2DVector TickFactory2D::getTickScreenPosition2D( double fScaledLogicTickValue ) const
{
B2DVector aRet(m_aAxisStartScreenPosition2D);
diff --git a/chart2/source/view/axes/Tickmarks.hxx b/chart2/source/view/axes/Tickmarks.hxx
index b0cb774dbf5d..34addbeb45db 100644
--- a/chart2/source/view/axes/Tickmarks.hxx
+++ b/chart2/source/view/axes/Tickmarks.hxx
@@ -135,6 +135,7 @@ public:
bool isHorizontalAxis() const;
bool isVerticalAxis() const;
+ ::basegfx::B2DVector getXaxisStartPos() const;
private:
::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 4b7f4df2f8ac..dce4de52783b 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -733,22 +733,15 @@ bool VCartesianAxis::createTextShapes(
// 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;
- }
+ nLimitedSpaceForText = rAxisLabelProperties.m_aFontReferenceSize.Height - pTickFactory->getXaxisStartPos().getY();
+ m_aAxisProperties.m_bLimitSpaceForLabels = false;
}
// recalculate the nLimitedSpaceForText in case of vertical category axis if the text break is true
if ( m_aAxisProperties.m_bSwapXAndY && bIsVerticalAxis && rAxisLabelProperties.fRotationAngleDegree == 0.0 )
{
- nLimitedSpaceForText = rAxisLabelProperties.m_aMaximumSpaceForLabels.X;
+ nLimitedSpaceForText = pTickFactory->getXaxisStartPos().getX();
+ m_aAxisProperties.m_bLimitSpaceForLabels = false;
}
}
diff --git a/sw/qa/extras/layout/data/tdf128996.docx b/sw/qa/extras/layout/data/tdf128996.docx
new file mode 100644
index 000000000000..8b6e77214b0c
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf128996.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index fdd1d2ae125c..80b0ecdac7f9 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2437,6 +2437,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122800)
// This failed, if the textarray length of the first axis label not 22.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128996)
+{
+ SwDoc* pDoc = createDoc("tdf128996.docx");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPathContent(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[1]/text",
+ "A very long category name 1");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127304)
{
SwDoc* pDoc = createDoc("tdf127304.odt");