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
daebd00f
Kaydet (Commit)
daebd00f
authored
Mar 22, 2010
tarafından
Mikhail Voytenko
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw321bf01: #i106861# encode the display name
üst
dadd3717
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
transfer.cxx
svtools/source/misc/transfer.cxx
+22
-2
No files found.
svtools/source/misc/transfer.cxx
Dosyayı görüntüle @
daebd00f
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <vos/mutex.hxx>
#include <vos/mutex.hxx>
#include <rtl/memory.h>
#include <rtl/memory.h>
#include <rtl/uuid.h>
#include <rtl/uuid.h>
#include <rtl/uri.hxx>
#ifndef DEBUG_HXX
#ifndef DEBUG_HXX
#include <tools/debug.hxx>
#include <tools/debug.hxx>
#endif
#endif
...
@@ -154,6 +155,10 @@ SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjD
...
@@ -154,6 +155,10 @@ SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjD
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// the reading of the parameter is done using the special service ::com::sun::star::datatransfer::MimeContentType,
// a similar approach should be implemented for creation of the mimetype string;
// for now the set of acceptable characters has to be hardcoded, in future it should be part of the service that creates the mimetype
const
::
rtl
::
OUString
aQuotedParamChars
=
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"()<>@,;:
\\\"
/[]?=!#$%&'*+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~. "
)
);
static
::
rtl
::
OUString
ImplGetParameterString
(
const
TransferableObjectDescriptor
&
rObjDesc
)
static
::
rtl
::
OUString
ImplGetParameterString
(
const
TransferableObjectDescriptor
&
rObjDesc
)
{
{
...
@@ -177,8 +182,21 @@ static ::rtl::OUString ImplGetParameterString( const TransferableObjectDescripto
...
@@ -177,8 +182,21 @@ static ::rtl::OUString ImplGetParameterString( const TransferableObjectDescripto
if
(
rObjDesc
.
maDisplayName
.
Len
()
)
if
(
rObjDesc
.
maDisplayName
.
Len
()
)
{
{
// the display name might contain unacceptable characters, encode all of them
// this seems to be the only parameter currently that might contain such characters
sal_Bool
pToAccept
[
128
];
for
(
sal_Int32
nBInd
=
0
;
nBInd
<
128
;
nBInd
++
)
pToAccept
[
nBInd
]
=
sal_False
;
for
(
sal_Int32
nInd
=
0
;
nInd
<
aQuotedParamChars
.
getLength
();
nInd
++
)
{
sal_Unicode
nChar
=
aQuotedParamChars
.
getStr
()[
nInd
];
if
(
nChar
>=
0
&&
nChar
<
128
)
pToAccept
[
nChar
]
=
sal_True
;
}
aParams
+=
::
rtl
::
OUString
::
createFromAscii
(
";displayname=
\"
"
);
aParams
+=
::
rtl
::
OUString
::
createFromAscii
(
";displayname=
\"
"
);
aParams
+=
rObjDesc
.
maDisplayName
;
aParams
+=
::
rtl
::
Uri
::
encode
(
rObjDesc
.
maDisplayName
,
pToAccept
,
rtl_UriEncodeIgnoreEscapes
,
RTL_TEXTENCODING_UTF8
)
;
aParams
+=
aChar
;
aParams
+=
aChar
;
}
}
...
@@ -248,7 +266,9 @@ static void ImplSetParameterString( TransferableObjectDescriptor& rObjDesc, cons
...
@@ -248,7 +266,9 @@ static void ImplSetParameterString( TransferableObjectDescriptor& rObjDesc, cons
if
(
xMimeType
->
hasParameter
(
aDisplayNameString
)
)
if
(
xMimeType
->
hasParameter
(
aDisplayNameString
)
)
{
{
rObjDesc
.
maDisplayName
=
xMimeType
->
getParameterValue
(
aDisplayNameString
);
// the display name might contain unacceptable characters, in this case they should be encoded
// this seems to be the only parameter currently that might contain such characters
rObjDesc
.
maDisplayName
=
::
rtl
::
Uri
::
decode
(
xMimeType
->
getParameterValue
(
aDisplayNameString
),
rtl_UriDecodeWithCharset
,
RTL_TEXTENCODING_UTF8
);
}
}
if
(
xMimeType
->
hasParameter
(
aViewAspectString
)
)
if
(
xMimeType
->
hasParameter
(
aViewAspectString
)
)
...
...
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