File: TjReportRow.cpp

package info (click to toggle)
taskjuggler 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,252 kB
  • ctags: 3,649
  • sloc: cpp: 37,290; sh: 12,764; xml: 5,938; perl: 5,207; makefile: 282; python: 258; lisp: 67
file content (54 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * The TaskJuggler Project Management Software
 *
 * Copyright (c) 2001, 2002, 2003, 2004, 2005 by Chris Schlaeger <cs@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * $Id$
 */

#include <assert.h>
#include "TjReportRow.h"

#include "CoreAttributes.h"

TjReportRow::TjReportRow(int cols, int idx) : columns(cols), index(idx)
{
    cells = new TjReportCell*[columns];
    for (int i = 0; i < columns; ++i)
        cells[i] = 0;

    topY = height = yPage = 0;
    lastOnPage = false;
    alternate = false;

    ca = subCA = 0;
}

TjReportRow::~TjReportRow()
{
    for (int i = 0; i < columns; ++i)
        delete cells[i];
    delete [] cells;
}

void
TjReportRow::insertCell(TjReportCell* c, int pos)
{
    if (pos > columns - 1)
        qFatal("TjReportRow::insert: pos (%d) out of range (%d)",
               pos, columns);
    cells[pos] = c;
}

TjReportCell*
TjReportRow::getCell(int pos) const
{
    assert(pos >= 0);
    assert(pos < columns);
    return cells[pos];
}