Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
16ea3bec
Kaydet (Commit)
16ea3bec
authored
Ara 30, 2011
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Unused, as pointed by Terrence Enger.
üst
36d7f011
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
271 deletions
+0
-271
bigpointerarray-new.cxx
sw/qa/core/bigpointerarray-new.cxx
+0
-111
bigpointerarray-new.hxx
sw/qa/core/bigpointerarray-new.hxx
+0
-160
No files found.
sw/qa/core/bigpointerarray-new.cxx
deleted
100644 → 0
Dosyayı görüntüle @
36d7f011
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* 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.
*
************************************************************************/
#include "bparr.hxx"
#include <algorithm>
BigPtrArray
::
BigPtrArray
()
{
//container_.reserve(1000);
}
sal_uLong
BigPtrArray
::
Count
()
const
{
return
container_
.
size
();
}
void
BigPtrArray
::
Move
(
sal_uLong
fromPos
,
sal_uLong
toPos
)
{
OSL_ENSURE
(
fromPos
<
container_
.
size
()
&&
toPos
<
container_
.
size
(),
"BigPtrArray.Move precondition violation"
);
Insert
(
container_
[
fromPos
],
toPos
);
Remove
(
toPos
<
fromPos
?
fromPos
+
1
:
fromPos
,
1
);
}
void
BigPtrArray
::
ForEach
(
sal_uLong
fromPos
,
sal_uLong
toPos
,
FnForEach
fn
,
void
*
pArgs
)
{
OSL_ENSURE
(
fromPos
<
toPos
&&
fromPos
<
container_
.
size
()
&&
toPos
<
container_
.
size
(),
"BigPtrArray::ForEach precondition violation"
);
Container_t
::
const_iterator
iter
=
container_
.
begin
()
+
fromPos
;
Container_t
::
const_iterator
iter_end
=
container_
.
begin
()
+
toPos
;
for
(
/*no init*/
;
iter
!=
iter_end
;
++
iter
)
fn
(
*
iter
,
pArgs
);
}
void
BigPtrArray
::
ForEach
(
FnForEach
fn
,
void
*
pArgs
)
{
Container_t
::
const_iterator
iter
=
container_
.
begin
();
Container_t
::
const_iterator
iter_end
=
container_
.
end
();
for
(
/*no init*/
;
iter
!=
iter_end
;
++
iter
)
fn
(
*
iter
,
pArgs
);
}
ElementPtr
BigPtrArray
::
operator
[](
sal_uLong
pos
)
const
{
OSL_ENSURE
(
pos
<
container_
.
size
(),
"BigPtrArray::operator[] precondition violation"
);
return
container_
[
pos
];
}
void
BigPtrArray
::
Insert
(
const
ElementPtr
&
rElem
,
sal_uLong
pos
)
{
OSL_ENSURE
(
pos
<=
container_
.
size
(),
"BigPtrArray::Insert precondition violation"
);
rElem
->
pBigPtrArray_
=
this
;
rElem
->
pos_
=
pos
;
if
(
pos
==
container_
.
size
())
container_
.
push_back
(
rElem
);
else
{
container_
.
insert
(
container_
.
begin
()
+
pos
,
rElem
);
FixElementIndizes
(
container_
.
begin
(),
container_
.
end
());
}
}
void
BigPtrArray
::
Remove
(
sal_uLong
pos
,
sal_uLong
n
)
{
OSL_ENSURE
((
pos
<
container_
.
size
())
&&
((
container_
.
begin
()
+
pos
+
n
)
<
container_
.
end
()),
"BigPtrArray.Remove precondition violation"
)
container_
.
erase
(
container_
.
begin
()
+
pos
,
container_
.
begin
()
+
pos
+
n
);
FixElementIndizes
(
container_
.
begin
(),
container_
.
end
());
}
void
BigPtrArray
::
Replace
(
sal_uLong
pos
,
const
ElementPtr
&
rElem
)
{
OSL_ENSURE
(
pos
<
container_
.
size
(),
"BigPtrArray::Replace precondition violation"
);
rElem
->
pBigPtrArray_
=
this
;
rElem
->
pos_
=
pos
;
container_
[
pos
]
=
rElem
;
}
void
BigPtrArray
::
FixElementIndizes
(
Container_t
::
const_iterator
begin
,
Container_t
::
const_iterator
end
)
const
{
Container_t
::
const_iterator
iter
=
begin
;
for
(
int
i
=
0
;
iter
!=
end
;
++
iter
,
i
++
)
(
*
iter
)
->
pos_
=
i
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/qa/core/bigpointerarray-new.hxx
deleted
100644 → 0
Dosyayı görüntüle @
36d7f011
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* 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 _BPARR_HXX
#define _BPARR_HXX
#include <tools/solar.h>
#include <deque>
class
BigPtrArray
;
/** Base class for container entries
*/
class
BigPtrEntry
{
friend
class
BigPtrArray
;
BigPtrArray
*
pBigPtrArray_
;
sal_uLong
pos_
;
protected
:
BigPtrEntry
()
:
pBigPtrArray_
(
0
),
pos_
(
0
)
{}
virtual
~
BigPtrEntry
()
{}
sal_uLong
GetPos
()
const
{
return
pos_
;
}
BigPtrArray
&
GetArray
()
const
{
return
*
pBigPtrArray_
;
}
};
typedef
BigPtrEntry
*
ElementPtr
;
typedef
sal_Bool
(
*
FnForEach
)(
const
ElementPtr
&
,
void
*
pArgs
);
/** A container abstraction
*/
class
BigPtrArray
{
public
:
typedef
std
::
deque
<
ElementPtr
>
Container_t
;
public
:
/**
*/
BigPtrArray
();
/** Return the number of entries inserted
into the array
*/
sal_uLong
Count
()
const
;
/** Insert an Element into the array at a certain
position
@param rElem
[in] the element
@param pos
[in] the position where to insert the element.
@pre (pos >= 0 && pos <= BigPtrArray.Count())
@post (((oldCount + 1) == BigPtrArray.Count()) && BigPtrArray[pos] == rElem)
*/
void
Insert
(
const
ElementPtr
&
rElem
,
sal_uLong
pos
);
/** Remove a specified number of elements starting at a certain position.
@param pos
[in] the position where to start removing elements
@param n
[in] the number of elements to remove
@pre (pos < BigPtrArray.Count() && n <= BigPtrArray.Count())
@post ((oldCount - n) == BigPtrArray.Count())
*/
void
Remove
(
sal_uLong
pos
,
sal_uLong
n
=
1
);
/** Move an entry from a certain position to another on.
@param from
[in]
@param to
[in]
*/
void
Move
(
sal_uLong
fromPos
,
sal_uLong
toPos
);
/** Replace an entry at a certain position
@param pos
[in] the position of the entry
@param rElem
[in] the new entry
@pre pos < BigPtrArray.Count()
@post (oldCount == BigPtrArray.Count() && BigPtrArray[pos] == rElem)
*/
void
Replace
(
sal_uLong
pos
,
const
ElementPtr
&
rElem
);
/** Get the entry at a certain index
@param pos
[in] the position of the entry
@pre pos < BigPtrArray.Count()
*/
ElementPtr
operator
[](
sal_uLong
pos
)
const
;
/**
*/
void
ForEach
(
FnForEach
fn
,
void
*
pArgs
=
NULL
);
/**
*/
void
ForEach
(
sal_uLong
fromPos
,
sal_uLong
toPos
,
FnForEach
fn
,
void
*
pArgs
=
NULL
);
private
:
void
FixElementIndizes
(
Container_t
::
const_iterator
begin
,
Container_t
::
const_iterator
end
)
const
;
private
:
Container_t
container_
;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment