|
|
@ -62,13 +62,13 @@
|
|
|
|
#include <kprocio.h>
|
|
|
|
#include <kprocio.h>
|
|
|
|
#include <kreplace.h>
|
|
|
|
#include <kreplace.h>
|
|
|
|
#include <kreplacedialog.h>
|
|
|
|
#include <kreplacedialog.h>
|
|
|
|
#include <kspell.h>
|
|
|
|
#include <tdespell.h>
|
|
|
|
#include <kspelldlg.h>
|
|
|
|
#include <tdespelldlg.h>
|
|
|
|
#include <kstatusbar.h>
|
|
|
|
#include <kstatusbar.h>
|
|
|
|
#include <kstdaction.h>
|
|
|
|
#include <kstdaction.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
#include <ktempfile.h>
|
|
|
|
#include <ktempfile.h>
|
|
|
|
#include <kparts/partmanager.h>
|
|
|
|
#include <tdeparts/partmanager.h>
|
|
|
|
#include <klistview.h>
|
|
|
|
#include <klistview.h>
|
|
|
|
#include <kpushbutton.h>
|
|
|
|
#include <kpushbutton.h>
|
|
|
|
|
|
|
|
|
|
|
@ -246,7 +246,7 @@ public:
|
|
|
|
// spell-check context
|
|
|
|
// spell-check context
|
|
|
|
struct
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KSpell * kspell;
|
|
|
|
KSpell * tdespell;
|
|
|
|
Sheet * firstSpellSheet;
|
|
|
|
Sheet * firstSpellSheet;
|
|
|
|
Sheet * currentSpellSheet;
|
|
|
|
Sheet * currentSpellSheet;
|
|
|
|
Cell * currentCell;
|
|
|
|
Cell * currentCell;
|
|
|
@ -1774,7 +1774,7 @@ View::View( TQWidget *_parent, const char *_name,
|
|
|
|
d->searchInSheets.firstSheet = 0;
|
|
|
|
d->searchInSheets.firstSheet = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// spell-check context
|
|
|
|
// spell-check context
|
|
|
|
d->spell.kspell = 0;
|
|
|
|
d->spell.tdespell = 0;
|
|
|
|
d->spell.macroCmdSpellCheck = 0;
|
|
|
|
d->spell.macroCmdSpellCheck = 0;
|
|
|
|
d->spell.firstSpellSheet = 0;
|
|
|
|
d->spell.firstSpellSheet = 0;
|
|
|
|
d->spell.currentSpellSheet = 0;
|
|
|
|
d->spell.currentSpellSheet = 0;
|
|
|
@ -1873,7 +1873,7 @@ View::~View()
|
|
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
delete d->spell.kspell;
|
|
|
|
delete d->spell.tdespell;
|
|
|
|
|
|
|
|
|
|
|
|
d->canvas->endChoose();
|
|
|
|
d->canvas->endChoose();
|
|
|
|
d->activeSheet = 0; // set the active sheet to 0L so that when during destruction
|
|
|
|
d->activeSheet = 0; // set the active sheet to 0L so that when during destruction
|
|
|
@ -2248,7 +2248,7 @@ void View::recalcWorkSheet()
|
|
|
|
|
|
|
|
|
|
|
|
void View::extraSpelling()
|
|
|
|
void View::extraSpelling()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( d->spell.kspell )
|
|
|
|
if ( d->spell.tdespell )
|
|
|
|
return; // Already in progress
|
|
|
|
return; // Already in progress
|
|
|
|
|
|
|
|
|
|
|
|
if (d->activeSheet == 0L)
|
|
|
|
if (d->activeSheet == 0L)
|
|
|
@ -2296,33 +2296,33 @@ void View::startKSpell()
|
|
|
|
doc()->getKSpellConfig()->setReplaceAllList( d->spell.replaceAll );
|
|
|
|
doc()->getKSpellConfig()->setReplaceAllList( d->spell.replaceAll );
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d->spell.kspell = new KSpell( this, i18n( "Spell Checking" ), TQT_TQOBJECT(this),
|
|
|
|
d->spell.tdespell = new KSpell( this, i18n( "Spell Checking" ), TQT_TQOBJECT(this),
|
|
|
|
TQT_SLOT( spellCheckerReady() ),
|
|
|
|
TQT_SLOT( spellCheckerReady() ),
|
|
|
|
doc()->getKSpellConfig() );
|
|
|
|
doc()->getKSpellConfig() );
|
|
|
|
|
|
|
|
|
|
|
|
d->spell.kspell->setIgnoreUpperWords( doc()->dontCheckUpperWord() );
|
|
|
|
d->spell.tdespell->setIgnoreUpperWords( doc()->dontCheckUpperWord() );
|
|
|
|
d->spell.kspell->setIgnoreTitleCase( doc()->dontCheckTitleCase() );
|
|
|
|
d->spell.tdespell->setIgnoreTitleCase( doc()->dontCheckTitleCase() );
|
|
|
|
|
|
|
|
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( death() ),
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( death() ),
|
|
|
|
this, TQT_SLOT( spellCheckerFinished() ) );
|
|
|
|
this, TQT_SLOT( spellCheckerFinished() ) );
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( misspelling( const TQString &,
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( misspelling( const TQString &,
|
|
|
|
const TQStringList &,
|
|
|
|
const TQStringList &,
|
|
|
|
unsigned int) ),
|
|
|
|
unsigned int) ),
|
|
|
|
this, TQT_SLOT( spellCheckerMisspelling( const TQString &,
|
|
|
|
this, TQT_SLOT( spellCheckerMisspelling( const TQString &,
|
|
|
|
const TQStringList &,
|
|
|
|
const TQStringList &,
|
|
|
|
unsigned int) ) );
|
|
|
|
unsigned int) ) );
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( corrected( const TQString &,
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( corrected( const TQString &,
|
|
|
|
const TQString &,
|
|
|
|
const TQString &,
|
|
|
|
unsigned int) ),
|
|
|
|
unsigned int) ),
|
|
|
|
this, TQT_SLOT( spellCheckerCorrected( const TQString &,
|
|
|
|
this, TQT_SLOT( spellCheckerCorrected( const TQString &,
|
|
|
|
const TQString &,
|
|
|
|
const TQString &,
|
|
|
|
unsigned int ) ) );
|
|
|
|
unsigned int ) ) );
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( done( const TQString & ) ),
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( done( const TQString & ) ),
|
|
|
|
this, TQT_SLOT( spellCheckerDone( const TQString & ) ) );
|
|
|
|
this, TQT_SLOT( spellCheckerDone( const TQString & ) ) );
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( ignoreall (const TQString & ) ),
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( ignoreall (const TQString & ) ),
|
|
|
|
this, TQT_SLOT( spellCheckerIgnoreAll( const TQString & ) ) );
|
|
|
|
this, TQT_SLOT( spellCheckerIgnoreAll( const TQString & ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.kspell, TQT_SIGNAL( replaceall( const TQString & , const TQString & )), this, TQT_SLOT( spellCheckerReplaceAll( const TQString & , const TQString & )));
|
|
|
|
TQT_BASE_OBJECT_NAME::connect( d->spell.tdespell, TQT_SIGNAL( replaceall( const TQString & , const TQString & )), this, TQT_SLOT( spellCheckerReplaceAll( const TQString & , const TQString & )));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2354,7 +2354,7 @@ void View::spellCheckerReady()
|
|
|
|
// check text only
|
|
|
|
// check text only
|
|
|
|
if ( d->spell.currentCell->value().isString() )
|
|
|
|
if ( d->spell.currentCell->value().isString() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->spell.kspell->check( d->spell.currentCell->text(), true );
|
|
|
|
d->spell.tdespell->check( d->spell.currentCell->text(), true );
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2397,7 +2397,7 @@ void View::spellCheckerReady()
|
|
|
|
d->spell.spellCurrCellX = x;
|
|
|
|
d->spell.spellCurrCellX = x;
|
|
|
|
d->spell.spellCurrCellY = y;
|
|
|
|
d->spell.spellCurrCellY = y;
|
|
|
|
|
|
|
|
|
|
|
|
d->spell.kspell->check( cell->text(), true );
|
|
|
|
d->spell.tdespell->check( cell->text(), true );
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2426,9 +2426,9 @@ void View::spellCleanup()
|
|
|
|
if ( d->canvas )
|
|
|
|
if ( d->canvas )
|
|
|
|
d->canvas->setCursor( ArrowCursor );
|
|
|
|
d->canvas->setCursor( ArrowCursor );
|
|
|
|
|
|
|
|
|
|
|
|
d->spell.kspell->cleanUp();
|
|
|
|
d->spell.tdespell->cleanUp();
|
|
|
|
delete d->spell.kspell;
|
|
|
|
delete d->spell.tdespell;
|
|
|
|
d->spell.kspell = 0L;
|
|
|
|
d->spell.tdespell = 0L;
|
|
|
|
d->spell.firstSpellSheet = 0L;
|
|
|
|
d->spell.firstSpellSheet = 0L;
|
|
|
|
d->spell.currentSpellSheet = 0L;
|
|
|
|
d->spell.currentSpellSheet = 0L;
|
|
|
|
d->spell.currentCell = 0L;
|
|
|
|
d->spell.currentCell = 0L;
|
|
|
@ -2548,11 +2548,11 @@ void View::spellCheckerCorrected( const TQString & old, const TQString & corr,
|
|
|
|
|
|
|
|
|
|
|
|
void View::spellCheckerDone( const TQString & )
|
|
|
|
void View::spellCheckerDone( const TQString & )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int result = d->spell.kspell->dlgResult();
|
|
|
|
int result = d->spell.tdespell->dlgResult();
|
|
|
|
|
|
|
|
|
|
|
|
d->spell.kspell->cleanUp();
|
|
|
|
d->spell.tdespell->cleanUp();
|
|
|
|
delete d->spell.kspell;
|
|
|
|
delete d->spell.tdespell;
|
|
|
|
d->spell.kspell = 0L;
|
|
|
|
d->spell.tdespell = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
if ( result != KS_CANCEL && result != KS_STOP )
|
|
|
|
if ( result != KS_CANCEL && result != KS_STOP )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2591,19 +2591,19 @@ void View::spellCheckerFinished()
|
|
|
|
if (d->canvas)
|
|
|
|
if (d->canvas)
|
|
|
|
d->canvas->setCursor( ArrowCursor );
|
|
|
|
d->canvas->setCursor( ArrowCursor );
|
|
|
|
|
|
|
|
|
|
|
|
KSpell::spellStatus status = d->spell.kspell->status();
|
|
|
|
KSpell::spellStatus status = d->spell.tdespell->status();
|
|
|
|
d->spell.kspell->cleanUp();
|
|
|
|
d->spell.tdespell->cleanUp();
|
|
|
|
delete d->spell.kspell;
|
|
|
|
delete d->spell.tdespell;
|
|
|
|
d->spell.kspell = 0L;
|
|
|
|
d->spell.tdespell = 0L;
|
|
|
|
d->spell.replaceAll.clear();
|
|
|
|
d->spell.replaceAll.clear();
|
|
|
|
|
|
|
|
|
|
|
|
bool kspellNotConfigured=false;
|
|
|
|
bool tdespellNotConfigured=false;
|
|
|
|
|
|
|
|
|
|
|
|
if (status == KSpell::Error)
|
|
|
|
if (status == KSpell::Error)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KMessageBox::sorry(this, i18n("ISpell could not be started.\n"
|
|
|
|
KMessageBox::sorry(this, i18n("ISpell could not be started.\n"
|
|
|
|
"Please make sure you have ISpell properly configured and in your PATH."));
|
|
|
|
"Please make sure you have ISpell properly configured and in your PATH."));
|
|
|
|
kspellNotConfigured=true;
|
|
|
|
tdespellNotConfigured=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (status == KSpell::Crashed)
|
|
|
|
else if (status == KSpell::Crashed)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2617,7 +2617,7 @@ void View::spellCheckerFinished()
|
|
|
|
d->spell.macroCmdSpellCheck=0L;
|
|
|
|
d->spell.macroCmdSpellCheck=0L;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (kspellNotConfigured)
|
|
|
|
if (tdespellNotConfigured)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PreferenceDialog configDlg( this, 0 );
|
|
|
|
PreferenceDialog configDlg( this, 0 );
|
|
|
|
configDlg.openPage( PreferenceDialog::KS_SPELLING);
|
|
|
|
configDlg.openPage( PreferenceDialog::KS_SPELLING);
|
|
|
|