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

« back to all changes in this revision

Viewing changes to filters/olefilters/powerpoint97/pptSlide.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
/*
 
2
    Copyright (C) 2002, M.Marcucio <michaelmarcucio@hotmail.com>.
 
3
    This file is part of the KDE project
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Library General Public
 
7
    License as published by the Free Software Foundation; either
 
8
    version 2 of the License, or (at your option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
    Library General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Library General Public License
 
16
    along with this library; see the file COPYING.LIB.  If not, write to
 
17
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
    Boston, MA 02111-1307, USA.
 
19
 
 
20
DESCRIPTION
 
21
 
 
22
*/
 
23
 
 
24
#include <pptSlide.h>
 
25
 
 
26
static const int s_area = 30512;
 
27
 
 
28
PptSlide::PptSlide()
 
29
{
 
30
        m_slideLayout = 0;              //type of slide
 
31
        m_numberOfPholders = 0; //number of placeholder on the slide
 
32
        m_psrReference = 0;             //logical reference
 
33
}
 
34
 
 
35
//PptSlide::~PptSlide()
 
36
//{
 
37
//}
 
38
 
 
39
QStringList PptSlide::getPlaceholderText(void)
 
40
{
 
41
        return m_currentPholder->paragraphs;
 
42
}
 
43
 
 
44
//styleRun PptSlide::getPlaceholderStyleRun(void)
 
45
//{
 
46
//      return m_currentPholder->styleRun;
 
47
//}
 
48
 
 
49
Q_UINT16 PptSlide::getPlaceholderType(void)
 
50
{
 
51
        return m_currentPholder->type;
 
52
}
 
53
 
 
54
void PptSlide::gotoPlaceholder(Q_UINT16 pholderNumber)
 
55
{
 
56
        m_currentPholder = m_placeholderList.at(pholderNumber);
 
57
}
 
58
        
 
59
Q_INT32 PptSlide::getPsrReference(void)
 
60
{
 
61
        return m_psrReference;
 
62
}
 
63
 
 
64
void PptSlide::setPsrReference(Q_INT32 psr)
 
65
{
 
66
        m_psrReference = psr;
 
67
}
 
68
 
 
69
Q_UINT16 PptSlide::getNumberOfPholders()
 
70
{
 
71
        return m_numberOfPholders;
 
72
}
 
73
        
 
74
void PptSlide::addText(QString text, Q_UINT16 type)
 
75
{
 
76
        unsigned j;
 
77
        m_currentPholder = new placeholder;
 
78
        m_placeholderList.append(m_currentPholder);
 
79
        m_numberOfPholders++;
 
80
        m_currentPholder->type = type;
 
81
        kdError(s_area) << "adding to slide now!!!!!!!!!!!! m_numberOfPholders: " << m_numberOfPholders << endl;
 
82
        
 
83
        switch (type)
 
84
        {
 
85
        case TITLE_TEXT:
 
86
        case CENTER_TITLE_TEXT:
 
87
                m_currentPholder->paragraphs.append(text);
 
88
                //m_titleText.append("\n");
 
89
                break;
 
90
        case NOTES_TEXT:
 
91
                m_currentPholder->paragraphs.append(text);
 
92
                m_currentPholder->paragraphs.append("\n");
 
93
                //m_notesText.append("\n");
 
94
                break;
 
95
        case BODY_TEXT:
 
96
        case OTHER_TEXT:
 
97
        case CENTER_BODY_TEXT:
 
98
        case HALF_BODY_TEXT:
 
99
        case QUARTER_BODY_TEXT:
 
100
                QStringList data(QStringList::split(QChar('\r'), text, true));
 
101
                for (j = 0; j < data.count(); j++)
 
102
                {
 
103
                        m_currentPholder->paragraphs.append(data[j]);
 
104
                        //m_body.paragraphs.append(data[j]);
 
105
                }
 
106
                //m_body.type = type;
 
107
                break;
 
108
        }
 
109
}//addtext
 
110