LibreOffice Module oox (master)
1
oox
source
drawingml
diagram
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
"
21
#include <
oox/helper/attributelist.hxx
>
22
#include <oox/token/namespaces.hxx>
23
#include <oox/token/tokens.hxx>
24
25
namespace
oox::drawingml
26
{
27
RuleListContext::RuleListContext
(ContextHandler2Helper
const
& rParent,
const
LayoutAtomPtr
& pNode)
28
:
ContextHandler2
(rParent)
29
,
mpNode
(pNode)
30
{
31
assert(pNode);
32
}
33
34
RuleListContext::~RuleListContext
() =
default
;
35
36
core::ContextHandlerRef
RuleListContext::onCreateContext
(sal_Int32 nElement,
37
const
AttributeList
& rAttribs)
38
{
39
switch
(nElement)
40
{
41
case
DGM_TOKEN(rule):
42
{
43
auto
pNode = std::make_shared<RuleAtom>(
mpNode
->getLayoutNode());
44
LayoutAtom::connect
(
mpNode
, pNode);
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: */
attributelist.hxx
oox::AttributeList
Provides access to attribute values of an element.
Definition:
attributelist.hxx:83
oox::AttributeList::getStringDefaulted
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
Definition:
attributelist.cxx:181
oox::core::ContextHandler2
Definition:
contexthandler2.hxx:240
oox::drawingml::LayoutAtom::connect
static void connect(const LayoutAtomPtr &pParent, const LayoutAtomPtr &pChild)
Definition:
diagramlayoutatoms.hxx:127
oox::drawingml::RuleListContext::RuleListContext
RuleListContext(ContextHandler2Helper const &rParent, const LayoutAtomPtr &pNode)
Definition:
rulelistcontext.cxx:27
oox::drawingml::RuleListContext::onCreateContext
oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Definition:
rulelistcontext.cxx:36
oox::drawingml::RuleListContext::mpNode
LayoutAtomPtr mpNode
Definition:
rulelistcontext.hxx:38
oox::drawingml::RuleListContext::~RuleListContext
~RuleListContext() override
rtl::Reference
mpNode
AlgAtomPtr mpNode
Definition:
layoutnodecontext.cxx:95
oox::drawingml
oox::drawingml::LayoutAtomPtr
std::shared_ptr< LayoutAtom > LayoutAtomPtr
Definition:
oox/source/drawingml/diagram/diagram.hxx:41
rulelistcontext.hxx
oox::drawingml::Rule
Rules allow you to specify what to do when constraints can't be fully satisfied.
Definition:
diagramlayoutatoms.hxx:84
oox::drawingml::Rule::msForName
OUString msForName
Definition:
diagramlayoutatoms.hxx:85
Generated on Sun Jul 30 2023 04:44:09 for LibreOffice Module oox (master) by
1.9.3