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
50a0473e
Kaydet (Commit)
50a0473e
authored
Haz 20, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up uses of Any::getValue() in comphelper
Change-Id: I433cca20fb29c6b6ede934edcb2e200f15b060f2
üst
4833ed2f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
container.cxx
comphelper/source/container/container.cxx
+3
-2
eventattachermgr.cxx
comphelper/source/eventattachermgr/eventattachermgr.cxx
+12
-9
types.cxx
comphelper/source/misc/types.cxx
+3
-2
uno3.hxx
include/comphelper/uno3.hxx
+3
-5
No files found.
comphelper/source/container/container.cxx
Dosyayı görüntüle @
50a0473e
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <comphelper/container.hxx>
#include <comphelper/container.hxx>
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
...
@@ -65,7 +66,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next()
...
@@ -65,7 +66,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next()
if
(
xContainerAccess
.
is
()
&&
xContainerAccess
->
getCount
()
&&
ShouldStepInto
(
xContainerAccess
))
if
(
xContainerAccess
.
is
()
&&
xContainerAccess
->
getCount
()
&&
ShouldStepInto
(
xContainerAccess
))
{
{
css
::
uno
::
Any
aElement
(
xContainerAccess
->
getByIndex
(
0
));
css
::
uno
::
Any
aElement
(
xContainerAccess
->
getByIndex
(
0
));
xSearchLoop
=
*
static_cast
<
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
const
*>
(
aElement
.
getValue
()
);
xSearchLoop
=
*
o3tl
::
doAccess
<
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>>
(
aElement
);
bCheckingStartingPoint
=
false
;
bCheckingStartingPoint
=
false
;
m_arrChildIndizies
.
push_back
((
sal_Int32
)
0
);
m_arrChildIndizies
.
push_back
((
sal_Int32
)
0
);
...
@@ -90,7 +91,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next()
...
@@ -90,7 +91,7 @@ css::uno::Reference< css::uno::XInterface> IndexAccessIterator::Next()
++
nOldSearchChildIndex
;
++
nOldSearchChildIndex
;
// and check the next child
// and check the next child
css
::
uno
::
Any
aElement
(
xContainerAccess
->
getByIndex
(
nOldSearchChildIndex
));
css
::
uno
::
Any
aElement
(
xContainerAccess
->
getByIndex
(
nOldSearchChildIndex
));
xSearchLoop
=
*
static_cast
<
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
const
*>
(
aElement
.
getValue
()
);
xSearchLoop
=
*
o3tl
::
doAccess
<
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>>
(
aElement
);
bCheckingStartingPoint
=
false
;
bCheckingStartingPoint
=
false
;
// and update its position in the list.
// and update its position in the list.
m_arrChildIndizies
.
push_back
((
sal_Int32
)
nOldSearchChildIndex
);
m_arrChildIndizies
.
push_back
((
sal_Int32
)
nOldSearchChildIndex
);
...
...
comphelper/source/eventattachermgr/eventattachermgr.cxx
Dosyayı görüntüle @
50a0473e
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include <sal/config.h>
#include <o3tl/any.hxx>
#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
#include <comphelper/eventattachermgr.hxx>
#include <comphelper/eventattachermgr.hxx>
...
@@ -284,24 +287,24 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even
...
@@ -284,24 +287,24 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even
case
TypeClass_BOOLEAN
:
case
TypeClass_BOOLEAN
:
// FALSE -> Return
// FALSE -> Return
if
(
!
(
*
static_cast
<
sal_Bool
const
*>
(
aRet
.
getValue
()
))
)
if
(
!
(
*
o3tl
::
forceAccess
<
bool
>
(
aRet
))
)
return
aRet
;
return
aRet
;
break
;
break
;
case
TypeClass_STRING
:
case
TypeClass_STRING
:
// none empty string -> return
// none empty string -> return
if
(
!
(
static_cast
<
OUString
const
*>
(
aRet
.
getValue
())
)
->
isEmpty
()
)
if
(
!
o3tl
::
forceAccess
<
OUString
>
(
aRet
)
->
isEmpty
()
)
return
aRet
;
return
aRet
;
break
;
break
;
// none zero number -> return
// none zero number -> return
case
TypeClass_FLOAT
:
if
(
*
static_cast
<
float
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_FLOAT
:
if
(
*
o3tl
::
forceAccess
<
float
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_DOUBLE
:
if
(
*
static_cast
<
double
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_DOUBLE
:
if
(
*
o3tl
::
forceAccess
<
double
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_BYTE
:
if
(
*
static_cast
<
sal_uInt8
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_BYTE
:
if
(
*
o3tl
::
forceAccess
<
sal_Int8
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_SHORT
:
if
(
*
static_cast
<
sal_Int16
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_SHORT
:
if
(
*
o3tl
::
forceAccess
<
sal_Int16
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_LONG
:
if
(
*
static_cast
<
sal_Int32
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_LONG
:
if
(
*
o3tl
::
forceAccess
<
sal_Int32
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_UNSIGNED_SHORT
:
if
(
*
static_cast
<
sal_uInt16
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_UNSIGNED_SHORT
:
if
(
*
o3tl
::
forceAccess
<
sal_uInt16
>
(
aRet
)
)
return
aRet
;
break
;
case
TypeClass_UNSIGNED_LONG
:
if
(
*
static_cast
<
sal_uInt32
const
*>
(
aRet
.
getValue
()
)
)
return
aRet
;
break
;
case
TypeClass_UNSIGNED_LONG
:
if
(
*
o3tl
::
forceAccess
<
sal_uInt32
>
(
aRet
)
)
return
aRet
;
break
;
default
:
default
:
OSL_ASSERT
(
false
);
OSL_ASSERT
(
false
);
...
...
comphelper/source/misc/types.cxx
Dosyayı görüntüle @
50a0473e
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
#include <typelib/typedescription.hxx>
#include <typelib/typedescription.hxx>
...
@@ -91,8 +92,8 @@ OUString getString(const Any& _rAny)
...
@@ -91,8 +92,8 @@ OUString getString(const Any& _rAny)
bool
getBOOL
(
const
Any
&
_rAny
)
bool
getBOOL
(
const
Any
&
_rAny
)
{
{
bool
bReturn
=
false
;
bool
bReturn
=
false
;
if
(
_rAny
.
getValueType
()
==
cppu
::
UnoType
<
bool
>::
get
(
))
if
(
auto
b
=
o3tl
::
tryAccess
<
bool
>
(
_rAny
))
bReturn
=
*
static_cast
<
sal_Bool
const
*>
(
_rAny
.
getValue
())
;
bReturn
=
*
b
;
else
else
OSL_FAIL
(
"comphelper::getBOOL : invalid argument !"
);
OSL_FAIL
(
"comphelper::getBOOL : invalid argument !"
);
return
bReturn
;
return
bReturn
;
...
...
include/comphelper/uno3.hxx
Dosyayı görüntüle @
50a0473e
...
@@ -169,13 +169,11 @@ namespace comphelper
...
@@ -169,13 +169,11 @@ namespace comphelper
template
<
class
iface
>
template
<
class
iface
>
bool
query_aggregation
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XAggregation
>&
_rxAggregate
,
css
::
uno
::
Reference
<
iface
>&
_rxOut
)
bool
query_aggregation
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XAggregation
>&
_rxAggregate
,
css
::
uno
::
Reference
<
iface
>&
_rxOut
)
{
{
_rxOut
=
static_cast
<
iface
*>
(
nullptr
);
_rxOut
.
clear
(
);
if
(
_rxAggregate
.
is
())
if
(
_rxAggregate
.
is
())
{
{
css
::
uno
::
Any
aCheck
=
_rxAggregate
->
queryAggregation
(
_rxAggregate
->
queryAggregation
(
cppu
::
UnoType
<
iface
>::
get
())
cppu
::
UnoType
<
iface
>::
get
());
>>=
_rxOut
;
if
(
aCheck
.
hasValue
())
_rxOut
=
*
static_cast
<
const
css
::
uno
::
Reference
<
iface
>*>
(
aCheck
.
getValue
());
}
}
return
_rxOut
.
is
();
return
_rxOut
.
is
();
}
}
...
...
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