Kaydet (Commit) 3e0bc5c7 authored tarafından Michael Stahl's avatar Michael Stahl

oox: move enum DocumentType out of drawingml.hxx

... which has nasty dependencies.

Change-Id: I84ba0302142ade6e15291b782453dbe3bac753dd
üst 24ada656
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <filter/msfilter/escherex.hxx> #include <filter/msfilter/escherex.hxx>
#include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/drawingmltypes.hxx"
#include <oox/token/tokens.hxx> #include <oox/token/tokens.hxx>
#include <oox/export/utils.hxx>
#ifndef OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY #ifndef OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY
// Our rotation is counter-clockwise and is in 100ths of a degree. // Our rotation is counter-clockwise and is in 100ths of a degree.
// drawingML rotation is clockwise and is in 60000ths of a degree. // drawingML rotation is clockwise and is in 60000ths of a degree.
...@@ -86,9 +88,8 @@ protected: ...@@ -86,9 +88,8 @@ protected:
virtual ~DMLTextExport() {} virtual ~DMLTextExport() {}
}; };
class OOX_DLLPUBLIC DrawingML { class OOX_DLLPUBLIC DrawingML
public: {
enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
private: private:
static int mnImageCounter; static int mnImageCounter;
......
...@@ -44,6 +44,10 @@ OString write1000thOfAPercent(T number) ...@@ -44,6 +44,10 @@ OString write1000thOfAPercent(T number)
return OString::number( number * 1000 ); return OString::number( number * 1000 );
} }
namespace oox { namespace drawingml {
enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
} }
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -1144,7 +1144,7 @@ ShapeExport& ShapeExport::WriteRectangleShape( Reference< XShape > xShape ) ...@@ -1144,7 +1144,7 @@ ShapeExport& ShapeExport::WriteRectangleShape( Reference< XShape > xShape )
typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > ); typedef ShapeExport& (ShapeExport::*ShapeConverter)( Reference< XShape > );
typedef std::unordered_map< const char*, ShapeConverter, rtl::CStringHash, rtl::CStringEqual> NameToConvertMapType; 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 bool shape_map_inited = false;
static NameToConvertMapType shape_converters; static NameToConvertMapType shape_converters;
...@@ -1177,7 +1177,7 @@ static const NameToConvertMapType& lcl_GetConverters(DrawingML::DocumentType eDo ...@@ -1177,7 +1177,7 @@ static const NameToConvertMapType& lcl_GetConverters(DrawingML::DocumentType eDo
shape_converters[ "com.sun.star.presentation.OutlinerShape" ] = &ShapeExport::WriteTextShape; shape_converters[ "com.sun.star.presentation.OutlinerShape" ] = &ShapeExport::WriteTextShape;
shape_converters[ "com.sun.star.presentation.SlideNumberShape" ] = &ShapeExport::WriteTextShape; shape_converters[ "com.sun.star.presentation.SlideNumberShape" ] = &ShapeExport::WriteTextShape;
shape_converters[ "com.sun.star.presentation.TitleTextShape" ] = &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_converters[ "com.sun.star.drawing.GroupShape" ] = &ShapeExport::WriteGroupShape;
shape_map_inited = true; shape_map_inited = true;
......
...@@ -445,7 +445,7 @@ void XclExpImgData::SaveXml( XclExpXmlStream& rStrm ) ...@@ -445,7 +445,7 @@ void XclExpImgData::SaveXml( XclExpXmlStream& rStrm )
{ {
sax_fastparser::FSHelperPtr pWorksheet = rStrm.GetCurrentStream(); 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 ); OUString rId = aDML.WriteImage( maGraphic );
pWorksheet->singleElement( XML_picture, pWorksheet->singleElement( XML_picture,
FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( rId ).getStr(), FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( rId ).getStr(),
...@@ -1137,7 +1137,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm ) ...@@ -1137,7 +1137,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
{ {
XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() ); XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() );
Reference< XModel > xModel( mxChartDoc, UNO_QUERY ); 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; static sal_Int32 nChartCount = 0;
nChartCount++; nChartCount++;
aChartExport.WriteChartObj( mxShape, nChartCount ); aChartExport.WriteChartObj( mxShape, nChartCount );
......
...@@ -1164,7 +1164,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm ) ...@@ -1164,7 +1164,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream(); 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)); std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc));
aDML.SetURLTranslator(pURLTransformer); aDML.SetURLTranslator(pURLTransformer);
......
...@@ -361,7 +361,7 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In ...@@ -361,7 +361,7 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In
m_pFilter->openFragmentStreamWithSerializer( aFileName, m_pFilter->openFragmentStreamWithSerializer( aFileName,
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml" ); "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(); aChartExport.ExportContent();
return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 );
} }
...@@ -422,7 +422,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape) ...@@ -422,7 +422,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape)
nNamespace = XML_wpg; nNamespace = XML_wpg;
else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) else if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape"))
nNamespace = XML_pic; 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); aExport.WriteShape(xShape);
} }
...@@ -1450,7 +1450,7 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur ...@@ -1450,7 +1450,7 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
SetFS(m_pDocumentFS); SetFS(m_pDocumentFS);
// the DrawingML access // 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 // the attribute output for the document
m_pAttrOutput = new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML ); m_pAttrOutput = new DocxAttributeOutput( *this, m_pDocumentFS, m_pDrawingML );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment