bump product version to 5.0.4.1
[LibreOffice.git] / svx / source / sdr / overlay / overlayhelpline.cxx
blob95958b277c6eb120c6c87eb6ee6d47060efddf5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sdr/overlay/overlayhelpline.hxx>
21 #include <vcl/outdev.hxx>
22 #include <basegfx/vector/b2dvector.hxx>
23 #include <sdr/overlay/overlaytools.hxx>
24 #include <svx/sdr/overlay/overlaymanager.hxx>
28 namespace sdr
30 namespace overlay
32 drawinglayer::primitive2d::Primitive2DSequence OverlayHelplineStriped::createOverlayObjectPrimitive2DSequence()
34 drawinglayer::primitive2d::Primitive2DSequence aRetval;
36 if(getOverlayManager())
38 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
39 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
40 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
41 const drawinglayer::primitive2d::HelplineStyle aStyle(
42 SDRHELPLINE_POINT == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_POINT :
43 SDRHELPLINE_VERTICAL == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_VERTICAL :
44 drawinglayer::primitive2d::HELPLINESTYLE_HORIZONTAL);
46 const drawinglayer::primitive2d::Primitive2DReference aReference(
47 new drawinglayer::primitive2d::OverlayHelplineStripedPrimitive(
48 getBasePosition(),
49 aStyle,
50 aRGBColorA,
51 aRGBColorB,
52 fStripeLengthPixel));
54 aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
57 return aRetval;
60 void OverlayHelplineStriped::stripeDefinitionHasChanged()
62 // react on OverlayManager's stripe definition change
63 objectChange();
66 OverlayHelplineStriped::OverlayHelplineStriped(
67 const basegfx::B2DPoint& rBasePos,
68 SdrHelpLineKind eNewKind)
69 : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
70 meKind(eNewKind)
74 OverlayHelplineStriped::~OverlayHelplineStriped()
77 } // end of namespace overlay
78 } // end of namespace sdr
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */