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
8795dff9
Kaydet (Commit)
8795dff9
authored
Ara 18, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Iaaf8e5f14691cde32058a78842b9c411f2b92d93
üst
85f17f9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
dpobject.hxx
sc/inc/dpobject.hxx
+3
-2
dpobject.cxx
sc/source/core/data/dpobject.cxx
+18
-18
No files found.
sc/inc/dpobject.hxx
Dosyayı görüntüle @
8795dff9
...
...
@@ -33,6 +33,7 @@
#include <memory>
#include <set>
#include <vector>
#include <map>
#include <boost/ptr_container/ptr_map.hpp>
...
...
@@ -267,9 +268,9 @@ public:
class
SheetCaches
{
friend
class
ScDPCollection
;
typedef
boost
::
ptr_map
<
size_t
,
ScDPCache
>
CachesType
;
typedef
std
::
map
<
size_t
,
std
::
unique_ptr
<
ScDPCache
>
>
CachesType
;
typedef
std
::
vector
<
ScRange
>
RangeIndexType
;
CachesType
m
a
Caches
;
CachesType
m
_
Caches
;
RangeIndexType
maRanges
;
ScDocument
*
mpDoc
;
public
:
...
...
sc/source/core/data/dpobject.cxx
Dosyayı görüntüle @
8795dff9
...
...
@@ -2841,8 +2841,8 @@ bool ScDPCollection::SheetCaches::hasCache(const ScRange& rRange) const
// Already cached.
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
const_iterator
itCache
=
ma
Caches
.
find
(
nIndex
);
return
itCache
!=
m
a
Caches
.
end
();
CachesType
::
const_iterator
const
itCache
=
m_
Caches
.
find
(
nIndex
);
return
itCache
!=
m
_
Caches
.
end
();
}
const
ScDPCache
*
ScDPCollection
::
SheetCaches
::
getCache
(
const
ScRange
&
rRange
,
const
ScDPDimensionSaveData
*
pDimData
)
...
...
@@ -2852,8 +2852,8 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co
{
// Already cached.
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
iterator
itCache
=
ma
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
a
Caches
.
end
())
CachesType
::
iterator
const
itCache
=
m_
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
_
Caches
.
end
())
{
OSL_FAIL
(
"Cache pool and index pool out-of-sync !!!"
);
return
nullptr
;
...
...
@@ -2862,7 +2862,7 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co
if
(
pDimData
)
pDimData
->
WriteToCache
(
*
itCache
->
second
);
return
itCache
->
second
;
return
itCache
->
second
.
get
()
;
}
// Not cached. Create a new cache.
...
...
@@ -2888,7 +2888,7 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co
}
const
ScDPCache
*
p
=
pCache
.
get
();
o3tl
::
ptr_container
::
insert
(
maCaches
,
nIndex
,
std
::
move
(
pCache
));
m_Caches
.
insert
(
std
::
make_pair
(
nIndex
,
std
::
move
(
pCache
)
));
return
p
;
}
...
...
@@ -2901,14 +2901,14 @@ ScDPCache* ScDPCollection::SheetCaches::getExistingCache(const ScRange& rRange)
// Already cached.
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
iterator
itCache
=
ma
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
a
Caches
.
end
())
CachesType
::
iterator
const
itCache
=
m_
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
_
Caches
.
end
())
{
OSL_FAIL
(
"Cache pool and index pool out-of-sync !!!"
);
return
nullptr
;
}
return
itCache
->
second
;
return
itCache
->
second
.
get
()
;
}
const
ScDPCache
*
ScDPCollection
::
SheetCaches
::
getExistingCache
(
const
ScRange
&
rRange
)
const
...
...
@@ -2920,19 +2920,19 @@ const ScDPCache* ScDPCollection::SheetCaches::getExistingCache(const ScRange& rR
// Already cached.
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
const_iterator
itCache
=
ma
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
a
Caches
.
end
())
CachesType
::
const_iterator
const
itCache
=
m_
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
_
Caches
.
end
())
{
OSL_FAIL
(
"Cache pool and index pool out-of-sync !!!"
);
return
nullptr
;
}
return
itCache
->
second
;
return
itCache
->
second
.
get
()
;
}
size_t
ScDPCollection
::
SheetCaches
::
size
()
const
{
return
m
a
Caches
.
size
();
return
m
_
Caches
.
size
();
}
void
ScDPCollection
::
SheetCaches
::
updateReference
(
...
...
@@ -2979,8 +2979,8 @@ void ScDPCollection::SheetCaches::updateCache(const ScRange& rRange, std::set<Sc
}
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
iterator
itCache
=
ma
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
a
Caches
.
end
())
CachesType
::
iterator
const
itCache
=
m_
Caches
.
find
(
nIndex
);
if
(
itCache
==
m
_
Caches
.
end
())
{
OSL_FAIL
(
"Cache pool and index pool out-of-sync !!!"
);
rRefs
.
clear
();
...
...
@@ -3001,13 +3001,13 @@ void ScDPCollection::SheetCaches::updateCache(const ScRange& rRange, std::set<Sc
bool
ScDPCollection
::
SheetCaches
::
remove
(
const
ScDPCache
*
p
)
{
CachesType
::
iterator
it
=
m
aCaches
.
begin
(),
itEnd
=
ma
Caches
.
end
();
CachesType
::
iterator
it
=
m
_Caches
.
begin
(),
itEnd
=
m_
Caches
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
{
if
(
it
->
second
==
p
)
if
(
it
->
second
.
get
()
==
p
)
{
size_t
idx
=
it
->
first
;
m
a
Caches
.
erase
(
it
);
m
_
Caches
.
erase
(
it
);
maRanges
[
idx
].
SetInvalid
();
return
true
;
}
...
...
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