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
fd8c06ad
Kaydet (Commit)
fd8c06ad
authored
Nis 20, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
duplicate surrogate code
Change-Id: I9fad024e4b5c8a4ca272f2387df07351198cf5dc
üst
a2fea109
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
41 deletions
+20
-41
surrogates.h
include/rtl/surrogates.h
+10
-2
inetmime.hxx
include/tools/inetmime.hxx
+0
-30
string.cxx
sal/rtl/string.cxx
+1
-1
uri.cxx
sal/rtl/uri.cxx
+1
-2
ustring.cxx
sal/rtl/ustring.cxx
+1
-1
urihelper.cxx
svl/source/misc/urihelper.cxx
+4
-3
urlobj.cxx
tools/source/fsys/urlobj.cxx
+3
-2
No files found.
sal/rtl/surrogates.hxx
→
include/rtl/surrogates.h
Dosyayı görüntüle @
fd8c06ad
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#ifndef INCLUDED_
SAL_RTL_SURROGATES_HXX
#ifndef INCLUDED_
RTL_SURROGATES_H
#define INCLUDED_
SAL_RTL_SURROGATES_HXX
#define INCLUDED_
RTL_SURROGATES_H
#include <sal/config.h>
#include <sal/config.h>
...
@@ -29,6 +29,10 @@
...
@@ -29,6 +29,10 @@
#define SAL_RTL_FIRST_LOW_SURROGATE 0xDC00
#define SAL_RTL_FIRST_LOW_SURROGATE 0xDC00
#define SAL_RTL_LAST_LOW_SURROGATE 0xDFFF
#define SAL_RTL_LAST_LOW_SURROGATE 0xDFFF
#ifdef __cplusplus
extern
"C"
{
#endif
inline
bool
isHighSurrogate
(
sal_uInt32
utf16
)
{
inline
bool
isHighSurrogate
(
sal_uInt32
utf16
)
{
return
utf16
>=
SAL_RTL_FIRST_HIGH_SURROGATE
return
utf16
>=
SAL_RTL_FIRST_HIGH_SURROGATE
&&
utf16
<=
SAL_RTL_LAST_HIGH_SURROGATE
;
&&
utf16
<=
SAL_RTL_LAST_HIGH_SURROGATE
;
...
@@ -44,6 +48,10 @@ inline sal_uInt32 combineSurrogates(sal_uInt32 high, sal_uInt32 low) {
...
@@ -44,6 +48,10 @@ inline sal_uInt32 combineSurrogates(sal_uInt32 high, sal_uInt32 low) {
+
(
low
-
SAL_RTL_FIRST_LOW_SURROGATE
)
+
0x10000
;
+
(
low
-
SAL_RTL_FIRST_LOW_SURROGATE
)
+
0x10000
;
}
}
#ifdef __cplusplus
}
#endif
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/tools/inetmime.hxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -262,13 +262,6 @@ public:
...
@@ -262,13 +262,6 @@ public:
*/
*/
static
sal_uInt32
getHexDigit
(
int
nWeight
);
static
sal_uInt32
getHexDigit
(
int
nWeight
);
static
inline
bool
isHighSurrogate
(
sal_uInt32
nUTF16
);
static
inline
bool
isLowSurrogate
(
sal_uInt32
nUTF16
);
static
inline
sal_uInt32
toUTF32
(
sal_Unicode
cHighSurrogate
,
sal_Unicode
cLowSurrogate
);
/** Check two US-ASCII strings for equality, ignoring case.
/** Check two US-ASCII strings for equality, ignoring case.
@param pBegin1 Points to the start of the first string, must not be
@param pBegin1 Points to the start of the first string, must not be
...
@@ -530,29 +523,6 @@ inline int INetMIME::getBase64Weight(sal_uInt32 nChar)
...
@@ -530,29 +523,6 @@ inline int INetMIME::getBase64Weight(sal_uInt32 nChar)
nChar
==
'='
?
-
1
:
-
2
;
nChar
==
'='
?
-
1
:
-
2
;
}
}
// static
inline
bool
INetMIME
::
isHighSurrogate
(
sal_uInt32
nUTF16
)
{
return
nUTF16
>=
0xD800
&&
nUTF16
<=
0xDBFF
;
}
// static
inline
bool
INetMIME
::
isLowSurrogate
(
sal_uInt32
nUTF16
)
{
return
nUTF16
>=
0xDC00
&&
nUTF16
<=
0xDFFF
;
}
// static
inline
sal_uInt32
INetMIME
::
toUTF32
(
sal_Unicode
cHighSurrogate
,
sal_Unicode
cLowSurrogate
)
{
DBG_ASSERT
(
isHighSurrogate
(
cHighSurrogate
)
&&
isLowSurrogate
(
cLowSurrogate
),
"INetMIME::toUTF32(): Bad chars"
);
return
((
sal_uInt32
(
cHighSurrogate
)
&
0x3FF
)
<<
10
)
|
(
sal_uInt32
(
cLowSurrogate
)
&
0x3FF
);
}
// static
// static
inline
bool
INetMIME
::
startsWithLineBreak
(
const
sal_Char
*
pBegin
,
inline
bool
INetMIME
::
startsWithLineBreak
(
const
sal_Char
*
pBegin
,
const
sal_Char
*
pEnd
)
const
sal_Char
*
pEnd
)
...
...
sal/rtl/string.cxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#include <rtl/tencinfo.h>
#include <rtl/tencinfo.h>
#include "strimp.hxx"
#include "strimp.hxx"
#include
"surrogates.hxx"
#include
<rtl/surrogates.h>
#include <rtl/string.h>
#include <rtl/string.h>
#include "rtl/math.h"
#include "rtl/math.h"
...
...
sal/rtl/uri.cxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -17,11 +17,10 @@
...
@@ -17,11 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include "surrogates.hxx"
#include "osl/diagnose.h"
#include "osl/diagnose.h"
#include "rtl/character.hxx"
#include "rtl/character.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/surrogates.h"
#include "rtl/textenc.h"
#include "rtl/textenc.h"
#include "rtl/textcvt.h"
#include "rtl/textcvt.h"
#include "rtl/uri.h"
#include "rtl/uri.h"
...
...
sal/rtl/ustring.cxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
#include "hash.hxx"
#include "hash.hxx"
#include "strimp.hxx"
#include "strimp.hxx"
#include
"surrogates.hxx"
#include
<rtl/surrogates.h>
#include <rtl/ustring.h>
#include <rtl/ustring.h>
#include "rtl/math.h"
#include "rtl/math.h"
...
...
svl/source/misc/urihelper.cxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -36,13 +36,14 @@
...
@@ -36,13 +36,14 @@
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
#include <rtl/surrogates.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <sal/types.h>
#include <tools/inetmime.hxx>
#include <tools/inetmime.hxx>
#include <unotools/charclass.hxx>
#include <unotools/charclass.hxx>
#include <rtl/instance.hxx>
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
;
...
@@ -280,9 +281,9 @@ namespace {
...
@@ -280,9 +281,9 @@ namespace {
inline
sal_Int32
nextChar
(
OUString
const
&
rStr
,
sal_Int32
nPos
)
inline
sal_Int32
nextChar
(
OUString
const
&
rStr
,
sal_Int32
nPos
)
{
{
return
INetMIME
::
isHighSurrogate
(
rStr
[
nPos
])
return
isHighSurrogate
(
rStr
[
nPos
])
&&
rStr
.
getLength
()
-
nPos
>=
2
&&
rStr
.
getLength
()
-
nPos
>=
2
&&
INetMIME
::
isLowSurrogate
(
rStr
[
nPos
+
1
])
?
&&
isLowSurrogate
(
rStr
[
nPos
+
1
])
?
nPos
+
2
:
nPos
+
1
;
nPos
+
2
:
nPos
+
1
;
}
}
...
...
tools/source/fsys/urlobj.cxx
Dosyayı görüntüle @
fd8c06ad
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <osl/file.hxx>
#include <osl/file.hxx>
#include <rtl/character.hxx>
#include <rtl/character.hxx>
#include <rtl/string.h>
#include <rtl/string.h>
#include <rtl/surrogates.h>
#include <rtl/textenc.h>
#include <rtl/textenc.h>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <sal/types.h>
...
@@ -4777,8 +4778,8 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
...
@@ -4777,8 +4778,8 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin,
nShift
-=
6
;
nShift
-=
6
;
}
}
if
(
bUTF8
&&
nEncoded
>=
nMin
if
(
bUTF8
&&
nEncoded
>=
nMin
&&
!
INetMIME
::
isHighSurrogate
(
nEncoded
)
&&
!
isHighSurrogate
(
nEncoded
)
&&
!
INetMIME
::
isLowSurrogate
(
nEncoded
)
&&
!
isLowSurrogate
(
nEncoded
)
&&
nEncoded
<=
0x10FFFF
)
&&
nEncoded
<=
0x10FFFF
)
{
{
rBegin
=
p
;
rBegin
=
p
;
...
...
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