summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/com/sun/star/uno/Reference.h11
-rw-r--r--include/rtl/ref.hxx9
2 files changed, 14 insertions, 6 deletions
diff --git a/include/com/sun/star/uno/Reference.h b/include/com/sun/star/uno/Reference.h
index ec45f44ca39b..cedd4721cf18 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -19,8 +19,11 @@
#ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
#define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
-#include <rtl/alloc.h>
+#include <sal/config.h>
+
+#include <cassert>
+#include <rtl/alloc.h>
namespace com
{
@@ -395,8 +398,10 @@ public:
@return UNacquired interface pointer
*/
- inline interface_type * SAL_CALL operator -> () const
- { return castFromXInterface(_pInterface); }
+ inline interface_type * SAL_CALL operator -> () const {
+ assert(_pInterface != 0);
+ return castFromXInterface(_pInterface);
+ }
/** Gets interface pointer. This call does not acquire the interface.
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index cccbc0105ff6..3e90ed2b4707 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -20,8 +20,11 @@
#ifndef INCLUDED_RTL_REF_HXX
#define INCLUDED_RTL_REF_HXX
+#include <sal/config.h>
+
+#include <cassert>
+
#include <sal/types.h>
-#include <osl/diagnose.h>
#include <osl/interlck.h>
namespace rtl
@@ -160,7 +163,7 @@ public:
*/
inline reference_type * SAL_CALL operator->() const
{
- OSL_PRECOND(m_pBody, "Reference::operator->() : null body");
+ assert(m_pBody != 0);
return m_pBody;
}
@@ -169,7 +172,7 @@ public:
*/
inline reference_type & SAL_CALL operator*() const
{
- OSL_PRECOND(m_pBody, "Reference::operator*() : null body");
+ assert(m_pBody != 0);
return *m_pBody;
}