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
d658c092
Kaydet (Commit)
d658c092
authored
Mar 07, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#75628: SUM should inherit error if one is present in its references.
Change-Id: I94017fe91295dbb929f57be5e3fb26edf5032a8f
üst
78e6b7a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
interpr6.cxx
sc/source/core/tool/interpr6.cxx
+38
-4
No files found.
sc/source/core/tool/interpr6.cxx
Dosyayı görüntüle @
d658c092
...
...
@@ -210,8 +210,10 @@ namespace {
class
NumericCellAccumulator
{
double
mfSum
;
sal_uInt16
mnError
;
public
:
NumericCellAccumulator
()
:
mfSum
(
0.0
)
{}
NumericCellAccumulator
()
:
mfSum
(
0.0
)
,
mnError
(
0
)
{}
void
operator
()
(
size_t
,
double
fVal
)
{
...
...
@@ -220,11 +222,28 @@ public:
void
operator
()
(
size_t
,
const
ScFormulaCell
*
pCell
)
{
if
(
mnError
)
// Skip all the rest if we have an error.
return
;
double
fVal
=
0.0
;
sal_uInt16
nErr
=
0
;
ScFormulaCell
&
rCell
=
const_cast
<
ScFormulaCell
&>
(
*
pCell
);
if
(
rCell
.
IsValue
())
mfSum
+=
rCell
.
GetValue
();
if
(
!
rCell
.
GetErrorOrValue
(
nErr
,
fVal
))
// The cell has neither error nor value. Perhaps string result.
return
;
if
(
nErr
)
{
// Cell has error.
mnError
=
nErr
;
return
;
}
mfSum
+=
fVal
;
}
sal_uInt16
getError
()
const
{
return
mnError
;
}
double
getSum
()
const
{
return
mfSum
;
}
};
...
...
@@ -299,10 +318,11 @@ class FuncSum : public sc::ColumnSpanSet::ColumnAction
sc
::
ColumnBlockConstPosition
maPos
;
ScColumn
*
mpCol
;
double
mfSum
;
sal_uInt16
mnError
;
sal_uInt32
mnNumFmt
;
public
:
FuncSum
()
:
mpCol
(
0
),
mfSum
(
0.0
),
mnNumFmt
(
0
)
{}
FuncSum
()
:
mpCol
(
0
),
mfSum
(
0.0
),
mn
Error
(
0
),
mn
NumFmt
(
0
)
{}
virtual
void
startColumn
(
ScColumn
*
pCol
)
{
...
...
@@ -315,12 +335,20 @@ public:
if
(
!
bVal
)
return
;
if
(
mnError
)
return
;
NumericCellAccumulator
aFunc
;
maPos
.
miCellPos
=
sc
::
ParseFormulaNumeric
(
maPos
.
miCellPos
,
mpCol
->
GetCellStore
(),
nRow1
,
nRow2
,
aFunc
);
mnError
=
aFunc
.
getError
();
if
(
mnError
)
return
;
mfSum
+=
aFunc
.
getSum
();
mnNumFmt
=
mpCol
->
GetNumberFormat
(
nRow2
);
};
sal_uInt16
getError
()
const
{
return
mnError
;
}
double
getSum
()
const
{
return
mfSum
;
}
sal_uInt32
getNumberFormat
()
const
{
return
mnNumFmt
;
}
};
...
...
@@ -806,6 +834,12 @@ void ScInterpreter::ScSum()
FuncSum
aAction
;
aSet
.
executeColumnAction
(
*
pDok
,
aAction
);
sal_uInt16
nErr
=
aAction
.
getError
();
if
(
nErr
)
{
SetError
(
nErr
);
return
;
}
fRes
+=
aAction
.
getSum
();
// Get the number format of the last iterated cell.
...
...
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