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
ed5d2c65
Kaydet (Commit)
ed5d2c65
authored
Tem 18, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Less indentations via early bailout.
Change-Id: Iae2b91fc732debe9b5c9cdd7c4717e1ef2fac08e
üst
32d9ed46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
62 deletions
+66
-62
interpr5.cxx
sc/source/core/tool/interpr5.cxx
+66
-62
No files found.
sc/source/core/tool/interpr5.cxx
Dosyayı görüntüle @
ed5d2c65
...
...
@@ -355,75 +355,79 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken
SCCOL
nCol1
,
SCROW
nRow1
,
SCTAB
nTab1
,
SCCOL
nCol2
,
SCROW
nRow2
,
SCTAB
nTab2
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"sc"
,
"er"
,
"ScInterpreter::CreateMatrixFromDoubleRef"
);
ScMatrixRef
pMat
=
NULL
;
if
(
nTab1
==
nTab2
&&
!
nGlobalError
)
{
ScTokenMatrixMap
::
const_iterator
aIter
;
if
(
static_cast
<
SCSIZE
>
(
nRow2
-
nRow1
+
1
)
*
static_cast
<
SCSIZE
>
(
nCol2
-
nCol1
+
1
)
>
ScMatrix
::
GetElementsMax
()
)
SetError
(
errStackOverflow
);
else
if
(
pTokenMatrixMap
&&
((
aIter
=
pTokenMatrixMap
->
find
(
pToken
))
!=
pTokenMatrixMap
->
end
()))
pMat
=
static_cast
<
ScToken
*>
((
*
aIter
).
second
.
get
())
->
GetMatrix
();
else
{
SCSIZE
nMatCols
=
static_cast
<
SCSIZE
>
(
nCol2
-
nCol1
+
1
);
SCSIZE
nMatRows
=
static_cast
<
SCSIZE
>
(
nRow2
-
nRow1
+
1
);
pMat
=
GetNewMat
(
nMatCols
,
nMatRows
,
true
);
if
(
pMat
&&
!
nGlobalError
)
{
ScCellIterator
aCellIter
(
pDok
,
nCol1
,
nRow1
,
nTab1
,
nCol2
,
nRow2
,
nTab2
);
if
(
nTab1
!=
nTab2
||
nGlobalError
)
{
// Not a 2D matrix.
SetError
(
errIllegalParameter
);
return
NULL
;
}
for
(
ScBaseCell
*
pCell
=
aCellIter
.
GetFirst
();
pCell
;
pCell
=
aCellIter
.
GetNext
())
{
SCCOL
nThisCol
=
aCellIter
.
GetCol
();
SCROW
nThisRow
=
aCellIter
.
GetRow
();
if
(
HasCellEmptyData
(
pCell
))
continue
;
SCSIZE
nMatCols
=
static_cast
<
SCSIZE
>
(
nCol2
-
nCol1
+
1
);
SCSIZE
nMatRows
=
static_cast
<
SCSIZE
>
(
nRow2
-
nRow1
+
1
);
if
(
HasCellValueData
(
pCell
))
{
ScAddress
aAdr
(
nThisCol
,
nThisRow
,
nTab1
);
double
fVal
=
GetCellValue
(
aAdr
,
pCell
);
if
(
nGlobalError
)
{
fVal
=
CreateDoubleError
(
nGlobalError
);
nGlobalError
=
0
;
}
pMat
->
PutDouble
(
fVal
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
continue
;
}
if
(
nMatRows
*
nMatCols
>
ScMatrix
::
GetElementsMax
())
{
SetError
(
errStackOverflow
);
return
NULL
;
}
String
aStr
;
GetCellString
(
aStr
,
pCell
);
if
(
nGlobalError
)
{
double
fVal
=
CreateDoubleError
(
nGlobalError
);
nGlobalError
=
0
;
pMat
->
PutDouble
(
fVal
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
}
else
pMat
->
PutString
(
aStr
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
}
ScTokenMatrixMap
::
const_iterator
aIter
;
if
(
pTokenMatrixMap
&&
((
aIter
=
pTokenMatrixMap
->
find
(
pToken
))
!=
pTokenMatrixMap
->
end
()))
{
return
static_cast
<
ScToken
*>
((
*
aIter
).
second
.
get
())
->
GetMatrix
();
}
ScMatrixRef
pMat
=
GetNewMat
(
nMatCols
,
nMatRows
,
true
);
if
(
!
pMat
||
nGlobalError
)
return
NULL
;
if
(
pTokenMatrixMap
)
pTokenMatrixMap
->
insert
(
ScTokenMatrixMap
::
value_type
(
pToken
,
new
ScMatrixToken
(
pMat
)));
ScCellIterator
aCellIter
(
pDok
,
nCol1
,
nRow1
,
nTab1
,
nCol2
,
nRow2
,
nTab2
);
for
(
ScBaseCell
*
pCell
=
aCellIter
.
GetFirst
();
pCell
;
pCell
=
aCellIter
.
GetNext
())
{
SCCOL
nThisCol
=
aCellIter
.
GetCol
();
SCROW
nThisRow
=
aCellIter
.
GetRow
();
if
(
HasCellEmptyData
(
pCell
))
continue
;
if
(
HasCellValueData
(
pCell
))
{
ScAddress
aAdr
(
nThisCol
,
nThisRow
,
nTab1
);
double
fVal
=
GetCellValue
(
aAdr
,
pCell
);
if
(
nGlobalError
)
{
fVal
=
CreateDoubleError
(
nGlobalError
);
nGlobalError
=
0
;
}
pMat
->
PutDouble
(
fVal
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
continue
;
}
String
aStr
;
GetCellString
(
aStr
,
pCell
);
if
(
nGlobalError
)
{
double
fVal
=
CreateDoubleError
(
nGlobalError
);
nGlobalError
=
0
;
pMat
->
PutDouble
(
fVal
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
}
else
pMat
->
PutString
(
aStr
,
static_cast
<
SCSIZE
>
(
nThisCol
-
nCol1
),
static_cast
<
SCSIZE
>
(
nThisRow
-
nRow1
));
}
else
// not a 2D matrix
SetError
(
errIllegalParameter
);
if
(
pTokenMatrixMap
)
pTokenMatrixMap
->
insert
(
ScTokenMatrixMap
::
value_type
(
pToken
,
new
ScMatrixToken
(
pMat
)));
return
pMat
;
}
...
...
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