android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / filter / xml / xmltext.cxx
blob115dc1a5236d5acc7e60b2c3e1feb0902b393978
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 "xmlimp.hxx"
22 using namespace ::com::sun::star;
23 using namespace ::com::sun::star::uno;
24 using namespace ::com::sun::star::text;
26 namespace {
28 class SwXMLBodyContentContext_Impl : public SvXMLImportContext
30 SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); }
32 public:
34 SwXMLBodyContentContext_Impl( SwXMLImport& rImport );
36 css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
37 sal_Int32 nElement,
38 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
40 // The body element's text:global attribute can be ignored, because
41 // we must have the correct object shell already.
42 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
47 SwXMLBodyContentContext_Impl::SwXMLBodyContentContext_Impl( SwXMLImport& rImport ) :
48 SvXMLImportContext( rImport )
52 css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLBodyContentContext_Impl::createFastChildContext(
53 sal_Int32 nElement,
54 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
56 return GetSwImport().GetTextImport()->CreateTextChildContext(
57 GetImport(), nElement, xAttrList,
58 XMLTextType::Body );
61 void SwXMLBodyContentContext_Impl::endFastElement(sal_Int32 )
63 /* Code moved to SwXMLOmport::endDocument */
64 GetImport().GetTextImport()->SetOutlineStyles( false );
67 SvXMLImportContext *SwXMLImport::CreateBodyContentContext()
69 SvXMLImportContext *pContext = nullptr;
71 if( !IsStylesOnlyMode() )
72 pContext = new SwXMLBodyContentContext_Impl( *this );
74 return pContext;
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */