KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8KB

  1. /* This file is part of the KDE project
  2. Copyright (C) 2005 Peter Simonsson
  3. Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. * Boston, MA 02110-1301, USA.
  16. */
  17. #include "kspread_pen.h"
  18. #include <KoTextZoomHandler.h>
  19. KSpreadPen::KSpreadPen()
  20. : TQPen()
  21. {
  22. m_pointWidth = 1.0;
  23. }
  24. KSpreadPen::KSpreadPen(const TQColor& _color, double _pointWidth, Qt::PenStyle _style)
  25. : TQPen()
  26. {
  27. setColor(_color);
  28. setPointWidth(_pointWidth);
  29. setStyle(_style);
  30. }
  31. KSpreadPen::KSpreadPen(const TQColor& _color)
  32. : TQPen(_color)
  33. {
  34. m_pointWidth = 1.0;
  35. }
  36. KSpreadPen::~KSpreadPen()
  37. {
  38. }
  39. bool KSpreadPen::operator==( const KSpreadPen &p ) const
  40. {
  41. return color() == p.color() && style() == p.style() && m_pointWidth == p.pointWidth();
  42. }
  43. bool KSpreadPen::operator!=( const KSpreadPen &p ) const
  44. {
  45. return color() != p.color() || style() != p.style() || m_pointWidth != p.pointWidth();
  46. }
  47. void KSpreadPen::setPointWidth(double w)
  48. {
  49. m_pointWidth = w;
  50. }
  51. TQPen KSpreadPen::zoomedPen(KoZoomHandler* zoomHandler)
  52. {
  53. TQPen pen = *this;
  54. pen.setWidth(zoomHandler->zoomItY(m_pointWidth));
  55. return pen;
  56. }