~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kivio/kiviopart/tklib/tkpagelayout.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "tkpagelayout.h"
2
 
 
3
 
#include "tkunits.h"
4
 
#include "tkcommon.h"
5
 
 
6
 
#include <qtextstream.h>
7
 
 
8
 
TKPageLayout::TKPageLayout()
9
 
{
10
 
}
11
 
 
12
 
TKPageLayout::~TKPageLayout()
13
 
{
14
 
}
15
 
 
16
 
float TKPageLayout::ptWidth()
17
 
{
18
 
  return cvtUnitToPt(unit, width);
19
 
}
20
 
 
21
 
float TKPageLayout::ptHeight()
22
 
{
23
 
  return cvtUnitToPt(unit, height);
24
 
}
25
 
 
26
 
float TKPageLayout::ptLeft()
27
 
{
28
 
  return cvtUnitToPt(unit, marginLeft);
29
 
}
30
 
 
31
 
float TKPageLayout::ptRight()
32
 
{
33
 
  return cvtUnitToPt(unit, marginRight);
34
 
}
35
 
 
36
 
float TKPageLayout::ptTop()
37
 
{
38
 
  return cvtUnitToPt(unit, marginTop);
39
 
}
40
 
 
41
 
float TKPageLayout::ptBottom()
42
 
{
43
 
  return cvtUnitToPt(unit, marginBottom);
44
 
}
45
 
 
46
 
void TKPageLayout::save(QDomElement& e)
47
 
{
48
 
  XmlWriteInt(e, "unit", unit);
49
 
  XmlWriteFloat(e, "width", width);
50
 
  XmlWriteFloat(e, "height", height);
51
 
  XmlWriteFloat(e, "marginLeft", marginLeft);
52
 
  XmlWriteFloat(e, "marginRight", marginRight);
53
 
  XmlWriteFloat(e, "marginTop", marginTop);
54
 
  XmlWriteFloat(e, "marginBottom", marginBottom);
55
 
}
56
 
 
57
 
void TKPageLayout::load(QDomElement& e)
58
 
{
59
 
  unit = XmlReadInt(e, "unit", 0);
60
 
  width = XmlReadFloat(e, "width", 0.0);
61
 
  height = XmlReadFloat(e, "height", 0.0);
62
 
  marginLeft = XmlReadFloat(e, "marginLeft", 0.0);
63
 
  marginRight = XmlReadFloat(e, "marginRight", 0.0);
64
 
  marginTop = XmlReadFloat(e, "marginTop", 0.0);
65
 
  marginBottom = XmlReadFloat(e, "marginBottom", 0.0);
66
 
}
67
 
 
68
 
void TKPageLayout::setDefault()
69
 
{
70
 
  unit = UnitMillimeter;
71
 
  width  = 210.0;
72
 
  height = 297.0;
73
 
 
74
 
  marginLeft   = 20.0;
75
 
  marginRight  = 20.0;
76
 
  marginTop    = 20.0;
77
 
  marginBottom = 20.0;
78
 
}