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
965f3ae4
Kaydet (Commit)
965f3ae4
authored
Ock 31, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up
üst
165a5bea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
28 deletions
+19
-28
nmspmap.hxx
xmloff/inc/xmloff/nmspmap.hxx
+10
-14
nmspmap.cxx
xmloff/source/core/nmspmap.cxx
+9
-14
No files found.
xmloff/inc/xmloff/nmspmap.hxx
Dosyayı görüntüle @
965f3ae4
...
@@ -30,11 +30,14 @@
...
@@ -30,11 +30,14 @@
#define _XMLOFF_NMSPMAP_HXX
#define _XMLOFF_NMSPMAP_HXX
#include "sal/config.h"
#include "sal/config.h"
#include <map>
#include <utility>
#include "xmloff/dllapi.h"
#include "xmloff/dllapi.h"
#include "sal/types.h"
#include "sal/types.h"
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <boost/unordered_map.hpp>
#include <boost/unordered_map.hpp>
#include <map>
#include <rtl/ref.hxx>
#include <rtl/ref.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/weak.hxx>
...
@@ -73,25 +76,17 @@ struct uInt32lt
...
@@ -73,25 +76,17 @@ struct uInt32lt
return
r1
<
r2
;
return
r1
<
r2
;
}
}
};
};
typedef
::
std
::
pair
<
sal_uInt16
,
const
::
rtl
::
OUString
*
>
QNamePair
;
typedef
::
std
::
pair
<
sal_uInt16
,
rtl
::
OUString
>
QNamePair
;
struct
QNamePairHash
struct
QNamePairHash
{
{
size_t
operator
()(
const
QNamePair
&
r1
)
const
size_t
operator
()(
const
QNamePair
&
r1
)
const
{
{
return
(
size_t
)
r1
.
second
->
hashCode
()
+
r1
.
first
;
return
(
size_t
)
r1
.
second
.
hashCode
()
+
r1
.
first
;
}
};
struct
QNamePairEq
{
bool
operator
()(
const
QNamePair
&
r1
,
const
QNamePair
&
r2
)
const
{
return
r1
.
first
==
r2
.
first
&&
*
(
r1
.
second
)
==
*
(
r2
.
second
);
}
}
};
};
typedef
::
boost
::
unordered_map
<
QNamePair
,
::
rtl
::
OUString
,
QNamePairHash
,
QNamePairEq
>
QNameCache
;
typedef
::
boost
::
unordered_map
<
QNamePair
,
::
rtl
::
OUString
,
QNamePairHash
>
QNameCache
;
typedef
::
boost
::
unordered_map
<
::
rtl
::
OUString
,
::
rtl
::
Reference
<
NameSpaceEntry
>
,
rtl
::
OUStringHash
,
OUStringEqFunc
>
NameSpaceHash
;
typedef
::
boost
::
unordered_map
<
::
rtl
::
OUString
,
::
rtl
::
Reference
<
NameSpaceEntry
>
,
rtl
::
OUStringHash
,
OUStringEqFunc
>
NameSpaceHash
;
typedef
::
std
::
map
<
sal_uInt16
,
::
rtl
::
Reference
<
NameSpaceEntry
>
,
uInt32lt
>
NameSpaceMap
;
typedef
::
std
::
map
<
sal_uInt16
,
::
rtl
::
Reference
<
NameSpaceEntry
>
,
uInt32lt
>
NameSpaceMap
;
...
@@ -100,9 +95,10 @@ class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
...
@@ -100,9 +95,10 @@ class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
const
::
rtl
::
OUString
sXMLNS
;
const
::
rtl
::
OUString
sXMLNS
;
const
::
rtl
::
OUString
sEmpty
;
const
::
rtl
::
OUString
sEmpty
;
NameSpaceHash
aNameHash
,
aNameCache
;
NameSpaceHash
aNameHash
;
mutable
NameSpaceHash
aNameCache
;
NameSpaceMap
aNameMap
;
NameSpaceMap
aNameMap
;
QNameCache
aQNameCache
;
mutable
QNameCache
aQNameCache
;
SAL_DLLPRIVATE
sal_uInt16
_Add
(
const
rtl
::
OUString
&
rPrefix
,
const
rtl
::
OUString
&
rName
,
sal_uInt16
nKey
);
SAL_DLLPRIVATE
sal_uInt16
_Add
(
const
rtl
::
OUString
&
rPrefix
,
const
rtl
::
OUString
&
rName
,
sal_uInt16
nKey
);
public
:
public
:
...
...
xmloff/source/core/nmspmap.cxx
Dosyayı görüntüle @
965f3ae4
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
*
*
************************************************************************/
************************************************************************/
#include "sal/config.h"
#include <tools/debug.hxx>
#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
...
@@ -75,13 +77,6 @@ void SvXMLNamespaceMap::operator=( const SvXMLNamespaceMap& rMap )
...
@@ -75,13 +77,6 @@ void SvXMLNamespaceMap::operator=( const SvXMLNamespaceMap& rMap )
SvXMLNamespaceMap
::~
SvXMLNamespaceMap
()
SvXMLNamespaceMap
::~
SvXMLNamespaceMap
()
{
{
QNameCache
::
iterator
aIter
=
aQNameCache
.
begin
(),
aEnd
=
aQNameCache
.
end
();
while
(
aIter
!=
aEnd
)
{
const
OUString
*
pString
=
(
*
aIter
).
first
.
second
;
++
aIter
;
delete
pString
;
}
}
}
int
SvXMLNamespaceMap
::
operator
==
(
const
SvXMLNamespaceMap
&
rCmp
)
const
int
SvXMLNamespaceMap
::
operator
==
(
const
SvXMLNamespaceMap
&
rCmp
)
const
...
@@ -243,7 +238,7 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
...
@@ -243,7 +238,7 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
{
{
QNameCache
::
const_iterator
aQCacheIter
;
QNameCache
::
const_iterator
aQCacheIter
;
if
(
bCache
)
if
(
bCache
)
aQCacheIter
=
aQNameCache
.
find
(
QNamePair
(
nKey
,
&
rLocalName
)
);
aQCacheIter
=
aQNameCache
.
find
(
QNamePair
(
nKey
,
rLocalName
)
);
else
else
aQCacheIter
=
aQNameCache
.
end
();
aQCacheIter
=
aQNameCache
.
end
();
if
(
aQCacheIter
!=
aQNameCache
.
end
()
)
if
(
aQCacheIter
!=
aQNameCache
.
end
()
)
...
@@ -265,8 +260,9 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
...
@@ -265,8 +260,9 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
if
(
bCache
)
if
(
bCache
)
{
{
OUString
sString
(
sQName
.
makeStringAndClear
());
OUString
sString
(
sQName
.
makeStringAndClear
());
OUString
*
pString
=
new
OUString
(
rLocalName
);
aQNameCache
.
insert
(
const_cast
<
QNameCache
*
>
(
&
aQNameCache
)
->
operator
[]
(
QNamePair
(
nKey
,
pString
)
)
=
sString
;
QNameCache
::
value_type
(
QNamePair
(
nKey
,
rLocalName
),
sString
));
return
sString
;
return
sString
;
}
}
else
else
...
@@ -357,10 +353,9 @@ sal_uInt16 SvXMLNamespaceMap::_GetKeyByAttrName( const OUString& rAttrName,
...
@@ -357,10 +353,9 @@ sal_uInt16 SvXMLNamespaceMap::_GetKeyByAttrName( const OUString& rAttrName,
nKey
=
xEntry
->
nKey
=
XML_NAMESPACE_NONE
;
nKey
=
xEntry
->
nKey
=
XML_NAMESPACE_NONE
;
if
(
bCache
)
if
(
bCache
)
{
{
typedef
std
::
pair
<
const
rtl
::
OUString
,
rtl
::
Reference
<
NameSpaceEntry
>
>
value_type
;
aNameCache
.
insert
(
NameSpaceHash
::
value_type
(
rAttrName
,
xEntry
));
(
void
)
const_cast
<
NameSpaceHash
*>
(
&
aNameCache
)
->
insert
(
value_type
(
rAttrName
,
xEntry
));
}
}
}
}
return
nKey
;
return
nKey
;
...
...
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