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
82896e32
Kaydet (Commit)
82896e32
authored
Kas 12, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: boost::ptr_vector->std::vector
Change-Id: Id445860c63347a49de1291470d091323f13ec8b5
üst
2328d1dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
autostyl.cxx
sc/source/ui/docshell/autostyl.cxx
+7
-17
autostyl.hxx
sc/source/ui/inc/autostyl.hxx
+13
-3
No files found.
sc/source/ui/docshell/autostyl.cxx
Dosyayı görüntüle @
82896e32
...
@@ -35,16 +35,6 @@ struct ScAutoStyleInitData
...
@@ -35,16 +35,6 @@ struct ScAutoStyleInitData
aRange
(
rR
),
aStyle1
(
rSt1
),
nTimeout
(
nT
),
aStyle2
(
rSt2
)
{}
aRange
(
rR
),
aStyle1
(
rSt1
),
nTimeout
(
nT
),
aStyle2
(
rSt2
)
{}
};
};
struct
ScAutoStyleData
{
sal_uLong
nTimeout
;
ScRange
aRange
;
OUString
aStyle
;
ScAutoStyleData
(
sal_uLong
nT
,
const
ScRange
&
rR
,
const
OUString
&
rT
)
:
nTimeout
(
nT
),
aRange
(
rR
),
aStyle
(
rT
)
{}
};
inline
sal_uLong
TimeNow
()
// Sekunden
inline
sal_uLong
TimeNow
()
// Sekunden
{
{
return
(
sal_uLong
)
time
(
nullptr
);
return
(
sal_uLong
)
time
(
nullptr
);
...
@@ -122,7 +112,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
...
@@ -122,7 +112,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
sal_uLong
nNow
=
TimeNow
();
sal_uLong
nNow
=
TimeNow
();
// Remove the first item with the same range.
// Remove the first item with the same range.
::
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
itr
=
std
::
vector
<
ScAutoStyleData
>::
iterator
itr
=
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindByRange
(
rRange
));
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindByRange
(
rRange
));
if
(
itr
!=
aEntries
.
end
())
if
(
itr
!=
aEntries
.
end
())
...
@@ -137,10 +127,10 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
...
@@ -137,10 +127,10 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
}
}
// Einfuege-Position suchen
// Einfuege-Position suchen
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
iter
=
std
::
vector
<
ScAutoStyleData
>::
iterator
iter
=
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindByTimeout
(
nTimeout
));
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindByTimeout
(
nTimeout
));
aEntries
.
insert
(
iter
,
new
ScAutoStyleData
(
nTimeout
,
rRange
,
rStyle
));
aEntries
.
insert
(
iter
,
ScAutoStyleData
(
nTimeout
,
rRange
,
rStyle
));
// abgelaufene ausfuehren, Timer neu starten
// abgelaufene ausfuehren, Timer neu starten
...
@@ -150,7 +140,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
...
@@ -150,7 +140,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
void
ScAutoStyleList
::
AdjustEntries
(
sal_uLong
nDiff
)
// Millisekunden
void
ScAutoStyleList
::
AdjustEntries
(
sal_uLong
nDiff
)
// Millisekunden
{
{
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
iter
;
std
::
vector
<
ScAutoStyleData
>::
iterator
iter
;
for
(
iter
=
aEntries
.
begin
();
iter
!=
aEntries
.
end
();
++
iter
)
for
(
iter
=
aEntries
.
begin
();
iter
!=
aEntries
.
end
();
++
iter
)
{
{
if
(
iter
->
nTimeout
<=
nDiff
)
if
(
iter
->
nTimeout
<=
nDiff
)
...
@@ -164,7 +154,7 @@ void ScAutoStyleList::ExecuteEntries()
...
@@ -164,7 +154,7 @@ void ScAutoStyleList::ExecuteEntries()
{
{
// Execute and remove all items with timeout == 0 from the begin position
// Execute and remove all items with timeout == 0 from the begin position
// until the first item with non-zero timeout value.
// until the first item with non-zero timeout value.
::
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
itr
=
aEntries
.
begin
(),
itrEnd
=
aEntries
.
end
();
std
::
vector
<
ScAutoStyleData
>::
iterator
itr
=
aEntries
.
begin
(),
itrEnd
=
aEntries
.
end
();
for
(;
itr
!=
itrEnd
;
++
itr
)
for
(;
itr
!=
itrEnd
;
++
itr
)
{
{
if
(
itr
->
nTimeout
)
if
(
itr
->
nTimeout
)
...
@@ -181,7 +171,7 @@ void ScAutoStyleList::ExecuteAllNow()
...
@@ -181,7 +171,7 @@ void ScAutoStyleList::ExecuteAllNow()
{
{
aTimer
.
Stop
();
aTimer
.
Stop
();
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
iter
;
std
::
vector
<
ScAutoStyleData
>::
iterator
iter
;
for
(
iter
=
aEntries
.
begin
();
iter
!=
aEntries
.
end
();
++
iter
)
for
(
iter
=
aEntries
.
begin
();
iter
!=
aEntries
.
end
();
++
iter
)
pDocSh
->
DoAutoStyle
(
iter
->
aRange
,
iter
->
aStyle
);
pDocSh
->
DoAutoStyle
(
iter
->
aRange
,
iter
->
aStyle
);
...
@@ -191,7 +181,7 @@ void ScAutoStyleList::ExecuteAllNow()
...
@@ -191,7 +181,7 @@ void ScAutoStyleList::ExecuteAllNow()
void
ScAutoStyleList
::
StartTimer
(
sal_uLong
nNow
)
// Sekunden
void
ScAutoStyleList
::
StartTimer
(
sal_uLong
nNow
)
// Sekunden
{
{
// ersten Eintrag mit Timeout != 0 suchen
// ersten Eintrag mit Timeout != 0 suchen
boost
::
ptr_
vector
<
ScAutoStyleData
>::
iterator
iter
=
std
::
vector
<
ScAutoStyleData
>::
iterator
iter
=
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindNonZeroTimeout
());
::
std
::
find_if
(
aEntries
.
begin
(),
aEntries
.
end
(),
FindNonZeroTimeout
());
if
(
iter
!=
aEntries
.
end
())
if
(
iter
!=
aEntries
.
end
())
...
...
sc/source/ui/inc/autostyl.hxx
Dosyayı görüntüle @
82896e32
...
@@ -21,15 +21,25 @@
...
@@ -21,15 +21,25 @@
#define INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
#define INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <vcl/timer.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <vcl/idle.hxx>
class
ScDocShell
;
class
ScDocShell
;
class
ScRange
;
class
ScRange
;
struct
ScAutoStyleData
;
struct
ScAutoStyleInitData
;
struct
ScAutoStyleInitData
;
struct
ScAutoStyleData
{
sal_uLong
nTimeout
;
ScRange
aRange
;
OUString
aStyle
;
ScAutoStyleData
(
sal_uLong
nT
,
const
ScRange
&
rR
,
const
OUString
&
rT
)
:
nTimeout
(
nT
),
aRange
(
rR
),
aStyle
(
rT
)
{}
};
class
ScAutoStyleList
class
ScAutoStyleList
{
{
private
:
private
:
...
@@ -37,8 +47,8 @@ private:
...
@@ -37,8 +47,8 @@ private:
ScDocShell
*
pDocSh
;
ScDocShell
*
pDocSh
;
Timer
aTimer
;
Timer
aTimer
;
Idle
aInitIdle
;
Idle
aInitIdle
;
sal_uLong
nTimerStart
;
sal_uLong
nTimerStart
;
boost
::
ptr_vector
<
ScAutoStyleData
>
aEntries
;
std
::
vector
<
ScAutoStyleData
>
aEntries
;
boost
::
ptr_vector
<
ScAutoStyleInitData
>
aInitials
;
boost
::
ptr_vector
<
ScAutoStyleInitData
>
aInitials
;
void
ExecuteEntries
();
void
ExecuteEntries
();
...
...
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