Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / oox / source / drawingml / ThemeOverrideFragmentHandler.cxx
blob147f3861157e69dedcc5c1d15d07a4ad6ae27298
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/.
8 */
10 #include <drawingml/ThemeOverrideFragmentHandler.hxx>
11 #include <oox/drawingml/theme.hxx>
12 #include <oox/token/namespaces.hxx>
13 #include <oox/token/tokens.hxx>
14 #include <drawingml/themeelementscontext.hxx>
16 using namespace ::oox::core;
18 namespace oox {
19 namespace drawingml {
21 ThemeOverrideFragmentHandler::ThemeOverrideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, Theme& rTheme ) :
22 FragmentHandler2( rFilter, rFragmentPath ),
23 mrTheme( rTheme )
27 ThemeOverrideFragmentHandler::~ThemeOverrideFragmentHandler()
31 ContextHandlerRef ThemeOverrideFragmentHandler::onCreateContext( sal_Int32 nElement, const AttributeList& )
33 // CT_OfficeStyleSheet
34 switch( getCurrentElement() )
36 case XML_ROOT_CONTEXT:
37 switch( nElement )
39 case A_TOKEN( themeOverride ): // CT_BaseStylesOverride
40 return new ThemeElementsContext( *this, mrTheme );
42 break;
44 return nullptr;
47 } // namespace drawingml
48 } // namespace oox
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */