include/oox/export/drawingml.hxx | 7 ++++--- include/oox/export/utils.hxx | 4 ++++ oox/source/drawingml/shape.cxx | 2 +- oox/source/export/shapes.cxx | 4 ++-- sc/source/filter/excel/xeescher.cxx | 4 ++-- sc/source/filter/xcl97/xcl97rec.cxx | 2 +- sw/source/filter/ww8/docxexport.cxx | 6 +++--- 7 files changed, 17 insertions(+), 12 deletions(-)
New commits: commit 09db5c150ea7eb14cfbbe710b32bc8bb6e79a247 Author: Michael Stahl <mst...@redhat.com> Date: Thu Jan 14 22:30:35 2016 +0100 oox: move enum DocumentType out of drawingml.hxx ... which has nasty dependencies. Change-Id: I84ba0302142ade6e15291b782453dbe3bac753dd (cherry picked from commit 3e0bc5c7fe715ebd38bfa64a49b23df58d6d29a9) Reviewed-on: https://gerrit.libreoffice.org/21493 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 988d34e..9305c01 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -29,6 +29,8 @@ #include <filter/msfilter/escherex.hxx> #include "oox/drawingml/drawingmltypes.hxx" #include <oox/token/tokens.hxx> +#include <oox/export/utils.hxx> + #ifndef OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY // Our rotation is counter-clockwise and is in 100ths of a degree. // drawingML rotation is clockwise and is in 60000ths of a degree. @@ -86,9 +88,8 @@ protected: virtual ~DMLTextExport() {} }; -class OOX_DLLPUBLIC DrawingML { -public: - enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX }; +class OOX_DLLPUBLIC DrawingML +{ private: static int mnImageCounter; diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx index 66854f6..f042c73 100644 --- a/include/oox/export/utils.hxx +++ b/include/oox/export/utils.hxx @@ -52,6 +52,10 @@ OString write1000thOfAPercent(T number) return OString::number( number * 1000 ); } +namespace oox { namespace drawingml { + enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX }; +} } + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index beb79c3..b8f758e 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1145,7 +1145,7 @@ ShapeExport& ShapeExport::WriteRectangleShape( Reference< XShape > xShape ) typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > ); typedef std::unordered_map< const char*, ShapeConverter, rtl::CStringHash, rtl::CStringEqual> NameToConvertMapType; -static const NameToConvertMapType& lcl_GetConverters(DrawingML::DocumentType eDocumentType) +static const NameToConvertMapType& lcl_GetConverters(DocumentType eDocumentType) { static bool shape_map_inited = false; static NameToConvertMapType shape_converters; @@ -1178,7 +1178,7 @@ static const NameToConvertMapType& lcl_GetConverters(DrawingML::DocumentType eDo shape_converters[ "com.sun.star.presentation.OutlinerShape" ] = &ShapeExport::WriteTextShape; shape_converters[ "com.sun.star.presentation.SlideNumberShape" ] = &ShapeExport::WriteTextShape; shape_converters[ "com.sun.star.presentation.TitleTextShape" ] = &ShapeExport::WriteTextShape; - if (eDocumentType == DrawingML::DOCUMENT_DOCX) + if (eDocumentType == DOCUMENT_DOCX) shape_converters[ "com.sun.star.drawing.GroupShape" ] = &ShapeExport::WriteGroupShape; shape_map_inited = true; diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 6e04a38..7c7d4d8 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -445,7 +445,7 @@ void XclExpImgData::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr pWorksheet = rStrm.GetCurrentStream(); - DrawingML aDML( pWorksheet, &rStrm, DrawingML::DOCUMENT_XLSX ); + DrawingML aDML(pWorksheet, &rStrm, drawingml::DOCUMENT_XLSX); OUString rId = aDML.WriteImage( maGraphic ); pWorksheet->singleElement( XML_picture, FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( rId ).getStr(), @@ -1137,7 +1137,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm ) { XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() ); Reference< XModel > xModel( mxChartDoc, UNO_QUERY ); - ChartExport aChartExport( XML_xdr, pDrawing, xModel, &rStrm, DrawingML::DOCUMENT_XLSX ); + ChartExport aChartExport(XML_xdr, pDrawing, xModel, &rStrm, drawingml::DOCUMENT_XLSX); static sal_Int32 nChartCount = 0; nChartCount++; aChartExport.WriteChartObj( mxShape, nChartCount ); diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 5a76ae8..8f5ac14 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1164,7 +1164,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm ) sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream(); - ShapeExport aDML( XML_xdr, pDrawing, nullptr, &rStrm, DrawingML::DOCUMENT_XLSX ); + ShapeExport aDML(XML_xdr, pDrawing, nullptr, &rStrm, drawingml::DOCUMENT_XLSX); std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc)); aDML.SetURLTranslator(pURLTransformer); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index f0a931c..b4db87f 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -360,7 +360,7 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In m_pFilter->openFragmentStreamWithSerializer( aFileName, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" ); - oox::drawingml::ChartExport aChartExport( XML_w, pChartFS, xModel, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX ); + oox::drawingml::ChartExport aChartExport(XML_w, pChartFS, xModel, m_pFilter, oox::drawingml::DOCUMENT_DOCX); aChartExport.ExportContent(); return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); } @@ -436,7 +436,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape) nNamespace = XML_wpg; else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) nNamespace = XML_pic; - oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), nullptr, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX, m_pAttrOutput); + oox::drawingml::ShapeExport aExport(nNamespace, m_pAttrOutput->GetSerializer(), nullptr, m_pFilter, oox::drawingml::DOCUMENT_DOCX, m_pAttrOutput); aExport.WriteShape(xShape); } @@ -1480,7 +1480,7 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur SetFS(m_pDocumentFS); // the DrawingML access - m_pDrawingML = new oox::drawingml::DrawingML( m_pDocumentFS, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX ); + m_pDrawingML = new oox::drawingml::DrawingML(m_pDocumentFS, m_pFilter, oox::drawingml::DOCUMENT_DOCX); // the attribute output for the document m_pAttrOutput = new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML ); commit edf886a14f08d8cb58db2a22485da58662d0181b Author: Michael Stahl <mst...@redhat.com> Date: Fri Jan 15 12:08:06 2016 +0100 oox: coverity#1348468 copy-paste error Change-Id: Ibea6944c4e61e9848aac936e399ed08192ec5812 (cherry picked from commit 99ab23d26010120e7e6344cb2b26e192890ec5c3) Reviewed-on: https://gerrit.libreoffice.org/21488 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 2dc84e9..b744bb1 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -518,7 +518,7 @@ Reference< XShape > Shape::createAndInsert( const basegfx::B2DPoint& rPreviousPoint = aPoly.getB2DPoint(i - 1); if (aPoint.getX() - rPreviousPoint.getX() == 0) aPoint.setX(aPoint.getX() + 1); - if (aPoint.getY() - rPreviousPoint.getX() == 0) + if (aPoint.getY() - rPreviousPoint.getY() == 0) aPoint.setY(aPoint.getY() + 1); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits