[Libreoffice-commits] core.git: sc/inc sc/source
Varun Dhall
varun.dhall at studentpartner.com
Mon Aug 14 09:37:06 UTC 2017
sc/inc/docpool.hxx | 16 --
sc/source/core/data/docpool.cxx | 261 ----------------------------------------
sc/source/core/data/global.cxx | 2
sc/source/ui/app/scdll.cxx | 2
4 files changed, 281 deletions(-)
New commits:
commit 78b3e279ca3a3da1e7a49756bc1edee82fc943a0
Author: Varun Dhall <varun.dhall at studentpartner.com>
Date: Sun Aug 13 03:49:12 2017 +0530
Removing unused SetVersionMap from sc
Change-Id: I16e4a80b721e8f419352ed2d546bd3d7197ed4f7
Reviewed-on: https://gerrit.libreoffice.org/41101
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index bafb72403692..064481952fcc 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -30,19 +30,6 @@ class ScDocument;
class SC_DLLPUBLIC ScDocumentPool: public SfxItemPool
{
std::vector<SfxPoolItem*>* mpPoolDefaults;
- static sal_uInt16* pVersionMap1;
- static sal_uInt16* pVersionMap2;
- static sal_uInt16* pVersionMap3;
- static sal_uInt16* pVersionMap4;
- static sal_uInt16* pVersionMap5;
- static sal_uInt16* pVersionMap6;
- static sal_uInt16* pVersionMap7;
- static sal_uInt16* pVersionMap8;
- static sal_uInt16* pVersionMap9;
- static sal_uInt16* pVersionMap10;
- static sal_uInt16* pVersionMap11;
- static sal_uInt16* pVersionMap12;
-
sal_uInt64 mnCurrentMaxKey;
public:
@@ -62,9 +49,6 @@ public:
MapUnit ePresentationMetric,
OUString& rText,
const IntlWrapper& rIntl ) const override;
-
- static void InitVersionMaps();
- static void DeleteVersionMaps();
};
#endif
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index fa44eb812358..85b57a7d8088 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -74,19 +74,6 @@
#include "document.hxx"
#include "sc.hrc"
-sal_uInt16* ScDocumentPool::pVersionMap1 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap2 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap3 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap4 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap5 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap6 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap7 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap8 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap9 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap10 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap11 = nullptr;
-sal_uInt16* ScDocumentPool::pVersionMap12 = nullptr;
-
// ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c
static SfxItemInfo const aItemInfos[] =
@@ -195,11 +182,6 @@ ScDocumentPool::ScDocumentPool()
aItemInfos, nullptr, false/*bLoadRefCounts*/ ),
mnCurrentMaxKey(0)
{
- // this is a hack for unit tests that need to have a ScDocument
- // but don't want to depend on BootstrapFixture
- if (!pVersionMap1)
- InitVersionMaps();
-
// latin font from GetDefaultFonts is not used, DEFAULTFONT_LATIN_SPREADSHEET instead
vcl::Font aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US,
GetDefaultFontFlags::OnlyOne );
@@ -337,44 +319,6 @@ ScDocumentPool::ScDocumentPool()
rPoolDefaults[ ATTR_HIDDEN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HIDDEN, false );
SetDefaults( mpPoolDefaults );
-
- // ATTR_LANGUAGE_FORMAT from sv329 inserted, VersionMap in _ScGlobal__Init
- SetVersionMap( 1, 100, 157, pVersionMap1 );
-
- // ATTR_VALIDDATA, ATTR_CONDITIONAL from 341
- SetVersionMap( 2, 100, 158, pVersionMap2 );
-
- // ATTR_INDENT from 350
- SetVersionMap( 3, 100, 160, pVersionMap3 );
-
- // ATTR_ROTATE_VALUE, ATTR_ROTATE_MODE from 367
- SetVersionMap( 4, 100, 161, pVersionMap4 );
-
- // CJK, CTL, EMPHASISMARK, TWOLINES from 614
- SetVersionMap( 5, 100, 163, pVersionMap5 );
-
- // ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES from 614d
- SetVersionMap( 6, 100, 175, pVersionMap6 );
-
- // ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE from 632b
- SetVersionMap( 7, 100, 178, pVersionMap7 );
-
- // ATTR_VERTICAL_ASIAN from 642q
- SetVersionMap( 8, 100, 181, pVersionMap8 );
-
- // ATTR_WRITINGDIR from 643y
- SetVersionMap( 9, 100, 182, pVersionMap9 );
-
- // ATTR_PAGE_SCALETO added in 680/sab008
- // new version map not required
-
- // ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
- SetVersionMap( 10, 100, 184, pVersionMap10 );
-
- // ATTR_FONT_OVERLINE added in DEV300/overline2
- SetVersionMap( 11, 100, 187, pVersionMap11 );
- // ATTR_HYERLINK added
- SetVersionMap( 12, 100, 192, pVersionMap12 );
}
ScDocumentPool::~ScDocumentPool()
@@ -390,211 +334,6 @@ ScDocumentPool::~ScDocumentPool()
delete mpPoolDefaults;
}
-void ScDocumentPool::InitVersionMaps()
-{
- OSL_PRECOND( !pVersionMap1 && !pVersionMap2 &&
- !pVersionMap3 && !pVersionMap4 &&
- !pVersionMap5 && !pVersionMap6 &&
- !pVersionMap7 && !pVersionMap8 &&
- !pVersionMap9 && !pVersionMap10 &&
- !pVersionMap11 && !pVersionMap12 , "InitVersionMaps call multiple times" );
-
- // Map old WhichId's
- // Do not count with ATTR_*, if they change again
-
- // First Map: ATTR_LANGUAGE_FORMAT from sv329 inserted
-
- const sal_uInt16 nMap1Start = 100; // Old ATTR_STARTINDEX
- const sal_uInt16 nMap1End = 157; // Old ATTR_ENDINDEX
- const sal_uInt16 nMap1Count = nMap1End - nMap1Start + 1;
- const sal_uInt16 nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX
- pVersionMap1 = new sal_uInt16 [ nMap1Count ];
- sal_uInt16 i, j;
- for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ )
- pVersionMap1[i] = j;
- // An entry inserted ...
- for ( i=nMap1New, j=nMap1Start+nMap1New+1; i < nMap1Count; i++, j++ )
- pVersionMap1[i] = j;
-
- // Second Map: ATTR_VALIDDATA and ATTR_CONDITIONAL from 341 inserted
-
- const sal_uInt16 nMap2Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap2End = 158; // ATTR_ENDINDEX
- const sal_uInt16 nMap2Count = nMap2End - nMap2Start + 1;
- const sal_uInt16 nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX
- pVersionMap2 = new sal_uInt16 [ nMap2Count ];
- for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ )
- pVersionMap2[i] = j;
- // Two entries inserted ...
- for ( i=nMap2New, j=nMap2Start+nMap2New+2; i < nMap2Count; i++, j++ )
- pVersionMap2[i] = j;
-
- // Third Map: ATTR_INDENT from 350 inserted
-
- const sal_uInt16 nMap3Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap3End = 160; // ATTR_ENDINDEX
- const sal_uInt16 nMap3Count = nMap3End - nMap3Start + 1;
- const sal_uInt16 nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX
- pVersionMap3 = new sal_uInt16 [ nMap3Count ];
- for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ )
- pVersionMap3[i] = j;
- // An entry inserted...
- for ( i=nMap3New, j=nMap3Start+nMap3New+1; i < nMap3Count; i++, j++ )
- pVersionMap3[i] = j;
-
- // Fourth Map: ATTR_ROTATE_VALUE and ATTR_ROTATE_MODE from 367 inserted
-
- const sal_uInt16 nMap4Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap4End = 161; // ATTR_ENDINDEX
- const sal_uInt16 nMap4Count = nMap4End - nMap4Start + 1;
- const sal_uInt16 nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX
- pVersionMap4 = new sal_uInt16 [ nMap4Count ];
- for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ )
- pVersionMap4[i] = j;
- // Two entries inserted ...
- for ( i=nMap4New, j=nMap4Start+nMap4New+2; i < nMap4Count; i++, j++ )
- pVersionMap4[i] = j;
-
- // fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614
-
- const sal_uInt16 nMap5Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap5End = 163; // ATTR_ENDINDEX
- const sal_uInt16 nMap5Count = nMap5End - nMap5Start + 1;
- const sal_uInt16 nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX
- pVersionMap5 = new sal_uInt16 [ nMap5Count ];
- for ( i=0, j=nMap5Start; i < nMap5New; i++, j++ )
- pVersionMap5[i] = j;
- // 12 entries inserted
- for ( i=nMap5New, j=nMap5Start+nMap5New+12; i < nMap5Count; i++, j++ )
- pVersionMap5[i] = j;
-
- // sixth map: ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES added in 614d
-
- const sal_uInt16 nMap6Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap6End = 175; // ATTR_ENDINDEX
- const sal_uInt16 nMap6Count = nMap6End - nMap6Start + 1;
- const sal_uInt16 nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX
- pVersionMap6 = new sal_uInt16 [ nMap6Count ];
- for ( i=0, j=nMap6Start; i < nMap6New; i++, j++ )
- pVersionMap6[i] = j;
- // 3 entries inserted
- for ( i=nMap6New, j=nMap6Start+nMap6New+3; i < nMap6Count; i++, j++ )
- pVersionMap6[i] = j;
-
- // seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b
-
- const sal_uInt16 nMap7Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap7End = 178; // ATTR_ENDINDEX
- const sal_uInt16 nMap7Count = nMap7End - nMap7Start + 1;
- const sal_uInt16 nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX
- pVersionMap7 = new sal_uInt16 [ nMap7Count ];
- for ( i=0, j=nMap7Start; i < nMap7New; i++, j++ )
- pVersionMap7[i] = j;
- // 3 entries inserted
- for ( i=nMap7New, j=nMap7Start+nMap7New+3; i < nMap7Count; i++, j++ )
- pVersionMap7[i] = j;
-
- // eighth map: ATTR_VERTICAL_ASIAN added in 642q
-
- const sal_uInt16 nMap8Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap8End = 181; // ATTR_ENDINDEX
- const sal_uInt16 nMap8Count = nMap8End - nMap8Start + 1;
- const sal_uInt16 nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX
- pVersionMap8 = new sal_uInt16 [ nMap8Count ];
- for ( i=0, j=nMap8Start; i < nMap8New; i++, j++ )
- pVersionMap8[i] = j;
- // 1 entry inserted
- for ( i=nMap8New, j=nMap8Start+nMap8New+1; i < nMap8Count; i++, j++ )
- pVersionMap8[i] = j;
-
- // 9th map: ATTR_WRITINGDIR added in 643y
-
- const sal_uInt16 nMap9Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap9End = 182; // ATTR_ENDINDEX
- const sal_uInt16 nMap9Count = nMap9End - nMap9Start + 1;
- const sal_uInt16 nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX
- pVersionMap9 = new sal_uInt16 [ nMap9Count ];
- for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ )
- pVersionMap9[i] = j;
- // 1 entry inserted
- for ( i=nMap9New, j=nMap9Start+nMap9New+1; i < nMap9Count; i++, j++ )
- pVersionMap9[i] = j;
-
- // ATTR_PAGE_SCALETO added in 680/sab008
-
- // 10th map: ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
-
- const sal_uInt16 nMap10Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap10End = 184; // ATTR_ENDINDEX
- const sal_uInt16 nMap10Count = nMap10End - nMap10Start + 1;
- const sal_uInt16 nMap10New = 37; // ATTR_SHRINKTOFIT - ATTR_STARTINDEX
- pVersionMap10 = new sal_uInt16 [ nMap10Count ];
- for ( i=0, j=nMap10Start; i < nMap10New; i++, j++ )
- pVersionMap10[i] = j;
- // 3 entries inserted
- for ( i=nMap10New, j=nMap10Start+nMap10New+3; i < nMap10Count; i++, j++ )
- pVersionMap10[i] = j;
-
- // 11th map: ATTR_FONT_OVERLINE added in DEV300/overline2
-
- const sal_uInt16 nMap11Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap11End = 187; // ATTR_ENDINDEX
- const sal_uInt16 nMap11Count = nMap11End - nMap11Start + 1;
- const sal_uInt16 nMap11New = 5; // ATTR_FONT_OVERLINE - ATTR_STARTINDEX
- pVersionMap11 = new sal_uInt16 [ nMap11Count ];
- for ( i=0, j=nMap11Start; i < nMap11New; i++, j++ )
- pVersionMap11[i] = j;
- // 1 entry inserted
- for ( i=nMap11New, j=nMap11Start+nMap11New+1; i < nMap11Count; i++, j++ )
- pVersionMap11[i] = j;
-
- const sal_uInt16 nMap12Start = 100; // ATTR_STARTINDEX
- const sal_uInt16 nMap12End = 192; // ATTR_ENDINDEX
- const sal_uInt16 nMap12Count = nMap12End - nMap12Start + 1;
- const sal_uInt16 nMap12New = 55; // ATTR_HYPERLINK - ATTR_STARTINDEX
- pVersionMap12 = new sal_uInt16 [ nMap12Count ];
- for ( i=0, j=nMap12Start; i < nMap12New; i++, j++ )
- pVersionMap12[i] = j;
- // 1 entry inserted
- for ( i=nMap12New, j=nMap12Start+nMap12New+1; i < nMap12Count; i++, j++ )
- pVersionMap12[i] = j;
-}
-
-void ScDocumentPool::DeleteVersionMaps()
-{
- OSL_PRECOND( pVersionMap1 && pVersionMap2 &&
- pVersionMap3 && pVersionMap4 &&
- pVersionMap5 && pVersionMap6 &&
- pVersionMap7 && pVersionMap8 &&
- pVersionMap9 && pVersionMap10 &&
- pVersionMap11 && pVersionMap12 , "DeleteVersionMaps without maps" );
-
- delete[] pVersionMap12;
- pVersionMap12 = nullptr;
- delete[] pVersionMap11;
- pVersionMap11 = nullptr;
- delete[] pVersionMap10;
- pVersionMap10 = nullptr;
- delete[] pVersionMap9;
- pVersionMap9 = nullptr;
- delete[] pVersionMap8;
- pVersionMap8 = nullptr;
- delete[] pVersionMap7;
- pVersionMap7 = nullptr;
- delete[] pVersionMap6;
- pVersionMap6 = nullptr;
- delete[] pVersionMap5;
- pVersionMap5 = nullptr;
- delete[] pVersionMap4;
- pVersionMap4 = nullptr;
- delete[] pVersionMap3;
- pVersionMap3 = nullptr;
- delete[] pVersionMap2;
- pVersionMap2 = nullptr;
- delete[] pVersionMap1;
- pVersionMap1 = nullptr;
-}
-
const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
if ( rItem.Which() != ATTR_PATTERN ) // Only Pattern is special
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index d6da69632833..0f89537f3c7a 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -580,8 +580,6 @@ void ScGlobal::Clear()
DELETEZ(pUnitConverter);
DELETEZ(pFieldEditEngine);
- ScDocumentPool::DeleteVersionMaps();
-
DELETEZ(pEmptyOUString);
xDrawClipDocShellRef.clear();
}
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 7c555111b6db..f857c6593888 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -116,8 +116,6 @@ void ScDLL::Init()
if ( SfxApplication::GetModule(SfxToolsModule::Calc) ) // Module already active
return;
- ScDocumentPool::InitVersionMaps(); // Is needed in the ScModule ctor
-
auto pUniqueModule = o3tl::make_unique<ScModule>(&ScDocShell::Factory());
ScModule* pMod = pUniqueModule.get();
SfxApplication::SetModule(SfxToolsModule::Calc, std::move(pUniqueModule));
More information about the Libreoffice-commits
mailing list