Avoid potential negative array index access to cached text.
[LibreOffice.git] / include / xmloff / XMLComplexColorContext.hxx
blob5654cc204206105bd3ea49399bafd7ac83933823
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 #pragma once
12 #include <xmloff/dllapi.h>
14 #include <memory>
15 #include <xmloff/XMLElementPropertyContext.hxx>
16 #include <xmloff/xmlictxt.hxx>
17 #include <docmodel/color/ComplexColor.hxx>
19 class XMLOFF_DLLPUBLIC XMLComplexColorImport
21 private:
22 model::ComplexColor& mrComplexColor;
24 public:
25 XMLComplexColorImport(model::ComplexColor& rComplexColor);
26 void fillAttributes(const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList);
27 bool
28 handleTransformContext(sal_Int32 nElement,
29 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList);
32 class XMLOFF_DLLPUBLIC XMLPropertyComplexColorContext final : public XMLElementPropertyContext
34 private:
35 model::ComplexColor maComplexColor;
36 sal_Int32 mnRootElement;
38 XMLComplexColorImport maComplexColorImport;
40 public:
41 XMLPropertyComplexColorContext(
42 SvXMLImport& rImport, sal_Int32 nElement,
43 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList,
44 const XMLPropertyState& rProp, std::vector<XMLPropertyState>& rProps);
46 css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(
47 sal_Int32 nElement,
48 const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override;
50 void SAL_CALL endFastElement(sal_Int32 nElement) override;
52 model::ComplexColor getComplexColor() { return maComplexColor; }
55 class XMLOFF_DLLPUBLIC XMLComplexColorContext final : public SvXMLImportContext
57 private:
58 XMLComplexColorImport maComplexColorImport;
60 public:
61 XMLComplexColorContext(SvXMLImport& rImport, model::ComplexColor& rComplexColor,
62 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList);
64 css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(
65 sal_Int32 nElement,
66 const css::uno::Reference<css::xml::sax::XFastAttributeList>& AttrList) override;
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */