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
b9ca4de9
Kaydet (Commit)
b9ca4de9
authored
Ara 03, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
From ill-named comphelper::getExpandedFilePath to comphelper::getExpanedUri
Change-Id: I749d78d115f641b2ac18cd6eb483c69a22ee210c
üst
6abdd2d9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
53 deletions
+48
-53
Library_comphelper.mk
comphelper/Library_comphelper.mk
+1
-1
getexpandeduri.cxx
comphelper/source/misc/getexpandeduri.cxx
+17
-21
getexpandeduri.hxx
include/comphelper/getexpandeduri.hxx
+23
-23
precompiled_sd.hxx
sd/inc/pch/precompiled_sd.hxx
+0
-1
CustomAnimationPreset.cxx
sd/source/core/CustomAnimationPreset.cxx
+2
-2
TransitionPreset.cxx
sd/source/core/TransitionPreset.cxx
+2
-2
drawdoc.cxx
sd/source/core/drawdoc.cxx
+3
-3
No files found.
comphelper/Library_comphelper.mk
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -88,7 +88,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/misc/documentiologring \
comphelper/source/misc/evtlistenerhlp \
comphelper/source/misc/evtmethodhelper \
comphelper/source/misc/
expandmacro
\
comphelper/source/misc/
getexpandeduri
\
comphelper/source/misc/instancelocker \
comphelper/source/misc/interaction \
comphelper/source/misc/listenernotification \
...
...
include/comphelper/expandmacro.h
xx
→
comphelper/source/misc/getexpandeduri.c
xx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -7,30 +7,26 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_COMPHELPER_EXPANDMACRO_HXX
#define INCLUDED_COMPHELPER_EXPANDMACRO_HXX
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include <comphelper/comphelperdllapi.h>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrlReference.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <comphelper/getexpandeduri.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
namespace
comphelper
OUString
comphelper
::
getExpandedUri
(
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
const
&
context
,
OUString
const
&
uri
)
{
/**
A helper function to get expanded version of macro for filepaths.
If the given path is prefixed by "vnd.sun.star.expand:", this
function substitutes contained macro references. It then always
returns a system file path, if necessary converting file
URIs. Example:
vnd.sun.star.expand:$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR gets
converted to e.g. /usr/lib64/libreoffice/share.
@param path to operate on. Both system file path and file URIs are accepted.
@return macro-expanded file URI.
*/
COMPHELPER_DLLPUBLIC
rtl
::
OUString
getExpandedFilePath
(
const
rtl
::
OUString
&
filepath
);
css
::
uno
::
Reference
<
css
::
uri
::
XVndSunStarExpandUrlReference
>
ref
(
css
::
uri
::
UriReferenceFactory
::
create
(
context
)
->
parse
(
uri
),
css
::
uno
::
UNO_QUERY
);
return
ref
.
is
()
?
ref
->
expand
(
css
::
util
::
theMacroExpander
::
get
(
context
))
:
uri
;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
comphelper/source/misc/expandmacro.c
xx
→
include/comphelper/getexpandeduri.h
xx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -7,35 +7,35 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <comphelper/expandmacro.hxx>
#ifndef INCLUDED_COMPHELPER_GETEXPANDEDURI_HXX
#define INCLUDED_COMPHELPER_GETEXPANDEDURI_HXX
#include <sal/config.h>
#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/comphelperdllapi.h>
#include <rtl/ustring.hxx>
#include <rtl/uri.hxx>
#include <rtl/bootstrap.hxx>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
#include <sal/types.h>
namespace
comphelper
{
rtl
::
OUString
getExpandedFilePath
(
const
rtl
::
OUString
&
filepath
)
{
rtl
::
OUString
aFilename
=
filepath
;
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
uno
{
class
XComponentContext
;
}
}
}
}
if
(
aFilename
.
startsWith
(
"vnd.sun.star.expand:"
)
)
{
// cut protocol
rtl
::
OUString
aMacro
(
aFilename
.
copy
(
sizeof
(
"vnd.sun.star.expand:"
)
-
1
)
);
namespace
comphelper
{
// decode uric class chars
aMacro
=
rtl
::
Uri
::
decode
(
aMacro
,
rtl_UriDecodeWithCharset
,
RTL_TEXTENCODING_UTF8
);
/**
A helper function to expand vnd.sun.star.expand URLs.
// expand macro string
rtl
::
Bootstrap
::
expandMacros
(
aMacro
);
If the given URI is a vnd.sun.star.expand URL, it is expanded (using the
given component context's com.sun.star.util.theMacroExpander); otherwise it
is returned unchanged.
*/
COMPHELPER_DLLPUBLIC
OUString
getExpandedUri
(
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
const
&
context
,
OUString
const
&
uri
);
aFilename
=
aMacro
;
}
return
aFilename
;
}
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sd/inc/pch/precompiled_sd.hxx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -355,7 +355,6 @@
#include <comphelper/anytostring.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/documentconstants.hxx>
#include <comphelper/expandmacro.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/genericpropertyset.hxx>
#include <comphelper/namedvaluecollection.hxx>
...
...
sd/source/core/CustomAnimationPreset.cxx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -29,12 +29,12 @@
#include <com/sun/star/presentation/EffectPresetClass.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <unotools/streamwrap.hxx>
#include <comphelper/getexpandeduri.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
#include <comphelper/string.hxx>
#include <unotools/pathoptions.hxx>
#include <tools/stream.hxx>
#include <comphelper/expandmacro.hxx>
#include <tools/debug.hxx>
#include <rtl/uri.hxx>
...
...
@@ -324,7 +324,7 @@ void CustomAnimationPresets::importEffects()
for
(
sal_Int32
i
=
0
;
i
<
aFiles
.
getLength
();
++
i
)
{
OUString
aURL
=
::
comphelper
::
getExpandedFilePath
(
aFiles
[
i
]);
OUString
aURL
=
comphelper
::
getExpandedUri
(
xContext
,
aFiles
[
i
]);
mxRootNode
=
implImportEffects
(
xServiceFactory
,
aURL
);
...
...
sd/source/core/TransitionPreset.cxx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -28,10 +28,10 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <unotools/streamwrap.hxx>
#include <comphelper/getexpandeduri.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/pathoptions.hxx>
#include <tools/stream.hxx>
#include <comphelper/expandmacro.hxx>
#include <rtl/uri.hxx>
#include <rtl/instance.hxx>
...
...
@@ -170,7 +170,7 @@ bool TransitionPreset::importTransitionPresetList( TransitionPresetList& rList )
for
(
sal_Int32
i
=
0
;
i
<
aFiles
.
getLength
();
++
i
)
{
OUString
aURL
=
::
comphelper
::
getExpandedFilePath
(
aFiles
[
i
]);
OUString
aURL
=
comphelper
::
getExpandedUri
(
xContext
,
aFiles
[
i
]);
bRet
|=
importTransitionsFile
(
rList
,
xServiceFactory
,
...
...
sd/source/core/drawdoc.cxx
Dosyayı görüntüle @
b9ca4de9
...
...
@@ -55,6 +55,7 @@
#include <editeng/outlobj.hxx>
#include <unotools/saveopt.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/getexpandeduri.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <unotools/charclass.hxx>
...
...
@@ -72,7 +73,6 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/ustring.hxx>
#include <rtl/uri.hxx>
#include <comphelper/expandmacro.hxx>
#include <editeng/outliner.hxx>
#include "drawdoc.hxx"
...
...
@@ -989,7 +989,7 @@ void SdDrawDocument::InitLayoutVector()
rtl
::
OUString
sFilename
;
for
(
sal_Int32
i
=
0
;
i
<
aFiles
.
getLength
();
++
i
)
{
sFilename
=
::
comphelper
::
getExpandedFilePath
(
aFiles
[
i
]);
sFilename
=
comphelper
::
getExpandedUri
(
xContext
,
aFiles
[
i
]);
// load layout file into DOM
Reference
<
XMultiServiceFactory
>
xServiceFactory
(
...
...
@@ -1025,7 +1025,7 @@ void SdDrawDocument::InitObjectVector()
rtl
::
OUString
sFilename
;
for
(
sal_Int32
i
=
0
;
i
<
aFiles
.
getLength
();
++
i
)
{
sFilename
=
::
comphelper
::
getExpandedFilePath
(
aFiles
[
i
]);
sFilename
=
comphelper
::
getExpandedUri
(
xContext
,
aFiles
[
i
]);
// load presentation object file into DOM
Reference
<
XMultiServiceFactory
>
xServiceFactory
(
...
...
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