kpresenter
KPrFindReplace.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <kdebug.h>
00022 #include "KPrFindReplace.h"
00023 #include "KPrCanvas.h"
00024 #include "KPrView.h"
00025 #include "KPrDocument.h"
00026 #include "KPrTextObject.h"
00027 #include <KoTextObject.h>
00028 #include <kcommand.h>
00029 #include <KoSearchDia.h>
00030 #include "KPrTextDocument.h"
00031
00032 KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoSearchDia * dialog,
00033 const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView)
00034 : KoFindReplace( parent, dialog, lstObjects, textView )
00035 {
00036 m_canvas = canvas;
00037 }
00038
00039 KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoReplaceDia * dialog,
00040 const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView )
00041 : KoFindReplace( parent, dialog, lstObjects, textView )
00042 {
00043 m_canvas = canvas;
00044 }
00045
00046 KPrFindReplace::~KPrFindReplace()
00047 {
00048
00049 }
00050
00051 void KPrFindReplace::emitNewCommand(KCommand *cmd)
00052 {
00053 m_canvas->getView()->kPresenterDoc()->addCommand(cmd);
00054 }
00055
00056 void KPrFindReplace::highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *_textdoc, KDialogBase* dialog)
00057 {
00058 bool repaint = isReplace() ? options() & KReplaceDialog::PromptOnReplace : true;
00059 KPrTextDocument *textdoc = static_cast<KPrTextDocument *>(_textdoc);
00060 KPrTextObject* textobj = textdoc->textObject();
00061 textobj->highlightPortion( parag, index, length, m_canvas, repaint, dialog );
00062 }
00063
00064 #include "KPrFindReplace.moc"
|