/************************************************************************* * * 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: bparr.hxx,v $ * $Revision: 1.5 $ * * 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 * * for a copy of the LGPLv3 License. * ************************************************************************/ #ifndef _BPARR_HXX #define _BPARR_HXX #include #include #include struct BlockInfo; class BigPtrArray; class BigPtrEntry { friend class BigPtrArray; BlockInfo* pBlock; USHORT nOffset; public: virtual ~BigPtrEntry() {} protected: BigPtrEntry() : pBlock(0), nOffset(0) {} inline ULONG GetPos() const; inline BigPtrArray& GetArray() const; }; typedef BigPtrEntry* ElementPtr; typedef BOOL (*FnForEach)( const ElementPtr&, void* pArgs ); // 1000 Eintr„ge pro Block = etwas weniger als 4K #define MAXENTRY 1000 // Anzahl Eintraege, die bei der Kompression frei bleiben duerfen // dieser Wert ist fuer den Worst Case, da wir MAXBLOCK mit ca 25% // Overhead definiert haben, reichen 80% = 800 Eintraege vollkommen aus // Will mann voellige Kompression haben, muss eben 100 angegeben werden. #define COMPRESSLVL 80 struct BlockInfo { // Block-Info: BigPtrArray* pBigArr; // in diesem Array steht der Block ElementPtr* pData; // Datenblock ULONG nStart, nEnd; // Start- und EndIndex USHORT nElem; // Anzahl Elemente }; class SW_DLLPUBLIC BigPtrArray { BlockInfo** ppInf; // Block-Infos ULONG nSize; // Anzahl Elemente USHORT nMaxBlock; // akt. max Anzahl Bloecke USHORT nBlock; // Anzahl Bloecke USHORT nCur; // letzter Block USHORT Index2Block( ULONG ) const; // Blocksuche BlockInfo* InsBlock( USHORT ); // Block einfuegen void BlockDel( USHORT ); // es wurden Bloecke geloescht void UpdIndex( USHORT ); // Indexe neu berechnen protected: // fuelle alle Bloecke auf. // Der short gibt in Prozent an, wie voll die Bloecke werden sollen. // Der ReturnWert besagt, das irgendetwas "getan" wurde USHORT Compress( short = COMPRESSLVL ); public: BigPtrArray(); ~BigPtrArray(); ULONG Count() const { return nSize; } void Insert( const ElementPtr& r, ULONG pos ); void Remove( ULONG pos, ULONG n = 1 ); void Move( ULONG from, ULONG to ); void Replace( ULONG pos, const ElementPtr& r); ElementPtr operator[]( ULONG ) const; void ForEach( FnForEach fn, void* pArgs = NULL ) { ForEach( 0, nSize, fn, pArgs ); } void ForEach( ULONG nStart, ULONG nEnd, FnForEach fn, void* pArgs = NULL ); }; inline ULONG BigPtrEntry::GetPos() const { DBG_ASSERT( this == pBlock->pData[ nOffset ], "Element nicht im Block" ); return pBlock->nStart + nOffset; } inline BigPtrArray& BigPtrEntry::GetArray() const { return *pBlock->pBigArr; } #endif dcm-6.2'>distro/collabora/dcm-6.2 LibreOffice 核心代ç ä»“库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2018-10-12loplugin:constfields in reportdesign,sal,saxNoel Grandin
2018-08-19Fix typosAndrea Gelmini
2018-07-23ofz#9507 wrong start point for Johab block 59Caolán McNamara
2018-02-08ofz#6112 wrong start off sets for korean KSC5601 tableCaolán McNamara
2018-01-12More loplugin:cstylecast: salStephan Bergmann
2017-12-27sal: fix typo in tcvtmb.cxx and remove comment cruftChris Sherlock
2017-12-11loplugin:salcall fix functionsNoel Grandin
2017-11-13Fix typosAndrea Gelmini
2017-11-01-I$(dir $(3)) in gb_CObject__command_pattern is no longer neededStephan Bergmann
2017-10-23loplugin:includeform: salStephan Bergmann
2017-10-20loplugin:constmethod in codemaker,registry,storeNoel Grandin
2017-09-28Warn about missing text converterStephan Bergmann
2017-09-26ofz#3186: wrong starting offset for JOHAB 0x6D blockCaolán McNamara
2017-09-24Map Windows code page 42 to RTL_TEXTENCODING_SYMBOLStephan Bergmann
2017-09-15Assert flags passed to rtl_convertTextToUnicode/UnicodeToText are validStephan Bergmann
2017-09-13New rtl::isUnicodeScalarValue, rtl::isSurrogateStephan Bergmann
2017-09-13Silence warning C4701: potentially uninitialized local variableStephan Bergmann
2017-09-13Make reading UTF-8 strictStephan Bergmann
2017-08-25ofz#2852 korean table entries start at 0xF not 0x7Caolán McNamara
2017-08-18Fix typosAndrea Gelmini
2017-08-17Fix typosAndrea Gelmini
2017-07-17RTL_UNICODETOTEXT_INFO_{DEST|SCR}BUFFERTOSMALL should use TOO, not TOChris Sherlock
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin
2017-07-05new loplugin unnecessaryparenNoel Grandin
2017-07-03Rather translate "Sonderzeichen" as "special characters"Stephan Bergmann
2017-07-03Translate German comments and debug strings (leftovers in dirs sal to sc)Johnny_M
2017-06-26loplugin:oncevar in oox..saxNoel Grandin
2017-06-14use more SAL_N_ELEMENTS part 2Noel Grandin
2017-06-09clang-tidy readability-non-const-parameterNoel Grandin
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke
2017-04-12clang-tidy: readability-else-after-returnNoel Grandin
2017-04-04ofz#770 JOHAB_73 table starts at 0xA not 0x2Caolán McNamara
2017-03-25Fix typosAndrea Gelmini
2017-03-03Fix typosAndrea Gelmini
2017-01-01ofz#358 SJIS_84 table mnLeadEnd is out by oneCaolán McNamara
2016-04-11tdf#94306 replace boost::noncopyable r.. to sdextJochen Nitschke
2016-04-01tdf#97966 Drop 'static' keywordsWastack
2016-02-15Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePointStephan Bergmann
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann