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
b2f5336b
Kaydet (Commit)
b2f5336b
authored
Mar 02, 2016
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: tdf#98297 exclude error values from COUNT in array/matrix
Change-Id: I202dcc2a2b90ee8ed27815b97a2aad6e4df2f1b9
üst
6d7aeebc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
13 deletions
+29
-13
scmatrix.hxx
sc/inc/scmatrix.hxx
+3
-3
interpr6.cxx
sc/source/core/tool/interpr6.cxx
+2
-2
scmatrix.cxx
sc/source/core/tool/scmatrix.cxx
+24
-8
No files found.
sc/inc/scmatrix.hxx
Dosyayı görüntüle @
b2f5336b
...
...
@@ -366,7 +366,7 @@ public:
virtual
IterateResult
Sum
(
bool
bTextAsZero
)
const
=
0
;
virtual
IterateResult
SumSquare
(
bool
bTextAsZero
)
const
=
0
;
virtual
IterateResult
Product
(
bool
bTextAsZero
)
const
=
0
;
virtual
size_t
Count
(
bool
bCountStrings
)
const
=
0
;
virtual
size_t
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
=
0
;
virtual
size_t
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
=
0
;
virtual
size_t
MatchStringInColumns
(
const
svl
::
SharedString
&
rStr
,
size_t
nCol1
,
size_t
nCol2
)
const
=
0
;
...
...
@@ -574,7 +574,7 @@ public:
virtual
IterateResult
Sum
(
bool
bTextAsZero
)
const
override
;
virtual
IterateResult
SumSquare
(
bool
bTextAsZero
)
const
override
;
virtual
IterateResult
Product
(
bool
bTextAsZero
)
const
override
;
virtual
size_t
Count
(
bool
bCountStrings
)
const
override
;
virtual
size_t
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
override
;
virtual
size_t
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
override
;
virtual
size_t
MatchStringInColumns
(
const
svl
::
SharedString
&
rStr
,
size_t
nCol1
,
size_t
nCol2
)
const
override
;
...
...
@@ -785,7 +785,7 @@ public:
virtual
IterateResult
Sum
(
bool
bTextAsZero
)
const
override
;
virtual
IterateResult
SumSquare
(
bool
bTextAsZero
)
const
override
;
virtual
IterateResult
Product
(
bool
bTextAsZero
)
const
override
;
virtual
size_t
Count
(
bool
bCountStrings
)
const
override
;
virtual
size_t
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
override
;
virtual
size_t
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
override
;
virtual
size_t
MatchStringInColumns
(
const
svl
::
SharedString
&
rStr
,
size_t
nCol1
,
size_t
nCol2
)
const
override
;
...
...
sc/source/core/tool/interpr6.cxx
Dosyayı görüntüle @
b2f5336b
...
...
@@ -433,10 +433,10 @@ void IterateMatrix(
}
break
;
case
ifCOUNT
:
rCount
+=
pMat
->
Count
(
bTextAsZero
);
rCount
+=
pMat
->
Count
(
bTextAsZero
,
false
);
// do not count error values
break
;
case
ifCOUNT2
:
rCount
+=
pMat
->
Count
(
true
);
rCount
+=
pMat
->
Count
(
true
,
true
);
// do count error values
break
;
case
ifPRODUCT
:
{
...
...
sc/source/core/tool/scmatrix.cxx
Dosyayı görüntüle @
b2f5336b
...
...
@@ -284,7 +284,7 @@ public:
ScMatrix
::
IterateResult
Sum
(
bool
bTextAsZero
)
const
;
ScMatrix
::
IterateResult
SumSquare
(
bool
bTextAsZero
)
const
;
ScMatrix
::
IterateResult
Product
(
bool
bTextAsZero
)
const
;
size_t
Count
(
bool
bCountStrings
)
const
;
size_t
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
;
size_t
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
;
size_t
MatchStringInColumns
(
const
svl
::
SharedString
&
rStr
,
size_t
nCol1
,
size_t
nCol2
)
const
;
...
...
@@ -1163,8 +1163,10 @@ class CountElements : public std::unary_function<MatrixImplType::element_block_n
{
size_t
mnCount
;
bool
mbCountString
;
bool
mbCountErrors
;
public
:
explicit
CountElements
(
bool
bCountString
)
:
mnCount
(
0
),
mbCountString
(
bCountString
)
{}
explicit
CountElements
(
bool
bCountString
,
bool
bCountErrors
)
:
mnCount
(
0
),
mbCountString
(
bCountString
),
mbCountErrors
(
bCountErrors
)
{}
size_t
getCount
()
const
{
return
mnCount
;
}
...
...
@@ -1173,6 +1175,20 @@ public:
switch
(
node
.
type
)
{
case
mdds
:
:
mtm
::
element_numeric
:
mnCount
+=
node
.
size
;
if
(
!
mbCountErrors
)
{
typedef
MatrixImplType
::
numeric_block_type
block_type
;
block_type
::
const_iterator
it
=
block_type
::
begin
(
*
node
.
data
);
block_type
::
const_iterator
itEnd
=
block_type
::
end
(
*
node
.
data
);
for
(;
it
!=
itEnd
;
++
it
)
{
if
(
!::
rtl
::
math
::
isFinite
(
*
it
))
--
mnCount
;
}
}
break
;
case
mdds
:
:
mtm
::
element_boolean
:
mnCount
+=
node
.
size
;
break
;
...
...
@@ -1782,9 +1798,9 @@ ScMatrix::IterateResult ScMatrixImpl::Product(bool bTextAsZero) const
return
GetValueWithCount
<
sc
::
op
::
Product
>
(
bTextAsZero
,
maMat
);
}
size_t
ScMatrixImpl
::
Count
(
bool
bCountStrings
)
const
size_t
ScMatrixImpl
::
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
{
CountElements
aFunc
(
bCountStrings
);
CountElements
aFunc
(
bCountStrings
,
bCountErrors
);
maMat
.
walk
(
aFunc
);
return
aFunc
.
getCount
();
}
...
...
@@ -2682,9 +2698,9 @@ ScMatrix::IterateResult ScFullMatrix::Product(bool bTextAsZero) const
return
pImpl
->
Product
(
bTextAsZero
);
}
size_t
ScFullMatrix
::
Count
(
bool
bCountStrings
)
const
size_t
ScFullMatrix
::
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
{
return
pImpl
->
Count
(
bCountStrings
);
return
pImpl
->
Count
(
bCountStrings
,
bCountErrors
);
}
size_t
ScFullMatrix
::
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
...
...
@@ -3581,10 +3597,10 @@ ScMatrix::IterateResult ScVectorRefMatrix::Product(bool bTextAsZero) const
return
mpFullMatrix
->
Product
(
bTextAsZero
);
}
size_t
ScVectorRefMatrix
::
Count
(
bool
bCountStrings
)
const
size_t
ScVectorRefMatrix
::
Count
(
bool
bCountStrings
,
bool
bCountErrors
)
const
{
const_cast
<
ScVectorRefMatrix
*>
(
this
)
->
ensureFullMatrix
();
return
mpFullMatrix
->
Count
(
bCountStrings
);
return
mpFullMatrix
->
Count
(
bCountStrings
,
bCountErrors
);
}
size_t
ScVectorRefMatrix
::
MatchDoubleInColumns
(
double
fValue
,
size_t
nCol1
,
size_t
nCol2
)
const
...
...
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