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
174c064b
Kaydet (Commit)
174c064b
authored
Agu 16, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:stringstatic
Change-Id: I3812abe3b275bc1b89e340d0e8f52aa1d67905e8
üst
dd2679ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
xmlimport.cxx
sax/qa/cppunit/xmlimport.cxx
+15
-15
No files found.
sax/qa/cppunit/xmlimport.cxx
Dosyayı görüntüle @
174c064b
...
...
@@ -270,9 +270,9 @@ class DummyTokenHandler : public cppu::WeakImplHelper< XFastTokenHandler >,
public
sax_fastparser
::
FastTokenHandlerBase
{
public
:
const
static
O
U
String
tokens
[];
const
static
OUString
namespaceURIs
[];
const
static
O
U
String
namespacePrefixes
[];
const
static
OString
tokens
[];
const
static
OUString
Literal
namespaceURIs
[];
const
static
OString
namespacePrefixes
[];
// XFastTokenHandler
virtual
Sequence
<
sal_Int8
>
SAL_CALL
getUTF8Identifier
(
sal_Int32
nToken
)
...
...
@@ -283,15 +283,15 @@ public:
virtual
sal_Int32
getTokenDirect
(
const
char
*
pToken
,
sal_Int32
nLength
)
const
override
;
};
const
O
U
String
DummyTokenHandler
::
tokens
[]
=
{
"Signature"
,
"CanonicalizationMethod"
,
"Algorithm"
,
"Type"
,
const
OString
DummyTokenHandler
::
tokens
[]
=
{
"Signature"
,
"CanonicalizationMethod"
,
"Algorithm"
,
"Type"
,
"DigestMethod"
,
"Reference"
,
"document"
,
"spacing"
,
"Player"
,
"Height"
};
const
OUString
DummyTokenHandler
::
namespaceURIs
[]
=
{
"http://www.w3.org/2000/09/xmldsig#"
,
"http://schemas.openxmlformats.org/wordprocessingml/2006/main/"
,
"xyzsports.com/players/football/"
};
const
OUString
Literal
DummyTokenHandler
::
namespaceURIs
[]
=
{
OUStringLiteral
(
"http://www.w3.org/2000/09/xmldsig#"
)
,
OUStringLiteral
(
"http://schemas.openxmlformats.org/wordprocessingml/2006/main/"
)
,
OUStringLiteral
(
"xyzsports.com/players/football/"
)
};
const
O
U
String
DummyTokenHandler
::
namespacePrefixes
[]
=
{
""
,
"w"
,
"Player"
};
const
OString
DummyTokenHandler
::
namespacePrefixes
[]
=
{
""
,
"w"
,
"Player"
};
Sequence
<
sal_Int8
>
DummyTokenHandler
::
getUTF8Identifier
(
sal_Int32
nToken
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
...
@@ -300,14 +300,14 @@ Sequence< sal_Int8 > DummyTokenHandler::getUTF8Identifier( sal_Int32 nToken )
if
(
(
(
nToken
&
0xffff0000
)
!=
0
)
)
//namespace
{
sal_uInt32
nNamespaceToken
=
(
nToken
>>
16
)
-
1
;
if
(
nNamespaceToken
<
sizeof
(
namespacePrefixes
)
/
sizeof
(
OUString
)
)
aUtf8Token
=
OUStringToOString
(
namespacePrefixes
[
nNamespaceToken
],
RTL_TEXTENCODING_UTF8
)
;
if
(
nNamespaceToken
<
SAL_N_ELEMENTS
(
namespacePrefixes
)
)
aUtf8Token
=
namespacePrefixes
[
nNamespaceToken
]
;
}
else
//element or attribute
{
sal_uInt32
nElementToken
=
nToken
&
0xffff
;
if
(
nElementToken
<
sizeof
(
tokens
)
/
sizeof
(
OUString
)
)
aUtf8Token
=
OUStringToOString
(
tokens
[
nElementToken
],
RTL_TEXTENCODING_UTF8
)
;
if
(
nElementToken
<
SAL_N_ELEMENTS
(
tokens
)
)
aUtf8Token
=
tokens
[
nElementToken
]
;
}
Sequence
<
sal_Int8
>
aSeq
=
Sequence
<
sal_Int8
>
(
reinterpret_cast
<
const
sal_Int8
*
>
(
aUtf8Token
.
getStr
()
),
aUtf8Token
.
getLength
()
);
...
...
@@ -323,8 +323,8 @@ sal_Int32 DummyTokenHandler::getTokenFromUTF8( const uno::Sequence< sal_Int8 >&
sal_Int32
DummyTokenHandler
::
getTokenDirect
(
const
char
*
pToken
,
sal_Int32
nLength
)
const
{
O
UString
sToken
(
pToken
,
nLength
,
RTL_TEXTENCODING_UTF8
);
for
(
sal_uInt16
i
=
0
;
i
<
sizeof
(
tokens
)
/
sizeof
(
OUString
);
i
++
)
O
String
sToken
(
pToken
,
nLength
);
for
(
sal_uInt16
i
=
0
;
i
<
SAL_N_ELEMENTS
(
tokens
);
i
++
)
{
if
(
tokens
[
i
]
==
sToken
)
return
(
sal_Int32
)
i
;
...
...
@@ -376,7 +376,7 @@ void XMLImportTest::setUp()
args
[
0
]
<<=
xTokenHandler
;
xInit
->
initialize
(
args
);
sal_Int32
nNamespaceCount
=
sizeof
(
DummyTokenHandler
::
namespaceURIs
)
/
sizeof
(
OUString
);
sal_Int32
nNamespaceCount
=
SAL_N_ELEMENTS
(
DummyTokenHandler
::
namespaceURIs
);
uno
::
Sequence
<
uno
::
Any
>
namespaceArgs
(
nNamespaceCount
+
1
);
namespaceArgs
[
0
]
<<=
OUString
(
"registerNamespaces"
);
for
(
sal_Int32
i
=
1
;
i
<=
nNamespaceCount
;
i
++
)
...
...
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