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
b6b0b95b
Kaydet (Commit)
b6b0b95b
authored
May 14, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bail out of group calculation in case the array fetching fails.
Change-Id: Ibb7575eeb025fc025d05b147629113796185c5d3
üst
0c53ccd1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
15 deletions
+45
-15
vectortoken.cxx
formula/source/core/api/vectortoken.cxx
+24
-5
vectortoken.hxx
include/formula/vectortoken.hxx
+5
-0
column2.cxx
sc/source/core/data/column2.cxx
+10
-10
grouptokenconverter.cxx
sc/source/core/data/grouptokenconverter.cxx
+6
-0
No files found.
formula/source/core/api/vectortoken.cxx
Dosyayı görüntüle @
b6b0b95b
...
@@ -11,15 +11,34 @@
...
@@ -11,15 +11,34 @@
namespace
formula
{
namespace
formula
{
VectorRefArray
::
VectorRefArray
()
:
mpNumericArray
(
NULL
),
mpStringArray
(
NULL
)
{}
VectorRefArray
::
VectorRefArray
()
:
VectorRefArray
::
VectorRefArray
(
const
double
*
pArray
)
:
mpNumericArray
(
pArray
),
mpStringArray
(
NULL
)
{}
mpNumericArray
(
NULL
),
VectorRefArray
::
VectorRefArray
(
rtl_uString
**
pArray
)
:
mpNumericArray
(
NULL
),
mpStringArray
(
pArray
)
{}
mpStringArray
(
NULL
),
mbValid
(
true
)
{}
VectorRefArray
::
VectorRefArray
(
InitInvalid
)
:
mpNumericArray
(
NULL
),
mpStringArray
(
NULL
),
mbValid
(
false
)
{}
VectorRefArray
::
VectorRefArray
(
const
double
*
pArray
)
:
mpNumericArray
(
pArray
),
mpStringArray
(
NULL
),
mbValid
(
true
)
{}
VectorRefArray
::
VectorRefArray
(
rtl_uString
**
pArray
)
:
mpNumericArray
(
NULL
),
mpStringArray
(
pArray
),
mbValid
(
true
)
{}
VectorRefArray
::
VectorRefArray
(
const
double
*
pNumArray
,
rtl_uString
**
pStrArray
)
:
VectorRefArray
::
VectorRefArray
(
const
double
*
pNumArray
,
rtl_uString
**
pStrArray
)
:
mpNumericArray
(
pNumArray
),
mpStringArray
(
pStrArray
)
{}
mpNumericArray
(
pNumArray
),
mpStringArray
(
pStrArray
),
mbValid
(
true
)
{}
bool
VectorRefArray
::
isValid
()
const
bool
VectorRefArray
::
isValid
()
const
{
{
return
m
pNumericArray
||
mpStringArray
;
return
m
bValid
;
}
}
SingleVectorRefToken
::
SingleVectorRefToken
(
const
VectorRefArray
&
rArray
,
size_t
nReqLength
,
size_t
nArrayLength
)
:
SingleVectorRefToken
::
SingleVectorRefToken
(
const
VectorRefArray
&
rArray
,
size_t
nReqLength
,
size_t
nArrayLength
)
:
...
...
include/formula/vectortoken.hxx
Dosyayı görüntüle @
b6b0b95b
...
@@ -34,10 +34,15 @@ namespace formula {
...
@@ -34,10 +34,15 @@ namespace formula {
*/
*/
struct
FORMULA_DLLPUBLIC
VectorRefArray
struct
FORMULA_DLLPUBLIC
VectorRefArray
{
{
enum
InitInvalid
{
Invalid
};
const
double
*
mpNumericArray
;
const
double
*
mpNumericArray
;
rtl_uString
**
mpStringArray
;
rtl_uString
**
mpStringArray
;
bool
mbValid
;
VectorRefArray
();
VectorRefArray
();
VectorRefArray
(
InitInvalid
);
VectorRefArray
(
const
double
*
pArray
);
VectorRefArray
(
const
double
*
pArray
);
VectorRefArray
(
rtl_uString
**
pArray
);
VectorRefArray
(
rtl_uString
**
pArray
);
VectorRefArray
(
const
double
*
pNumArray
,
rtl_uString
**
pStrArray
);
VectorRefArray
(
const
double
*
pNumArray
,
rtl_uString
**
pStrArray
);
...
...
sc/source/core/data/column2.cxx
Dosyayı görüntüle @
b6b0b95b
...
@@ -2426,7 +2426,7 @@ bool hasNonEmpty( const sc::FormulaGroupContext::StrArrayType& rArray, SCROW nRo
...
@@ -2426,7 +2426,7 @@ bool hasNonEmpty( const sc::FormulaGroupContext::StrArrayType& rArray, SCROW nRo
formula
::
VectorRefArray
ScColumn
::
FetchVectorRefArray
(
SCROW
nRow1
,
SCROW
nRow2
)
formula
::
VectorRefArray
ScColumn
::
FetchVectorRefArray
(
SCROW
nRow1
,
SCROW
nRow2
)
{
{
if
(
nRow1
>
nRow2
)
if
(
nRow1
>
nRow2
)
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
// See if the requested range is already cached.
// See if the requested range is already cached.
sc
::
FormulaGroupContext
&
rCxt
=
pDocument
->
GetFormulaGroupContext
();
sc
::
FormulaGroupContext
&
rCxt
=
pDocument
->
GetFormulaGroupContext
();
...
@@ -2470,13 +2470,13 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2470,13 +2470,13 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
pColArray
=
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
&
rArray
,
NULL
);
pColArray
=
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
&
rArray
,
NULL
);
if
(
!
pColArray
)
if
(
!
pColArray
)
// Failed to insert a new cached column array.
// Failed to insert a new cached column array.
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
// Fill the remaining array with values from the following blocks.
// Fill the remaining array with values from the following blocks.
size_t
nPos
=
itBlk
->
size
;
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
++
itBlk
;
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
if
(
pColArray
->
mpStrArray
)
if
(
pColArray
->
mpStrArray
)
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
...
@@ -2507,7 +2507,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2507,7 +2507,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
size_t
nPos
=
itBlk
->
size
;
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
++
itBlk
;
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
if
(
pColArray
->
mpNumArray
)
if
(
pColArray
->
mpNumArray
)
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
...
@@ -2524,7 +2524,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2524,7 +2524,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
pColArray
=
copyFirstFormulaBlock
(
rCxt
,
itBlk
,
nRow2
+
1
,
nTab
,
nCol
);
pColArray
=
copyFirstFormulaBlock
(
rCxt
,
itBlk
,
nRow2
+
1
,
nTab
,
nCol
);
if
(
!
pColArray
)
if
(
!
pColArray
)
// Failed to insert a new cached column array.
// Failed to insert a new cached column array.
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
const
double
*
pNum
=
NULL
;
const
double
*
pNum
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
...
@@ -2539,12 +2539,12 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2539,12 +2539,12 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
pColArray
=
copyFirstFormulaBlock
(
rCxt
,
itBlk
,
nRow2
+
1
,
nTab
,
nCol
);
pColArray
=
copyFirstFormulaBlock
(
rCxt
,
itBlk
,
nRow2
+
1
,
nTab
,
nCol
);
if
(
!
pColArray
)
if
(
!
pColArray
)
// Failed to insert a new cached column array.
// Failed to insert a new cached column array.
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
size_t
nPos
=
itBlk
->
size
;
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
++
itBlk
;
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
const
double
*
pNum
=
NULL
;
const
double
*
pNum
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
rtl_uString
**
pStr
=
NULL
;
...
@@ -2564,7 +2564,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2564,7 +2564,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
pColArray
=
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
&
rArray
,
NULL
);
pColArray
=
rCxt
.
setCachedColArray
(
nTab
,
nCol
,
&
rArray
,
NULL
);
if
(
!
pColArray
)
if
(
!
pColArray
)
// Failed to insert a new cached column array.
// Failed to insert a new cached column array.
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
if
(
static_cast
<
size_t
>
(
nRow2
)
<
itBlk
->
size
)
if
(
static_cast
<
size_t
>
(
nRow2
)
<
itBlk
->
size
)
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
]);
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
]);
...
@@ -2573,7 +2573,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2573,7 +2573,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
size_t
nPos
=
itBlk
->
size
;
size_t
nPos
=
itBlk
->
size
;
++
itBlk
;
++
itBlk
;
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
if
(
!
appendToBlock
(
pDocument
,
rCxt
,
*
pColArray
,
nPos
,
nRow2
+
1
,
itBlk
,
maCells
.
end
()))
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
if
(
pColArray
->
mpStrArray
&&
hasNonEmpty
(
*
pColArray
->
mpStrArray
,
nRow1
,
nRow2
))
if
(
pColArray
->
mpStrArray
&&
hasNonEmpty
(
*
pColArray
->
mpStrArray
,
nRow1
,
nRow2
))
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
return
formula
::
VectorRefArray
(
&
(
*
pColArray
->
mpNumArray
)[
nRow1
],
&
(
*
pColArray
->
mpStrArray
)[
nRow1
]);
...
@@ -2585,7 +2585,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
...
@@ -2585,7 +2585,7 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2
;
;
}
}
return
formula
::
VectorRefArray
();
return
formula
::
VectorRefArray
(
formula
::
VectorRefArray
::
Invalid
);
}
}
void
ScColumn
::
SetFormulaResults
(
SCROW
nRow
,
const
double
*
pResults
,
size_t
nLen
)
void
ScColumn
::
SetFormulaResults
(
SCROW
nRow
,
const
double
*
pResults
,
size_t
nLen
)
...
...
sc/source/core/data/grouptokenconverter.cxx
Dosyayı görüntüle @
b6b0b95b
...
@@ -119,6 +119,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
...
@@ -119,6 +119,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
if
(
nTrimLen
)
if
(
nTrimLen
)
aArray
=
mrDoc
.
FetchVectorRefArray
(
aRefPos
,
nTrimLen
);
aArray
=
mrDoc
.
FetchVectorRefArray
(
aRefPos
,
nTrimLen
);
if
(
!
aArray
.
isValid
())
return
false
;
formula
::
SingleVectorRefToken
aTok
(
aArray
,
nLen
,
nTrimLen
);
formula
::
SingleVectorRefToken
aTok
(
aArray
,
nLen
,
nTrimLen
);
mrGroupTokens
.
AddToken
(
aTok
);
mrGroupTokens
.
AddToken
(
aTok
);
}
}
...
@@ -188,6 +191,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
...
@@ -188,6 +191,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
if
(
nArrayLength
)
if
(
nArrayLength
)
aArray
=
mrDoc
.
FetchVectorRefArray
(
aRefPos
,
nArrayLength
);
aArray
=
mrDoc
.
FetchVectorRefArray
(
aRefPos
,
nArrayLength
);
if
(
!
aArray
.
isValid
())
return
false
;
aArrays
.
push_back
(
aArray
);
aArrays
.
push_back
(
aArray
);
}
}
...
...
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