calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / svgio / source / svgreader / svgdocument.cxx
blob69066c96f8b5ac006dd18ca377b8d2e5be33aabf
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svgdocument.hxx>
21 #include <utility>
23 namespace svgio::svgreader
25 SvgDocument::SvgDocument(OUString aAbsolutePath)
26 : maAbsolutePath(std::move(aAbsolutePath))
30 SvgDocument::~SvgDocument()
34 void SvgDocument::appendNode(std::unique_ptr<SvgNode> pNode)
36 assert(pNode);
37 maNodes.push_back(std::move(pNode));
40 void SvgDocument::addSvgNodeToMapper(const OUString& rStr, const SvgNode& rNode)
42 if(!rStr.isEmpty())
44 maIdTokenMapperList.emplace(rStr, &rNode);
48 void SvgDocument::removeSvgNodeFromMapper(const OUString& rStr)
50 if(!rStr.isEmpty())
52 maIdTokenMapperList.erase(rStr);
56 const SvgNode* SvgDocument::findSvgNodeById(const OUString& rStr) const
58 const IdTokenMapper::const_iterator aResult(maIdTokenMapperList.find(rStr));
60 if(aResult == maIdTokenMapperList.end())
62 return nullptr;
64 else
66 return aResult->second;
70 void SvgDocument::addSvgStyleAttributesToMapper(const OUString& rStr, const SvgStyleAttributes& rSvgStyleAttributes)
72 if(!rStr.isEmpty())
74 maIdStyleTokenMapperList.emplace(rStr, &rSvgStyleAttributes);
78 const SvgStyleAttributes* SvgDocument::findGlobalCssStyleAttributes(const OUString& rStr) const
80 const IdStyleTokenMapper::const_iterator aResult(maIdStyleTokenMapperList.find(rStr));
82 if(aResult == maIdStyleTokenMapperList.end())
84 return nullptr;
86 else
88 return aResult->second;
92 } // end of namespace svgio::svgreader
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */