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
;
48 ScXMLTabProtectionData();
56 ScMyOLEFixer aFixupOLEs
;
58 css::uno::Reference
< css::sheet::XSpreadsheet
> xCurrentSheet
;
59 css::uno::Reference
< css::drawing::XDrawPage
> xDrawPage
;
60 css::uno::Reference
< css::drawing::XShapes
> xShapes
;
61 OUString sCurrentSheetName
;
62 ScAddress maCurrentCellPos
;
63 ScRangeList maMatrixRangeList
;
64 ScXMLTabProtectionData maProtectionData
;
65 sal_Int32 nCurrentColCount
;
66 sal_Int16 nCurrentDrawPage
;
67 sal_Int16 nCurrentXShapes
;
69 void SetTableStyle(const OUString
& sStyleName
);
71 explicit ScMyTables(ScXMLImport
& rImport
);
73 void NewSheet(const OUString
& sTableName
, const OUString
& sStyleName
,
74 const ScXMLTabProtectionData
& rProtectData
);
76 void SetRowStyle(const OUString
& rCellStyleName
);
77 void AddColumn(bool bIsCovered
);
78 void AddColumns(sal_Int32 nRepeat
);
79 void FixupOLEs() { aFixupOLEs
.FixupOLEs(); }
80 static bool IsOLE(const css::uno::Reference
< css::drawing::XShape
>& rShape
)
81 { return ScMyOLEFixer::IsOLE(rShape
); }
83 const ScAddress
& GetCurrentCellPos() const { return maCurrentCellPos
; };
84 void AddColStyle(const sal_Int32 nRepeat
, const OUString
& rCellStyleName
);
85 ScXMLTabProtectionData
& GetCurrentProtectionData() { return maProtectionData
; }
86 const OUString
& GetCurrentSheetName() const { return sCurrentSheetName
; }
87 SCTAB
GetCurrentSheet() const { return (maCurrentCellPos
.Tab() >= 0) ? maCurrentCellPos
.Tab() : 0; }
88 SCCOL
GetCurrentColCount() const;
89 SCROW
GetCurrentRow() const { return (maCurrentCellPos
.Row() >= 0) ? maCurrentCellPos
.Row() : 0; }
90 const css::uno::Reference
< css::sheet::XSpreadsheet
>&
91 GetCurrentXSheet() const { return xCurrentSheet
; }
92 css::uno::Reference
< css::drawing::XDrawPage
> const &
93 GetCurrentXDrawPage();
94 css::uno::Reference
< css::drawing::XShapes
> const &
96 bool HasDrawPage() const;
97 bool HasXShapes() const;
98 void AddOLE(const css::uno::Reference
<css::drawing::XShape
>& rShape
,
99 const OUString
&rRangeList
);
101 void AddMatrixRange( const SCCOL nStartColumn
,
102 const SCROW nStartRow
,
103 const SCCOL nEndColumn
,
105 const OUString
& rFormula
,
106 const OUString
& rFormulaNmsp
,
107 const formula::FormulaGrammar::Grammar
);
108 bool IsPartOfMatrix( const ScAddress
& rScAddress
) const;
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */