Avoid potential negative array index access to cached text.
[LibreOffice.git] / writerfilter / source / rtftok / rtfreferenceproperties.cxx
blobd32557bc7d465c694a97b6cd0d5232af1693bc56
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/.
8 */
10 #include "rtfreferenceproperties.hxx"
12 namespace writerfilter::rtftok
14 RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes, RTFSprms aSprms)
15 : m_aAttributes(std::move(aAttributes))
16 , m_aSprms(std::move(aSprms))
20 RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes)
21 : m_aAttributes(std::move(aAttributes))
25 RTFReferenceProperties::~RTFReferenceProperties() = default;
27 void RTFReferenceProperties::resolve(Properties& rHandler)
29 for (auto& rAttribute : m_aAttributes)
30 rHandler.attribute(rAttribute.first, *rAttribute.second);
31 for (auto& rSprm : m_aSprms)
33 RTFSprm aSprm(rSprm.first, rSprm.second);
34 rHandler.sprm(aSprm);
38 } // namespace writerfilter::rtftok
40 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */