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
a074320c
Kaydet (Commit)
a074320c
authored
Eki 30, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Thread excel table row/column format finalization.
Change-Id: I6ddc0270831989291893b170d57fea14329a26ba
üst
7bd4d1e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
8 deletions
+55
-8
xetable.cxx
sc/source/filter/excel/xetable.cxx
+53
-7
xetable.hxx
sc/source/filter/inc/xetable.hxx
+2
-1
No files found.
sc/source/filter/excel/xetable.cxx
Dosyayı görüntüle @
a074320c
...
...
@@ -34,6 +34,8 @@
#include "xeescher.hxx"
#include "xeextlst.hxx"
#include "tokenarray.hxx"
#include <thread>
#include <comphelper/threadpool.hxx>
using
namespace
::
oox
;
...
...
@@ -1777,7 +1779,7 @@ void XclExpRow::AppendCell( XclExpCellRef xCell, bool bIsMergedBase )
InsertCell
(
xCell
,
maCellList
.
GetSize
(),
bIsMergedBase
);
}
void
XclExpRow
::
Finalize
(
const
ScfUInt16Vec
&
rColXFIndexes
)
void
XclExpRow
::
Finalize
(
const
ScfUInt16Vec
&
rColXFIndexes
,
bool
bProgress
)
{
size_t
nPos
,
nSize
;
...
...
@@ -1911,10 +1913,10 @@ void XclExpRow::Finalize( const ScfUInt16Vec& rColXFIndexes )
++
nPos
;
}
// progress bar includes disabled rows
GetProgressBar
().
Progress
();
// progress bar includes disabled rows; only update it in the lead thread.
if
(
bProgress
)
GetProgressBar
().
Progress
();
}
sal_uInt16
XclExpRow
::
GetFirstUsedXclCol
()
const
{
return
maCellList
.
IsEmpty
()
?
0
:
maCellList
.
GetFirstRecord
()
->
GetXclCol
();
...
...
@@ -2038,15 +2040,58 @@ void XclExpRowBuffer::CreateRows( SCROW nFirstFreeScRow )
GetOrCreateRow
(
::
std
::
max
(
nFirstFreeScRow
-
1
,
GetMaxPos
().
Row
()
),
true
);
}
class
RowFinalizeTask
:
public
comphelper
::
ThreadTask
{
bool
mbProgress
;
const
ScfUInt16Vec
&
mrColXFIndexes
;
std
::
vector
<
XclExpRow
*
>
maRows
;
public
:
RowFinalizeTask
(
const
ScfUInt16Vec
&
rColXFIndexes
,
bool
bProgress
)
:
mbProgress
(
bProgress
),
mrColXFIndexes
(
rColXFIndexes
)
{}
virtual
~
RowFinalizeTask
()
{}
void
push_back
(
XclExpRow
*
pRow
)
{
maRows
.
push_back
(
pRow
);
}
virtual
void
doWork
()
{
for
(
size_t
i
=
0
;
i
<
maRows
.
size
();
i
++
)
maRows
[
i
]
->
Finalize
(
mrColXFIndexes
,
mbProgress
);
}
};
void
XclExpRowBuffer
::
Finalize
(
XclExpDefaultRowData
&
rDefRowData
,
const
ScfUInt16Vec
&
rColXFIndexes
)
{
// *** Finalize all rows *** ----------------------------------------------
GetProgressBar
().
ActivateFinalRowsSegment
();
RowMap
::
iterator
itr
,
itrBeg
=
maRowMap
.
begin
(),
itrEnd
=
maRowMap
.
end
();
for
(
itr
=
itrBeg
;
itr
!=
itrEnd
;
++
itr
)
itr
->
second
->
Finalize
(
rColXFIndexes
);
// This is staggeringly slow, and each element operates only
// on its own data.
size_t
nRows
=
maRowMap
.
size
();
size_t
nThreads
=
std
::
max
(
std
::
thread
::
hardware_concurrency
(),
1U
);
if
(
nThreads
==
1
||
nRows
<
128
)
{
RowMap
::
iterator
itr
,
itrBeg
=
maRowMap
.
begin
(),
itrEnd
=
maRowMap
.
end
();
for
(
itr
=
itrBeg
;
itr
!=
itrEnd
;
++
itr
)
itr
->
second
->
Finalize
(
rColXFIndexes
,
true
);
}
else
{
comphelper
::
ThreadPool
&
rPool
=
comphelper
::
ThreadPool
::
getSharedOptimalPool
();
std
::
vector
<
RowFinalizeTask
*>
pTasks
(
nThreads
,
NULL
);
for
(
size_t
i
=
0
;
i
<
nThreads
;
i
++
)
pTasks
[
i
]
=
new
RowFinalizeTask
(
rColXFIndexes
,
i
==
0
);
RowMap
::
iterator
itr
,
itrBeg
=
maRowMap
.
begin
(),
itrEnd
=
maRowMap
.
end
();
size_t
nIdx
=
0
;
for
(
itr
=
itrBeg
;
itr
!=
itrEnd
;
++
itr
,
++
nIdx
)
pTasks
[
nIdx
%
nThreads
]
->
push_back
(
itr
->
second
.
get
()
);
for
(
size_t
i
=
0
;
i
<
nThreads
;
i
++
)
rPool
.
pushTask
(
pTasks
[
i
]
);
rPool
.
waitUntilEmpty
();
}
// *** Default row format *** ---------------------------------------------
...
...
@@ -2059,6 +2104,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt
XclExpRow
*
pPrev
=
NULL
;
typedef
std
::
vector
<
XclExpRow
*
>
XclRepeatedRows
;
XclRepeatedRows
aRepeated
;
RowMap
::
iterator
itr
,
itrBeg
=
maRowMap
.
begin
(),
itrEnd
=
maRowMap
.
end
();
for
(
itr
=
itrBeg
;
itr
!=
itrEnd
;
++
itr
)
{
const
RowRef
&
rRow
=
itr
->
second
;
...
...
sc/source/filter/inc/xetable.hxx
Dosyayı görüntüle @
a074320c
...
...
@@ -857,7 +857,8 @@ public:
void
AppendCell
(
XclExpCellRef
xCell
,
bool
bIsMergedBase
);
/** Converts all XF identifiers into the Excel XF indexes. */
void
Finalize
(
const
ScfUInt16Vec
&
rColXFIndexes
);
void
Finalize
(
const
ScfUInt16Vec
&
rColXFIndexes
,
bool
bUpdateProgress
);
/** Returns the column index of the first used cell in this row.
@descr This function can only be called after Finalize(). */
...
...
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