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 $
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
;
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;
54 case XLS_TOKEN( connections
):
57 case XLS_TOKEN( connection
): importConnection( rAttribs
); return this;
61 case XLS_TOKEN( connection
):
64 case XLS_TOKEN( webPr
): importWebPr( rAttribs
); return this;
68 case XLS_TOKEN( webPr
):
71 case XLS_TOKEN( tables
): importTables( rAttribs
); return this;
75 case XLS_TOKEN( tables
):
78 case XLS_TOKEN( s
): importS( rAttribs
); break;
79 case XLS_TOKEN( x
): importX( rAttribs
); break;
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 );