diff options
Diffstat (limited to 'oox/source/drawingml/graphicshapecontext.cxx')
-rw-r--r-- | oox/source/drawingml/graphicshapecontext.cxx | 63 |
1 files changed, 15 insertions, 48 deletions
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 5df5c45de1c3..e181fb7f01ca 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -31,7 +31,7 @@ #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/customshapeproperties.hxx" -#include "oox/drawingml/diagram/diagramfragmenthandler.hxx" +#include "oox/drawingml/diagram/diagram.hxx" #include "oox/drawingml/table/tablecontext.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/attributelist.hxx" @@ -85,7 +85,7 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa (mpShapePtr->getCustomShapeProperties()); sal_uInt32 nType = getBaseToken( aElementToken ); - OUString sType(GetShapeType(nType)); + OUString sType(GetShapePresetType(nType)); if (sType.getLength() > 0) pCstmShpProps->setShapePresetType(sType); @@ -221,48 +221,6 @@ DiagramGraphicDataContext::~DiagramGraphicDataContext() { } -DiagramPtr DiagramGraphicDataContext::loadDiagram() -{ - DiagramPtr pDiagram( new Diagram() ); - XmlFilterBase& rFilter = getFilter(); - - // data - OUString sDmPath = getFragmentPathFromRelId( msDm ); - if( sDmPath.getLength() > 0 ) - { - DiagramDataPtr pData( new DiagramData() ); - pDiagram->setData( pData ); - rFilter.importFragment( new DiagramDataFragmentHandler( rFilter, sDmPath, pData ) ); - } - // layout - OUString sLoPath = getFragmentPathFromRelId( msLo ); - if( sLoPath.getLength() > 0 ) - { - DiagramLayoutPtr pLayout( new DiagramLayout() ); - pDiagram->setLayout( pLayout ); - rFilter.importFragment( new DiagramLayoutFragmentHandler( rFilter, sLoPath, pLayout ) ); - } - // style - OUString sQsPath = getFragmentPathFromRelId( msQs ); - if( sQsPath.getLength() > 0 ) - { - DiagramQStylesPtr pStyles( new DiagramQStyles() ); - pDiagram->setQStyles( pStyles ); - rFilter.importFragment( new DiagramQStylesFragmentHandler( rFilter, sQsPath, pStyles ) ); - } - // colors - OUString sCsPath = getFragmentPathFromRelId( msCs ); - if( sCsPath.getLength() > 0 ) - { - DiagramColorsPtr pColors( new DiagramColors() ); - pDiagram->setColors( pColors ); - rFilter.importFragment( new DiagramColorsFragmentHandler( rFilter, sCsPath, pColors ) ) ; - } - - return pDiagram; -} - - Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException) { @@ -276,10 +234,19 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte msLo = xAttribs->getOptionalValue( R_TOKEN( lo ) ); msQs = xAttribs->getOptionalValue( R_TOKEN( qs ) ); msCs = xAttribs->getOptionalValue( R_TOKEN( cs ) ); - DiagramPtr pDiagram = loadDiagram(); - pDiagram->addTo( mpShapePtr ); - OSL_TRACE("diagram added shape %s of type %s", OUSTRING_TO_CSTR( mpShapePtr->getName() ), - OUSTRING_TO_CSTR( mpShapePtr->getServiceName() ) ); + loadDiagram(mpShapePtr, + getFilter(), + getFragmentPathFromRelId( msDm ), + getFragmentPathFromRelId( msLo ), + getFragmentPathFromRelId( msQs ), + getFragmentPathFromRelId( msCs )); + OSL_TRACE("diagram added shape %s of type %s, size (%d,%d,%d,%d)", + OUSTRING_TO_CSTR( mpShapePtr->getName() ), + OUSTRING_TO_CSTR( mpShapePtr->getServiceName() ), + mpShapePtr->getPosition().X, + mpShapePtr->getPosition().Y, + mpShapePtr->getSize().Width, + mpShapePtr->getSize().Height); break; } default: |