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 
27 using namespace ::oox::core;
28 using namespace ::com::sun::star;
29 using namespace ::com::sun::star::uno;
30 using namespace ::com::sun::star::xml::sax;
31 
32 namespace 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
62 TableStyleTextStyleContext::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: */
TableStyleTextStyleContext(::oox::core::ContextHandler2Helper const &rParent, const ::oox::AttributeList &rAttribs, TableStylePart &rTableStylePart)
::oox::drawingml::ShapeStyleRefMap & getStyleRefs()
::oox::drawingml::Color & getTextColor()
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
bool hasAttribute(sal_Int32 nAttrToken) const
Returns true, if the specified attribute is present.
Context handler for the different color value elements (a:scrgbClr, a:srgbClr, a:hslClr, a:sysClr, a:schemeClr, a:prstClr).
Context handler for elements that contain a color value element (a:scrgbClr, a:srgbClr, a:hslClr, a:sysClr, a:schemeClr, a:prstClr).
::std::optional< bool > & getTextBoldStyle()
void setAttributes(const AttributeList &rAttribs)
Sets attributes from the passed attribute list.
Definition: textfont.cxx:56
Provides access to attribute values of an element.
::std::optional< bool > & getTextItalicStyle()
::oox::drawingml::TextFont & getSymbolFont()
::oox::drawingml::TextFont & getComplexFont()
::oox::drawingml::TextFont & getAsianFont()
Helper class that provides a context stack.
OptValue< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
::oox::drawingml::TextFont & getLatinFont()