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
9b92b423
Kaydet (Commit)
9b92b423
authored
Eki 10, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#706285 Uncaught exception
Change-Id: I6d7227a0614042f7a65520fc79b31afa3d7ca744
üst
0e06dbd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
propertybag.cxx
comphelper/source/property/propertybag.cxx
+15
-4
No files found.
comphelper/source/property/propertybag.cxx
Dosyayı görüntüle @
9b92b423
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <com/sun/star/beans/PropertyExistException.hpp>
#include <com/sun/star/beans/PropertyExistException.hpp>
#include <com/sun/star/container/ElementExistException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/NotRemoveableException.hpp>
#include <com/sun/star/beans/NotRemoveableException.hpp>
...
@@ -37,6 +38,7 @@ namespace comphelper
...
@@ -37,6 +38,7 @@ namespace comphelper
using
::
com
::
sun
::
star
::
uno
::
TypeClass_VOID
;
using
::
com
::
sun
::
star
::
uno
::
TypeClass_VOID
;
using
::
com
::
sun
::
star
::
beans
::
IllegalTypeException
;
using
::
com
::
sun
::
star
::
beans
::
IllegalTypeException
;
using
::
com
::
sun
::
star
::
beans
::
PropertyExistException
;
using
::
com
::
sun
::
star
::
beans
::
PropertyExistException
;
using
::
com
::
sun
::
star
::
container
::
ElementExistException
;
using
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
;
using
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
;
using
::
com
::
sun
::
star
::
beans
::
Property
;
using
::
com
::
sun
::
star
::
beans
::
Property
;
using
::
com
::
sun
::
star
::
beans
::
NotRemoveableException
;
using
::
com
::
sun
::
star
::
beans
::
NotRemoveableException
;
...
@@ -88,15 +90,24 @@ namespace comphelper
...
@@ -88,15 +90,24 @@ namespace comphelper
);
);
}
}
void
lcl_checkNameAndHandle
(
const
OUString
&
_name
,
const
sal_Int32
_handle
,
const
PropertyBag
&
_container
)
void
lcl_checkNameAndHandle
_PropertyExistException
(
const
OUString
&
_name
,
const
sal_Int32
_handle
,
const
PropertyBag
&
_container
)
{
{
if
(
_container
.
hasPropertyByName
(
_name
)
||
_container
.
hasPropertyByHandle
(
_handle
)
)
if
(
_container
.
hasPropertyByName
(
_name
)
||
_container
.
hasPropertyByHandle
(
_handle
)
)
throw
PropertyExistException
(
throw
PropertyExistException
(
"Property name or handle already used."
,
"Property name or handle already used."
,
// TODO: resource
NULL
);
NULL
);
}
}
void
lcl_checkNameAndHandle_ElementExistException
(
const
OUString
&
_name
,
const
sal_Int32
_handle
,
const
PropertyBag
&
_container
)
{
if
(
_container
.
hasPropertyByName
(
_name
)
||
_container
.
hasPropertyByHandle
(
_handle
)
)
throw
ElementExistException
(
"Property name or handle already used."
,
NULL
);
}
}
}
...
@@ -112,7 +123,7 @@ namespace comphelper
...
@@ -112,7 +123,7 @@ namespace comphelper
// check name/handle sanity
// check name/handle sanity
lcl_checkForEmptyName
(
m_pImpl
->
m_bAllowEmptyPropertyName
,
_rName
);
lcl_checkForEmptyName
(
m_pImpl
->
m_bAllowEmptyPropertyName
,
_rName
);
lcl_checkNameAndHandle
(
_rName
,
_nHandle
,
*
this
);
lcl_checkNameAndHandle
_ElementExistException
(
_rName
,
_nHandle
,
*
this
);
// register the property
// register the property
OSL_ENSURE
(
_nAttributes
&
PropertyAttribute
::
MAYBEVOID
,
"PropertyBag::addVoidProperty: this is for default-void properties only!"
);
OSL_ENSURE
(
_nAttributes
&
PropertyAttribute
::
MAYBEVOID
,
"PropertyBag::addVoidProperty: this is for default-void properties only!"
);
...
@@ -135,7 +146,7 @@ namespace comphelper
...
@@ -135,7 +146,7 @@ namespace comphelper
// check name/handle sanity
// check name/handle sanity
lcl_checkForEmptyName
(
m_pImpl
->
m_bAllowEmptyPropertyName
,
_rName
);
lcl_checkForEmptyName
(
m_pImpl
->
m_bAllowEmptyPropertyName
,
_rName
);
lcl_checkNameAndHandle
(
_rName
,
_nHandle
,
*
this
);
lcl_checkNameAndHandle
_PropertyExistException
(
_rName
,
_nHandle
,
*
this
);
// register the property
// register the property
registerPropertyNoMember
(
_rName
,
_nHandle
,
_nAttributes
,
aPropertyType
,
registerPropertyNoMember
(
_rName
,
_nHandle
,
_nAttributes
,
aPropertyType
,
...
...
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