~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kpresenter/KPrFindReplace.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
 
2
/* This file is part of the KDE project
 
3
   Copyright (C) 2001, Laurent Montel <lmontel@mandrakesoft.com>
 
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., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#include <kdebug.h>
 
22
#include "KPrFindReplace.h"
 
23
#include "KPrCanvas.h"
 
24
#include "KPrView.h"
 
25
#include "KPrDocument.h"
 
26
#include "KPrTextObject.h"
 
27
#include <KoTextObject.h>
 
28
#include <kcommand.h>
 
29
#include <KoSearchDia.h>
 
30
#include "KPrTextDocument.h"
 
31
 
 
32
KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoSearchDia * dialog,
 
33
                                const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView)
 
34
    : KoFindReplace( parent, dialog, lstObjects, textView )
 
35
{
 
36
    m_canvas = canvas;
 
37
}
 
38
 
 
39
KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoReplaceDia * dialog,
 
40
                                const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView )
 
41
    : KoFindReplace( parent, dialog, lstObjects, textView )
 
42
{
 
43
    m_canvas = canvas;
 
44
}
 
45
 
 
46
KPrFindReplace::~KPrFindReplace()
 
47
{
 
48
    //kdDebug(33001)() << "KPrFindReplace::~KPrFindReplace m_destroying=" << m_destroying << endl;
 
49
}
 
50
 
 
51
void KPrFindReplace::emitNewCommand(KCommand *cmd)
 
52
{
 
53
    m_canvas->getView()->kPresenterDoc()->addCommand(cmd);
 
54
}
 
55
 
 
56
void KPrFindReplace::highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *_textdoc, KDialogBase* dialog)
 
57
{
 
58
    bool repaint = isReplace() ? options() & KReplaceDialog::PromptOnReplace : true;
 
59
    KPrTextDocument *textdoc = static_cast<KPrTextDocument *>(_textdoc);
 
60
    KPrTextObject* textobj = textdoc->textObject();
 
61
    textobj->highlightPortion( parag, index, length, m_canvas, repaint, dialog );
 
62
}
 
63
 
 
64
#include "KPrFindReplace.moc"