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
4de4f1fd
Kaydet (Commit)
4de4f1fd
authored
Şub 17, 2015
tarafından
László Németh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#89436 fix ScHorizontalAttrIterator performance
Change-Id: I69be1a85b74ede8f02788a6370d4ebb40bddbe11
üst
4ed53dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
17 deletions
+33
-17
dociter.hxx
sc/inc/dociter.hxx
+3
-0
dociter.cxx
sc/source/core/data/dociter.cxx
+30
-17
No files found.
sc/inc/dociter.hxx
Dosyayı görüntüle @
4de4f1fd
...
...
@@ -487,11 +487,14 @@ private:
SCROW
nEndRow
;
SCROW
*
pNextEnd
;
SCCOL
*
pPrevColEnd
;
SCSIZE
*
pIndices
;
const
ScPatternAttr
**
ppPatterns
;
SCCOL
nCol
;
SCROW
nRow
;
bool
bRowEmpty
;
bool
bRepeatedRow
;
SCROW
nMinNextEnd
;
public
:
ScHorizontalAttrIterator
(
ScDocument
*
pDocument
,
SCTAB
nTable
,
...
...
sc/source/core/data/dociter.cxx
Dosyayı görüntüle @
4de4f1fd
...
...
@@ -2235,12 +2235,14 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB
nRow
=
nStartRow
;
nCol
=
nStartCol
;
bRowEmpty
=
false
;
bRepeatedRow
=
false
;
pIndices
=
new
SCSIZE
[
nEndCol
-
nStartCol
+
1
];
pNextEnd
=
new
SCROW
[
nEndCol
-
nStartCol
+
1
];
pPrevColEnd
=
new
SCCOL
[
nEndCol
-
nStartCol
+
1
];
ppPatterns
=
new
const
ScPatternAttr
*
[
nEndCol
-
nStartCol
+
1
];
SCROW
nSkipTo
=
MAXROW
;
nMinNextEnd
=
MAXROW
;
bool
bEmpty
=
true
;
for
(
i
=
nStartCol
;
i
<=
nEndCol
;
i
++
)
{
...
...
@@ -2253,12 +2255,12 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB
const
ScPatternAttr
*
pPattern
=
pArray
->
pData
[
nIndex
].
pPattern
;
SCROW
nThisEnd
=
pArray
->
pData
[
nIndex
].
nRow
;
if
(
nThisEnd
<
nMinNextEnd
)
nMinNextEnd
=
nThisEnd
;
// nMinNextEnd can be set here already
if
(
IsDefaultItem
(
pPattern
)
)
{
pPattern
=
NULL
;
if
(
nThisEnd
<
nSkipTo
)
nSkipTo
=
nThisEnd
;
// nSkipTo can be set here already
}
else
bEmpty
=
false
;
// Found attributes
...
...
@@ -2268,7 +2270,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB
}
if
(
bEmpty
)
nRow
=
n
SkipTo
;
// Skip until end of next section
nRow
=
n
MinNextEnd
;
// Skip until end of next section
bRowEmpty
=
bEmpty
;
}
...
...
@@ -2277,6 +2279,7 @@ ScHorizontalAttrIterator::~ScHorizontalAttrIterator()
{
delete
[]
ppPatterns
;
delete
[]
pNextEnd
;
delete
[]
pPrevColEnd
;
delete
[]
pIndices
;
}
...
...
@@ -2297,8 +2300,15 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
const
ScPatternAttr
*
pPat
=
ppPatterns
[
nCol
-
nStartCol
];
rRow
=
nRow
;
rCol1
=
nCol
;
while
(
nCol
<
nEndCol
&&
ppPatterns
[
nCol
+
1
-
nStartCol
]
==
pPat
)
++
nCol
;
if
(
bRepeatedRow
)
nCol
=
pPrevColEnd
[
nCol
];
else
{
while
(
nCol
<
nEndCol
&&
(
ppPatterns
[
nCol
+
1
-
nStartCol
]
==
pPat
)
)
++
nCol
;
// store the result to avoid the previous very expensive comparisons
pPrevColEnd
[
rCol1
]
=
nCol
;
}
rCol2
=
nCol
;
++
nCol
;
// Count up for next call
return
pPat
;
// Found it!
...
...
@@ -2309,7 +2319,13 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
++
nRow
;
if
(
nRow
>
nEndRow
)
// Already at the end?
return
NULL
;
// Found nothing
nCol
=
nStartCol
;
// Start at the left again
if
(
bRepeatedRow
&&
!
nMinNextEnd
<
nRow
)
// use the data of the previous row
continue
;
bRepeatedRow
=
true
;
// ppPatterns is not modified
nMinNextEnd
=
MAXROW
;
bool
bEmpty
=
true
;
SCCOL
i
;
...
...
@@ -2319,6 +2335,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
if
(
pNextEnd
[
nPos
]
<
nRow
)
{
const
ScAttrArray
*
pArray
=
pDoc
->
maTabs
[
nTab
]
->
aCol
[
i
].
pAttrArray
;
bRepeatedRow
=
false
;
SCSIZE
nIndex
=
++
pIndices
[
nPos
];
if
(
nIndex
<
pArray
->
nCount
)
...
...
@@ -2344,19 +2361,15 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
}
else
if
(
ppPatterns
[
nPos
]
)
bEmpty
=
false
;
// Area not at the end yet
if
(
nMinNextEnd
>
pNextEnd
[
nPos
]
)
nMinNextEnd
=
pNextEnd
[
nPos
];
}
if
(
bEmpty
)
{
SCCOL
nCount
=
nEndCol
-
nStartCol
+
1
;
SCROW
nSkipTo
=
pNextEnd
[
0
];
// Search next end of area
for
(
i
=
1
;
i
<
nCount
;
i
++
)
if
(
pNextEnd
[
i
]
<
nSkipTo
)
nSkipTo
=
pNextEnd
[
i
];
nRow
=
nSkipTo
;
// Skip empty rows
}
nRow
=
nMinNextEnd
;
// Skip empty rows
bRowEmpty
=
bEmpty
;
nCol
=
nStartCol
;
// Start at the left again
}
}
...
...
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