oox/source/drawingml/chart/seriescontext.cxx | 11 ++++++----- oox/source/drawingml/chart/seriesconverter.cxx | 4 ++++ oox/source/export/chartexport.cxx | 11 +++++++---- sc/source/filter/excel/excdoc.cxx | 4 ++++ sc/source/filter/excel/xelink.cxx | 15 ++++++++++++--- sc/source/filter/excel/xepage.cxx | 7 ++++++- sc/source/filter/inc/xepage.hxx | 4 ++++ 7 files changed, 43 insertions(+), 13 deletions(-)
New commits: commit e2ed0c6e2729438a6512fc51fc0bfd6055e849f2 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 04:07:36 2015 +0200 finally a good step in the direction of valid external data export Change-Id: I22cbcb9d1f15ab18a8d70c1793c64f04f27389a2 diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 454c918..7962745 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1683,14 +1683,20 @@ void XclExpSupbook::SaveXml( XclExpXmlStream& rStrm ) } - if (!maXctList.IsEmpty() || mxExtNameBfr) + if (mxExtNameBfr) + { + pExternalLink->startElement(XML_definedNames, FSEND); + // externalName elements + WriteExtNameBufferXml( rStrm ); + pExternalLink->endElement(XML_definedNames); + } + + if (!maXctList.IsEmpty()) { pExternalLink->startElement( XML_sheetDataSet, FSEND); // sheetData elements maXctList.SaveXml( rStrm ); - // externalName elements - WriteExtNameBufferXml( rStrm ); pExternalLink->endElement( XML_sheetDataSet); commit 1b15733a87462f7075190e5344e6d8e0b46345ca Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 04:06:49 2015 +0200 document when we are going to create invalid OOXML documents That makes my life so much easier when I need to debug where we screw up. Change-Id: Ia0b54eef47a06c43e3d0ba66b909e398e02a6d0e diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index f9e22a7..454c918 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1390,7 +1390,10 @@ void XclExpXct::SaveXml( XclExpXmlStream& rStrm ) { XclExpCrnList aCrnRecs; if (!BuildCrnList( aCrnRecs)) + { + SAL_WARN("sc", "generating invalid OOXML files: sheetDataSet without sheetData child element"); return; + } sax_fastparser::FSHelperPtr pFS = rStrm.GetCurrentStream(); commit 78f4ed104c832b4aa1ae2d8d367f1db7de486065 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 03:50:50 2015 +0200 correct xlsx element order, related tdf#59663 Change-Id: Iffb7a766f15475e3600332a6c76a15a1d192d7c8 diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 2582712..c322625 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -673,6 +673,10 @@ void ExcTable::FillAsTableXml() // all MSODRAWING and OBJ stuff of this sheet goes here aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) ); + XclExpImgData* pImgData = xPageSett->getGraphicExport(); + if (pImgData) + aRecList.AppendRecord(std::shared_ptr<XclExpRecordBase>(pImgData)); + aRecList.AppendRecord( xExtLst ); } diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index d352025..a68f021 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -405,9 +405,14 @@ void XclExpPageSettings::SaveXml( XclExpXmlStream& rStrm ) static_cast< sal_uInt16 >( GetXclMaxPos().Col() ) ).SaveXml( rStrm ); XclExpPageBreaks( EXC_ID_VERPAGEBREAKS, maData.maVerPageBreaks, static_cast< sal_uInt16 >( GetXclMaxPos().Row() ) ).SaveXml( rStrm ); +} +XclExpImgData* XclExpPageSettings::getGraphicExport() +{ if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() ) - XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ).SaveXml( rStrm ); + return new XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ); + + return NULL; } XclExpChartPageSettings::XclExpChartPageSettings( const XclExpRoot& rRoot ) : diff --git a/sc/source/filter/inc/xepage.hxx b/sc/source/filter/inc/xepage.hxx index 2df9be9..ea1d82c 100644 --- a/sc/source/filter/inc/xepage.hxx +++ b/sc/source/filter/inc/xepage.hxx @@ -24,6 +24,8 @@ #include "xlpage.hxx" #include "xeroot.hxx" +class XclExpImgData; + // Page settings records ====================================================== // Header/footer -------------------------------------------------------------- @@ -100,6 +102,8 @@ public: virtual void Save( XclExpStream& rStrm ) SAL_OVERRIDE; virtual void SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE; + XclExpImgData* getGraphicExport(); + private: XclPageData maData; /// Page settings data. }; commit 4ca0ca862fcfb81a500b52f4ae6454d949d8681c Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 02:45:33 2015 +0200 make that code a bit more robust against strange internal states Change-Id: I1fd67449b9182db8eb9fb0e58b092cef00283c2a diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 6187f67..c12bf02 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2598,12 +2598,15 @@ void writeLabelProperties( { pFS->startElement(FSNS(XML_c, XML_spPr), FSEND); pFS->startElement(FSNS(XML_a, XML_ln), XML_w, IS(convertHmmToEmu(nLabelBorderWidth)), FSEND); - pFS->startElement(FSNS(XML_a, XML_solidFill), FSEND); + if (nLabelBorderColor != -1) + { + pFS->startElement(FSNS(XML_a, XML_solidFill), FSEND); - OString aStr = OString::number(nLabelBorderColor, 16).toAsciiUpperCase(); - pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr.getStr(), FSEND); + OString aStr = OString::number(nLabelBorderColor, 16).toAsciiUpperCase(); + pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr.getStr(), FSEND); - pFS->endElement(FSNS(XML_a, XML_solidFill)); + pFS->endElement(FSNS(XML_a, XML_solidFill)); + } pFS->endElement(FSNS(XML_a, XML_ln)); pFS->endElement(FSNS(XML_c, XML_spPr)); } commit 6f37dc503c8ade591a2550439e11d2c2981c074a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 02:41:49 2015 +0200 don't import data labels border properties for noFill borders They are not shown anyway and just confuse us internally as they contain a width but no color and produce invalid documents during export. Change-Id: Ibe20a27b0172ece86dbb1f734df567b903465ebf diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 1925314..7470929 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -168,6 +168,10 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt void importBorderProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper ) { LineProperties& rLP = rShape.getLineProperties(); + // no fill has the same effect as no border so skip it + if (rLP.maLineFill.moFillType.get() == XML_noFill) + return; + if (rLP.moLineWidth.has()) { sal_Int32 nWidth = convertEmuToHmm(rLP.moLineWidth.get()); commit 547c58a6173535c679027c83fb3ed77f6060fd09 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 4 02:25:00 2015 +0200 fix OOXML vs MSO2007 in chart import in one more place Change-Id: I96bafad0cc73b27c2a08b5205a35b10b4901afb9 diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index 3e71233..b8ade3d 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -36,13 +36,12 @@ using ::oox::core::ContextHandlerRef; namespace { ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext, - sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel ) + sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel, bool bMSO2007 ) { if( rContext.isRootElement() ) switch( nElement ) { case C_TOKEN( delete ): - // default is 'false', not 'true' as specified - orModel.mbDeleted = rAttribs.getBool( XML_val, false ); + orModel.mbDeleted = rAttribs.getBool( XML_val, bMSO2007 ? false : true ); return 0; case C_TOKEN( dLblPos ): orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID ); @@ -108,7 +107,8 @@ ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const A case C_TOKEN( tx ): return new TextContext( *this, mrModel.mxText.create() ); } - return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel ); + bool bMSO2007 = getFilter().isMSO2007Document(); + return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 ); } void DataLabelContext::onCharacters( const OUString& rChars ) @@ -138,7 +138,8 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false ); return 0; } - return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel ); + bool bMSO2007 = getFilter().isMSO2007Document(); + return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 ); } void DataLabelsContext::onCharacters( const OUString& rChars ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits