@@ -544,18 +544,17 @@ class WXDLLIMPEXP_CORE wxDCImpl : public wxObject
544544 {
545545 return m_contentScaleFactor;
546546 }
547+ # ifdef __WXMSW__
547548 // Native Windows functions using the underlying HDC don't honour GDI+
548549 // transformations which may be applied to it. Using this function we can
549550 // transform the coordinates manually before passing them to such functions
550551 // (as in e.g. wxRendererMSW code). It doesn't do anything if this is not a
551552 // wxGCDC.
552- virtual wxRect MSWApplyGDIPlusTransform (const wxRect& r) const
553- {
554- return r;
555- }
556- #endif // __WXMSW__
557-
558-
553+ virtual wxRect MSWApplyGDIPlusTransform (const wxRect& r) const
554+ {
555+ return r;
556+ }
557+ # endif
559558 // ---------------------------------------------------------
560559 // the actual drawing API
561560 virtual bool DoFloodFill (wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE) = 0;
@@ -1363,62 +1362,57 @@ class WXDLLIMPEXP_CORE wxDC : public wxObject
13631362 }
13641363# endif
13651364 // for compatibility with the old code when wxCoord was long everywhere
1366- wxDEPRECATED ( void GetTextExtent (const wxString& string,
1367- long *x, long *y,
1368- long *descent = NULL ,
1369- long *externalLeading = NULL ,
1370- const wxFont *theFont = NULL ) const );
1371- wxDEPRECATED ( void GetLogicalOrigin (long *x, long *y) const );
1372- wxDEPRECATED ( void GetDeviceOrigin (long *x, long *y) const );
1373- wxDEPRECATED ( void GetClippingBox (long *x, long *y, long *w, long *h) const );
1374-
1375- wxDEPRECATED ( void DrawObject (wxDrawObject* drawobject) );
1376- #endif // WXWIN_COMPATIBILITY_2_8
1377-
1378- #ifdef __WXMSW__
1365+ # ifdef __WXMSW__
13791366 // GetHDC() is the simplest way to retrieve an HDC From a wxDC but only
13801367 // works if this wxDC is GDI-based and fails for GDI+ contexts (and
13811368 // anything else without HDC, e.g. wxPostScriptDC)
1382- WXHDC GetHDC () const ;
1383-
1369+ WXHDC GetHDC () const ;
13841370 // don't use these methods manually, use GetTempHDC() instead
1385- virtual WXHDC AcquireHDC () { return GetHDC (); }
1386- virtual void ReleaseHDC (WXHDC WXUNUSED (hdc)) { }
1387-
1371+ virtual WXHDC AcquireHDC ()
1372+ {
1373+ return GetHDC ();
1374+ }
1375+ virtual void ReleaseHDC (WXHDC)
1376+ {
1377+ }
13881378 // helper class holding the result of GetTempHDC() with std::auto_ptr<>-like
13891379 // semantics, i.e. it is moved when copied
1390- class TempHDC
1380+ class TempHDC
1381+ {
1382+ public:
1383+ TempHDC (wxDC& dc)
1384+ : m_dc(dc)
1385+ , m_hdc(dc.AcquireHDC())
13911386 {
1392- public:
1393- TempHDC (wxDC& dc)
1394- : m_dc(dc),
1395- m_hdc (dc.AcquireHDC())
1396- {
1397- }
1398-
1399- TempHDC (const TempHDC& thdc)
1400- : m_dc(thdc.m_dc),
1401- m_hdc(thdc.m_hdc)
1402- {
1403- const_cast <TempHDC&>(thdc).m_hdc = NULL ;
1404- }
1405-
1406- ~TempHDC ()
1407- {
1408- if ( m_hdc )
1409- m_dc.ReleaseHDC (m_hdc);
1410- }
1411-
1412- WXHDC GetHDC () const { return m_hdc; }
1413-
1414- private:
1415- wxDC& m_dc;
1416- WXHDC m_hdc;
1417-
1418- wxDECLARE_NO_ASSIGN_CLASS (TempHDC);
1419- };
1420-
1387+ }
1388+ TempHDC (const TempHDC& thdc)
1389+ : m_dc(thdc.m_dc)
1390+ , m_hdc(thdc.m_hdc)
1391+ {
1392+ const_cast <TempHDC&>(thdc).m_hdc = NULL ;
1393+ }
1394+ ~TempHDC ()
1395+ {
1396+ if (m_hdc)
1397+ {
1398+ m_dc.ReleaseHDC (m_hdc);
1399+ }
1400+ }
1401+ WXHDC GetHDC () const
1402+ {
1403+ return m_hdc;
1404+ }
1405+ private:
1406+ wxDC& m_dc;
1407+ WXHDC m_hdc;
1408+ wxDECLARE_NO_ASSIGN_CLASS (TempHDC);
1409+ };
14211410 // GetTempHDC() also works for wxGCDC (but still not for wxPostScriptDC &c)
1411+ TempHDC GetTempHDC ()
1412+ {
1413+ return TempHDC (*this );
1414+ }
1415+ # endif
14221416# if wxUSE_GRAPHICS_CONTEXT
14231417 virtual wxGraphicsContext* GetGraphicsContext () const
14241418 {
0 commit comments