1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <tablecolumnscontext.hxx>
22 #include <tablecolumnsbuffer.hxx>
23 #include <oox/token/namespaces.hxx>
27 using ::oox::core::ContextHandlerRef
;
29 TableColumnContext::TableColumnContext( WorksheetContextBase
& rParent
, TableColumn
& rTableColumn
) :
30 WorksheetContextBase( rParent
),
31 mrTableColumn( rTableColumn
)
35 ContextHandlerRef
TableColumnContext::onCreateContext( sal_Int32
/*nElement*/, const AttributeList
& /*rAttribs*/ )
37 /* no known child elements */
41 void TableColumnContext::onStartElement( const AttributeList
& rAttribs
)
43 mrTableColumn
.importTableColumn( rAttribs
);
46 ContextHandlerRef
TableColumnContext::onCreateRecordContext( sal_Int32
/*nRecId*/, SequenceInputStream
& /*rStrm*/ )
48 /* no known child elements */
52 void TableColumnContext::onStartRecord( SequenceInputStream
& rStrm
)
54 mrTableColumn
.importTableColumn( rStrm
);
57 TableColumnsContext::TableColumnsContext( WorksheetFragmentBase
& rFragment
, TableColumns
& rTableColumns
) :
58 WorksheetContextBase( rFragment
),
59 mrTableColumns( rTableColumns
)
63 ContextHandlerRef
TableColumnsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& /*rAttribs*/ )
65 if( (getCurrentElement() == XLS_TOKEN( tableColumns
)) && (nElement
== XLS_TOKEN( tableColumn
)) )
66 return new TableColumnContext( *this, mrTableColumns
.createTableColumn() );
70 void TableColumnsContext::onStartElement( const AttributeList
& rAttribs
)
72 mrTableColumns
.importTableColumns( rAttribs
);
75 ContextHandlerRef
TableColumnsContext::onCreateRecordContext( sal_Int32
/*nRecId*/, SequenceInputStream
& /*rStrm*/ )
77 /* XXX not implemented */
79 if( (getCurrentElement() == BIFF12_ID_TABLECOLUMNS
) && (nRecId
== BIFF12_ID_TABLECOLUMN
) )
80 return new TableColumnContext( *this, mrTableColumns
.createTableColumn() );
85 void TableColumnsContext::onStartRecord( SequenceInputStream
& rStrm
)
87 mrTableColumns
.importTableColumns( rStrm
);
90 } // namespace oox::xls
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */