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 .
22 #include <editeng/editdata.hxx>
24 #include <unordered_set>
28 #include "address.hxx"
30 class SvXMLNamespaceMap
;
31 enum class XmlStyleFamily
;
35 sal_Int64 mnStartOffset
;
36 sal_Int64 mnEndOffset
;
44 ScStreamEntry( sal_Int64 nStart
, sal_Int64 nEnd
) :
45 mnStartOffset(nStart
),
51 struct ScCellStyleEntry
56 ScCellStyleEntry( OUString aName
, const ScAddress
& rPos
) :
57 maName(std::move(aName
)),
63 struct ScNoteStyleEntry
69 ScNoteStyleEntry( OUString aStyle
, OUString aText
, const ScAddress
& rPos
) :
70 maStyleName(std::move(aStyle
)),
71 maTextStyle(std::move(aText
)),
77 struct ScTextStyleEntry
81 ESelection maSelection
;
83 ScTextStyleEntry( OUString aName
, const ScAddress
& rPos
, const ESelection
& rSel
) :
84 maName(std::move(aName
)),
91 struct ScLoadedNamespaceEntry
97 ScLoadedNamespaceEntry( OUString aPrefix
, OUString aName
, sal_uInt16 nKey
) :
98 maPrefix(std::move(aPrefix
)),
99 maName(std::move(aName
)),
105 class ScSheetSaveData
107 std::unordered_set
<OUString
> maInitialPrefixes
;
108 std::vector
<ScLoadedNamespaceEntry
> maLoadedNamespaces
;
110 std::vector
<ScCellStyleEntry
> maCellStyles
;
111 std::vector
<ScCellStyleEntry
> maColumnStyles
;
112 std::vector
<ScCellStyleEntry
> maRowStyles
;
113 std::vector
<ScCellStyleEntry
> maTableStyles
;
114 std::vector
<ScNoteStyleEntry
> maNoteStyles
;
115 std::vector
<ScTextStyleEntry
> maNoteParaStyles
;
116 std::vector
<ScTextStyleEntry
> maNoteTextStyles
;
117 std::vector
<ScTextStyleEntry
> maTextStyles
;
118 std::vector
<bool> maBlocked
;
119 std::vector
<ScStreamEntry
> maStreamEntries
;
120 std::vector
<ScStreamEntry
> maSaveEntries
;
122 sal_Int64 mnStartOffset
;
124 ScNoteStyleEntry maPreviousNote
;
126 bool mbInSupportedSave
;
132 void AddCellStyle( const OUString
& rName
, const ScAddress
& rCellPos
);
133 void AddColumnStyle( const OUString
& rName
, const ScAddress
& rCellPos
);
134 void AddRowStyle( const OUString
& rName
, const ScAddress
& rCellPos
);
135 void AddTableStyle( const OUString
& rName
, const ScAddress
& rCellPos
);
137 void HandleNoteStyles( const OUString
& rStyleName
, const OUString
& rTextName
, const ScAddress
& rCellPos
);
138 void AddNoteContentStyle( XmlStyleFamily nFamily
, const OUString
& rName
, const ScAddress
& rCellPos
, const ESelection
& rSelection
);
140 void AddTextStyle( const OUString
& rName
, const ScAddress
& rCellPos
, const ESelection
& rSelection
);
142 void BlockSheet( SCTAB nTab
);
143 bool IsSheetBlocked( SCTAB nTab
) const;
145 void AddStreamPos( SCTAB nTab
, sal_Int64 nStartOffset
, sal_Int64 nEndOffset
);
146 void GetStreamPos( SCTAB nTab
, sal_Int64
& rStartOffset
, sal_Int64
& rEndOffset
) const;
147 bool HasStreamPos( SCTAB nTab
) const;
149 void StartStreamPos( SCTAB nTab
, sal_Int64 nStartOffset
);
150 void EndStreamPos( sal_Int64 nEndOffset
);
152 bool HasStartPos() const { return mnStartTab
>= 0; }
154 void ResetSaveEntries();
155 void AddSavePos( SCTAB nTab
, sal_Int64 nStartOffset
, sal_Int64 nEndOffset
);
156 void UseSaveEntries();
158 void StoreInitialNamespaces( const SvXMLNamespaceMap
& rNamespaces
);
159 void StoreLoadedNamespaces( const SvXMLNamespaceMap
& rNamespaces
);
160 bool AddLoadedNamespaces( SvXMLNamespaceMap
& rNamespaces
) const;
162 const std::vector
<ScCellStyleEntry
>& GetCellStyles() const { return maCellStyles
; }
163 const std::vector
<ScCellStyleEntry
>& GetColumnStyles() const { return maColumnStyles
; }
164 const std::vector
<ScCellStyleEntry
>& GetRowStyles() const { return maRowStyles
; }
165 const std::vector
<ScCellStyleEntry
>& GetTableStyles() const { return maTableStyles
; }
166 const std::vector
<ScNoteStyleEntry
>& GetNoteStyles() const { return maNoteStyles
; }
167 const std::vector
<ScTextStyleEntry
>& GetNoteParaStyles() const { return maNoteParaStyles
; }
168 const std::vector
<ScTextStyleEntry
>& GetNoteTextStyles() const { return maNoteTextStyles
; }
169 const std::vector
<ScTextStyleEntry
>& GetTextStyles() const { return maTextStyles
; }
171 bool IsInSupportedSave() const { return mbInSupportedSave
;}
172 void SetInSupportedSave( bool bSet
);
175 struct ScFormatSaveData
177 std::map
<sal_uInt64
, OUString
> maIDToName
;
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */