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
9eda4d7f
Kaydet (Commit)
9eda4d7f
authored
Eki 30, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svl: replace boost::ptr_map with std::map
Change-Id: I87863482a5331b47e71b3e8c9de6e58347aacf24
üst
87f15b94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
26 deletions
+15
-26
precompiled_svl.hxx
svl/inc/pch/precompiled_svl.hxx
+0
-2
inettype.cxx
svl/source/misc/inettype.cxx
+15
-24
No files found.
svl/inc/pch/precompiled_svl.hxx
Dosyayı görüntüle @
9eda4d7f
...
...
@@ -18,7 +18,6 @@
#include <algorithm>
#include <boost/noncopyable.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <cassert>
...
...
@@ -119,7 +118,6 @@
#include <mdds/multi_type_vector_custom_func1.hpp>
#include <mdds/multi_type_vector_trait.hpp>
#include <mdds/multi_type_vector_types.hpp>
#include <o3tl/ptr_container.hxx>
#include <osl/diagnose.h>
#include <osl/endian.h>
#include <osl/file.h>
...
...
svl/source/misc/inettype.cxx
Dosyayı görüntüle @
9eda4d7f
...
...
@@ -20,8 +20,8 @@
#include <sal/config.h>
#include <utility>
#include <map>
#include <o3tl/ptr_container.hxx>
#include <tools/wldcrd.hxx>
#include <tools/inetmime.hxx>
#include <rtl/instance.hxx>
...
...
@@ -29,8 +29,6 @@
#include <svl/inettype.hxx>
#include <svl/svl.hrc>
#include <boost/ptr_container/ptr_map.hpp>
#include "getstringresource.hxx"
namespace
...
...
@@ -55,22 +53,24 @@ struct TypeNameMapEntry
OUString
m_aExtension
;
INetContentType
m_eTypeID
;
TypeNameMapEntry
()
:
m_eTypeID
(
CONTENT_TYPE_UNKNOWN
)
{}
TypeNameMapEntry
(
INetContentType
const
eTypeID
,
OUString
const
*
const
pExtension
)
:
m_aExtension
((
pExtension
)
?
*
pExtension
:
OUString
())
,
m_eTypeID
(
eTypeID
)
{}
};
struct
ExtensionMapEntry
{
INetContentType
m_eTypeID
;
ExtensionMapEntry
(
)
:
m_eTypeID
(
CONTENT_TYPE_UNKNOWN
)
{}
ExtensionMapEntry
(
INetContentType
const
eTypeID
)
:
m_eTypeID
(
eTypeID
)
{}
};
class
Registration
{
typedef
boost
::
ptr_
map
<
OUString
,
TypeNameMapEntry
>
TypeNameMap
;
typedef
boost
::
ptr_
map
<
OUString
,
ExtensionMapEntry
>
ExtensionMap
;
typedef
std
::
map
<
OUString
,
TypeNameMapEntry
>
TypeNameMap
;
typedef
std
::
map
<
OUString
,
ExtensionMapEntry
>
ExtensionMap
;
typedef
std
::
map
<
INetContentType
,
TypeIDMapEntry
*>
TypeIDMap
;
TypeIDMap
m_aTypeIDMap
;
// map ContentType to TypeID
...
...
@@ -443,7 +443,7 @@ TypeNameMapEntry * Registration::getExtensionEntry(OUString const & rTypeName)
Registration
&
rRegistration
=
theRegistration
::
get
();
TypeNameMap
::
iterator
it
=
rRegistration
.
m_aTypeNameMap
.
find
(
aTheTypeName
);
if
(
it
!=
rRegistration
.
m_aTypeNameMap
.
end
())
return
it
->
second
;
return
&
it
->
second
;
return
0
;
}
...
...
@@ -468,21 +468,12 @@ INetContentType Registration::RegisterContentType(OUString const & rTypeName,
pTypeIDMapEntry
->
m_aSystemFileType
=
*
pSystemFileType
;
rRegistration
.
m_aTypeIDMap
.
insert
(
::
std
::
make_pair
(
eTypeID
,
pTypeIDMapEntry
)
);
std
::
unique_ptr
<
TypeNameMapEntry
>
pTypeNameMapEntry
(
new
TypeNameMapEntry
());
if
(
pExtension
)
pTypeNameMapEntry
->
m_aExtension
=
*
pExtension
;
pTypeNameMapEntry
->
m_eTypeID
=
eTypeID
;
o3tl
::
ptr_container
::
insert
(
rRegistration
.
m_aTypeNameMap
,
aTheTypeName
,
std
::
move
(
pTypeNameMapEntry
));
rRegistration
.
m_aTypeNameMap
.
insert
(
std
::
make_pair
(
aTheTypeName
,
TypeNameMapEntry
(
eTypeID
,
pExtension
)));
if
(
pExtension
)
{
std
::
unique_ptr
<
ExtensionMapEntry
>
pExtensionMapEntry
(
new
ExtensionMapEntry
());
pExtensionMapEntry
->
m_eTypeID
=
eTypeID
;
o3tl
::
ptr_container
::
insert
(
rRegistration
.
m_aExtensionMap
,
*
pExtension
,
std
::
move
(
pExtensionMapEntry
));
rRegistration
.
m_aExtensionMap
.
insert
(
std
::
make_pair
(
*
pExtension
,
ExtensionMapEntry
(
eTypeID
)));
}
return
eTypeID
;
...
...
@@ -496,7 +487,7 @@ INetContentType Registration::GetContentType(OUString const & rTypeName)
OUString
aTheTypeName
=
rTypeName
.
toAsciiLowerCase
();
TypeNameMap
::
iterator
it
=
rRegistration
.
m_aTypeNameMap
.
find
(
aTheTypeName
);
return
it
!=
rRegistration
.
m_aTypeNameMap
.
end
()
?
it
->
second
->
m_eTypeID
?
it
->
second
.
m_eTypeID
:
CONTENT_TYPE_UNKNOWN
;
}
...
...
@@ -530,7 +521,7 @@ INetContentType Registration::GetContentType4Extension(OUString const & rExtensi
ExtensionMap
::
iterator
it
=
rRegistration
.
m_aExtensionMap
.
find
(
rExtension
);
return
it
!=
rRegistration
.
m_aExtensionMap
.
end
()
?
it
->
second
->
m_eTypeID
?
it
->
second
.
m_eTypeID
:
CONTENT_TYPE_UNKNOWN
;
}
...
...
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