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
fa90bbb7
Kaydet (Commit)
fa90bbb7
authored
Ara 17, 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: I32ab5eb985bd55d9194f3bff4739614cb6e93516
üst
742bcd2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
htmlpars.cxx
sc/source/filter/html/htmlpars.cxx
+12
-11
htmlpars.hxx
sc/source/filter/inc/htmlpars.hxx
+3
-3
No files found.
sc/source/filter/html/htmlpars.cxx
Dosyayı görüntüle @
fa90bbb7
...
...
@@ -103,7 +103,7 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla
else
{
// Element name only. Add it to the element global.
insertProp
(
m
a
ElemGlobalProps
,
aElem
,
aProp
,
aValue
);
insertProp
(
m
_
ElemGlobalProps
,
aElem
,
aProp
,
aValue
);
}
}
else
...
...
@@ -113,7 +113,7 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla
// Class name only. Add it to the global.
OUString
aClass
(
pClassName
,
nClassName
,
RTL_TEXTENCODING_UTF8
);
aClass
=
aClass
.
toAsciiLowerCase
();
insertProp
(
m
a
GlobalProps
,
aClass
,
aProp
,
aValue
);
insertProp
(
m
_
GlobalProps
,
aClass
,
aProp
,
aValue
);
}
}
}
...
...
@@ -130,7 +130,7 @@ const OUString& ScHTMLStyles::getPropertyValue(
NamePropsType
::
const_iterator
itr2
=
pClasses
->
find
(
rClass
);
if
(
itr2
!=
pClasses
->
end
())
{
const
PropsType
*
pProps
=
itr2
->
second
;
const
PropsType
*
const
pProps
=
itr2
->
second
.
get
()
;
PropsType
::
const_iterator
itr3
=
pProps
->
find
(
rPropName
);
if
(
itr3
!=
pProps
->
end
())
return
itr3
->
second
;
...
...
@@ -139,10 +139,10 @@ const OUString& ScHTMLStyles::getPropertyValue(
}
// Next, look into the class global storage.
{
NamePropsType
::
const_iterator
itr
=
ma
GlobalProps
.
find
(
rClass
);
if
(
itr
!=
m
a
GlobalProps
.
end
())
auto
const
itr
=
m_
GlobalProps
.
find
(
rClass
);
if
(
itr
!=
m
_
GlobalProps
.
end
())
{
const
PropsType
*
pProps
=
itr
->
second
;
const
PropsType
*
const
pProps
=
itr
->
second
.
get
()
;
PropsType
::
const_iterator
itr2
=
pProps
->
find
(
rPropName
);
if
(
itr2
!=
pProps
->
end
())
return
itr2
->
second
;
...
...
@@ -150,10 +150,10 @@ const OUString& ScHTMLStyles::getPropertyValue(
}
// As the last resort, look into the element global storage.
{
NamePropsType
::
const_iterator
itr
=
ma
ElemGlobalProps
.
find
(
rClass
);
if
(
itr
!=
m
a
ElemGlobalProps
.
end
())
auto
const
itr
=
m_
ElemGlobalProps
.
find
(
rClass
);
if
(
itr
!=
m
_
ElemGlobalProps
.
end
())
{
const
PropsType
*
pProps
=
itr
->
second
;
const
PropsType
*
const
pProps
=
itr
->
second
.
get
()
;
PropsType
::
const_iterator
itr2
=
pProps
->
find
(
rPropName
);
if
(
itr2
!=
pProps
->
end
())
return
itr2
->
second
;
...
...
@@ -172,7 +172,8 @@ void ScHTMLStyles::insertProp(
{
// new element
std
::
unique_ptr
<
PropsType
>
p
(
new
PropsType
);
std
::
pair
<
NamePropsType
::
iterator
,
bool
>
r
=
o3tl
::
ptr_container
::
insert
(
rStore
,
aName
,
std
::
move
(
p
));
std
::
pair
<
NamePropsType
::
iterator
,
bool
>
r
=
rStore
.
insert
(
std
::
make_pair
(
aName
,
std
::
move
(
p
)));
if
(
!
r
.
second
)
// insertion failed.
return
;
...
...
@@ -180,7 +181,7 @@ void ScHTMLStyles::insertProp(
itr
=
r
.
first
;
}
PropsType
*
pProps
=
itr
->
second
;
PropsType
*
const
pProps
=
itr
->
second
.
get
()
;
pProps
->
insert
(
PropsType
::
value_type
(
aProp
,
aValue
));
}
...
...
sc/source/filter/inc/htmlpars.hxx
Dosyayı görüntüle @
fa90bbb7
...
...
@@ -49,11 +49,11 @@ class ScHTMLTable;
class
ScHTMLStyles
{
typedef
std
::
unordered_map
<
OUString
,
OUString
,
OUStringHash
>
PropsType
;
typedef
::
boost
::
ptr_map
<
OUString
,
PropsType
>
NamePropsType
;
typedef
::
std
::
map
<
OUString
,
std
::
unique_ptr
<
PropsType
>
>
NamePropsType
;
typedef
::
boost
::
ptr_map
<
OUString
,
NamePropsType
>
ElemsType
;
NamePropsType
m
a
GlobalProps
;
/// global properties (for a given class for all elements)
NamePropsType
m
a
ElemGlobalProps
;
/// element global properties (no class specified)
NamePropsType
m
_
GlobalProps
;
/// global properties (for a given class for all elements)
NamePropsType
m
_
ElemGlobalProps
;
/// element global properties (no class specified)
ElemsType
maElemProps
;
/// element to class to properties (both element and class are given)
const
OUString
maEmpty
;
/// just a persistent empty string.
public
:
...
...
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