LibreOffice Module dbaccess (master) 1
xmlDatabaseDescription.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21#include "xmlfilter.hxx"
22#include <xmloff/xmltoken.hxx>
24#include "xmlEnums.hxx"
26#include "xmlServerDatabase.hxx"
27
28namespace dbaxml
29{
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::xml::sax;
32
34 SvXMLImportContext( rImport )
35 ,m_bFoundOne(false)
36{
37}
38
40{
41
42}
43
44css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLDatabaseDescription::createFastChildContext(
45 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
46{
47 SvXMLImportContext *pContext = nullptr;
48
49 switch( nElement & TOKEN_MASK )
50 {
52 if ( !m_bFoundOne )
53 {
54 m_bFoundOne = true;
55 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
56 pContext = new OXMLFileBasedDatabase( GetOwnImport(), xAttrList );
57 }
58 break;
60 if ( !m_bFoundOne )
61 {
62 m_bFoundOne = true;
63 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
64 pContext = new OXMLServerDatabase( GetOwnImport(), xAttrList );
65 }
66 break;
67 }
68
69 return pContext;
70}
71
73{
74 return static_cast<ODBFilter&>(GetImport());
75}
76
77} // namespace dbaxml
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLImport & GetImport()
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
XML_FILE_BASED_DATABASE
XML_SERVER_DATABASE
#define PROGRESS_BAR_STEP
Definition: xmlEnums.hxx:21
constexpr sal_Int32 TOKEN_MASK