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
14a0115b
Kaydet (Commit)
14a0115b
authored
Ara 09, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I311d3a3e35ae4321e92e1fe2e0651b3b4899c0bd
üst
27f5679c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
27 deletions
+35
-27
autoform.hxx
sc/inc/autoform.hxx
+5
-3
autoform.cxx
sc/source/core/tool/autoform.cxx
+27
-21
scuiautofmt.cxx
sc/source/ui/miscdlgs/scuiautofmt.cxx
+1
-1
afmtuno.cxx
sc/source/ui/unoobj/afmtuno.cxx
+2
-2
No files found.
sc/inc/autoform.hxx
Dosyayı görüntüle @
14a0115b
...
@@ -59,7 +59,9 @@
...
@@ -59,7 +59,9 @@
#include "zforauto.hxx"
#include "zforauto.hxx"
#include <boost/noncopyable.hpp>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <memory>
#include <map>
/**
/**
A binary blob of writer-specific data. This data typically consists of types that are
A binary blob of writer-specific data. This data typically consists of types that are
...
@@ -313,8 +315,8 @@ struct DefaultFirstEntry {
...
@@ -313,8 +315,8 @@ struct DefaultFirstEntry {
class
SC_DLLPUBLIC
ScAutoFormat
class
SC_DLLPUBLIC
ScAutoFormat
{
{
typedef
boost
::
ptr_map
<
OUString
,
ScAutoFormatData
,
DefaultFirstEntry
>
MapType
;
typedef
std
::
map
<
OUString
,
std
::
unique_ptr
<
ScAutoFormatData
>
,
DefaultFirstEntry
>
MapType
;
MapType
m
a
Data
;
MapType
m
_
Data
;
bool
mbSaveLater
;
bool
mbSaveLater
;
ScAfVersions
m_aVersions
;
ScAfVersions
m_aVersions
;
...
...
sc/source/core/tool/autoform.cxx
Dosyayı görüntüle @
14a0115b
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <tools/urlobj.hxx>
#include <tools/urlobj.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <tools/tenccvt.hxx>
#include <tools/tenccvt.hxx>
#include <o3tl/make_unique.hxx>
#include "globstr.hrc"
#include "globstr.hrc"
#include "document.hxx"
#include "document.hxx"
...
@@ -906,9 +907,14 @@ bool DefaultFirstEntry::operator() (const OUString& left, const OUString& right)
...
@@ -906,9 +907,14 @@ bool DefaultFirstEntry::operator() (const OUString& left, const OUString& right)
return
ScGlobal
::
GetCollator
()
->
compareString
(
left
,
right
)
<
0
;
return
ScGlobal
::
GetCollator
()
->
compareString
(
left
,
right
)
<
0
;
}
}
ScAutoFormat
::
ScAutoFormat
(
const
ScAutoFormat
&
r
)
:
ScAutoFormat
::
ScAutoFormat
(
const
ScAutoFormat
&
r
)
maData
(
r
.
maData
),
:
mbSaveLater
(
false
)
mbSaveLater
(
false
)
{}
{
for
(
auto
const
&
it
:
r
.
m_Data
)
{
m_Data
.
insert
(
std
::
make_pair
(
it
.
first
,
o3tl
::
make_unique
<
ScAutoFormatData
>
(
*
it
.
second
)));
}
}
ScAutoFormat
::~
ScAutoFormat
()
ScAutoFormat
::~
ScAutoFormat
()
{
{
...
@@ -926,30 +932,30 @@ void ScAutoFormat::SetSaveLater( bool bSet )
...
@@ -926,30 +932,30 @@ void ScAutoFormat::SetSaveLater( bool bSet )
const
ScAutoFormatData
*
ScAutoFormat
::
findByIndex
(
size_t
nIndex
)
const
const
ScAutoFormatData
*
ScAutoFormat
::
findByIndex
(
size_t
nIndex
)
const
{
{
if
(
nIndex
>=
m
a
Data
.
size
())
if
(
nIndex
>=
m
_
Data
.
size
())
return
nullptr
;
return
nullptr
;
MapType
::
const_iterator
it
=
m
a
Data
.
begin
();
MapType
::
const_iterator
it
=
m
_
Data
.
begin
();
std
::
advance
(
it
,
nIndex
);
std
::
advance
(
it
,
nIndex
);
return
it
->
second
;
return
it
->
second
.
get
()
;
}
}
ScAutoFormatData
*
ScAutoFormat
::
findByIndex
(
size_t
nIndex
)
ScAutoFormatData
*
ScAutoFormat
::
findByIndex
(
size_t
nIndex
)
{
{
if
(
nIndex
>=
m
a
Data
.
size
())
if
(
nIndex
>=
m
_
Data
.
size
())
return
nullptr
;
return
nullptr
;
MapType
::
iterator
it
=
m
a
Data
.
begin
();
MapType
::
iterator
it
=
m
_
Data
.
begin
();
std
::
advance
(
it
,
nIndex
);
std
::
advance
(
it
,
nIndex
);
return
it
->
second
;
return
it
->
second
.
get
()
;
}
}
ScAutoFormat
::
iterator
ScAutoFormat
::
find
(
const
ScAutoFormatData
*
pData
)
ScAutoFormat
::
iterator
ScAutoFormat
::
find
(
const
ScAutoFormatData
*
pData
)
{
{
MapType
::
iterator
it
=
m
aData
.
begin
(),
itEnd
=
ma
Data
.
end
();
MapType
::
iterator
it
=
m
_Data
.
begin
(),
itEnd
=
m_
Data
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
for
(;
it
!=
itEnd
;
++
it
)
{
{
if
(
it
->
second
==
pData
)
if
(
it
->
second
.
get
()
==
pData
)
return
it
;
return
it
;
}
}
return
itEnd
;
return
itEnd
;
...
@@ -957,43 +963,43 @@ ScAutoFormat::iterator ScAutoFormat::find(const ScAutoFormatData* pData)
...
@@ -957,43 +963,43 @@ ScAutoFormat::iterator ScAutoFormat::find(const ScAutoFormatData* pData)
ScAutoFormat
::
iterator
ScAutoFormat
::
find
(
const
OUString
&
rName
)
ScAutoFormat
::
iterator
ScAutoFormat
::
find
(
const
OUString
&
rName
)
{
{
return
m
a
Data
.
find
(
rName
);
return
m
_
Data
.
find
(
rName
);
}
}
bool
ScAutoFormat
::
insert
(
ScAutoFormatData
*
pNew
)
bool
ScAutoFormat
::
insert
(
ScAutoFormatData
*
pNew
)
{
{
OUString
aName
=
pNew
->
GetName
();
OUString
aName
=
pNew
->
GetName
();
return
m
aData
.
insert
(
aName
,
pNew
).
second
;
return
m
_Data
.
insert
(
std
::
make_pair
(
aName
,
std
::
unique_ptr
<
ScAutoFormatData
>
(
pNew
))
).
second
;
}
}
void
ScAutoFormat
::
erase
(
const
iterator
&
it
)
void
ScAutoFormat
::
erase
(
const
iterator
&
it
)
{
{
m
a
Data
.
erase
(
it
);
m
_
Data
.
erase
(
it
);
}
}
size_t
ScAutoFormat
::
size
()
const
size_t
ScAutoFormat
::
size
()
const
{
{
return
m
a
Data
.
size
();
return
m
_
Data
.
size
();
}
}
ScAutoFormat
::
const_iterator
ScAutoFormat
::
begin
()
const
ScAutoFormat
::
const_iterator
ScAutoFormat
::
begin
()
const
{
{
return
m
a
Data
.
begin
();
return
m
_
Data
.
begin
();
}
}
ScAutoFormat
::
const_iterator
ScAutoFormat
::
end
()
const
ScAutoFormat
::
const_iterator
ScAutoFormat
::
end
()
const
{
{
return
m
a
Data
.
end
();
return
m
_
Data
.
end
();
}
}
ScAutoFormat
::
iterator
ScAutoFormat
::
begin
()
ScAutoFormat
::
iterator
ScAutoFormat
::
begin
()
{
{
return
m
a
Data
.
begin
();
return
m
_
Data
.
begin
();
}
}
ScAutoFormat
::
iterator
ScAutoFormat
::
end
()
ScAutoFormat
::
iterator
ScAutoFormat
::
end
()
{
{
return
m
a
Data
.
end
();
return
m
_
Data
.
end
();
}
}
bool
ScAutoFormat
::
Load
()
bool
ScAutoFormat
::
Load
()
...
@@ -1084,9 +1090,9 @@ bool ScAutoFormat::Save()
...
@@ -1084,9 +1090,9 @@ bool ScAutoFormat::Save()
bRet
&=
(
rStream
.
GetError
()
==
0
);
bRet
&=
(
rStream
.
GetError
()
==
0
);
rStream
.
WriteUInt16
(
m
a
Data
.
size
()
-
1
);
rStream
.
WriteUInt16
(
m
_
Data
.
size
()
-
1
);
bRet
&=
(
rStream
.
GetError
()
==
0
);
bRet
&=
(
rStream
.
GetError
()
==
0
);
MapType
::
iterator
it
=
m
aData
.
begin
(),
itEnd
=
ma
Data
.
end
();
MapType
::
iterator
it
=
m
_Data
.
begin
(),
itEnd
=
m_
Data
.
end
();
if
(
it
!=
itEnd
)
if
(
it
!=
itEnd
)
{
{
for
(
++
it
;
bRet
&&
it
!=
itEnd
;
++
it
)
// Skip the first item.
for
(
++
it
;
bRet
&&
it
!=
itEnd
;
++
it
)
// Skip the first item.
...
...
sc/source/ui/miscdlgs/scuiautofmt.cxx
Dosyayı görüntüle @
14a0115b
...
@@ -84,7 +84,7 @@ ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent,
...
@@ -84,7 +84,7 @@ ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent,
Init
();
Init
();
ScAutoFormat
::
iterator
it
=
pFormat
->
begin
();
ScAutoFormat
::
iterator
it
=
pFormat
->
begin
();
m_pWndPreview
->
NotifyChange
(
it
->
second
);
m_pWndPreview
->
NotifyChange
(
it
->
second
.
get
()
);
}
}
ScAutoFormatDlg
::~
ScAutoFormatDlg
()
ScAutoFormatDlg
::~
ScAutoFormatDlg
()
...
...
sc/source/ui/unoobj/afmtuno.cxx
Dosyayı görüntüle @
14a0115b
...
@@ -149,7 +149,7 @@ static bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const OUStrin
...
@@ -149,7 +149,7 @@ static bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const OUStrin
ScAutoFormat
::
const_iterator
itBeg
=
rFormats
.
begin
(),
itEnd
=
rFormats
.
end
();
ScAutoFormat
::
const_iterator
itBeg
=
rFormats
.
begin
(),
itEnd
=
rFormats
.
end
();
for
(
ScAutoFormat
::
const_iterator
it
=
itBeg
;
it
!=
itEnd
;
++
it
)
for
(
ScAutoFormat
::
const_iterator
it
=
itBeg
;
it
!=
itEnd
;
++
it
)
{
{
const
ScAutoFormatData
*
pEntry
=
it
->
second
;
const
ScAutoFormatData
*
const
pEntry
=
it
->
second
.
get
()
;
const
OUString
&
aEntryName
=
pEntry
->
GetName
();
const
OUString
&
aEntryName
=
pEntry
->
GetName
();
if
(
aEntryName
.
equals
(
rName
)
)
if
(
aEntryName
.
equals
(
rName
)
)
{
{
...
@@ -513,7 +513,7 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
...
@@ -513,7 +513,7 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
{
{
ScAutoFormat
::
iterator
it
=
pFormats
->
begin
();
ScAutoFormat
::
iterator
it
=
pFormats
->
begin
();
std
::
advance
(
it
,
nFormatIndex
);
std
::
advance
(
it
,
nFormatIndex
);
ScAutoFormatData
*
pData
=
it
->
second
;
ScAutoFormatData
*
const
pData
=
it
->
second
.
get
()
;
OSL_ENSURE
(
pData
,
"AutoFormat Daten nicht da"
);
OSL_ENSURE
(
pData
,
"AutoFormat Daten nicht da"
);
ScAutoFormatData
*
pNew
=
new
ScAutoFormatData
(
*
pData
);
ScAutoFormatData
*
pNew
=
new
ScAutoFormatData
(
*
pData
);
...
...
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