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
babe7c89
Kaydet (Commit)
babe7c89
authored
Eki 26, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some cleanup to remove duplicated code.
Change-Id: I522d3259636f6ebb29c3f4da2155c9322a382903
üst
7171b268
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
188 deletions
+9
-188
column2.cxx
sc/source/core/data/column2.cxx
+9
-188
No files found.
sc/source/core/data/column2.cxx
Dosyayı görüntüle @
babe7c89
...
...
@@ -2409,87 +2409,14 @@ void getBlockIterators(
}
}
bool
appendDouble
(
sc
::
FormulaGroupContext
::
NumArrayType
&
rArray
,
size_t
nLen
,
sc
::
CellStoreType
::
iterator
it
,
const
sc
::
CellStoreType
::
iterator
&
itEnd
)
{
size_t
nLenRemain
=
nLen
;
double
fNan
;
rtl
::
math
::
setNan
(
&
fNan
);
for
(;
it
!=
itEnd
;
++
it
)
{
switch
(
it
->
type
)
{
case
sc
:
:
element_type_numeric
:
{
sc
::
numeric_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
numeric_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
)
rArray
.
push_back
(
*
itData
);
}
break
;
case
sc
:
:
element_type_formula
:
{
sc
::
formula_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
formula_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
sal_uInt16
nErr
;
double
fVal
;
for
(;
itData
!=
itDataEnd
;
++
itData
)
{
ScFormulaCell
&
rFC
=
**
itData
;
if
(
!
rFC
.
GetErrorOrValue
(
nErr
,
fVal
)
||
nErr
)
{
if
(
nErr
==
ScErrorCodes
::
errCircularReference
)
{
// This cell needs to be recalculated on next visit.
rFC
.
SetErrCode
(
0
);
rFC
.
SetDirtyVar
();
}
return
false
;
}
rArray
.
push_back
(
fVal
);
}
}
break
;
case
sc
:
:
element_type_empty
:
{
// Fill it with NaN's.
if
(
nLenRemain
>=
it
->
size
)
{
rArray
.
resize
(
rArray
.
size
()
+
it
->
size
,
fNan
);
nLenRemain
-=
it
->
size
;
}
else
{
rArray
.
resize
(
rArray
.
size
()
+
nLenRemain
,
fNan
);
nLenRemain
=
0
;
}
}
break
;
case
sc
:
:
element_type_string
:
case
sc
:
:
element_type_edittext
:
default
:
return
false
;
}
if
(
!
nLenRemain
)
return
true
;
}
return
false
;
}
bool
appendToNumBlock
(
bool
appendToBlock
(
ScDocument
*
pDoc
,
sc
::
FormulaGroupContext
&
rCxt
,
sc
::
FormulaGroupContext
::
ColArray
&
rColArray
,
size_t
nPos
,
size_t
nArrayLen
,
sc
::
CellStoreType
::
iterator
it
,
const
sc
::
CellStoreType
::
iterator
&
itEnd
)
{
sc
::
FormulaGroupContext
::
NumArrayType
&
rNumArray
=
*
rColArray
.
mpNumArray
;
svl
::
SharedStringPool
&
rPool
=
pDoc
->
GetSharedStringPool
();
size_t
nLenRemain
=
nArrayLen
-
nPos
;
double
fNan
;
rtl
::
math
::
setNan
(
&
fNan
);
for
(;
it
!=
itEnd
;
++
it
)
{
...
...
@@ -2550,9 +2477,7 @@ bool appendToNumBlock(
return
false
;
}
if
(
aRes
.
meType
==
sc
::
FormulaResultValue
::
Value
)
rNumArray
[
nPos
]
=
aRes
.
mfValue
;
else
if
(
aRes
.
meType
==
sc
::
FormulaResultValue
::
String
)
{
if
(
!
rColArray
.
mpStrArray
)
{
...
...
@@ -2563,100 +2488,6 @@ bool appendToNumBlock(
(
*
rColArray
.
mpStrArray
)[
nPos
]
=
aRes
.
maString
.
getDataIgnoreCase
();
}
}
}
break
;
case
sc
:
:
element_type_empty
:
{
if
(
nLenRemain
>
it
->
size
)
{
nPos
+=
it
->
size
;
nLenRemain
-=
it
->
size
;
}
else
{
nPos
=
nArrayLen
;
nLenRemain
=
0
;
}
}
break
;
case
sc
:
:
element_type_numeric
:
{
sc
::
numeric_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
numeric_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
,
++
nPos
)
rNumArray
[
nPos
]
=
*
itData
;
}
break
;
default
:
return
false
;
}
if
(
!
nLenRemain
)
return
true
;
}
return
false
;
}
bool
appendToStringBlock
(
ScDocument
*
pDoc
,
sc
::
FormulaGroupContext
&
rCxt
,
sc
::
FormulaGroupContext
::
ColArray
&
rColArray
,
size_t
nPos
,
size_t
nArrayLen
,
sc
::
CellStoreType
::
iterator
it
,
const
sc
::
CellStoreType
::
iterator
&
itEnd
)
{
sc
::
FormulaGroupContext
::
StrArrayType
&
rStrArray
=
*
rColArray
.
mpStrArray
;
svl
::
SharedStringPool
&
rPool
=
pDoc
->
GetSharedStringPool
();
size_t
nLenRemain
=
nArrayLen
-
nPos
;
double
fNan
;
rtl
::
math
::
setNan
(
&
fNan
);
for
(;
it
!=
itEnd
;
++
it
)
{
switch
(
it
->
type
)
{
case
sc
:
:
element_type_string
:
{
sc
::
string_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
string_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
,
++
nPos
)
rStrArray
[
nPos
]
=
itData
->
getDataIgnoreCase
();
}
break
;
case
sc
:
:
element_type_edittext
:
{
sc
::
edittext_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
edittext_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
,
++
nPos
)
{
OUString
aStr
=
ScEditUtil
::
GetString
(
**
itData
,
pDoc
);
rStrArray
[
nPos
]
=
rPool
.
intern
(
aStr
).
getDataIgnoreCase
();
}
}
break
;
case
sc
:
:
element_type_formula
:
{
sc
::
formula_block
::
iterator
itData
,
itDataEnd
;
getBlockIterators
<
sc
::
formula_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
,
++
nPos
)
{
ScFormulaCell
&
rFC
=
**
itData
;
sc
::
FormulaResultValue
aRes
=
rFC
.
GetResult
();
if
(
aRes
.
meType
==
sc
::
FormulaResultValue
::
Invalid
||
aRes
.
mnError
)
{
if
(
aRes
.
mnError
==
ScErrorCodes
::
errCircularReference
)
{
// This cell needs to be recalculated on next visit.
rFC
.
SetErrCode
(
0
);
rFC
.
SetDirtyVar
();
}
return
false
;
}
if
(
aRes
.
meType
==
sc
::
FormulaResultValue
::
String
)
rStrArray
[
nPos
]
=
aRes
.
maString
.
getDataIgnoreCase
();
else
{
if
(
!
rColArray
.
mpNumArray
)
...
...
@@ -2866,10 +2697,8 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( sc::FormulaGroupContext&
// Fill the remaining array with values from the following blocks.
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
if
(
!
appendToNumBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
{
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
}
if
(
pColArray
->
mpStrArray
)
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
...
...
@@ -2899,7 +2728,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( sc::FormulaGroupContext&
// Fill the remaining array with values from the following blocks.
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
if
(
!
appendTo
String
Block
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
if
(
pColArray
->
mpNumArray
)
...
...
@@ -2936,16 +2765,8 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( sc::FormulaGroupContext&
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
if
(
pColArray
->
mpNumArray
)
{
if
(
!
appendToNumBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
}
else
{
if
(
!
appendToStringBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
}
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
const
double
*
pNum
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
...
...
@@ -2973,7 +2794,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( sc::FormulaGroupContext&
// Fill the remaining array with values from the following blocks.
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
if
(
!
appendTo
Num
Block
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
if
(
pColArray
->
mpStrArray
)
...
...
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