merge the formfield patch from ooo-build
[ooovba.git] / oox / source / drawingml / diagram / diagramfragmenthandler.cxx
blob537c5ad984f890f477a194bde432079859150945
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: diagramfragmenthandler.cxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <osl/diagnose.h>
33 #include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
34 #include "oox/drawingml/diagram/datamodelcontext.hxx"
35 #include "oox/core/namespaces.hxx"
36 #include "diagramdefinitioncontext.hxx"
37 #include "tokens.hxx"
39 using namespace ::oox::core;
40 using namespace ::com::sun::star::xml::sax;
41 using namespace ::com::sun::star::uno;
42 using ::rtl::OUString;
44 namespace oox { namespace drawingml {
46 DiagramDataFragmentHandler::DiagramDataFragmentHandler( XmlFilterBase& rFilter,
47 const OUString& rFragmentPath,
48 const DiagramDataPtr pDataPtr )
49 throw( )
50 : FragmentHandler( rFilter, rFragmentPath )
51 , mpDataPtr( pDataPtr )
55 DiagramDataFragmentHandler::~DiagramDataFragmentHandler( ) throw ()
60 void SAL_CALL DiagramDataFragmentHandler::endDocument()
61 throw (SAXException, RuntimeException)
67 Reference< XFastContextHandler > SAL_CALL
68 DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
69 const Reference< XFastAttributeList >& )
70 throw ( SAXException, RuntimeException)
72 Reference< XFastContextHandler > xRet;
74 switch( aElement )
76 case NMSP_DIAGRAM|XML_dataModel:
77 xRet.set( new DataModelContext( *this, mpDataPtr ) );
78 break;
79 default:
80 break;
83 if( !xRet.is() )
84 xRet = getFastContextHandler();
86 return xRet;
89 ///////////////////
91 DiagramLayoutFragmentHandler::DiagramLayoutFragmentHandler( XmlFilterBase& rFilter,
92 const OUString& rFragmentPath,
93 const DiagramLayoutPtr pDataPtr )
94 throw( )
95 : FragmentHandler( rFilter, rFragmentPath )
96 , mpDataPtr( pDataPtr )
100 DiagramLayoutFragmentHandler::~DiagramLayoutFragmentHandler( ) throw ()
105 void SAL_CALL DiagramLayoutFragmentHandler::endDocument()
106 throw (SAXException, RuntimeException)
112 Reference< XFastContextHandler > SAL_CALL
113 DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
114 const Reference< XFastAttributeList >& xAttribs )
115 throw ( SAXException, RuntimeException)
117 Reference< XFastContextHandler > xRet;
119 switch( aElement )
121 case NMSP_DIAGRAM|XML_layoutDef:
122 xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) );
123 break;
124 default:
125 break;
128 if( !xRet.is() )
129 xRet = getFastContextHandler();
131 return xRet;
134 ///////////////////////
136 DiagramQStylesFragmentHandler::DiagramQStylesFragmentHandler( XmlFilterBase& rFilter,
137 const OUString& rFragmentPath,
138 const DiagramQStylesPtr pDataPtr )
139 throw( )
140 : FragmentHandler( rFilter, rFragmentPath )
141 , mpDataPtr( pDataPtr )
145 DiagramQStylesFragmentHandler::~DiagramQStylesFragmentHandler( ) throw ()
150 void SAL_CALL DiagramQStylesFragmentHandler::endDocument()
151 throw (SAXException, RuntimeException)
157 Reference< XFastContextHandler > SAL_CALL
158 DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
159 const Reference< XFastAttributeList >& )
160 throw ( SAXException, RuntimeException)
162 Reference< XFastContextHandler > xRet;
164 switch( aElement )
166 case NMSP_DIAGRAM|XML_styleDef:
167 // TODO
168 break;
169 default:
170 break;
173 if( !xRet.is() )
174 xRet = getFastContextHandler();
176 return xRet;
179 /////////////////////
181 DiagramColorsFragmentHandler::DiagramColorsFragmentHandler( XmlFilterBase& rFilter,
182 const OUString& rFragmentPath,
183 const DiagramColorsPtr pDataPtr )
184 throw( )
185 : FragmentHandler( rFilter, rFragmentPath )
186 , mpDataPtr( pDataPtr )
190 DiagramColorsFragmentHandler::~DiagramColorsFragmentHandler( ) throw ()
195 void SAL_CALL DiagramColorsFragmentHandler::endDocument()
196 throw (SAXException, RuntimeException)
202 Reference< XFastContextHandler > SAL_CALL
203 DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
204 const Reference< XFastAttributeList >& )
205 throw ( SAXException, RuntimeException)
207 Reference< XFastContextHandler > xRet;
209 switch( aElement )
211 case NMSP_DIAGRAM|XML_colorsDef:
212 // TODO
213 break;
214 default:
215 break;
218 if( !xRet.is() )
219 xRet = getFastContextHandler();
221 return xRet;