LibreOffice Module dbaccess (master) 1
xmlTableFilterList.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
22#include "xmlEnums.hxx"
23#include <xmloff/xmltoken.hxx>
26#include <strings.hxx>
27#include <com/sun/star/beans/XPropertySet.hpp>
29#include <xmloff/xmlimp.hxx>
30#include "xmlfilter.hxx"
31
32namespace dbaxml
33{
34 using namespace ::xmloff::token;
35 using namespace ::com::sun::star::uno;
36 using namespace ::com::sun::star::beans;
37 using namespace ::com::sun::star::xml::sax;
38
40 :SvXMLImportContext( rImport )
41{
42
43}
44
46{
47}
48
49css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLTableFilterList::createFastChildContext(
50 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/ )
51{
52 SvXMLImportContext *pContext = nullptr;
53
54 if ( IsTokenInNamespace(nElement, XML_NAMESPACE_DB) ||
56 {
57 GetImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
58 switch (nElement & TOKEN_MASK)
59 {
61 pContext = new OXMLTableFilterPattern( GetImport(), true,*this);
62 break;
63 case XML_TABLE_TYPE:
64 pContext = new OXMLTableFilterPattern( GetImport(), false,*this);
65 break;
67 pContext = new OXMLTableFilterList( GetImport() );
68 break;
69 default: break;
70 }
71 }
72
73 return pContext;
74}
75
77{
78 return static_cast<ODBFilter&>(GetImport());
79}
80
82{
83 Reference<XPropertySet> xDataSource(GetOwnImport().getDataSource());
84 if ( xDataSource.is() )
85 {
86 if ( !m_aPatterns.empty() )
88 if ( !m_aTypes.empty() )
90 }
91}
92
93} // namespace dbaxml
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLImport & GetImport()
std::vector< OUString > m_aTypes
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
OXMLTableFilterList(SvXMLImport &rImport)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual ~OXMLTableFilterList() override
std::vector< OUString > m_aPatterns
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::uno::Reference< css::uno::XInterface > getDataSource(const css::uno::Reference< css::uno::XInterface > &_rxDependentObject)
XML_TABLE_TYPE
XML_TABLE_INCLUDE_FILTER
XML_TABLE_FILTER_PATTERN
constexpr OUStringLiteral PROPERTY_TABLEFILTER(u"TableFilter")
constexpr OUStringLiteral PROPERTY_TABLETYPEFILTER(u"TableTypeFilter")
#define PROGRESS_BAR_STEP
Definition: xmlEnums.hxx:21
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_DB
constexpr sal_uInt16 XML_NAMESPACE_DB_OASIS