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
cffba76a
Kaydet (Commit)
cffba76a
authored
Tem 12, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cache select converted tokens to avoid unnecessary token duplication.
Change-Id: I3a63d5cbbc1cdc37d681ffd41ec22ff65e56cc0d
üst
1a74c58b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
formulagroup.cxx
sc/source/core/tool/formulagroup.cxx
+25
-2
No files found.
sc/source/core/tool/formulagroup.cxx
Dosyayı görüntüle @
cffba76a
...
...
@@ -19,6 +19,7 @@
#include "formula/vectortoken.hxx"
#include <vector>
#include <boost/unordered_map.hpp>
#define USE_DUMMY_INTERPRETER 1
...
...
@@ -37,6 +38,8 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
const
ScFormulaCellGroupRef
&
xGroup
,
ScTokenArray
&
rCode
)
{
typedef
boost
::
unordered_map
<
const
formula
::
FormulaToken
*
,
formula
::
FormulaTokenRef
>
CachedTokensType
;
// Decompose the group into individual cells and calculate them individually.
// The caller must ensure that the top position is the start position of
...
...
@@ -45,11 +48,21 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
ScAddress
aTmpPos
=
rTopPos
;
std
::
vector
<
double
>
aResults
;
aResults
.
reserve
(
xGroup
->
mnLength
);
CachedTokensType
aCachedTokens
;
for
(
SCROW
i
=
0
;
i
<
xGroup
->
mnLength
;
++
i
,
aTmpPos
.
IncRow
())
{
ScTokenArray
aCode2
;
for
(
const
formula
::
FormulaToken
*
p
=
rCode
.
First
();
p
;
p
=
rCode
.
Next
())
{
CachedTokensType
::
iterator
it
=
aCachedTokens
.
find
(
p
);
if
(
it
!=
aCachedTokens
.
end
())
{
// This token is cached. Use the cached one.
aCode2
.
AddToken
(
*
it
->
second
);
continue
;
}
switch
(
p
->
GetType
())
{
case
formula
:
:
svSingleVectorRef
:
...
...
@@ -77,8 +90,18 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
pMat
->
PutDouble
(
pArray
,
nRowSize
,
nCol
,
0
);
}
ScMatrixToken
aTok
(
pMat
);
aCode2
.
AddToken
(
aTok
);
if
(
p2
->
IsStartFixed
()
&&
p2
->
IsEndFixed
())
{
// Cached the converted token for absolute range referene.
formula
::
FormulaTokenRef
xTok
(
new
ScMatrixToken
(
pMat
));
aCachedTokens
.
insert
(
CachedTokensType
::
value_type
(
p
,
xTok
));
aCode2
.
AddToken
(
*
xTok
);
}
else
{
ScMatrixToken
aTok
(
pMat
);
aCode2
.
AddToken
(
aTok
);
}
}
break
;
default
:
...
...
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