LibreOffice Module oox (master) 1
rulelistcontext.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#include "rulelistcontext.hxx"
22#include <oox/token/namespaces.hxx>
23#include <oox/token/tokens.hxx>
24
25namespace oox::drawingml
26{
27RuleListContext::RuleListContext(ContextHandler2Helper const& rParent, const LayoutAtomPtr& pNode)
28 : ContextHandler2(rParent)
29 , mpNode(pNode)
30{
31 assert(pNode);
32}
33
35
37 const AttributeList& rAttribs)
38{
39 switch (nElement)
40 {
41 case DGM_TOKEN(rule):
42 {
43 auto pNode = std::make_shared<RuleAtom>(mpNode->getLayoutNode());
45
46 Rule& rRule = pNode->getRule();
47 rRule.msForName = rAttribs.getStringDefaulted(XML_forName);
48 break;
49 }
50 default:
51 break;
52 }
53
54 return this;
55}
56}
57
58/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
static void connect(const LayoutAtomPtr &pParent, const LayoutAtomPtr &pChild)
RuleListContext(ContextHandler2Helper const &rParent, const LayoutAtomPtr &pNode)
oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
AlgAtomPtr mpNode
std::shared_ptr< LayoutAtom > LayoutAtomPtr
Rules allow you to specify what to do when constraints can't be fully satisfied.