Update ooo320-m1
[ooovba.git] / oox / source / xls / connectionsfragment.cxx
blobd034aa7d6b07b683f76d30b2aca21ad6da1f2956
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: connectionsfragment.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 "oox/xls/connectionsfragment.hxx"
32 #include "oox/helper/attributelist.hxx"
33 #include "oox/xls/webquerybuffer.hxx"
35 using ::rtl::OUString;
36 using ::oox::core::ContextHandlerRef;
38 namespace oox {
39 namespace xls {
41 OoxConnectionsFragment::OoxConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
42 OoxWorkbookFragmentBase( rHelper, rFragmentPath )
46 ContextHandlerRef OoxConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
48 switch( getCurrentElement() )
50 case XML_ROOT_CONTEXT:
51 if( nElement == XLS_TOKEN( connections ) ) return this;
52 break;
54 case XLS_TOKEN( connections ):
55 switch( nElement )
57 case XLS_TOKEN( connection ): importConnection( rAttribs ); return this;
59 break;
61 case XLS_TOKEN( connection ):
62 switch( nElement )
64 case XLS_TOKEN( webPr ): importWebPr( rAttribs ); return this;
66 break;
68 case XLS_TOKEN( webPr ):
69 switch( nElement )
71 case XLS_TOKEN( tables ): importTables( rAttribs ); return this;
73 break;
75 case XLS_TOKEN( tables ):
76 switch( nElement )
78 case XLS_TOKEN( s ): importS( rAttribs ); break;
79 case XLS_TOKEN( x ): importX( rAttribs ); break;
81 break;
83 return 0;
86 void OoxConnectionsFragment::importConnection( const AttributeList& rAttribs )
88 if ( rAttribs.getInteger( XML_type, 0 ) == Connection::CONNECTION_WEBQUERY )
90 getWebQueries().importConnection( rAttribs );
94 void OoxConnectionsFragment::importWebPr( const AttributeList& rAttribs )
96 getWebQueries().importWebPr( rAttribs );
99 void OoxConnectionsFragment::importTables( const AttributeList& /*rAttribs*/ )
101 // sal_Int32 nCount = rAttribs.getInteger( XML_count, 0 );
104 void OoxConnectionsFragment::importS( const AttributeList& /*rAttribs*/ )
106 // OUString aName = rAttribs.getString( XML_v );
109 void OoxConnectionsFragment::importX( const AttributeList& /*rAttribs*/ )
111 // sal_Int32 nSharedId = rAttribs.getInteger( XML_v, 0 );
114 } // namespace xls
115 } // namespace oox