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
cb1c4edc
Kaydet (Commit)
cb1c4edc
authored
Haz 13, 2001
tarafından
Daniel Boelzle
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#87233# singleton init
üst
d5d00d88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
15 deletions
+40
-15
component_context.cxx
cppuhelper/source/component_context.cxx
+40
-15
No files found.
cppuhelper/source/component_context.cxx
Dosyayı görüntüle @
cb1c4edc
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: component_context.cxx,v $
*
* $Revision: 1.
8
$
* $Revision: 1.
9
$
*
* last change: $Author: dbo $ $Date: 2001-06-
07 12:55:20
$
* last change: $Author: dbo $ $Date: 2001-06-
13 08:39:27
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -135,12 +135,12 @@ class ComponentContext
struct
ContextEntry
{
Any
lateInit
;
Any
value
;
bool
bLateInitService
;
inline
ContextEntry
(
bool
bLateInitService
_
,
Any
const
&
value_
)
:
value
(
value
_
)
,
bLateInitService
(
bLateInitServic
e_
)
inline
ContextEntry
(
Any
const
&
lateInit
_
,
Any
const
&
value_
)
:
lateInit
(
lateInit
_
)
,
value
(
valu
e_
)
{}
};
typedef
::
std
::
hash_map
<
OUString
,
ContextEntry
*
,
OUStringHash
>
t_map
;
...
...
@@ -183,21 +183,21 @@ Any ComponentContext::getValueByName( OUString const & rName )
{
ContextEntry
*
pEntry
=
iFind
->
second
;
if
(
pEntry
->
bLateInitService
)
if
(
pEntry
->
lateInit
.
hasValue
()
)
{
try
{
Reference
<
XInterface
>
xInstance
;
Reference
<
lang
::
XSingleComponentFactory
>
xFac
;
if
(
pEntry
->
value
>>=
xFac
)
// try via factory
if
(
pEntry
->
lateInit
>>=
xFac
)
// try via factory
{
xInstance
=
xFac
->
createInstanceWithContext
(
this
);
}
else
// optionally service name
{
OUString
aServiceName
;
if
((
pEntry
->
value
>>=
aServiceName
)
&&
aServiceName
.
getLength
())
if
((
pEntry
->
lateInit
>>=
aServiceName
)
&&
aServiceName
.
getLength
())
{
if
(
m_xSMgr
.
is
())
{
...
...
@@ -215,10 +215,10 @@ Any ComponentContext::getValueByName( OUString const & rName )
if
(
xInstance
.
is
())
{
ClearableMutexGuard
aGuard
(
m_mutex
);
if
(
pEntry
->
bLateInitService
)
if
(
pEntry
->
lateInit
.
hasValue
()
)
{
pEntry
->
value
.
setValue
(
&
xInstance
,
::
getCppuType
(
&
xInstance
)
);
pEntry
->
bLateInitService
=
false
;
pEntry
->
lateInit
.
clear
()
;
}
else
// inited in the meantime
{
...
...
@@ -296,11 +296,12 @@ void ComponentContext::disposing()
{
Reference
<
lang
::
XComponent
>
xComp
;
if
(
pEntry
->
bLateInitService
)
if
(
pEntry
->
lateInit
.
hasValue
()
)
{
// may be in late init
MutexGuard
aGuard
(
m_mutex
);
pEntry
->
value
>>=
xComp
;
pEntry
->
lateInit
.
clear
();
}
else
{
...
...
@@ -362,7 +363,19 @@ ComponentContext::ComponentContext(
{
rEntry
.
value
>>=
m_xSMgr
;
}
m_map
[
rEntry
.
name
]
=
new
ContextEntry
(
rEntry
.
bLateInitService
,
rEntry
.
value
);
ContextEntry
*
pEntry
;
if
(
rEntry
.
bLateInitService
)
{
// value is factory or string for late init
pEntry
=
new
ContextEntry
(
rEntry
.
value
,
Any
()
);
}
else
{
// only value, no late init factory nor string
pEntry
=
new
ContextEntry
(
Any
(),
rEntry
.
value
);
}
m_map
[
rEntry
.
name
]
=
pEntry
;
}
m_bDisposeSMgr
=
(
m_xSMgr
.
is
()
!=
sal_False
);
...
...
@@ -398,7 +411,19 @@ ComponentContext::ComponentContext(
{
rEntry
.
value
>>=
m_xSMgr
;
}
m_map
[
rEntry
.
name
]
=
new
ContextEntry
(
rEntry
.
bLateInitService
,
rEntry
.
value
);
ContextEntry
*
pEntry
;
if
(
rEntry
.
bLateInitService
)
{
// value is factory or string for late init
pEntry
=
new
ContextEntry
(
rEntry
.
value
,
Any
()
);
}
else
{
// only value, no late init factory nor string
pEntry
=
new
ContextEntry
(
Any
(),
rEntry
.
value
);
}
m_map
[
rEntry
.
name
]
=
pEntry
;
}
m_bDisposeSMgr
=
(
m_xSMgr
.
is
()
!=
sal_False
);
...
...
@@ -420,7 +445,7 @@ ComponentContext::ComponentContext(
{
Reference
<
registry
::
XRegistryKey
>
const
&
xKey
=
pKeys
[
nPos
];
m_map
[
xKey
->
getKeyName
().
copy
(
sizeof
(
"/SINGLETONS"
)
/* -\0 +'/' */
)
]
=
new
ContextEntry
(
true
,
makeAny
(
xKey
->
getStringValue
()
)
);
new
ContextEntry
(
makeAny
(
xKey
->
getStringValue
()
),
Any
(
)
);
}
catch
(
Exception
&
rExc
)
{
...
...
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