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>
28 using ::oox::core::ContextHandlerRef
;
30 TableColumnContext::TableColumnContext( WorksheetContextBase
& rParent
, TableColumn
& rTableColumn
) :
31 WorksheetContextBase( rParent
),
32 mrTableColumn( rTableColumn
)
36 ContextHandlerRef
TableColumnContext::onCreateContext( sal_Int32
/*nElement*/, const AttributeList
& /*rAttribs*/ )
38 /* no known child elements */
42 void TableColumnContext::onStartElement( const AttributeList
& rAttribs
)
44 mrTableColumn
.importTableColumn( rAttribs
);
47 ContextHandlerRef
TableColumnContext::onCreateRecordContext( sal_Int32
/*nRecId*/, SequenceInputStream
& /*rStrm*/ )
49 /* no known child elements */
53 void TableColumnContext::onStartRecord( SequenceInputStream
& rStrm
)
55 mrTableColumn
.importTableColumn( rStrm
);
58 TableColumnsContext::TableColumnsContext( WorksheetFragmentBase
& rFragment
, TableColumns
& rTableColumns
) :
59 WorksheetContextBase( rFragment
),
60 mrTableColumns( rTableColumns
)
64 ContextHandlerRef
TableColumnsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& /*rAttribs*/ )
66 if( (getCurrentElement() == XLS_TOKEN( tableColumns
)) && (nElement
== XLS_TOKEN( tableColumn
)) )
67 return new TableColumnContext( *this, mrTableColumns
.createTableColumn() );
71 void TableColumnsContext::onStartElement( const AttributeList
& rAttribs
)
73 mrTableColumns
.importTableColumns( rAttribs
);
76 ContextHandlerRef
TableColumnsContext::onCreateRecordContext( sal_Int32
/*nRecId*/, SequenceInputStream
& /*rStrm*/ )
78 /* XXX not implemented */
80 if( (getCurrentElement() == BIFF12_ID_TABLECOLUMNS
) && (nRecId
== BIFF12_ID_TABLECOLUMN
) )
81 return new TableColumnContext( *this, mrTableColumns
.createTableColumn() );
86 void TableColumnsContext::onStartRecord( SequenceInputStream
& rStrm
)
88 mrTableColumns
.importTableColumns( rStrm
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */