1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include "XMLTableShapeResizer.hxx"
22 #include <formula/grammar.hxx>
23 #include <tabprotection.hxx>
24 #include <rangelst.hxx>
26 namespace com::sun::star::drawing
{ class XDrawPage
; }
27 namespace com::sun::star::sheet
{ class XSpreadsheet
; }
28 namespace com::sun::star::table
{ class XCellRange
; }
29 namespace com::sun::star::drawing
{ class XShapes
; }
33 struct ScXMLTabProtectionData
36 ScPasswordHash meHash1
;
37 ScPasswordHash meHash2
;
39 bool mbSelectProtectedCells
;
40 bool mbSelectUnprotectedCells
;
46 ScXMLTabProtectionData();
54 ScMyOLEFixer aFixupOLEs
;
56 css::uno::Reference
< css::sheet::XSpreadsheet
> xCurrentSheet
;
57 css::uno::Reference
< css::drawing::XDrawPage
> xDrawPage
;
58 css::uno::Reference
< css::drawing::XShapes
> xShapes
;
59 OUString sCurrentSheetName
;
60 ScAddress maCurrentCellPos
;
61 ScRangeList maMatrixRangeList
;
62 ScXMLTabProtectionData maProtectionData
;
63 sal_Int32 nCurrentColCount
;
64 sal_Int16 nCurrentDrawPage
;
65 sal_Int16 nCurrentXShapes
;
67 void SetTableStyle(const OUString
& sStyleName
);
69 explicit ScMyTables(ScXMLImport
& rImport
);
71 void NewSheet(const OUString
& sTableName
, const OUString
& sStyleName
,
72 const ScXMLTabProtectionData
& rProtectData
);
74 void SetRowStyle(const OUString
& rCellStyleName
);
75 void AddColumn(bool bIsCovered
);
76 void FixupOLEs() { aFixupOLEs
.FixupOLEs(); }
77 static bool IsOLE(const css::uno::Reference
< css::drawing::XShape
>& rShape
)
78 { return ScMyOLEFixer::IsOLE(rShape
); }
80 const ScAddress
& GetCurrentCellPos() const { return maCurrentCellPos
; };
81 void AddColStyle(const sal_Int32 nRepeat
, const OUString
& rCellStyleName
);
82 ScXMLTabProtectionData
& GetCurrentProtectionData() { return maProtectionData
; }
83 const OUString
& GetCurrentSheetName() const { return sCurrentSheetName
; }
84 SCTAB
GetCurrentSheet() const { return (maCurrentCellPos
.Tab() >= 0) ? maCurrentCellPos
.Tab() : 0; }
85 SCCOL
GetCurrentColCount() const;
86 SCROW
GetCurrentRow() const { return (maCurrentCellPos
.Row() >= 0) ? maCurrentCellPos
.Row() : 0; }
87 const css::uno::Reference
< css::sheet::XSpreadsheet
>&
88 GetCurrentXSheet() const { return xCurrentSheet
; }
89 css::uno::Reference
< css::drawing::XDrawPage
> const &
90 GetCurrentXDrawPage();
91 css::uno::Reference
< css::drawing::XShapes
> const &
93 bool HasDrawPage() const;
94 bool HasXShapes() const;
95 void AddOLE(const css::uno::Reference
<css::drawing::XShape
>& rShape
,
96 const OUString
&rRangeList
);
98 void AddMatrixRange( const SCCOL nStartColumn
,
99 const SCROW nStartRow
,
100 const SCCOL nEndColumn
,
102 const OUString
& rFormula
,
103 const OUString
& rFormulaNmsp
,
104 const formula::FormulaGrammar::Grammar
);
105 bool IsPartOfMatrix( const ScAddress
& rScAddress
) const;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */