diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-17 22:52:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-17 22:52:55 +0200 |
commit | 1a2479c93a013ba2d67319849869693bd01cf1ad (patch) | |
tree | 383d9196eccca9c978e40ee8f9ec36c8b1c0e001 /sw/source/ui/envelp | |
parent | c73a9119429ba72a87ee000b4c84490629529927 (diff) |
loplugin:staticmethods
Change-Id: I441cafcd641477626eb8de9d4b35212fd29af248
Diffstat (limited to 'sw/source/ui/envelp')
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 108 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hxx | 2 |
2 files changed, 56 insertions, 54 deletions
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index d578bf3b20a9..56ea2660fc61 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -43,6 +43,62 @@ using namespace ::com::sun::star::beans; #define ROUND(x) static_cast<long>((x) + .5) +namespace { + +// Arrow or interval character +void DrawArrow(vcl::RenderContext& rRenderContext, const Point &rP1, const Point &rP2, bool bArrow) +{ + rRenderContext.DrawLine(rP1, rP2); + if (bArrow) + { + Point aArr[3]; + + // Arrow character + if (rP1.Y() == rP2.Y()) + { + // Horizontal + aArr[0].X() = rP2.X() - 5; + aArr[0].Y() = rP2.Y() - 2; + aArr[1].X() = rP2.X(); + aArr[1].Y() = rP2.Y(); + aArr[2].X() = rP2.X() - 5; + aArr[2].Y() = rP2.Y() + 2; + } + else + { + // Vertical + aArr[0].X() = rP2.X() - 2; + aArr[0].Y() = rP2.Y() - 5; + aArr[1].X() = rP2.X() + 2; + aArr[1].Y() = rP2.Y() - 5; + aArr[2].X() = rP2.X(); + aArr[2].Y() = rP2.Y(); + } + + const Color& rFieldTextColor = SwViewOption::GetFontColor(); + rRenderContext.SetFillColor(rFieldTextColor); + rRenderContext.DrawPolygon(Polygon(3, aArr)); + } + else + { + // Interval symbol + if (rP1.Y() == rP2.Y()) + { + // Horizontal + rRenderContext.DrawLine(Point(rP1.X(), rP1.Y() - 2), Point(rP1.X(), rP1.Y() + 2)); + rRenderContext.DrawLine(Point(rP2.X(), rP2.Y() - 2), Point(rP2.X(), rP2.Y() + 2)); + } + else + { + // Vertical + rRenderContext.DrawLine(Point(rP1.X() - 2, rP1.Y()), Point(rP1.X() + 2, rP1.Y())); + rRenderContext.DrawLine(Point(rP2.X() - 2, rP2.Y()), Point(rP2.X() + 2, rP2.Y())); + } + } +} + +} + SwLabPreview::SwLabPreview(vcl::Window* pParent) : Window(pParent, 0) , aGrayColor(COL_LIGHTGRAY) @@ -228,58 +284,6 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) } } -// Arrow or interval character -void SwLabPreview::DrawArrow(vcl::RenderContext& rRenderContext, const Point &rP1, const Point &rP2, bool bArrow) -{ - rRenderContext.DrawLine(rP1, rP2); - if (bArrow) - { - Point aArr[3]; - - // Arrow character - if (rP1.Y() == rP2.Y()) - { - // Horizontal - aArr[0].X() = rP2.X() - 5; - aArr[0].Y() = rP2.Y() - 2; - aArr[1].X() = rP2.X(); - aArr[1].Y() = rP2.Y(); - aArr[2].X() = rP2.X() - 5; - aArr[2].Y() = rP2.Y() + 2; - } - else - { - // Vertical - aArr[0].X() = rP2.X() - 2; - aArr[0].Y() = rP2.Y() - 5; - aArr[1].X() = rP2.X() + 2; - aArr[1].Y() = rP2.Y() - 5; - aArr[2].X() = rP2.X(); - aArr[2].Y() = rP2.Y(); - } - - const Color& rFieldTextColor = SwViewOption::GetFontColor(); - rRenderContext.SetFillColor(rFieldTextColor); - rRenderContext.DrawPolygon(Polygon(3, aArr)); - } - else - { - // Interval symbol - if (rP1.Y() == rP2.Y()) - { - // Horizontal - rRenderContext.DrawLine(Point(rP1.X(), rP1.Y() - 2), Point(rP1.X(), rP1.Y() + 2)); - rRenderContext.DrawLine(Point(rP2.X(), rP2.Y() - 2), Point(rP2.X(), rP2.Y() + 2)); - } - else - { - // Vertical - rRenderContext.DrawLine(Point(rP1.X() - 2, rP1.Y()), Point(rP1.X() + 2, rP1.Y())); - rRenderContext.DrawLine(Point(rP2.X() - 2, rP2.Y()), Point(rP2.X() + 2, rP2.Y())); - } - } -} - void SwLabPreview::UpdateItem(const SwLabItem& rItem) { aItem = rItem; diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 3097fd530263..db9826a0c429 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -58,8 +58,6 @@ class SwLabPreview : public vcl::Window virtual Size GetOptimalSize() const SAL_OVERRIDE; - void DrawArrow(vcl::RenderContext& rRenderContext, const Point& rP1, const Point& rP2, bool bArrow); - public: SwLabPreview(vcl::Window* pParent); |