summaryrefslogtreecommitdiff
path: root/sc/inc/sheetdata.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/inc/sheetdata.hxx')
-rw-r--r--sc/inc/sheetdata.hxx185
1 files changed, 185 insertions, 0 deletions
diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx
new file mode 100644
index 000000000000..de67786ff9fe
--- /dev/null
+++ b/sc/inc/sheetdata.hxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * 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 <editeng/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;
+
+ bool mbInSupportedSave;
+
+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; }
+
+ bool IsInSupportedSave() const;
+ void SetInSupportedSave( bool bSet );
+};
+
+#endif
+
td>Noel Grandin Change-Id: I8981050aeadc1efe907e7e9a47d18dc3c72956c2 Reviewed-on: https://gerrit.libreoffice.org/61439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-05-24member can be a ref instead of a pointerCaolán McNamara Change-Id: Idb0c27933b42f3aef65f0bce098f9bd7a81dc034 2018-05-24ScTabViewShell is never optionalCaolán McNamara Change-Id: I9f42fd6179c0a64cc14a051ca7c9e2ed9300f5c8 2018-04-07SOSAW080: Added first bunch of basic changes to helpersArmin Le Grand SOSAW080: Make SdrModel& prerequisite to SdrObjects Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. SOSAW080: removed and replaced old SdrModel Removed and replaced GetModel()/SetModel() in all using classes (SdrObject, SdrPage, SdrView), added accessors to new referenced SdrModel, adapted all accessing places. Refactored/Extended ::Clone and ::operator== for these classes to allow cloning objects to a target SdrModel. Adapted places where this is done AFAP. Added quite some comments (tagged with 'TTTT') where possible further work is needed. Builds completely, thus checking in. This does not mean that this change is done yet. SOSAW080: Adapted SdrPage/SdrModel relationship Also needed to work on copy-construction of SdrPage and hierarchy, quite some stuff removed, no copy-constructor anymore, no MigrateItemPool stuff. Builds well, test stuck, will need some cleanup/finetunung SOSAW080: Smaller corrections/includes adapted SOSAW080: Smaller corrections/includes adapted SOSAW080: Debugging/Stabilizing/MakeUnitTestWork SOSAW080: Stabilized for UnitTests, cleanups SOSAW080: Adapted GetObjGraphic to just take a const SdrObject& SOSAW080: Removed ChangeModel from classes Classes SvxTextEditSource and SvxDrawPage (including TextEditSource stuff) do not need change of SdrModel anymore. SOSAW080: Adapted some comments to make more readable SOSAW080: Corrected constructor SOSAW080: getSdrModelFromUnoModel added override marks SOSAW080: Added missing includes SOSAW080: Corrected SdrPage constructor SOSAW080: Corrected some SdrObject::Clone scenarios Especially when cloning to another SdrModel and taking the sdr::properties into account. SOSAW080: Added include for Mac-Build SOSAW080: Added Scale to DefaultProperties If a SdrModel change happens in DefaultProperties copy constructor (used from Clone()), potentially a Scale for the SfxItems has to be done. SOSAW080: Added missing include for MacBuild SOSAW080: Corrected CppunitTest_sc_anchor_test An adaption of a SdrPathObj instantiation was missing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078 Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c Reviewed-on: https://gerrit.libreoffice.org/52526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> 2018-04-06Revert "SOSAW080: Added first bunch of basic changes to helpers"Armin Le Grand This reverts commit 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91. 2018-04-06SOSAW080: Added first bunch of basic changes to helpersArmin Le Grand SOSAW080: Make SdrModel& prerequisite to SdrObjects Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. SOSAW080: removed and replaced old SdrModel Removed and replaced GetModel()/SetModel() in all using classes (SdrObject, SdrPage, SdrView), added accessors to new referenced SdrModel, adapted all accessing places. Refactored/Extended ::Clone and ::operator== for these classes to allow cloning objects to a target SdrModel. Adapted places where this is done AFAP. Added quite some comments (tagged with 'TTTT') where possible further work is needed. Builds completely, thus checking in. This does not mean that this change is done yet. SOSAW080: Adapted SdrPage/SdrModel relationship Also needed to work on copy-construction of SdrPage and hierarchy, quite some stuff removed, no copy-constructor anymore, no MigrateItemPool stuff. Builds well, test stuck, will need some cleanup/finetunung SOSAW080: Smaller corrections/includes adapted SOSAW080: Smaller corrections/includes adapted SOSAW080: Debugging/Stabilizing/MakeUnitTestWork SOSAW080: Stabilized for UnitTests, cleanups SOSAW080: Adapted GetObjGraphic to just take a const SdrObject& SOSAW080: Removed ChangeModel from classes Classes SvxTextEditSource and SvxDrawPage (including TextEditSource stuff) do not need change of SdrModel anymore. SOSAW080: Adapted some comments to make more readable SOSAW080: Corrected constructor SOSAW080: getSdrModelFromUnoModel added override marks SOSAW080: Added missing includes SOSAW080: Corrected SdrPage constructor SOSAW080: Corrected some SdrObject::Clone scenarios Especially when cloning to another SdrModel and taking the sdr::properties into account. SOSAW080: Added include for Mac-Build SOSAW080: Added Scale to DefaultProperties If a SdrModel change happens in DefaultProperties copy constructor (used from Clone()), potentially a Scale for the SfxItems has to be done. SOSAW080: Added missing include for MacBuild SOSAW080: Corrected CppunitTest_sc_anchor_test An adaption of a SdrPathObj instantiation was missing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078 2017-10-23loplugin:includeform: scStephan Bergmann Change-Id: I2ed763e0584a188032c80fde60890de3c6985cbd 2017-08-25loplugin:constparam in sc part6Noel Grandin Change-Id: Ifbb921b820b7210e7f9539e45d4852764a1e9cbd Reviewed-on: https://gerrit.libreoffice.org/41563 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-05-19Removed unneccessary ASCII-Art and commentsThomas Beck Change-Id: I455d7aa7c6e6313a0d24137e02b7bf04ede9aae9 Reviewed-on: https://gerrit.libreoffice.org/37752 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> 2017-05-15tdf#39468 translate German commentsThomas Beck Translated comments in sc/source/ui/drawfunc/. There were still some left that bin/find-german-comments did not find. Removed unneccessary comments. Change-Id: I61c1cadea259bb2a4b14721a25da85e9a9c0753e Reviewed-on: https://gerrit.libreoffice.org/37530 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> 2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> 2016-08-19convert SdrCreateCmd to scoped enumNoel Grandin Change-Id: I8772032dee25c790314384750b8c7277c4879318 2016-07-15new loplugin unnecessary overrideNoel Grandin Change-Id: I88d3e33823d68745b98625050a8a274f9ef04bcb Reviewed-on: https://gerrit.libreoffice.org/27135 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> 2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94