Update ooo320-m1
[ooovba.git] / oox / source / drawingml / table / tablerowcontext.cxx
blob1d12f9c7a42b61d434b9555c132002b7a87f4a07
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: tablerowcontext.cxx,v $
10 * $Revision: 1.3 $
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/table/tablerowcontext.hxx"
34 #include "oox/drawingml/table/tablecellcontext.hxx"
35 #include "oox/drawingml/table/tablerow.hxx"
36 #include "oox/core/namespaces.hxx"
37 #include "tokens.hxx"
39 using namespace ::oox::core;
40 using namespace ::com::sun::star;
41 using ::rtl::OUString;
43 namespace oox { namespace drawingml { namespace table {
45 TableRowContext::TableRowContext( ContextHandler& rParent, const uno::Reference< xml::sax::XFastAttributeList >& xAttribs, TableRow& rTableRow )
46 : ContextHandler( rParent )
47 , mrTableRow( rTableRow )
49 rTableRow.setHeight( xAttribs->getOptionalValue( XML_h ).toInt32() );
52 TableRowContext::~TableRowContext()
56 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
57 TableRowContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Reference< xml::sax::XFastAttributeList >& xAttribs )
58 throw ( xml::sax::SAXException, uno::RuntimeException)
60 uno::Reference< xml::sax::XFastContextHandler > xRet;
62 switch( aElementToken )
64 case NMSP_DRAWINGML|XML_tc: // CT_TableCell
66 std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells();
67 rvTableCells.resize( rvTableCells.size() + 1 );
68 xRet.set( new TableCellContext( *this, xAttribs, rvTableCells.back() ) );
70 break;
71 case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
72 default:
73 break;
75 if( !xRet.is() )
77 uno::Reference< XFastContextHandler > xTmp( this );
78 xRet.set( xTmp );
80 return xRet;
83 } } }