- if (!m_refData)
- {
- m_refData = new wxPenRefData();
- }
- else
- {
- wxPenRefData* ref = new wxPenRefData( *(wxPenRefData*)m_refData );
- UnRef();
- m_refData = ref;
- }
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+
+ return M_PENDATA->m_colour;
+}
+
+bool wxPen::Ok() const
+{
+ return (m_refData != NULL);
+}
+
+void wxPen::Unshare()
+{
+ if (!m_refData)
+ {
+ m_refData = new wxPenRefData();
+ }
+ else
+ {
+ wxPenRefData* ref = new wxPenRefData( *(wxPenRefData*)m_refData );
+ UnRef();
+ m_refData = ref;
+ }