summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/export/chartexport.hxx3
-rw-r--r--oox/source/export/chartexport.cxx10
-rw-r--r--oox/source/export/shapes.cxx2
-rw-r--r--sc/source/filter/excel/xeescher.cxx3
-rwxr-xr-xsd/qa/unit/data/pptx/tdf112089.pptxbin0 -> 46671 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx16
6 files changed, 21 insertions, 13 deletions
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 528dc84473f5..74016281745a 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -210,10 +210,9 @@ public:
ChartExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, css::uno::Reference< css::frame::XModel >& xModel, ::oox::core::XmlFilterBase* pFB = nullptr, DocumentType eDocumentType = DOCUMENT_PPTX );
virtual ~ChartExport() {}
- sal_Int32 GetChartID( );
const css::uno::Reference< css::frame::XModel >& getModel(){ return mxChartModel; }
- void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& xShape, sal_Int32 nChartCount );
+ void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& xShape, sal_Int32 nID, sal_Int32 nChartCount );
void ExportContent();
void InitRangeSegmentationProperties(
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 41faecacdbdb..b1e9368d7c7a 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -452,12 +452,6 @@ ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< f
{
}
-sal_Int32 ChartExport::GetChartID( )
-{
- sal_Int32 nID = GetFB()->GetUniqueId();
- return nID;
-}
-
sal_Int32 ChartExport::getChartType( )
{
OUString sChartType = mxDiagram->getDiagramType();
@@ -509,7 +503,7 @@ OUString ChartExport::parseFormula( const OUString& rRange )
return aResult;
}
-void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nChartCount )
+void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nID, sal_Int32 nChartCount )
{
FSHelperPtr pFS = GetFS();
@@ -523,8 +517,6 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nC
if (xNamed.is())
sName = xNamed->getName();
- sal_Int32 nID = GetChartID();
-
pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
XML_id, I32S( nID ),
XML_name, USS( sName ),
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index c9661684535e..871873c968b1 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1941,7 +1941,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
Reference< XModel > xModel( xChartDoc, UNO_QUERY );
ChartExport aChartExport( mnXmlNamespace, GetFS(), xModel, GetFB(), GetDocumentType() );
static sal_Int32 nChartCount = 0;
- aChartExport.WriteChartObj( xShape, ++nChartCount );
+ aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), ++nChartCount );
return *this;
}
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index e0eb7775549b..ac175ca9b135 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1137,7 +1137,8 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
ChartExport aChartExport(XML_xdr, pDrawing, xModel, &rStrm, drawingml::DOCUMENT_XLSX);
static sal_Int32 nChartCount = 0;
nChartCount++;
- aChartExport.WriteChartObj( mxShape, nChartCount );
+ sal_Int32 nID = rStrm.GetUniqueId();
+ aChartExport.WriteChartObj( mxShape, nID, nChartCount );
// TODO: get the correcto chart number
}
diff --git a/sd/qa/unit/data/pptx/tdf112089.pptx b/sd/qa/unit/data/pptx/tdf112089.pptx
new file mode 100755
index 000000000000..d0cafcd91c72
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf112089.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index dd723a68c3fb..7ed12af08b67 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -111,6 +111,7 @@ public:
void testTdf112557();
void testTdf112088();
void testTdf112333();
+ void testTdf112089();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -145,6 +146,7 @@ public:
CPPUNIT_TEST(testTdf112557);
CPPUNIT_TEST(testTdf112088);
CPPUNIT_TEST(testTdf112333);
+ CPPUNIT_TEST(testTdf112089);
CPPUNIT_TEST_SUITE_END();
@@ -930,6 +932,20 @@ void SdOOXMLExportTest2::testTdf112333()
CPPUNIT_ASSERT_EQUAL(OUString("fillcolor"), sAttributeName);
}
+void SdOOXMLExportTest2::testTdf112089()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112089.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xDocShRef->DoClose();
+
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+
+ OUString sID = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/p:nvGraphicFramePr/p:cNvPr", "id");
+ OUString sTarget = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:tgtEl/p:spTgt", "spid");
+ CPPUNIT_ASSERT_EQUAL(sID, sTarget);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();