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
ad6f9f2f
Kaydet (Commit)
ad6f9f2f
authored
Kas 26, 2012
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String=>OUString of svl's urihelper
Change-Id: Ib4d9175ce4661140a147962b8f45be40f800d85a
üst
c7709b46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
45 deletions
+41
-45
baside2b.cxx
basctl/source/basicide/baside2b.cxx
+7
-7
svxacorr.cxx
editeng/source/misc/svxacorr.cxx
+6
-1
urihelper.hxx
svl/inc/svl/urihelper.hxx
+24
-33
test_URIHelper.cxx
svl/qa/unit/test_URIHelper.cxx
+4
-4
urihelper.cxx
svl/source/misc/urihelper.cxx
+0
-0
No files found.
basctl/source/basicide/baside2b.cxx
Dosyayı görüntüle @
ad6f9f2f
...
@@ -278,16 +278,16 @@ String EditorWindow::GetWordAtCursor()
...
@@ -278,16 +278,16 @@ String EditorWindow::GetWordAtCursor()
const
TextSelection
&
rSelection
=
pEditView
->
GetSelection
();
const
TextSelection
&
rSelection
=
pEditView
->
GetSelection
();
const
TextPaM
&
rSelStart
=
rSelection
.
GetStart
();
const
TextPaM
&
rSelStart
=
rSelection
.
GetStart
();
const
TextPaM
&
rSelEnd
=
rSelection
.
GetEnd
();
const
TextPaM
&
rSelEnd
=
rSelection
.
GetEnd
();
String
aText
=
pTextEngine
->
GetText
(
rSelEnd
.
GetPara
()
);
OU
String
aText
=
pTextEngine
->
GetText
(
rSelEnd
.
GetPara
()
);
CharClass
aClass
(
::
comphelper
::
getProcessComponentContext
()
,
Application
::
GetSettings
().
GetLanguageTag
()
);
CharClass
aClass
(
::
comphelper
::
getProcessComponentContext
()
,
Application
::
GetSettings
().
GetLanguageTag
()
);
xub_StrLen
nSelStart
=
static_cast
<
xub_StrLen
>
(
rSelStart
.
GetIndex
()
);
sal_Int32
nSelStart
=
rSelStart
.
GetIndex
(
);
xub_StrLen
nSelEnd
=
static_cast
<
xub_StrLen
>
(
rSelEnd
.
GetIndex
()
);
sal_Int32
nSelEnd
=
rSelEnd
.
GetIndex
(
);
xub_StrLen
nLength
=
static_cast
<
xub_StrLen
>
(
aText
.
Len
()
);
sal_Int32
nLength
=
aText
.
getLength
(
);
xub_StrLen
nStart
=
0
;
sal_Int32
nStart
=
0
;
xub_StrLen
nEnd
=
nLength
;
sal_Int32
nEnd
=
nLength
;
while
(
nStart
<
nLength
)
while
(
nStart
<
nLength
)
{
{
String
aURL
(
URIHelper
::
FindFirstURLInText
(
aText
,
nStart
,
nEnd
,
aClass
)
);
OU
String
aURL
(
URIHelper
::
FindFirstURLInText
(
aText
,
nStart
,
nEnd
,
aClass
)
);
INetURLObject
aURLObj
(
aURL
);
INetURLObject
aURLObj
(
aURL
);
if
(
aURLObj
.
GetProtocol
()
==
INET_PROT_VND_SUN_STAR_HELP
if
(
aURLObj
.
GetProtocol
()
==
INET_PROT_VND_SUN_STAR_HELP
&&
nSelStart
>=
nStart
&&
nSelStart
<=
nEnd
&&
nSelEnd
>=
nStart
&&
nSelEnd
<=
nEnd
)
&&
nSelStart
>=
nStart
&&
nSelStart
<=
nEnd
&&
nSelEnd
>=
nStart
&&
nSelEnd
<=
nEnd
)
...
...
editeng/source/misc/svxacorr.cxx
Dosyayı görüntüle @
ad6f9f2f
...
@@ -690,8 +690,13 @@ sal_Bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const String& rTxt
...
@@ -690,8 +690,13 @@ sal_Bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const String& rTxt
xub_StrLen
nSttPos
,
xub_StrLen
nEndPos
,
xub_StrLen
nSttPos
,
xub_StrLen
nEndPos
,
LanguageType
eLang
)
LanguageType
eLang
)
{
{
String
sURL
(
URIHelper
::
FindFirstURLInText
(
rTxt
,
nSttPos
,
nEndPos
,
sal_Int32
nStart
(
nSttPos
);
sal_Int32
nEnd
(
nEndPos
);
String
sURL
(
URIHelper
::
FindFirstURLInText
(
rTxt
,
nStart
,
nEnd
,
GetCharClass
(
eLang
)
));
GetCharClass
(
eLang
)
));
nSttPos
=
(
xub_StrLen
)
nStart
;
nEndPos
=
(
xub_StrLen
)
nEnd
;
sal_Bool
bRet
=
0
!=
sURL
.
Len
();
sal_Bool
bRet
=
0
!=
sURL
.
Len
();
if
(
bRet
)
// also Attribut setzen:
if
(
bRet
)
// also Attribut setzen:
rDoc
.
SetINetAttr
(
nSttPos
,
nEndPos
,
sURL
);
rDoc
.
SetINetAttr
(
nSttPos
,
nEndPos
,
sURL
);
...
...
svl/inc/svl/urihelper.hxx
Dosyayı görüntüle @
ad6f9f2f
...
@@ -32,7 +32,7 @@ namespace com { namespace sun { namespace star {
...
@@ -32,7 +32,7 @@ namespace com { namespace sun { namespace star {
namespace
uno
{
class
XComponentContext
;
}
namespace
uno
{
class
XComponentContext
;
}
namespace
uri
{
class
XUriReference
;
}
namespace
uri
{
class
XUriReference
;
}
}
}
}
}
}
}
namespace
rtl
{
class
OUString
;
}
class
CharClass
;
class
CharClass
;
//============================================================================
//============================================================================
...
@@ -51,19 +51,16 @@ namespace URIHelper {
...
@@ -51,19 +51,16 @@ namespace URIHelper {
existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false
existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false
if you want to generate file URLs without checking for their existence.
if you want to generate file URLs without checking for their existence.
*/
*/
SVL_DLLPUBLIC
rtl
::
OUString
SVL_DLLPUBLIC
OUString
SmartRel2Abs
(
INetURLObject
const
&
rTheBaseURIRef
,
SmartRel2Abs
(
INetURLObject
const
&
rTheBaseURIRef
,
OUString
const
&
rTheRelURIRef
,
rtl
::
OUString
const
&
rTheRelURIRef
,
Link
const
&
rMaybeFileHdl
=
Link
(),
Link
const
&
rMaybeFileHdl
=
Link
(),
bool
bCheckFileExists
=
true
,
bool
bCheckFileExists
=
true
,
bool
bIgnoreFragment
=
false
,
bool
bIgnoreFragment
=
false
,
INetURLObject
::
EncodeMechanism
eEncodeMechanism
=
INetURLObject
::
WAS_ENCODED
,
INetURLObject
::
EncodeMechanism
eEncodeMechanism
INetURLObject
::
DecodeMechanism
eDecodeMechanism
=
INetURLObject
::
DECODE_TO_IURI
,
=
INetURLObject
::
WAS_ENCODED
,
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
,
INetURLObject
::
DecodeMechanism
eDecodeMechanism
bool
bRelativeNonURIs
=
false
,
=
INetURLObject
::
DECODE_TO_IURI
,
INetURLObject
::
FSysStyle
eStyle
=
INetURLObject
::
FSYS_DETECT
);
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
,
bool
bRelativeNonURIs
=
false
,
INetURLObject
::
FSysStyle
eStyle
=
INetURLObject
::
FSYS_DETECT
);
//============================================================================
//============================================================================
SVL_DLLPUBLIC
void
SetMaybeFileHdl
(
Link
const
&
rTheMaybeFileHdl
);
SVL_DLLPUBLIC
void
SetMaybeFileHdl
(
Link
const
&
rTheMaybeFileHdl
);
...
@@ -119,20 +116,17 @@ normalizedMakeRelative(
...
@@ -119,20 +116,17 @@ normalizedMakeRelative(
@deprecated
@deprecated
No code should rely on the default component context.
No code should rely on the default component context.
*/
*/
SVL_DLLPUBLIC
rtl
::
OUString
simpleNormalizedMakeRelative
(
SVL_DLLPUBLIC
OUString
simpleNormalizedMakeRelative
(
OUString
const
&
baseUriReference
,
rtl
::
OUString
const
&
baseUriReference
,
rtl
::
OUString
const
&
uriReference
);
OUString
const
&
uriReference
);
//============================================================================
//============================================================================
SVL_DLLPUBLIC
rtl
::
OUString
SVL_DLLPUBLIC
OUString
FindFirstURLInText
(
OUString
const
&
rText
,
FindFirstURLInText
(
rtl
::
OUString
const
&
rText
,
sal_Int32
&
rBegin
,
xub_StrLen
&
rBegin
,
sal_Int32
&
rEnd
,
xub_StrLen
&
rEnd
,
CharClass
const
&
rCharClass
,
CharClass
const
&
rCharClass
,
INetURLObject
::
EncodeMechanism
eMechanism
=
INetURLObject
::
WAS_ENCODED
,
INetURLObject
::
EncodeMechanism
eMechanism
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
,
=
INetURLObject
::
WAS_ENCODED
,
INetURLObject
::
FSysStyle
eStyle
=
INetURLObject
::
FSYS_DETECT
);
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
,
INetURLObject
::
FSysStyle
eStyle
=
INetURLObject
::
FSYS_DETECT
);
//============================================================================
//============================================================================
/** Remove any password component from both absolute and relative URLs.
/** Remove any password component from both absolute and relative URLs.
...
@@ -160,13 +154,10 @@ FindFirstURLInText(rtl::OUString const & rText,
...
@@ -160,13 +154,10 @@ FindFirstURLInText(rtl::OUString const & rText,
@return The input URI with any password component removed.
@return The input URI with any password component removed.
*/
*/
SVL_DLLPUBLIC
rtl
::
OUString
SVL_DLLPUBLIC
OUString
removePassword
(
OUString
const
&
rURI
,
removePassword
(
rtl
::
OUString
const
&
rURI
,
INetURLObject
::
EncodeMechanism
eEncodeMechanism
=
INetURLObject
::
WAS_ENCODED
,
INetURLObject
::
EncodeMechanism
eEncodeMechanism
INetURLObject
::
DecodeMechanism
eDecodeMechanism
=
INetURLObject
::
DECODE_TO_IURI
,
=
INetURLObject
::
WAS_ENCODED
,
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
);
INetURLObject
::
DecodeMechanism
eDecodeMechanism
=
INetURLObject
::
DECODE_TO_IURI
,
rtl_TextEncoding
eCharset
=
RTL_TEXTENCODING_UTF8
);
}
}
#endif // SVTOOLS_URIHELPER_HXX
#endif // SVTOOLS_URIHELPER_HXX
...
...
svl/qa/unit/test_URIHelper.cxx
Dosyayı görüntüle @
ad6f9f2f
...
@@ -301,8 +301,8 @@ void Test::testFindFirstURLInText() {
...
@@ -301,8 +301,8 @@ void Test::testFindFirstURLInText() {
struct
Data
{
struct
Data
{
char
const
*
input
;
char
const
*
input
;
char
const
*
result
;
char
const
*
result
;
xub_StrLen
begin
;
sal_Int32
begin
;
xub_StrLen
end
;
sal_Int32
end
;
};
};
static
Data
const
tests
[]
=
{
static
Data
const
tests
[]
=
{
{
"...ftp://bla.bla.bla/blubber/..."
,
{
"...ftp://bla.bla.bla/blubber/..."
,
...
@@ -390,8 +390,8 @@ void Test::testFindFirstURLInText() {
...
@@ -390,8 +390,8 @@ void Test::testFindFirstURLInText() {
CharClass
charClass
(
m_context
,
LanguageTag
(
com
::
sun
::
star
::
lang
::
Locale
(
"en"
,
"US"
,
""
)));
CharClass
charClass
(
m_context
,
LanguageTag
(
com
::
sun
::
star
::
lang
::
Locale
(
"en"
,
"US"
,
""
)));
for
(
std
::
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
tests
);
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
tests
);
++
i
)
{
rtl
::
OUString
input
(
rtl
::
OUString
::
createFromAscii
(
tests
[
i
].
input
));
rtl
::
OUString
input
(
rtl
::
OUString
::
createFromAscii
(
tests
[
i
].
input
));
xub_StrLen
begin
=
0
;
sal_Int32
begin
=
0
;
xub_StrLen
end
=
static_cast
<
xub_StrLen
>
(
input
.
getLength
()
);
sal_Int32
end
=
input
.
getLength
(
);
rtl
::
OUString
result
(
rtl
::
OUString
result
(
URIHelper
::
FindFirstURLInText
(
input
,
begin
,
end
,
charClass
));
URIHelper
::
FindFirstURLInText
(
input
,
begin
,
end
,
charClass
));
bool
ok
=
tests
[
i
].
result
==
0
bool
ok
=
tests
[
i
].
result
==
0
...
...
svl/source/misc/urihelper.cxx
Dosyayı görüntüle @
ad6f9f2f
This diff is collapsed.
Click to expand it.
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