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
ca73d85c
Kaydet (Commit)
ca73d85c
authored
Ock 12, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test code for sheet source data cache relocation.
üst
278c9130
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
dpobject.hxx
sc/inc/dpobject.hxx
+2
-1
ucalc.cxx
sc/qa/unit/ucalc.cxx
+11
-1
dpobject.cxx
sc/source/core/data/dpobject.cxx
+14
-3
No files found.
sc/inc/dpobject.hxx
Dosyayı görüntüle @
ca73d85c
...
...
@@ -266,6 +266,7 @@ public:
ScDocument
*
mpDoc
;
public
:
SheetCaches
(
ScDocument
*
pDoc
);
bool
hasCache
(
const
ScRange
&
rRange
)
const
;
const
ScDPCache
*
getCache
(
const
ScRange
&
rRange
);
void
updateReference
(
...
...
@@ -286,7 +287,7 @@ public:
ScDocument
*
mpDoc
;
public
:
NameCaches
(
ScDocument
*
pDoc
);
const
ScDPCache
*
get
Cache
(
const
rtl
::
OUString
&
rName
)
const
;
bool
has
Cache
(
const
rtl
::
OUString
&
rName
)
const
;
const
ScDPCache
*
getCache
(
const
::
rtl
::
OUString
&
rName
,
const
ScRange
&
rRange
);
private
:
void
removeCache
(
const
::
rtl
::
OUString
&
rName
);
...
...
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
ca73d85c
...
...
@@ -1386,6 +1386,16 @@ void Test::testDataPilot()
CPPUNIT_ASSERT_MESSAGE
(
"Table output check failed"
,
bSuccess
);
}
CPPUNIT_ASSERT_MESSAGE
(
"Cache should be here."
,
pDPs
->
GetSheetCaches
().
hasCache
(
aSrcRange
));
// Swap the two sheets.
m_pDoc
->
MoveTab
(
1
,
0
);
CPPUNIT_ASSERT_MESSAGE
(
"Cache should have moved."
,
!
pDPs
->
GetSheetCaches
().
hasCache
(
aSrcRange
));
aSrcRange
.
aStart
.
SetTab
(
1
);
aSrcRange
.
aEnd
.
SetTab
(
1
);
CPPUNIT_ASSERT_MESSAGE
(
"Cache should be here."
,
pDPs
->
GetSheetCaches
().
hasCache
(
aSrcRange
));
pDPs
->
FreeTable
(
pDPObj2
);
CPPUNIT_ASSERT_MESSAGE
(
"There shouldn't be any data pilot table stored with the document."
,
pDPs
->
GetCount
()
==
0
);
...
...
@@ -1671,7 +1681,7 @@ void Test::testDataPilotNamedSource()
CPPUNIT_ASSERT_MESSAGE
(
"Named source range has been altered unexpectedly!"
,
pDesc
->
GetRangeName
().
equals
(
aRangeName
));
CPPUNIT_ASSERT_MESSAGE
(
"Cache should exist."
,
pDPs
->
GetNameCaches
().
getCache
(
aRangeName
)
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"Cache should exist."
,
pDPs
->
GetNameCaches
().
hasCache
(
aRangeName
)
);
pDPs
->
FreeTable
(
pDPObj
);
CPPUNIT_ASSERT_MESSAGE
(
"There should be no more tables."
,
pDPs
->
GetCount
()
==
0
);
...
...
sc/source/core/data/dpobject.cxx
Dosyayı görüntüle @
ca73d85c
...
...
@@ -2471,6 +2471,18 @@ struct FindInvalidRange : public std::unary_function<ScRange, bool>
}
bool
ScDPCollection
::
SheetCaches
::
hasCache
(
const
ScRange
&
rRange
)
const
{
RangeIndexType
::
const_iterator
it
=
std
::
find
(
maRanges
.
begin
(),
maRanges
.
end
(),
rRange
);
if
(
it
==
maRanges
.
end
())
return
false
;
// Already cached.
size_t
nIndex
=
std
::
distance
(
maRanges
.
begin
(),
it
);
CachesType
::
const_iterator
itCache
=
maCaches
.
find
(
nIndex
);
return
itCache
!=
maCaches
.
end
();
}
const
ScDPCache
*
ScDPCollection
::
SheetCaches
::
getCache
(
const
ScRange
&
rRange
)
{
RangeIndexType
::
iterator
it
=
std
::
find
(
maRanges
.
begin
(),
maRanges
.
end
(),
rRange
);
...
...
@@ -2565,10 +2577,9 @@ void ScDPCollection::SheetCaches::removeCache(const ScRange& rRange)
ScDPCollection
::
NameCaches
::
NameCaches
(
ScDocument
*
pDoc
)
:
mpDoc
(
pDoc
)
{}
const
ScDPCache
*
ScDPCollection
::
NameCaches
::
get
Cache
(
const
OUString
&
rName
)
const
bool
ScDPCollection
::
NameCaches
::
has
Cache
(
const
OUString
&
rName
)
const
{
CachesType
::
const_iterator
itr
=
maCaches
.
find
(
rName
);
return
itr
!=
maCaches
.
end
()
?
itr
->
second
:
NULL
;
return
maCaches
.
count
(
rName
)
!=
0
;
}
const
ScDPCache
*
ScDPCollection
::
NameCaches
::
getCache
(
const
OUString
&
rName
,
const
ScRange
&
rRange
)
...
...
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