Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / oox / tablecolumnscontext.cxx
blobce1c3f38b5b5a5f3929fbc7a5b76d64af8081c03
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 namespace oox {
26 namespace xls {
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 */
39 return nullptr;
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 */
50 return nullptr;
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() );
68 return nullptr;
71 void TableColumnsContext::onStartElement( const AttributeList& rAttribs )
73 mrTableColumns.importTableColumns( rAttribs );
76 ContextHandlerRef TableColumnsContext::onCreateRecordContext( sal_Int32 /*nRecId*/, SequenceInputStream& /*rStrm*/ )
78 /* XXX not implemented */
79 #if 0
80 if( (getCurrentElement() == BIFF12_ID_TABLECOLUMNS) && (nRecId == BIFF12_ID_TABLECOLUMN) )
81 return new TableColumnContext( *this, mrTableColumns.createTableColumn() );
82 #endif
83 return nullptr;
86 void TableColumnsContext::onStartRecord( SequenceInputStream& rStrm )
88 mrTableColumns.importTableColumns( rStrm );
91 } // namespace xls
92 } // namespace oox
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */