summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2010-06-07 18:32:33 +0200
committerDaniel Elstner <danielk@openismus.com>2010-06-07 18:35:27 +0200
commit83bb42f4696fea74ce82a22cec6a2fa8aa8049bc (patch)
treee7cbee99d818bdf314c0461a5a34d8c50764c3a3
parent2dbde9037d0376a665bbcd9a27c1b5c43670c42f (diff)
Disallow copying of Cairo::Context objects
* cairomm/context.h (Cairo::Context): Declare a private copy constructor and assignment operator in order to explicitly prevent objects from being copied by value. That was never valid, and not disallowing it seems to have been merely an oversight.
-rw-r--r--ChangeLog9
-rw-r--r--cairomm/context.h10
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 536757f..927747c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2010-06-07 Daniel Elstner <danielk@openismus.com>
+ Disallow copying of Cairo::Context objects
+
+ * cairomm/context.h (Cairo::Context): Declare a private copy
+ constructor and assignment operator in order to explicitly prevent
+ objects from being copied by value. That was never valid, and not
+ disallowing it seems to have been merely an oversight.
+
+2010-06-07 Daniel Elstner <danielk@openismus.com>
+
Do not unnecessarily cast booleans to pointers
* cairomm/fontface.cc (USER_DATA_KEY_DEFAULT_TEXT_TO_GLYPHS): Put
diff --git a/cairomm/context.h b/cairomm/context.h
index 774b213..24f5134 100644
--- a/cairomm/context.h
+++ b/cairomm/context.h
@@ -1041,19 +1041,21 @@ public:
*/
inline const cobject* cobj() const { return m_cobject; }
- #ifndef DOXYGEN_IGNORE_THIS
+#ifndef DOXYGEN_IGNORE_THIS
///For use only by the cairomm implementation.
inline ErrorStatus get_status() const
{ return cairo_status(const_cast<cairo_t*>(cobj())); }
void reference() const;
void unreference() const;
- #endif //DOXYGEN_IGNORE_THIS
+#endif //DOXYGEN_IGNORE_THIS
protected:
-
-
cobject* m_cobject;
+
+private:
+ Context(const Context&);
+ Context& operator=(const Context&);
};
} // namespace Cairo