summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-07-03 08:22:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-07-03 08:24:09 +0200
commitf36e64d8cc4a2fce8d84ef464a482445a8b8540a (patch)
treebb3934252107a275cd33cfb756e4b7042c9e55b7 /include
parent6c4e21a234f12e1310ba06f9859e08b424acf8bf (diff)
Avoid null this pointers in member function calls
Change-Id: Iada6d8fcd261ddfb02b4dbc2f628ef0738c4ea01
Diffstat (limited to 'include')
-rw-r--r--include/svx/svdmodel.hxx12
-rw-r--r--include/svx/xtable.hxx42
2 files changed, 36 insertions, 18 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 350ad963deba..5be7bcb497a1 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -597,12 +597,12 @@ public:
void SetPropertyList( XPropertyListRef p ) { maProperties[ p->Type() ] = p; }
// friendlier helpers
- XDashListRef GetDashList() const { return GetPropertyList( XDASH_LIST )->AsDashList(); }
- XHatchListRef GetHatchList() const { return GetPropertyList( XHATCH_LIST )->AsHatchList(); }
- XColorListRef GetColorList() const { return GetPropertyList( XCOLOR_LIST )->AsColorList(); }
- XBitmapListRef GetBitmapList() const { return GetPropertyList( XBITMAP_LIST )->AsBitmapList(); }
- XLineEndListRef GetLineEndList() const { return GetPropertyList( XLINE_END_LIST )->AsLineEndList(); }
- XGradientListRef GetGradientList() const { return GetPropertyList( XGRADIENT_LIST )->AsGradientList(); }
+ XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XDASH_LIST )); }
+ XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XHATCH_LIST )); }
+ XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XCOLOR_LIST )); }
+ XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XBITMAP_LIST )); }
+ XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XLINE_END_LIST )); }
+ XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XGRADIENT_LIST )); }
// The DrawingEngine only references the StyleSheetPool, whoever
// made it needs to delete it.
diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx
index d86b5f49e4ab..a6585969c928 100644
--- a/include/svx/xtable.hxx
+++ b/include/svx/xtable.hxx
@@ -266,12 +266,18 @@ public:
const OUString & rUrl);
// helper accessors
- inline XDashListRef AsDashList();
- inline XHatchListRef AsHatchList();
- inline XColorListRef AsColorList();
- inline XBitmapListRef AsBitmapList();
- inline XLineEndListRef AsLineEndList();
- inline XGradientListRef AsGradientList();
+ static inline XDashListRef AsDashList(
+ rtl::Reference<XPropertyList> const & plist);
+ static inline XHatchListRef AsHatchList(
+ rtl::Reference<XPropertyList> const & plist);
+ static inline XColorListRef AsColorList(
+ rtl::Reference<XPropertyList> const & plist);
+ static inline XBitmapListRef AsBitmapList(
+ rtl::Reference<XPropertyList> const & plist);
+ static inline XLineEndListRef AsLineEndList(
+ rtl::Reference<XPropertyList> const & plist);
+ static inline XGradientListRef AsGradientList(
+ rtl::Reference<XPropertyList> const & plist);
};
@@ -429,12 +435,24 @@ public:
// FIXME: could add type checking too ...
-inline XDashListRef XPropertyList::AsDashList() { return XDashListRef( static_cast<XDashList *> (this) ); }
-inline XHatchListRef XPropertyList::AsHatchList() { return XHatchListRef( static_cast<XHatchList *> (this) ); }
-inline XColorListRef XPropertyList::AsColorList() { return XColorListRef( static_cast<XColorList *> (this) ); }
-inline XBitmapListRef XPropertyList::AsBitmapList() { return XBitmapListRef( static_cast<XBitmapList *> (this) ); }
-inline XLineEndListRef XPropertyList::AsLineEndList() { return XLineEndListRef( static_cast<XLineEndList *> (this) ); }
-inline XGradientListRef XPropertyList::AsGradientList() { return XGradientListRef( static_cast<XGradientList *> (this) ); }
+inline XDashListRef XPropertyList::AsDashList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XDashListRef( static_cast<XDashList *> (plist.get()) ); }
+inline XHatchListRef XPropertyList::AsHatchList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XHatchListRef( static_cast<XHatchList *> (plist.get()) ); }
+inline XColorListRef XPropertyList::AsColorList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XColorListRef( static_cast<XColorList *> (plist.get()) ); }
+inline XBitmapListRef XPropertyList::AsBitmapList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XBitmapListRef( static_cast<XBitmapList *> (plist.get()) ); }
+inline XLineEndListRef XPropertyList::AsLineEndList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XLineEndListRef( static_cast<XLineEndList *> (plist.get()) ); }
+inline XGradientListRef XPropertyList::AsGradientList(
+ rtl::Reference<XPropertyList> const & plist)
+{ return XGradientListRef( static_cast<XGradientList *> (plist.get()) ); }
#endif // INCLUDED_SVX_XTABLE_HXX