summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/view/main/VLegend.cxx2
-rw-r--r--sw/qa/extras/layout/data/tdf123268.odtbin0 -> 12629 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx18
3 files changed, 20 insertions, 0 deletions
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index df5ca49cea74..8272696ea102 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -951,6 +951,8 @@ void VLegend::createShapes(
std::vector<ViewLegendEntry> aNewEntries = pLegendEntryProvider->createLegendEntries(
aMaxSymbolExtent, eExpansion, xLegendProp,
xLegendContainer, m_xShapeFactory, m_xContext, mrModel);
+ if (aNewEntries.size() == 0)
+ return;
aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() );
}
}
diff --git a/sw/qa/extras/layout/data/tdf123268.odt b/sw/qa/extras/layout/data/tdf123268.odt
new file mode 100644
index 000000000000..e68c8139f52c
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf123268.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 7752f2e53e1d..58b98a602e1a 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2331,6 +2331,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659)
// These failed, if the legend names are empty strings.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123268)
+{
+ SwDoc* pDoc = createDoc("tdf123268.odt");
+ 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);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 41
+ // - Actual : 0
+ // i.e. the chart lost.
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push",
+ 41);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630)
{
SwDoc* pDoc = createDoc("tdf115630.docx");