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
a12db8e9
Kaydet (Commit)
a12db8e9
authored
Haz 30, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#92440: Reduce code areas covered by mutex
Change-Id: Iec79e088e67e1cddeb8242d069fae911b305f613
üst
b6cefd5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
introspection.cxx
stoc/source/inspect/introspection.cxx
+31
-14
No files found.
stoc/source/inspect/introspection.cxx
Dosyayı görüntüle @
a12db8e9
...
@@ -1537,6 +1537,7 @@ public:
...
@@ -1537,6 +1537,7 @@ public:
private
:
private
:
virtual
void
SAL_CALL
disposing
()
SAL_OVERRIDE
{
virtual
void
SAL_CALL
disposing
()
SAL_OVERRIDE
{
osl
::
MutexGuard
g
(
m_aMutex
);
reflection_
.
clear
();
reflection_
.
clear
();
classCache_
.
clear
();
classCache_
.
clear
();
typeCache_
.
clear
();
typeCache_
.
clear
();
...
@@ -1572,16 +1573,20 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1572,16 +1573,20 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
css
::
uno
::
Any
const
&
aObject
)
css
::
uno
::
Any
const
&
aObject
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
osl
::
MutexGuard
g
(
m_aMutex
);
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlReflection
>
reflection
;
if
(
rBHelper
.
bDisposed
||
rBHelper
.
bInDispose
)
{
{
throw
css
::
lang
::
DisposedException
(
osl
::
MutexGuard
g
(
m_aMutex
);
getImplementationName
(),
static_cast
<
OWeakObject
*>
(
this
));
if
(
rBHelper
.
bDisposed
||
rBHelper
.
bInDispose
)
{
throw
css
::
lang
::
DisposedException
(
getImplementationName
(),
static_cast
<
OWeakObject
*>
(
this
));
}
reflection
=
reflection_
;
}
}
css
::
uno
::
Any
aToInspectObj
;
css
::
uno
::
Any
aToInspectObj
;
css
::
uno
::
Type
t
;
css
::
uno
::
Type
t
;
if
(
aObject
>>=
t
)
{
if
(
aObject
>>=
t
)
{
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
c
(
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
c
(
reflection
_
->
forName
(
t
.
getTypeName
()));
reflection
->
forName
(
t
.
getTypeName
()));
if
(
!
c
.
is
())
{
if
(
!
c
.
is
())
{
SAL_WARN
(
"stoc"
,
"cannot reflect type "
<<
t
.
getTypeName
());
SAL_WARN
(
"stoc"
,
"cannot reflect type "
<<
t
.
getTypeName
());
return
css
::
uno
::
Reference
<
css
::
beans
::
XIntrospectionAccess
>
();
return
css
::
uno
::
Reference
<
css
::
beans
::
XIntrospectionAccess
>
();
...
@@ -1632,7 +1637,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1632,7 +1637,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
const
Type
*
pTypes
=
SupportedTypesSeq
.
getConstArray
();
const
Type
*
pTypes
=
SupportedTypesSeq
.
getConstArray
();
for
(
sal_Int32
i
=
0
;
i
<
nTypeCount
;
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
nTypeCount
;
i
++
)
{
{
pClasses
[
i
]
=
reflection
_
->
forName
(
pTypes
[
i
].
getTypeName
());
pClasses
[
i
]
=
reflection
->
forName
(
pTypes
[
i
].
getTypeName
());
}
}
// TODO: Caching!
// TODO: Caching!
}
}
...
@@ -1641,7 +1646,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1641,7 +1646,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
"stoc"
,
"stoc"
,
"object of type
\"
"
<<
aToInspectObj
.
getValueTypeName
()
"object of type
\"
"
<<
aToInspectObj
.
getValueTypeName
()
<<
"
\"
lacks XTypeProvider"
);
<<
"
\"
lacks XTypeProvider"
);
xImplClass
=
reflection
_
->
forName
(
aToInspectObj
.
getValueTypeName
());
xImplClass
=
reflection
->
forName
(
aToInspectObj
.
getValueTypeName
());
SupportedClassSeq
.
realloc
(
1
);
SupportedClassSeq
.
realloc
(
1
);
SupportedClassSeq
[
0
]
=
xImplClass
;
SupportedClassSeq
[
0
]
=
xImplClass
;
}
}
...
@@ -1651,24 +1656,36 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1651,24 +1656,36 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
if
(
xPropSet
.
is
()
)
if
(
xPropSet
.
is
()
)
xPropSetInfo
=
xPropSet
->
getPropertySetInfo
();
xPropSetInfo
=
xPropSet
->
getPropertySetInfo
();
}
else
{
}
else
{
xImplClass
=
reflection
_
->
forName
(
aToInspectObj
.
getValueTypeName
());
xImplClass
=
reflection
->
forName
(
aToInspectObj
.
getValueTypeName
());
}
}
if
(
xTypeProvider
.
is
())
{
if
(
xTypeProvider
.
is
())
{
TypeKey
key
(
xPropSetInfo
,
xTypeProvider
->
getTypes
());
TypeKey
key
(
xPropSetInfo
,
xTypeProvider
->
getTypes
());
osl
::
MutexGuard
g
(
m_aMutex
);
if
(
rBHelper
.
bDisposed
||
rBHelper
.
bInDispose
)
{
throw
css
::
lang
::
DisposedException
(
getImplementationName
(),
static_cast
<
OWeakObject
*>
(
this
));
}
pAccess
=
typeCache_
.
find
(
key
);
pAccess
=
typeCache_
.
find
(
key
);
if
(
pAccess
.
is
())
{
if
(
pAccess
.
is
())
{
return
new
ImplIntrospectionAccess
(
aToInspectObj
,
pAccess
);
return
new
ImplIntrospectionAccess
(
aToInspectObj
,
pAccess
);
}
}
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
_
);
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
);
typeCache_
.
insert
(
key
,
pAccess
);
typeCache_
.
insert
(
key
,
pAccess
);
}
else
if
(
xImplClass
.
is
())
{
}
else
if
(
xImplClass
.
is
())
{
ClassKey
key
(
xPropSetInfo
,
xImplClass
,
SupportedClassSeq
);
ClassKey
key
(
xPropSetInfo
,
xImplClass
,
SupportedClassSeq
);
osl
::
MutexGuard
g
(
m_aMutex
);
if
(
rBHelper
.
bDisposed
||
rBHelper
.
bInDispose
)
{
throw
css
::
lang
::
DisposedException
(
getImplementationName
(),
static_cast
<
OWeakObject
*>
(
this
));
}
pAccess
=
classCache_
.
find
(
key
);
pAccess
=
classCache_
.
find
(
key
);
if
(
pAccess
.
is
())
{
if
(
pAccess
.
is
())
{
return
new
ImplIntrospectionAccess
(
aToInspectObj
,
pAccess
);
return
new
ImplIntrospectionAccess
(
aToInspectObj
,
pAccess
);
}
}
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
_
);
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
);
classCache_
.
insert
(
key
,
pAccess
);
classCache_
.
insert
(
key
,
pAccess
);
}
}
...
@@ -1681,7 +1698,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -1681,7 +1698,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
sal_Int32
i
;
sal_Int32
i
;
if
(
!
pAccess
.
is
()
)
if
(
!
pAccess
.
is
()
)
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
_
);
pAccess
=
new
IntrospectionAccessStatic_Impl
(
reflection
);
// Referenzen auf wichtige Daten von pAccess
// Referenzen auf wichtige Daten von pAccess
sal_Int32
&
rPropCount
=
pAccess
->
mnPropCount
;
sal_Int32
&
rPropCount
=
pAccess
->
mnPropCount
;
...
@@ -2317,7 +2334,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2317,7 +2334,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// void als Default-Klasse eintragen
// void als Default-Klasse eintragen
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
xListenerClass
(
xListenerClass
(
reflection
_
->
forName
(
reflection
->
forName
(
cppu
::
UnoType
<
void
>::
get
()
cppu
::
UnoType
<
void
>::
get
()
.
getTypeName
()));
.
getTypeName
()));
// ALT: Reference<XIdlClass> xListenerClass = Void_getReflection()->getIdlClass();
// ALT: Reference<XIdlClass> xListenerClass = Void_getReflection()->getIdlClass();
...
@@ -2329,7 +2346,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2329,7 +2346,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
xEventListenerClass
(
xEventListenerClass
(
reflection
_
->
forName
(
reflection
->
forName
(
cppu
::
UnoType
<
cppu
::
UnoType
<
css
::
lang
::
XEventListener
>::
get
()
css
::
lang
::
XEventListener
>::
get
()
.
getTypeName
()));
.
getTypeName
()));
...
@@ -2404,7 +2421,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
...
@@ -2404,7 +2421,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// Ist es ein Interface oder eine struct?
// Ist es ein Interface oder eine struct?
//Reference<XIdlClass> xClassRef = aToInspectObj.getReflection()->getIdlClass();
//Reference<XIdlClass> xClassRef = aToInspectObj.getReflection()->getIdlClass();
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
xClassRef
(
css
::
uno
::
Reference
<
css
::
reflection
::
XIdlClass
>
xClassRef
(
reflection
_
->
forName
(
aToInspectObj
.
getValueTypeName
()));
reflection
->
forName
(
aToInspectObj
.
getValueTypeName
()));
if
(
!
xClassRef
.
is
()
)
if
(
!
xClassRef
.
is
()
)
{
{
SAL_WARN
(
"stoc"
,
"Can't get XIdlClass from Reflection"
);
SAL_WARN
(
"stoc"
,
"Can't get XIdlClass from Reflection"
);
...
...
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