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
f518cd28
Kaydet (Commit)
f518cd28
authored
Eki 30, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Restore the old behavior, even when the data comes from a cache.
Change-Id: I722a53ee0e8a8f757c1d02fa5f604e6ccedf3b1a
üst
d502ddff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+6
-0
column2.cxx
sc/source/core/data/column2.cxx
+32
-2
No files found.
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
f518cd28
...
@@ -229,6 +229,12 @@ void Test::testFetchVectorRefArray()
...
@@ -229,6 +229,12 @@ void Test::testFetchVectorRefArray()
CPPUNIT_ASSERT_MESSAGE
(
"This should be empty."
,
isEmpty
(
aArray
,
8
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be empty."
,
isEmpty
(
aArray
,
8
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be empty."
,
isEmpty
(
aArray
,
9
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be empty."
,
isEmpty
(
aArray
,
9
));
// Get the array for F3:F4. This array should only consist of numeric array.
aArray
=
m_pDoc
->
FetchVectorRefArray
(
ScAddress
(
5
,
2
,
0
),
3
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to fetch vector ref array."
,
aArray
.
isValid
());
CPPUNIT_ASSERT_MESSAGE
(
"Array should have a numeric array."
,
aArray
.
mpNumericArray
);
CPPUNIT_ASSERT_MESSAGE
(
"Array should NOT have a string array."
,
!
aArray
.
mpStringArray
);
m_pDoc
->
DeleteTab
(
0
);
m_pDoc
->
DeleteTab
(
0
);
}
}
...
...
sc/source/core/data/column2.cxx
Dosyayı görüntüle @
f518cd28
...
@@ -2614,6 +2614,36 @@ copyFirstFormulaBlock(
...
@@ -2614,6 +2614,36 @@ copyFirstFormulaBlock(
return
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
pNumArray
,
pStrArray
);
return
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
pNumArray
,
pStrArray
);
}
}
struct
FiniteValueFinder
:
std
::
unary_function
<
double
,
bool
>
{
bool
operator
()
(
double
f
)
const
{
return
!
rtl
::
math
::
isNan
(
f
);
}
};
struct
NonNullStringFinder
:
std
::
unary_function
<
const
rtl_uString
*
,
bool
>
{
bool
operator
()
(
const
rtl_uString
*
p
)
const
{
return
p
!=
NULL
;
}
};
bool
hasNonEmpty
(
const
sc
::
FormulaGroupContext
::
NumArrayType
&
rArray
,
SCROW
nRow1
,
SCROW
nRow2
)
{
// The caller has to make sure the array is at least nRow2+1 long.
sc
::
FormulaGroupContext
::
NumArrayType
::
const_iterator
it
=
rArray
.
begin
();
std
::
advance
(
it
,
nRow1
);
sc
::
FormulaGroupContext
::
NumArrayType
::
const_iterator
itEnd
=
it
;
std
::
advance
(
itEnd
,
nRow2
-
nRow1
+
1
);
return
std
::
find_if
(
it
,
itEnd
,
FiniteValueFinder
())
!=
itEnd
;
}
bool
hasNonEmpty
(
const
sc
::
FormulaGroupContext
::
StrArrayType
&
rArray
,
SCROW
nRow1
,
SCROW
nRow2
)
{
// The caller has to make sure the array is at least nRow2+1 long.
sc
::
FormulaGroupContext
::
StrArrayType
::
const_iterator
it
=
rArray
.
begin
();
std
::
advance
(
it
,
nRow1
);
sc
::
FormulaGroupContext
::
StrArrayType
::
const_iterator
itEnd
=
it
;
std
::
advance
(
itEnd
,
nRow2
-
nRow1
+
1
);
return
std
::
find_if
(
it
,
itEnd
,
NonNullStringFinder
())
!=
itEnd
;
}
}
}
formula
::
VectorRefArray
ScColumn
::
FetchVectorRefArray
(
SCROW
nRow1
,
SCROW
nRow2
)
formula
::
VectorRefArray
ScColumn
::
FetchVectorRefArray
(
SCROW
nRow1
,
SCROW
nRow2
)
...
@@ -2627,11 +2657,11 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2627,11 +2657,11 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
if
(
pColArray
)
if
(
pColArray
)
{
{
const
double
*
pNum
=
NULL
;
const
double
*
pNum
=
NULL
;
if
(
pColArray
->
mpNumArray
)
if
(
pColArray
->
mpNumArray
&&
hasNonEmpty
(
*
pColArray
->
mpNumArray
,
nRow1
,
nRow2
)
)
pNum
=
&
(
*
pColArray
->
mpNumArray
)[
nRow1
];
pNum
=
&
(
*
pColArray
->
mpNumArray
)[
nRow1
];
rtl_uString
**
pStr
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
if
(
pColArray
->
mpStrArray
)
if
(
pColArray
->
mpStrArray
&&
hasNonEmpty
(
*
pColArray
->
mpStrArray
,
nRow1
,
nRow2
)
)
pStr
=
&
(
*
pColArray
->
mpStrArray
)[
nRow1
];
pStr
=
&
(
*
pColArray
->
mpStrArray
)[
nRow1
];
return
formula
::
VectorRefArray
(
pNum
,
pStr
);
return
formula
::
VectorRefArray
(
pNum
,
pStr
);
...
...
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