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
ba686b9b
Kaydet (Commit)
ba686b9b
authored
Şub 12, 2015
tarafından
László Németh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#89281 fix performance regression of XLS import - cleanup
Change-Id: I6d7f279732d9992d584aab96c3a747d6e6130147
üst
359cfa16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
33 deletions
+49
-33
tokenarray.hxx
sc/inc/tokenarray.hxx
+2
-1
token.cxx
sc/source/core/tool/token.cxx
+43
-29
excform.cxx
sc/source/filter/excel/excform.cxx
+4
-3
No files found.
sc/inc/tokenarray.hxx
Dosyayı görüntüle @
ba686b9b
...
...
@@ -239,7 +239,8 @@ public:
*/
OUString
CreateString
(
sc
::
TokenStringContext
&
rCxt
,
const
ScAddress
&
rPos
)
const
;
bool
WrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
,
bool
bQueryNeedWrap
=
false
);
void
WrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
);
bool
NeedsWrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
)
const
;
#if DEBUG_FORMULA_COMPILER
void
Dump
()
const
;
...
...
sc/source/core/tool/token.cxx
Dosyayı görüntüle @
ba686b9b
...
...
@@ -3994,27 +3994,17 @@ OUString ScTokenArray::CreateString( sc::TokenStringContext& rCxt, const ScAddre
namespace
{
bool
wrapAddress
(
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
,
bool
bQueryOnly
)
void
wrapAddress
(
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
)
{
bool
bChanged
=
false
;
if
(
rPos
.
Col
()
>
nMaxCol
)
{
if
(
!
bQueryOnly
)
rPos
.
SetCol
(
rPos
.
Col
()
-
nMaxCol
-
1
);
bChanged
=
true
;
}
rPos
.
SetCol
(
rPos
.
Col
()
-
nMaxCol
-
1
);
if
(
rPos
.
Row
()
>
nMaxRow
)
{
if
(
!
bQueryOnly
)
rPos
.
SetRow
(
rPos
.
Row
()
-
nMaxRow
-
1
);
bChanged
=
true
;
}
return
bChanged
;
rPos
.
SetRow
(
rPos
.
Row
()
-
nMaxRow
-
1
);
}
}
bool
ScTokenArray
::
WrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
,
bool
bQueryNeedWrap
)
void
ScTokenArray
::
WrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
)
{
FormulaToken
**
p
=
pCode
;
FormulaToken
**
pEnd
=
p
+
static_cast
<
size_t
>
(
nLen
);
...
...
@@ -4027,12 +4017,8 @@ bool ScTokenArray::WrapReference( const ScAddress& rPos, SCCOL nMaxCol, SCROW nM
formula
::
FormulaToken
*
pToken
=
*
p
;
ScSingleRefData
&
rRef
=
*
pToken
->
GetSingleRef
();
ScAddress
aAbs
=
rRef
.
toAbs
(
rPos
);
if
(
wrapAddress
(
aAbs
,
nMaxCol
,
nMaxRow
,
bQueryNeedWrap
))
{
if
(
bQueryNeedWrap
)
return
true
;
rRef
.
SetAddress
(
aAbs
,
rPos
);
}
wrapAddress
(
aAbs
,
nMaxCol
,
nMaxRow
);
rRef
.
SetAddress
(
aAbs
,
rPos
);
}
break
;
case
svDoubleRef
:
...
...
@@ -4040,15 +4026,43 @@ bool ScTokenArray::WrapReference( const ScAddress& rPos, SCCOL nMaxCol, SCROW nM
formula
::
FormulaToken
*
pToken
=
*
p
;
ScComplexRefData
&
rRef
=
*
pToken
->
GetDoubleRef
();
ScRange
aAbs
=
rRef
.
toAbs
(
rPos
);
bool
bChanged
=
wrapAddress
(
aAbs
.
aStart
,
nMaxCol
,
nMaxRow
,
bQueryNeedWrap
);
bool
bChanged2
=
wrapAddress
(
aAbs
.
aEnd
,
nMaxCol
,
nMaxRow
,
bQueryNeedWrap
);
if
(
bChanged
||
bChanged2
)
{
if
(
bQueryNeedWrap
)
return
true
;
aAbs
.
PutInOrder
();
rRef
.
SetRange
(
aAbs
,
rPos
);
}
wrapAddress
(
aAbs
.
aStart
,
nMaxCol
,
nMaxRow
);
wrapAddress
(
aAbs
.
aEnd
,
nMaxCol
,
nMaxRow
);
aAbs
.
PutInOrder
();
rRef
.
SetRange
(
aAbs
,
rPos
);
}
break
;
default
:
;
}
}
}
bool
ScTokenArray
::
NeedsWrapReference
(
const
ScAddress
&
rPos
,
SCCOL
nMaxCol
,
SCROW
nMaxRow
)
const
{
FormulaToken
**
p
=
pCode
;
FormulaToken
**
pEnd
=
p
+
static_cast
<
size_t
>
(
nLen
);
for
(;
p
!=
pEnd
;
++
p
)
{
switch
((
*
p
)
->
GetType
())
{
case
svSingleRef
:
{
formula
::
FormulaToken
*
pToken
=
*
p
;
ScSingleRefData
&
rRef
=
*
pToken
->
GetSingleRef
();
ScAddress
aAbs
=
rRef
.
toAbs
(
rPos
);
if
(
aAbs
.
Col
()
>
nMaxCol
||
aAbs
.
Row
()
>
nMaxRow
)
return
true
;
}
break
;
case
svDoubleRef
:
{
formula
::
FormulaToken
*
pToken
=
*
p
;
ScComplexRefData
&
rRef
=
*
pToken
->
GetDoubleRef
();
ScRange
aAbs
=
rRef
.
toAbs
(
rPos
);
if
(
aAbs
.
aStart
.
Col
()
>
nMaxCol
||
aAbs
.
aStart
.
Row
()
>
nMaxRow
||
aAbs
.
aEnd
.
Col
()
>
nMaxCol
||
aAbs
.
aEnd
.
Row
()
>
nMaxRow
)
return
true
;
}
break
;
default
:
...
...
sc/source/filter/excel/excform.cxx
Dosyayı görüntüle @
ba686b9b
...
...
@@ -122,13 +122,14 @@ void ImportExcel::Formula(
const
ScTokenArray
*
pSharedCode
=
pFormConv
->
GetSharedFormula
(
aRefPos
);
if
(
pSharedCode
)
{
ScFormulaCell
*
pCell
=
new
ScFormulaCell
(
pD
,
aScPos
,
*
pSharedCode
);
// Do we need to wrap the column or row indices? (tdf#76611)
if
(
pCell
->
GetCode
()
->
WrapReference
(
aScPos
,
EXC_MAXCOL8
,
EXC_MAXROW8
,
true
))
ScFormulaCell
*
pCell
;
if
(
pSharedCode
->
NeedsWrapReference
(
aScPos
,
EXC_MAXCOL8
,
EXC_MAXROW8
))
{
pCell
=
new
ScFormulaCell
(
pD
,
aScPos
,
pSharedCode
->
Clone
());
pCell
->
GetCode
()
->
WrapReference
(
aScPos
,
EXC_MAXCOL8
,
EXC_MAXROW8
);
}
else
pCell
=
new
ScFormulaCell
(
pD
,
aScPos
,
*
pSharedCode
);
rDoc
.
getDoc
().
EnsureTable
(
aScPos
.
Tab
());
rDoc
.
setFormulaCell
(
aScPos
,
pCell
);
pCell
->
SetNeedNumberFormat
(
false
);
...
...
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