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
cdf176c9
Kaydet (Commit)
cdf176c9
authored
Şub 23, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert PropertyDescription::LocationType to scoped enum
Change-Id: Ifcd6bf1728c632ed10301c4a426dae57dbf0912a
üst
3b168bc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
propertycontainerhelper.cxx
comphelper/source/property/propertycontainerhelper.cxx
+13
-13
propertycontainerhelper.hxx
include/comphelper/propertycontainerhelper.hxx
+5
-5
No files found.
comphelper/source/property/propertycontainerhelper.cxx
Dosyayı görüntüle @
cdf176c9
...
@@ -83,7 +83,7 @@ void OPropertyContainerHelper::registerProperty(const OUString& _rName, sal_Int3
...
@@ -83,7 +83,7 @@ void OPropertyContainerHelper::registerProperty(const OUString& _rName, sal_Int3
PropertyDescription
aNewProp
;
PropertyDescription
aNewProp
;
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rMemberType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rMemberType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
eLocated
=
PropertyDescription
::
lt
DerivedClassRealType
;
aNewProp
.
eLocated
=
PropertyDescription
::
LocationType
::
DerivedClassRealType
;
aNewProp
.
aLocation
.
pDerivedClassMember
=
_pPointerToMember
;
aNewProp
.
aLocation
.
pDerivedClassMember
=
_pPointerToMember
;
implPushBackProperty
(
aNewProp
);
implPushBackProperty
(
aNewProp
);
...
@@ -113,7 +113,7 @@ void OPropertyContainerHelper::registerMayBeVoidProperty(const OUString& _rName,
...
@@ -113,7 +113,7 @@ void OPropertyContainerHelper::registerMayBeVoidProperty(const OUString& _rName,
PropertyDescription
aNewProp
;
PropertyDescription
aNewProp
;
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rExpectedType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rExpectedType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
eLocated
=
PropertyDescription
::
lt
DerivedClassAnyType
;
aNewProp
.
eLocated
=
PropertyDescription
::
LocationType
::
DerivedClassAnyType
;
aNewProp
.
aLocation
.
pDerivedClassMember
=
_pPointerToMember
;
aNewProp
.
aLocation
.
pDerivedClassMember
=
_pPointerToMember
;
implPushBackProperty
(
aNewProp
);
implPushBackProperty
(
aNewProp
);
...
@@ -130,7 +130,7 @@ void OPropertyContainerHelper::registerPropertyNoMember(const OUString& _rName,
...
@@ -130,7 +130,7 @@ void OPropertyContainerHelper::registerPropertyNoMember(const OUString& _rName,
PropertyDescription
aNewProp
;
PropertyDescription
aNewProp
;
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
aProperty
=
Property
(
_rName
,
_nHandle
,
_rType
,
(
sal_Int16
)
_nAttributes
);
aNewProp
.
eLocated
=
PropertyDescription
::
lt
HoldMyself
;
aNewProp
.
eLocated
=
PropertyDescription
::
LocationType
::
HoldMyself
;
aNewProp
.
aLocation
.
nOwnClassVectorIndex
=
m_aHoldProperties
.
size
();
aNewProp
.
aLocation
.
nOwnClassVectorIndex
=
m_aHoldProperties
.
size
();
if
(
_pInitialValue
)
if
(
_pInitialValue
)
m_aHoldProperties
.
push_back
(
Any
(
_pInitialValue
,
_rType
));
m_aHoldProperties
.
push_back
(
Any
(
_pInitialValue
,
_rType
));
...
@@ -232,8 +232,8 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
...
@@ -232,8 +232,8 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
switch
(
aPos
->
eLocated
)
switch
(
aPos
->
eLocated
)
{
{
// similar handling for the two cases where the value is stored in an any
// similar handling for the two cases where the value is stored in an any
case
PropertyDescription
:
:
lt
HoldMyself
:
case
PropertyDescription
:
:
LocationType
::
HoldMyself
:
case
PropertyDescription
:
:
lt
DerivedClassAnyType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassAnyType
:
{
{
bool
bMayBeVoid
=
((
aPos
->
aProperty
.
Attributes
&
PropertyAttribute
::
MAYBEVOID
)
!=
0
);
bool
bMayBeVoid
=
((
aPos
->
aProperty
.
Attributes
&
PropertyAttribute
::
MAYBEVOID
)
!=
0
);
...
@@ -275,7 +275,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
...
@@ -275,7 +275,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
// the pointer to the any which holds the property value, no matter if located in the derived class
// the pointer to the any which holds the property value, no matter if located in the derived class
// or in out vector
// or in out vector
if
(
PropertyDescription
::
lt
HoldMyself
==
aPos
->
eLocated
)
if
(
PropertyDescription
::
LocationType
::
HoldMyself
==
aPos
->
eLocated
)
{
{
OSL_ENSURE
(
aPos
->
aLocation
.
nOwnClassVectorIndex
<
(
sal_Int32
)
m_aHoldProperties
.
size
(),
OSL_ENSURE
(
aPos
->
aLocation
.
nOwnClassVectorIndex
<
(
sal_Int32
)
m_aHoldProperties
.
size
(),
"OPropertyContainerHelper::convertFastPropertyValue: invalid position !"
);
"OPropertyContainerHelper::convertFastPropertyValue: invalid position !"
);
...
@@ -303,7 +303,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
...
@@ -303,7 +303,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue(
}
}
}
}
break
;
break
;
case
PropertyDescription
:
:
lt
DerivedClassRealType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassRealType
:
// let the UNO runtime library do any possible conversion
// let the UNO runtime library do any possible conversion
// this may include a change of the type - for instance, if a LONG is required,
// this may include a change of the type - for instance, if a LONG is required,
// but a short is given, then this is valid, as it can be converted without any potential
// but a short is given, then this is valid, as it can be converted without any potential
...
@@ -376,15 +376,15 @@ bool OPropertyContainerHelper::setFastPropertyValue(sal_Int32 _nHandle, const An
...
@@ -376,15 +376,15 @@ bool OPropertyContainerHelper::setFastPropertyValue(sal_Int32 _nHandle, const An
switch
(
aPos
->
eLocated
)
switch
(
aPos
->
eLocated
)
{
{
case
PropertyDescription
:
:
lt
HoldMyself
:
case
PropertyDescription
:
:
LocationType
::
HoldMyself
:
m_aHoldProperties
[
aPos
->
aLocation
.
nOwnClassVectorIndex
]
=
_rValue
;
m_aHoldProperties
[
aPos
->
aLocation
.
nOwnClassVectorIndex
]
=
_rValue
;
break
;
break
;
case
PropertyDescription
:
:
lt
DerivedClassAnyType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassAnyType
:
*
static_cast
<
Any
*
>
(
aPos
->
aLocation
.
pDerivedClassMember
)
=
_rValue
;
*
static_cast
<
Any
*
>
(
aPos
->
aLocation
.
pDerivedClassMember
)
=
_rValue
;
break
;
break
;
case
PropertyDescription
:
:
lt
DerivedClassRealType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassRealType
:
// copy the data from the to-be-set value
// copy the data from the to-be-set value
bSuccess
=
uno_type_assignData
(
bSuccess
=
uno_type_assignData
(
aPos
->
aLocation
.
pDerivedClassMember
,
aPos
->
aProperty
.
Type
.
getTypeLibType
(),
aPos
->
aLocation
.
pDerivedClassMember
,
aPos
->
aProperty
.
Type
.
getTypeLibType
(),
...
@@ -416,15 +416,15 @@ void OPropertyContainerHelper::getFastPropertyValue(Any& _rValue, sal_Int32 _nHa
...
@@ -416,15 +416,15 @@ void OPropertyContainerHelper::getFastPropertyValue(Any& _rValue, sal_Int32 _nHa
switch
(
aPos
->
eLocated
)
switch
(
aPos
->
eLocated
)
{
{
case
PropertyDescription
:
:
lt
HoldMyself
:
case
PropertyDescription
:
:
LocationType
::
HoldMyself
:
OSL_ENSURE
(
aPos
->
aLocation
.
nOwnClassVectorIndex
<
(
sal_Int32
)
m_aHoldProperties
.
size
(),
OSL_ENSURE
(
aPos
->
aLocation
.
nOwnClassVectorIndex
<
(
sal_Int32
)
m_aHoldProperties
.
size
(),
"OPropertyContainerHelper::convertFastPropertyValue: invalid position !"
);
"OPropertyContainerHelper::convertFastPropertyValue: invalid position !"
);
_rValue
=
m_aHoldProperties
[
aPos
->
aLocation
.
nOwnClassVectorIndex
];
_rValue
=
m_aHoldProperties
[
aPos
->
aLocation
.
nOwnClassVectorIndex
];
break
;
break
;
case
PropertyDescription
:
:
lt
DerivedClassAnyType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassAnyType
:
_rValue
=
*
static_cast
<
Any
*>
(
aPos
->
aLocation
.
pDerivedClassMember
);
_rValue
=
*
static_cast
<
Any
*>
(
aPos
->
aLocation
.
pDerivedClassMember
);
break
;
break
;
case
PropertyDescription
:
:
lt
DerivedClassRealType
:
case
PropertyDescription
:
:
LocationType
::
DerivedClassRealType
:
_rValue
.
setValue
(
aPos
->
aLocation
.
pDerivedClassMember
,
aPos
->
aProperty
.
Type
);
_rValue
.
setValue
(
aPos
->
aLocation
.
pDerivedClassMember
,
aPos
->
aProperty
.
Type
);
break
;
break
;
}
}
...
...
include/comphelper/propertycontainerhelper.hxx
Dosyayı görüntüle @
cdf176c9
...
@@ -35,11 +35,11 @@ namespace comphelper
...
@@ -35,11 +35,11 @@ namespace comphelper
struct
COMPHELPER_DLLPUBLIC
PropertyDescription
struct
COMPHELPER_DLLPUBLIC
PropertyDescription
{
{
// the possibilities where a property holding object may be located
// the possibilities where a property holding object may be located
enum
LocationType
enum
class
LocationType
{
{
lt
DerivedClassRealType
,
// within the derived class, it's a "real" (non-Any) type
DerivedClassRealType
,
// within the derived class, it's a "real" (non-Any) type
lt
DerivedClassAnyType
,
// within the derived class, it's a com.sun.star.uno::Any
DerivedClassAnyType
,
// within the derived class, it's a com.sun.star.uno::Any
lt
HoldMyself
// within m_aHoldProperties
HoldMyself
// within m_aHoldProperties
};
};
// the location of an object holding a property value :
// the location of an object holding a property value :
union
LocationAccess
union
LocationAccess
...
@@ -54,7 +54,7 @@ struct COMPHELPER_DLLPUBLIC PropertyDescription
...
@@ -54,7 +54,7 @@ struct COMPHELPER_DLLPUBLIC PropertyDescription
PropertyDescription
()
PropertyDescription
()
:
aProperty
(
OUString
(),
-
1
,
css
::
uno
::
Type
(),
0
)
:
aProperty
(
OUString
(),
-
1
,
css
::
uno
::
Type
(),
0
)
,
eLocated
(
lt
HoldMyself
)
,
eLocated
(
LocationType
::
HoldMyself
)
{
{
aLocation
.
nOwnClassVectorIndex
=
-
1
;
aLocation
.
nOwnClassVectorIndex
=
-
1
;
}
}
...
...
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