cid#1607171 Data race condition
[LibreOffice.git] / sc / source / filter / xml / XMLDDELinksContext.hxx
bloba599786203c27a144e9565b8519deaa31ace9190
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 #pragma once
22 #include "importcontext.hxx"
23 #include <vector>
25 namespace sax_fastparser { class FastAttributeList; }
27 class ScXMLDDELinksContext : public ScXMLImportContext
29 public:
30 ScXMLDDELinksContext( ScXMLImport& rImport);
32 virtual ~ScXMLDDELinksContext() override;
34 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
35 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
38 struct ScDDELinkCell
40 OUString sValue;
41 double fValue;
42 bool bString;
43 bool bEmpty;
46 typedef std::vector<ScDDELinkCell> ScDDELinkCells;
48 class ScXMLDDELinkContext : public ScXMLImportContext
50 ScDDELinkCells aDDELinkTable;
51 ScDDELinkCells aDDELinkRow;
52 OUString sApplication;
53 OUString sTopic;
54 OUString sItem;
55 sal_Int32 nPosition;
56 sal_Int32 nColumns;
57 sal_Int32 nRows;
58 sal_uInt8 nMode;
60 public:
61 ScXMLDDELinkContext( ScXMLImport& rImport);
63 virtual ~ScXMLDDELinkContext() override;
65 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
66 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
68 void SetApplication(const OUString& sValue) { sApplication = sValue; }
69 void SetTopic(const OUString& sValue) { sTopic = sValue; }
70 void SetItem(const OUString& sValue) { sItem = sValue; }
71 void SetMode(const sal_uInt8 nValue) { nMode = nValue; }
72 void CreateDDELink();
73 void AddColumns(const sal_Int32 nValue) { nColumns += nValue; }
74 void AddRows(const sal_Int32 nValue) { nRows += nValue; }
75 void AddCellToRow(const ScDDELinkCell& aCell);
76 void AddRowsToTable(const sal_Int32 nRows);
78 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
81 class ScXMLDDESourceContext : public ScXMLImportContext
83 ScXMLDDELinkContext* pDDELink;
85 public:
86 ScXMLDDESourceContext( ScXMLImport& rImport,
87 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
88 ScXMLDDELinkContext* pDDELink);
90 virtual ~ScXMLDDESourceContext() override;
92 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
95 class ScXMLDDETableContext : public ScXMLImportContext
97 ScXMLDDELinkContext* pDDELink;
99 public:
100 ScXMLDDETableContext( ScXMLImport& rImport,
101 ScXMLDDELinkContext* pDDELink);
103 virtual ~ScXMLDDETableContext() override;
105 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
106 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
109 class ScXMLDDEColumnContext : public ScXMLImportContext
111 public:
112 ScXMLDDEColumnContext( ScXMLImport& rImport,
113 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
114 ScXMLDDELinkContext* pDDELink);
116 virtual ~ScXMLDDEColumnContext() override;
119 class ScXMLDDERowContext : public ScXMLImportContext
121 ScXMLDDELinkContext* pDDELink;
122 sal_Int32 nRows;
124 public:
125 ScXMLDDERowContext( ScXMLImport& rImport,
126 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
127 ScXMLDDELinkContext* pDDELink);
129 virtual ~ScXMLDDERowContext() override;
131 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
132 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
134 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
137 class ScXMLDDECellContext : public ScXMLImportContext
139 OUString sValue;
140 double fValue;
141 sal_Int32 nCells;
142 bool bString;
143 bool bString2;
144 bool bEmpty;
146 ScXMLDDELinkContext* pDDELink;
148 public:
149 ScXMLDDECellContext( ScXMLImport& rImport,
150 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
151 ScXMLDDELinkContext* pDDELink);
153 virtual ~ScXMLDDECellContext() override;
155 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */