From ca166a7a42d5c9cde3cf9385e58523168c2f186c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 15 Aug 2012 15:52:51 +0200 Subject: Remove the Container class Change-Id: I296d2c90af59524280c2582670c6cfe7a10f2269 --- tools/inc/impcont.hxx | 106 -------------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 tools/inc/impcont.hxx (limited to 'tools/inc/impcont.hxx') diff --git a/tools/inc/impcont.hxx b/tools/inc/impcont.hxx deleted file mode 100644 index 1cfb374e61c4..000000000000 --- a/tools/inc/impcont.hxx +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _IMPCONT_HXX -#define _IMPCONT_HXX - -#include -#include - -typedef void* PVOID; - -class CBlock -{ -private: - CBlock* pPrev; ///< Previous block - CBlock* pNext; ///< Next block - sal_uInt16 nSize; ///< block size - sal_uInt16 nCount; ///< number of pointers - void** pNodes; ///< stores node pointers - -#if defined DBG_UTIL - static char const * DbgCheckCBlock(void const *); -#endif - -public: - /// used for list container - CBlock( sal_uInt16 nSize, CBlock* pPrev, CBlock* pNext ); - /// used for array container - CBlock( sal_uInt16 nSize, CBlock* pPrev ); - /// Copy-Ctor - CBlock( const CBlock& r, CBlock* pPrev ); - ~CBlock(); - - void Insert( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize ); - CBlock* Split( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize ); - void* Remove( sal_uInt16 nIndex, sal_uInt16 nReSize ); - void* Replace( void* pNew, sal_uInt16 nIndex ); - - void** GetNodes() const { return pNodes; } - void** GetObjectPtr( sal_uInt16 nIndex ); - void* GetObject( sal_uInt16 nIndex ) const; - - sal_uInt16 GetSize() const { return nCount; } - sal_uInt16 Count() const { return nCount; } - void SetPrevBlock( CBlock* p ) { pPrev = p; } - void SetNextBlock( CBlock* p ) { pNext = p; } - CBlock* GetPrevBlock() const { return pPrev; } - CBlock* GetNextBlock() const { return pNext; } - void Reset() { nCount = 0; } - -private: - CBlock( const CBlock& r ); - - friend class Container; -}; - -/// @return a node pointer given a block index -inline void* CBlock::GetObject( sal_uInt16 nIndex ) const -{ - return pNodes[nIndex]; -} - -/** A pointer is often located in the first block, thus check this position - before calling GetObject. - */ -inline void* Container::ImpGetObject( sal_uIntPtr nIndex ) const -{ - if ( pFirstBlock && (nIndex < pFirstBlock->Count()) ) - // Return item within the found block - return pFirstBlock->GetObject( (sal_uInt16)nIndex ); - else - return GetObject( nIndex ); -} - -// #i70651#: Prevent warnings on Mac OS X -#ifdef MACOSX -#pragma GCC system_header -#endif - -/// If only one block exists, return its data array. -inline void** Container::ImpGetOnlyNodes() const -{ - if ( (pFirstBlock == pLastBlock) && pFirstBlock ) - return pFirstBlock->GetNodes(); - else - return NULL; -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit