diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-26 14:37:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-26 14:37:16 +0100 |
commit | 8995371b01560fa7358ef1ef21a31d614e6fe7f3 (patch) | |
tree | b9999f0a71b34d475c3125fcb2f928b205bc4a38 | |
parent | 5da0eb4d45c6ffa9b8b290812edf277736f93f52 (diff) |
annoying inlines and formatting
Change-Id: I4a664c1c71a5aab183e7441dcdbcdb8b769fb996
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index c838d567d9fb..bbc2b369fcbe 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -57,28 +57,31 @@ class SalPolyLine { - XPoint Points_[STATIC_POINTS]; - XPoint *pFirst_; + XPoint Points_[STATIC_POINTS]; + XPoint *pFirst_; public: - inline SalPolyLine( sal_uLong nPoints, const SalPoint *p ); - inline ~SalPolyLine(); - inline XPoint &operator [] ( sal_uLong n ) const - { return pFirst_[n]; } -}; + SalPolyLine(sal_uLong nPoints, const SalPoint *p) + : pFirst_(nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_) + { + for( sal_uLong i = 0; i < nPoints; i++ ) + { + pFirst_[i].x = (short)p[i].mnX; + pFirst_[i].y = (short)p[i].mnY; + } + pFirst_[nPoints] = pFirst_[0]; // close polyline + } -inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p ) - : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ ) -{ - for( sal_uLong i = 0; i < nPoints; i++ ) + ~SalPolyLine() { - pFirst_[i].x = (short)p[i].mnX; - pFirst_[i].y = (short)p[i].mnY; + if( pFirst_ != Points_ ) + delete [] pFirst_; } - pFirst_[nPoints] = pFirst_[0]; // close polyline -} -inline SalPolyLine::~SalPolyLine() -{ if( pFirst_ != Points_ ) delete [] pFirst_; } + XPoint &operator [] ( sal_uLong n ) const + { + return pFirst_[n]; + } +}; #undef STATIC_POINTS |