diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-09-07 15:38:19 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-09-07 15:38:19 +0000 |
commit | fbeb3ce4a4fc1cf2a4a171709cfeb677971cf577 (patch) | |
tree | 0954231fafce7d5addb67820f28cbec4280820ee /sc/inc/sheetdata.hxx | |
parent | 712e83090c793bd4a29ca77022e52d7fd82b70f7 (diff) |
CWS-TOOLING: integrate CWS calcsheetdata
2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results
2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54)
2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up
2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid
2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid
2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling
2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed
2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed
2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator
2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes
2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells
2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes
2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict
2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53)
2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles
2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles
2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles
2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets
2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets
2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer
2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle
2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets
2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets
2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading
2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
Diffstat (limited to 'sc/inc/sheetdata.hxx')
-rw-r--r-- | sc/inc/sheetdata.hxx | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx new file mode 100644 index 000000000000..63853f6bc675 --- /dev/null +++ b/sc/inc/sheetdata.hxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sheetdata.hxx,v $ + * $Revision: 1.16.32.2 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHEETDATA_HXX +#define SC_SHEETDATA_HXX + +#include <xmloff/maptype.hxx> +#include <svx/editdata.hxx> +#include <vector> +#include <hash_set> + +#include "address.hxx" + +class ScAddress; +class SvXMLNamespaceMap; + + +struct ScStreamEntry +{ + sal_Int32 mnStartOffset; + sal_Int32 mnEndOffset; + + ScStreamEntry() : + mnStartOffset(-1), + mnEndOffset(-1) + { + } + + ScStreamEntry( sal_Int32 nStart, sal_Int32 nEnd ) : + mnStartOffset(nStart), + mnEndOffset(nEnd) + { + } +}; + +struct ScCellStyleEntry +{ + rtl::OUString maName; + ScAddress maCellPos; + + ScCellStyleEntry( const rtl::OUString& rName, const ScAddress& rPos ) : + maName(rName), + maCellPos(rPos) + { + } +}; + +struct ScNoteStyleEntry +{ + rtl::OUString maStyleName; + rtl::OUString maTextStyle; + ScAddress maCellPos; + + ScNoteStyleEntry( const rtl::OUString& rStyle, const rtl::OUString& rText, const ScAddress& rPos ) : + maStyleName(rStyle), + maTextStyle(rText), + maCellPos(rPos) + { + } +}; + +struct ScTextStyleEntry +{ + rtl::OUString maName; + ScAddress maCellPos; + ESelection maSelection; + + ScTextStyleEntry( const rtl::OUString& rName, const ScAddress& rPos, const ESelection& rSel ) : + maName(rName), + maCellPos(rPos), + maSelection(rSel) + { + } +}; + +struct ScLoadedNamespaceEntry +{ + rtl::OUString maPrefix; + rtl::OUString maName; + sal_uInt16 mnKey; + + ScLoadedNamespaceEntry( const rtl::OUString& rPrefix, const rtl::OUString& rName, sal_uInt16 nKey ) : + maPrefix(rPrefix), + maName(rName), + mnKey(nKey) + { + } +}; + +class ScSheetSaveData +{ + std::hash_set<rtl::OUString, rtl::OUStringHash> maInitialPrefixes; + std::vector<ScLoadedNamespaceEntry> maLoadedNamespaces; + + std::vector<ScCellStyleEntry> maCellStyles; + std::vector<ScCellStyleEntry> maColumnStyles; + std::vector<ScCellStyleEntry> maRowStyles; + std::vector<ScCellStyleEntry> maTableStyles; + std::vector<ScNoteStyleEntry> maNoteStyles; + std::vector<ScTextStyleEntry> maNoteParaStyles; + std::vector<ScTextStyleEntry> maNoteTextStyles; + std::vector<ScTextStyleEntry> maTextStyles; + std::vector<bool> maBlocked; + std::vector<ScStreamEntry> maStreamEntries; + std::vector<ScStreamEntry> maSaveEntries; + sal_Int32 mnStartTab; + sal_Int32 mnStartOffset; + + ScNoteStyleEntry maPreviousNote; + +public: + ScSheetSaveData(); + ~ScSheetSaveData(); + + void AddCellStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddColumnStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddRowStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + void AddTableStyle( const rtl::OUString& rName, const ScAddress& rCellPos ); + + void HandleNoteStyles( const rtl::OUString& rStyleName, const rtl::OUString& rTextName, const ScAddress& rCellPos ); + void AddNoteContentStyle( sal_uInt16 nFamily, const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); + + void AddTextStyle( const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ); + + void BlockSheet( sal_Int32 nTab ); + bool IsSheetBlocked( sal_Int32 nTab ) const; + + void AddStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ); + void GetStreamPos( sal_Int32 nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const; + bool HasStreamPos( sal_Int32 nTab ) const; + + void StartStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset ); + void EndStreamPos( sal_Int32 nEndOffset ); + + bool HasStartPos() const { return mnStartTab >= 0; } + + void ResetSaveEntries(); + void AddSavePos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ); + void UseSaveEntries(); + + void StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces ); + void StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespaces ); + bool AddLoadedNamespaces( SvXMLNamespaceMap& rNamespaces ) const; + + const std::vector<ScCellStyleEntry>& GetCellStyles() const { return maCellStyles; } + const std::vector<ScCellStyleEntry>& GetColumnStyles() const { return maColumnStyles; } + const std::vector<ScCellStyleEntry>& GetRowStyles() const { return maRowStyles; } + const std::vector<ScCellStyleEntry>& GetTableStyles() const { return maTableStyles; } + const std::vector<ScNoteStyleEntry>& GetNoteStyles() const { return maNoteStyles; } + const std::vector<ScTextStyleEntry>& GetNoteParaStyles() const { return maNoteParaStyles; } + const std::vector<ScTextStyleEntry>& GetNoteTextStyles() const { return maNoteTextStyles; } + const std::vector<ScTextStyleEntry>& GetTextStyles() const { return maTextStyles; } +}; + +#endif + |