merge the formfield patch from ooo-build
[ooovba.git] / oox / source / xls / tablefragment.cxx
blob8e8cca20b53444f7353cbecace71f44381aeda49
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: tablefragment.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/tablefragment.hxx"
33 using ::rtl::OUString;
34 using ::oox::core::ContextHandlerRef;
35 using ::oox::core::RecordInfo;
37 namespace oox {
38 namespace xls {
40 // ============================================================================
42 OoxTableFragment::OoxTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
43 OoxWorksheetFragmentBase( rHelper, rFragmentPath )
47 // oox.core.ContextHandler2Helper interface -----------------------------------
49 ContextHandlerRef OoxTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
51 switch( getCurrentElement() )
53 case XML_ROOT_CONTEXT:
54 if( nElement == XLS_TOKEN( table ) )
55 mxTable = getTables().importTable( rAttribs, getSheetIndex() );
56 break;
58 return 0;
61 ContextHandlerRef OoxTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
63 switch( getCurrentElement() )
65 case XML_ROOT_CONTEXT:
66 if( nRecId == OOBIN_ID_TABLE )
67 mxTable = getTables().importTable( rStrm, getSheetIndex() );
68 break;
70 return 0;
73 // oox.core.FragmentHandler2 interface ----------------------------------------
75 const RecordInfo* OoxTableFragment::getRecordInfos() const
77 static const RecordInfo spRecInfos[] =
79 { OOBIN_ID_TABLE, OOBIN_ID_TABLE + 1 },
80 { -1, -1 }
82 return spRecInfos;
85 // ============================================================================
87 } // namespace xls
88 } // namespace oox