Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 11638 → Rev 11646

/branches/Version133x/Scribus/scribus/search.cpp
537,23 → 537,20
chars = ScMW->CurrStED->Editor->StyledText.at(pa);
if (SText->isChecked())
{
QString para = ScMW->CurrStED->Editor->text(pa);
if (CaseIgnore->isChecked())
para = para.lower();
if (Word->isChecked())
{
QRegExp rx( "(\\b"+sText+"\\b)" );
if (CaseIgnore->isChecked())
as = rx.search( ScMW->CurrStED->Editor->text(pa).lower(), i );
else
as = rx.search( ScMW->CurrStED->Editor->text(pa), i );
as = rx.search( para, i );
}
else
as = para.find(sText, i);
// #6688 : it's necessary to control chars->count() as QTextExit::text(int)
// may return paragraph text with an appended space
if (as != -1 && (as < (int) chars->count()))
{
if (CaseIgnore->isChecked())
as = ScMW->CurrStED->Editor->text(pa).lower().find(sText, i);
else
as = ScMW->CurrStED->Editor->text(pa).find(sText, i);
}
if (as != -1)
{
fch = as;
fpa = pa;
found = true;
809,12 → 806,16
{
disconnect(ScMW->CurrStED->Editor, SIGNAL(cursorPositionChanged(int, int)), ScMW->CurrStED, SLOT(updateProps(int, int)));
int PStart, PEnd, SelStart, SelEnd;
// #6688 : QTextExit::getSelection() may return sometime a truly empty selection,
// so check that PStart != PEnd || SelStart != SelEnd
ScMW->CurrStED->Editor->getSelection(&PStart, &SelStart, &PEnd, &SelEnd);
ScMW->CurrStED->Editor->insChars(RTextVal->text());
ScMW->CurrStED->Editor->setSelection(PStart, SelStart, PEnd, SelEnd);
if ((PStart != PEnd) || (SelStart != SelEnd))
{
ScMW->CurrStED->Editor->removeSelectedText();
ScMW->CurrStED->Editor->setStyle(ScMW->CurrStED->Editor->CurrentStyle);
ScMW->CurrStED->Editor->insert(RTextVal->text());
ScMW->CurrStED->Editor->insChars(RTextVal->text(), PStart, SelStart, true);
ScMW->CurrStED->Editor->insert(RTextVal->text(), PStart, SelStart, false);
}
connect(ScMW->CurrStED->Editor, SIGNAL(cursorPositionChanged(int, int)), ScMW->CurrStED, SLOT(updateProps(int, int)));
ScMW->CurrStED->newAlign(ScMW->CurrStED->Editor->currentParaStyle);
}