/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// the default type is XML_node const sal_Int32 nType = rAttribs.getToken( XML_type, XML_node );
mrPoint.mnXMLType = static_cast<svx::diagram::TypeConstant>(nType);
// ignore the cxnId unless it is this type. See 5.15.3.1.3 in Primer if( ( nType == XML_parTrans ) || ( nType == XML_sibTrans ) )
mrPoint.msCnxId = rAttribs.getStringDefaulted( XML_cxnId );
}
// CT_BackgroundFormatting class BackgroundFormattingContext
: public ContextHandler2
{ public:
BackgroundFormattingContext( ContextHandler2Helper const & rParent, OoxDiagramDataPtr const& pModel )
: ContextHandler2( rParent )
, mpDataModel( pModel )
{
assert( pModel && "the data model MUST NOT be NULL" );
}
virtual ContextHandlerRef
onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) override
{ switch( aElementToken )
{ case A_TOKEN( blipFill ): case A_TOKEN( gradFill ): case A_TOKEN( grpFill ): case A_TOKEN( noFill ): case A_TOKEN( pattFill ): case A_TOKEN( solidFill ): // EG_FillProperties return FillPropertiesContext::createFillContext(*this, aElementToken, rAttribs, *mpDataModel->getBackgroundShapeFillProperties(), nullptr); case A_TOKEN( effectDag ): case A_TOKEN( effectLst ): // TODO // EG_EffectProperties break; default: break;
} returnthis;
} private:
OoxDiagramDataPtr mpDataModel;
};
}
DataModelContext::DataModelContext( ContextHandler2Helper const& rParent, const OoxDiagramDataPtr& pDataModel )
: ContextHandler2( rParent )
, mpDataModel( pDataModel )
{
assert( pDataModel && "Data Model must not be NULL" );
}
DataModelContext::~DataModelContext()
{ // some debug
mpDataModel->dump();
}
ContextHandlerRef
DataModelContext::onCreateContext( ::sal_Int32 aElement, const AttributeList& rAttribs )
{ switch( aElement )
{ case DGM_TOKEN( cxnLst ): // CT_CxnList returnnew CxnListContext( *this, mpDataModel->getConnections() ); case DGM_TOKEN( ptLst ): // CT_PtList returnnew PtListContext( *this, mpDataModel->getPoints(), *mpDataModel ); case DGM_TOKEN( bg ): // CT_BackgroundFormatting returnnew BackgroundFormattingContext( *this, mpDataModel ); case DGM_TOKEN( whole ): // CT_WholeE2oFormatting // TODO return nullptr; case DGM_TOKEN( extLst ): case A_TOKEN( ext ): break; case DSP_TOKEN( dataModelExt ):
mpDataModel->getExtDrawings().push_back( rAttribs.getStringDefaulted( XML_relId ) ); break; default: break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.