diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-26 11:52:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-26 21:07:10 +0200 |
commit | 0346371fcbb16ac4b31910469f5216b8eeacd850 (patch) | |
tree | d4500ca3ae54eb5c8d2fd6cd138f6fe61d1f0ac8 /lotuswordpro | |
parent | e9b91268635859be3aba841fe1ea142e82a93254 (diff) |
lwp: use std::array and get copy ctor for free
Change-Id: I3c0f8cea0adca843ec88f4742243c6cdada6bc5f
Reviewed-on: https://gerrit.libreoffice.org/39260
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpsdwrect.cxx | 36 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpsdwrect.hxx | 7 |
2 files changed, 8 insertions, 35 deletions
diff --git a/lotuswordpro/source/filter/lwpsdwrect.cxx b/lotuswordpro/source/filter/lwpsdwrect.cxx index d9f73ebde2b9..bb462d9951d7 100644 --- a/lotuswordpro/source/filter/lwpsdwrect.cxx +++ b/lotuswordpro/source/filter/lwpsdwrect.cxx @@ -64,47 +64,23 @@ /************************************************************************** * @short: Default constructor **************************************************************************/ -SdwRectangle::SdwRectangle() : m_bRotated(false) +SdwRectangle::SdwRectangle() + : m_bRotated(false) + // m_nRectCorner array fields are default initialized with Point() { - for (sal_uInt16 i = 0; i < 4; i++) - { - m_nRectCorner[0] = Point(0, 0); - } } /************************************************************************** * @short: Constructor * @param: aPt0~aPt3 four corner points of a rectangle. **************************************************************************/ SdwRectangle::SdwRectangle(const Point& rPt0, const Point& rPt1, - const Point& rPt2, const Point& rPt3) : m_bRotated(true) + const Point& rPt2, const Point& rPt3) + : m_bRotated(rPt0.Y() != rPt1.Y() || rPt0.Y() >= rPt3.Y()) + , m_nRectCorner({{rPt0, rPt1, rPt2, rPt3}}) { - m_nRectCorner[0] = rPt0; - m_nRectCorner[1] = rPt1; - m_nRectCorner[2] = rPt2; - m_nRectCorner[3] = rPt3; - - if (rPt0.Y() == rPt1.Y() && rPt0.Y() < rPt3.Y()) - { - m_bRotated = false; - } } /************************************************************************** - * @short: Copy constructor -**************************************************************************/ -SdwRectangle::SdwRectangle(const SdwRectangle& rOther) -{ - m_nRectCorner[0] = rOther.m_nRectCorner[0]; - m_nRectCorner[1] = rOther.m_nRectCorner[1]; - m_nRectCorner[2] = rOther.m_nRectCorner[2]; - m_nRectCorner[3] = rOther.m_nRectCorner[3]; - - m_bRotated = rOther.IsRectRotated(); -} -SdwRectangle::~SdwRectangle() -{ -} -/************************************************************************** * @short: Calculate and return center point of the rectangle. * @return: center point **************************************************************************/ diff --git a/lotuswordpro/source/filter/lwpsdwrect.hxx b/lotuswordpro/source/filter/lwpsdwrect.hxx index 9af37440ef68..39c228f028c9 100644 --- a/lotuswordpro/source/filter/lwpsdwrect.hxx +++ b/lotuswordpro/source/filter/lwpsdwrect.hxx @@ -63,6 +63,7 @@ #include "lwpheader.hxx" #include <tools/gen.hxx> +#include <array> /** * @brief @@ -90,7 +91,7 @@ private: bool m_bRotated; public: - Point m_nRectCorner[4]; + std::array<Point, 4> m_nRectCorner; public: @@ -99,10 +100,6 @@ public: SdwRectangle(const Point& rPt0, const Point& rPt1, const Point& rPt2, const Point& rPt3); - SdwRectangle(const SdwRectangle& rOther); - - ~SdwRectangle(); - public: /* * @short: Get the flag whether if the rectangle has been rotated. |