LibreOffice Module oox (master) 1
tablestyletextstylecontext.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
20
24#include <oox/token/namespaces.hxx>
25#include <oox/token/tokens.hxx>
26
27using namespace ::oox::core;
28using namespace ::com::sun::star;
29using namespace ::com::sun::star::uno;
30using namespace ::com::sun::star::xml::sax;
31
32namespace oox::drawingml::table {
33
35 const AttributeList& rAttribs, TableStylePart& rTableStylePart )
36: ContextHandler2( rParent )
37, mrTableStylePart( rTableStylePart )
38{
39 if( rAttribs.hasAttribute( XML_b ) ) {
40 sal_Int32 nB = rAttribs.getToken( XML_b, XML_def );
41 if ( nB == XML_on )
43 else if ( nB == XML_off )
45 }
46
47 if( rAttribs.hasAttribute( XML_i ) ) {
48 sal_Int32 nI = rAttribs.getToken( XML_i, XML_def );
49 if ( nI == XML_on )
51 else if ( nI == XML_off )
53 }
54}
55
57{
58}
59
60// CT_TableStyleTextStyle
62TableStyleTextStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs )
63{
64 switch( aElementToken )
65 {
66 // EG_ThemeableFontStyles (choice)
67 case A_TOKEN( font ): // CT_FontCollection
68 return this;
69 case A_TOKEN( ea ): // CT_TextFont
71 return nullptr;
72 case A_TOKEN( cs ): // CT_TextFont
74 return nullptr;
75 case A_TOKEN( sym ): // CT_TextFont
77 return nullptr;
78 case A_TOKEN( latin ): // CT_TextFont
80 return nullptr;
81
82 case A_TOKEN( fontRef ): // CT_FontReference
83 {
84 ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ];
85 rFontStyle.mnThemedIdx = rAttribs.getToken( XML_idx, XML_none );
86 return new ColorContext( *this, rFontStyle.maPhClr );
87 }
88
89 case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
90 break;
91 }
92
93 return new ColorValueContext( *this, mrTableStylePart.getTextColor() );
94}
95
96}
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to attribute values of an element.
bool hasAttribute(sal_Int32 nAttrToken) const
Returns true, if the specified attribute is present.
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
Helper class that provides a context stack.
Context handler for elements that contain a color value element (a:scrgbClr, a:srgbClr,...
Context handler for the different color value elements (a:scrgbClr, a:srgbClr, a:hslClr,...
void setAttributes(const AttributeList &rAttribs)
Sets attributes from the passed attribute list.
Definition: textfont.cxx:56
::oox::drawingml::TextFont & getSymbolFont()
::oox::drawingml::ShapeStyleRefMap & getStyleRefs()
::oox::drawingml::TextFont & getComplexFont()
::std::optional< bool > & getTextBoldStyle()
::oox::drawingml::TextFont & getLatinFont()
::std::optional< bool > & getTextItalicStyle()
::oox::drawingml::Color & getTextColor()
::oox::drawingml::TextFont & getAsianFont()
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
TableStyleTextStyleContext(::oox::core::ContextHandler2Helper const &rParent, const ::oox::AttributeList &rAttribs, TableStylePart &rTableStylePart)
XML_none