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
aed1f0d5
Kaydet (Commit)
aed1f0d5
authored
Ock 15, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify defaultbootstrap.cxx
Change-Id: Ice206b1dabf8dbcad613f886574e737c039d2119
üst
3250fad6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
38 deletions
+32
-38
defaultbootstrap.cxx
cppuhelper/source/defaultbootstrap.cxx
+32
-38
No files found.
cppuhelper/source/defaultbootstrap.cxx
Dosyayı görüntüle @
aed1f0d5
...
...
@@ -52,12 +52,33 @@
namespace
{
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
bootstrapComponentContext
(
css
::
uno
::
Reference
<
css
::
registry
::
XSimpleRegistry
>
const
&
typeRegistry
,
rtl
::
OUString
const
&
serviceUris
,
rtl
::
Bootstrap
const
&
bootstrap
)
rtl
::
OUString
getBootstrapVariable
(
rtl
::
Bootstrap
const
&
bootstrap
,
rtl
::
OUString
const
&
name
)
{
rtl
::
OUString
v
;
if
(
!
bootstrap
.
getFrom
(
name
,
v
))
{
throw
css
::
uno
::
DeploymentException
(
"Cannot obtain "
+
name
+
" from uno ini"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
return
v
;
}
}
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
cppu
::
defaultBootstrap_InitialComponentContext
(
rtl
::
OUString
const
&
iniUri
)
SAL_THROW
((
css
::
uno
::
Exception
))
{
rtl
::
Bootstrap
bs
(
iniUri
);
if
(
bs
.
getHandle
()
==
0
)
{
throw
css
::
uno
::
DeploymentException
(
"Cannot open uno ini "
+
iniUri
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
rtl
::
Reference
<
cppuhelper
::
ServiceManager
>
smgr
(
new
cppuhelper
::
ServiceManager
(
serviceUris
));
new
cppuhelper
::
ServiceManager
(
getBootstrapVariable
(
bs
,
"UNO_SERVICES"
)));
cppu
::
ContextEntry_Init
entry
;
std
::
vector
<
cppu
::
ContextEntry_Init
>
context_values
;
context_values
.
push_back
(
...
...
@@ -95,7 +116,7 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
"/singletons/"
+
i
->
first
,
css
::
uno
::
makeAny
(
i
->
second
[
0
]
->
info
->
name
),
true
));
}
cppu
::
add_access_control_entries
(
&
context_values
,
b
ootstrap
);
cppu
::
add_access_control_entries
(
&
context_values
,
b
s
);
assert
(
!
context_values
.
empty
());
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
context
(
createComponentContext
(
...
...
@@ -106,9 +127,13 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
context
->
getValueByName
(
"/singletons/com.sun.star.reflection.theTypeDescriptionManager"
),
css
::
uno
::
UNO_QUERY_THROW
);
if
(
typeRegistry
.
is
())
{
css
::
uno
::
Reference
<
css
::
registry
::
XSimpleRegistry
>
typereg
(
cppuhelper
::
createTypeRegistry
(
getBootstrapVariable
(
bs
,
"UNO_TYPES"
),
getBootstrapVariable
(
bs
,
"URE_INTERNAL_LIB_DIR"
)));
if
(
typereg
.
is
())
{
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>
arg
(
1
);
arg
[
0
]
<<=
type
Registry
;
arg
[
0
]
<<=
type
reg
;
css
::
uno
::
Reference
<
css
::
container
::
XSet
>
(
tdmgr
,
css
::
uno
::
UNO_QUERY_THROW
)
->
insert
(
...
...
@@ -122,37 +147,6 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
return
context
;
}
rtl
::
OUString
getBootstrapVariable
(
rtl
::
Bootstrap
const
&
bootstrap
,
rtl
::
OUString
const
&
name
)
{
rtl
::
OUString
v
;
if
(
!
bootstrap
.
getFrom
(
name
,
v
))
{
throw
css
::
uno
::
DeploymentException
(
"Cannot obtain "
+
name
+
" from uno ini"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
return
v
;
}
}
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
cppu
::
defaultBootstrap_InitialComponentContext
(
rtl
::
OUString
const
&
iniUri
)
SAL_THROW
((
css
::
uno
::
Exception
))
{
rtl
::
Bootstrap
bs
(
iniUri
);
if
(
bs
.
getHandle
()
==
0
)
{
throw
css
::
uno
::
DeploymentException
(
"Cannot open uno ini "
+
iniUri
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
return
bootstrapComponentContext
(
cppuhelper
::
createTypeRegistry
(
getBootstrapVariable
(
bs
,
"UNO_TYPES"
),
getBootstrapVariable
(
bs
,
"URE_INTERNAL_LIB_DIR"
)),
getBootstrapVariable
(
bs
,
"UNO_SERVICES"
),
bs
);
}
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
cppu
::
defaultBootstrap_InitialComponentContext
()
SAL_THROW
((
css
::
uno
::
Exception
))
...
...
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