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
2c6363eb
Kaydet (Commit)
2c6363eb
authored
Agu 30, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Be less pathetic
Change-Id: Ifeadfa9f95f85514f7d01ea777e2563803e0898c
üst
352f8418
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
49 deletions
+19
-49
mediadescriptor.cxx
comphelper/source/misc/mediadescriptor.cxx
+19
-37
mediadescriptor.hxx
include/comphelper/mediadescriptor.hxx
+0
-12
No files found.
comphelper/source/misc/mediadescriptor.cxx
Dosyayı görüntüle @
2c6363eb
...
@@ -47,6 +47,24 @@
...
@@ -47,6 +47,24 @@
namespace
comphelper
{
namespace
comphelper
{
namespace
{
OUString
removeFragment
(
OUString
const
&
uri
)
{
css
::
uno
::
Reference
<
css
::
uri
::
XUriReference
>
ref
(
css
::
uri
::
UriReferenceFactory
::
create
(
comphelper
::
getProcessComponentContext
())
->
parse
(
uri
));
if
(
ref
.
is
())
{
ref
->
clearFragment
();
return
ref
->
getUriReference
();
}
else
{
SAL_WARN
(
"comphelper"
,
"cannot parse <"
<<
uri
<<
">"
);
return
uri
;
}
}
}
const
OUString
&
MediaDescriptor
::
PROP_ABORTED
()
const
OUString
&
MediaDescriptor
::
PROP_ABORTED
()
{
{
static
const
OUString
sProp
(
"Aborted"
);
static
const
OUString
sProp
(
"Aborted"
);
...
@@ -466,9 +484,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
...
@@ -466,9 +484,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
throw
css
::
uno
::
Exception
(
"Found no URL."
,
throw
css
::
uno
::
Exception
(
"Found no URL."
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
// Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
return
impl_openStreamWithURL
(
removeFragment
(
sURL
),
bLockFile
);
OUString
sNormalizedURL
=
impl_normalizeURL
(
sURL
);
return
impl_openStreamWithURL
(
sNormalizedURL
,
bLockFile
);
}
}
catch
(
const
css
::
uno
::
Exception
&
ex
)
catch
(
const
css
::
uno
::
Exception
&
ex
)
{
{
...
@@ -707,40 +723,6 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, sal_Bool
...
@@ -707,40 +723,6 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, sal_Bool
return
xInputStream
.
is
();
return
xInputStream
.
is
();
}
}
OUString
MediaDescriptor
::
impl_normalizeURL
(
const
OUString
&
sURL
)
{
/* Remove Jumpmarks (fragments) of an URL only here.
They are not part of any URL and as a result may be
no ucb content can be created then.
On the other side arguments must exists ... because
they are part of an URL.
Do not use the URLTransformer service here. Because
it parses the URL in another way. It's main part isnt enough
and it's complete part contains the jumpmark (fragment) parameter ...
*/
try
{
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
css
::
uno
::
Reference
<
css
::
uri
::
XUriReferenceFactory
>
xUriFactory
=
css
::
uri
::
UriReferenceFactory
::
create
(
xContext
);;
css
::
uno
::
Reference
<
css
::
uri
::
XUriReference
>
xUriRef
=
xUriFactory
->
parse
(
sURL
);
if
(
xUriRef
.
is
())
{
xUriRef
->
clearFragment
();
return
xUriRef
->
getUriReference
();
}
}
catch
(
const
css
::
uno
::
RuntimeException
&
)
{
throw
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{}
// If an error ocurred ... return the original URL.
// It's a try .-)
return
sURL
;
}
}
// namespace comphelper
}
// namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/comphelper/mediadescriptor.hxx
Dosyayı görüntüle @
2c6363eb
...
@@ -271,18 +271,6 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
...
@@ -271,18 +271,6 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
sal_Bool
bLockFile
sal_Bool
bLockFile
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
//---------------------------------------
/** @short some URL parts can make trouble for opening streams (e.g. jumpmarks.)
An URL should be "normalized" before its used.
@param sURL
the original URL (e.g. including a jumpmark)
@return [string]
the "normalized" URL (e.g. without jumpmark)
*/
COMPHELPER_DLLPRIVATE
OUString
impl_normalizeURL
(
const
OUString
&
sURL
);
//---------------------------------------
//---------------------------------------
/** @short it checks if the descriptor already has a valid
/** @short it checks if the descriptor already has a valid
InputStream item and creates a new one, if not.
InputStream item and creates a new one, if not.
...
...
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