Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 356 → Rev 357

/trunk/Scribus/ChangeLogCVS
1,5 → 1,12
Changes since Version 1.1.7
 
02.08.2004
* bug #658: Templates: issues with text editing in story editor
* bug #659: Templates > Story Editor & Properties: Confusion about styles
* bug #921: importing SVG does not set save flag
* feature # 25: Add Find & Replace option to Story Editor / Text Frames
* feature #904: integrate font preview plugin to the story editor
 
01.08.2004
* bug #450: Dialog Tools>Layers needs <ESC> binding and loose the "X" button
* bug #768: insert sample text
/trunk/Scribus/scribus/hyphenator.cpp
230,6 → 230,7
}
if ((!useAble) || (nb1->PType != 4) || (nb1 ->Ptext.count() == 0))
return;
doc->DoDrawing = false;
const char *word;
char *buffer;
const int BORDER = 2;
354,5 → 355,6
}
nb1->Dirty = true;
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
doc->DoDrawing = true;
nb1->OwnPage->RefreshItem(nb1);
}
/trunk/Scribus/scribus/story.cpp
22,6 → 22,8
#include <qmessagebox.h>
#include <qregexp.h>
#include <qhbox.h>
#include <qcolordialog.h>
#include <qfontdialog.h>
#include "serializer.h"
#include "customfdialog.h"
#include "search.h"
246,9 → 248,9
void SEditor::insChars(QString t)
{
int p, i;
getCursorPosition(&p, &i);
if (hasSelectedText())
deleteSel();
getCursorPosition(&p, &i);
ChList *chars;
if ((p >= static_cast<int>(StyledText.count())) || (StyledText.count() == 0))
{
980,14 → 982,18
Mpaste = emenu->insertItem(loadIcon("editpaste.png"), tr("&Paste"), this, SLOT(Do_paste()), CTRL+Key_V);
Mdel = emenu->insertItem(loadIcon("editdelete.png"), tr("C&lear"), this, SLOT(Do_del()), CTRL+Key_V);
emenu->insertSeparator();
int sr = emenu->insertItem( tr("&Search/Replace..."), this, SLOT(SearchText()));
emenu->insertItem(loadIcon("find16.png"), tr("&Search/Replace..."), this, SLOT(SearchText()));
emenu->insertItem( tr("&Insert Special..."), this , SLOT(Do_insSp()));
// emenu->setItemEnabled(sr, 0);
emenu->insertSeparator();
emenu->insertItem( tr("&Edit Styles..."), this , SLOT(slotEditStyles()));
emenu->insertItem( tr("Font &Preview..."), this , SLOT(Do_fontPrev()));
Mupdt = emenu->insertItem(loadIcon("compfile16.png"), tr("&Update Text Frame"), this, SLOT(updateTextFrame()), CTRL+Key_U);
settingsMenu = new QPopupMenu();
settingsMenu->insertItem( tr("&Background..."), this , SLOT(setBackPref()));
settingsMenu->insertItem( tr("&Display Font..."), this , SLOT(setFontPref()));
menuBar()->insertItem( tr("&File"), fmenu);
menuBar()->insertItem( tr("&Edit"), emenu);
menuBar()->insertItem( tr("&Settings"), settingsMenu );
 
/* Setting up Toolbars */
FileTools = new QToolBar( tr("File"), this);
998,6 → 1004,7
DatCan = new QToolButton(loadIcon("exit22.png"), tr("Exit Without Updating Text Frame"), QString::null, this, SLOT(Do_leave()), FileTools);
DatRel = new QToolButton(loadIcon("reload.png"), tr("Reload Text from Frame"), QString::null, this, SLOT(slotFileRevert()), FileTools);
DatUpdt = new QToolButton(loadIcon("compfile.png"), tr("Update Text Frame"), QString::null, this, SLOT(updateTextFrame()), FileTools);
DatFin = new QToolButton(loadIcon("find.png"), tr("Search/Replace"), QString::null, this, SLOT(SearchText()), FileTools);
DatUpdt->setEnabled(false);
DatRel->setEnabled(false);
setDockEnabled(FileTools, DockLeft, false);
1098,6 → 1105,10
emenu->setItemEnabled(Mdel, 0);
emenu->setItemEnabled(Mupdt, 0);
resize( QSize(660, 500).expandedTo(minimumSizeHint()) );
Editor->setPaper(ScApp->Prefs.STEcolor);
QFont fo;
fo.fromString(ScApp->Prefs.STEfont);
Editor->setFont(fo);
CurrItem = ite;
firstSet = false;
Editor->loadItemText(ite);
1151,10 → 1162,29
qApp->exit_loop();
}
 
void StoryEditor::setBackPref()
{
QColor neu = QColor();
neu = QColorDialog::getColor(Editor->paper().color(), this);
if (neu.isValid())
{
Editor->setPaper(neu);
ScApp->Prefs.STEcolor = neu;
}
}
 
void StoryEditor::setFontPref()
{
Editor->setFont( QFontDialog::getFont( 0, Editor->font() ) );
ScApp->Prefs.STEfont = Editor->font().toString();
}
 
void StoryEditor::newTxFill(int c, int s)
{
Editor->CurrTextFill = FillTools->TxFill->text(c);
Editor->CurrTextFillSh = s;
if (c != -1)
Editor->CurrTextFill = FillTools->TxFill->text(c);
if (s != -1)
Editor->CurrTextFillSh = s;
Editor->setFarbe(Editor->CurrTextFill, Editor->CurrTextFillSh);
struct PtiSmall hg;
hg.ccolor = Editor->CurrTextFill;
1166,8 → 1196,10
 
void StoryEditor::newTxStroke(int c, int s)
{
Editor->CurrTextStroke = StrokeTools->TxStroke->text(c);
Editor->CurrTextStrokeSh = s;
if (c != -1)
Editor->CurrTextStroke = StrokeTools->TxStroke->text(c);
if (s != -1)
Editor->CurrTextStrokeSh = s;
struct PtiSmall hg;
hg.cstroke = Editor->CurrTextStroke;
hg.cshade2 = Editor->CurrTextStrokeSh;
1438,6 → 1470,20
ScApp->DLLReturn = "";
}
 
void StoryEditor::Do_fontPrev()
{
ScApp->DLLinput = Editor->CurrFont;
ScApp->DLLReturn = "";
ScApp->CallDLL( tr("&Fonts Preview") );
if (ScApp->DLLReturn != "")
{
newTxFont(ScApp->DLLReturn);
FontTools->SetFont(ScApp->DLLReturn);
}
ScApp->DLLinput = "";
ScApp->DLLReturn = "";
}
 
void StoryEditor::Do_leave2()
{
result = QDialog::Accepted;
1570,20 → 1616,6
doc->Trenner->slotNewDict(nb->Language);
doc->Trenner->slotHyphenate(nb);
}
while (nb != 0)
{
bool savre = doc->RePos;
doc->RePos = true;
QPixmap pgPix(1, 1);
ScPainter *painter = new ScPainter(&pgPix, 1, 1);
painter->translate(0.5, 0.5);
nb->DrawObj(painter, QRect(0, 0, 1, 1));
painter->end();
delete painter;
doc->RePos = savre;
nb->OwnPage->RefreshItem(nb);
nb = nb->NextBox;
}
TextChanged = false;
emenu->setItemEnabled(Mupdt, 0);
fmenu->setItemEnabled(fid52, 0);
/trunk/Scribus/scribus/icons/find16.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/Scribus/scribus/icons/Makefile.am
===================================================================
--- trunk/Scribus/scribus/icons/Makefile.am (revision 356)
+++ trunk/Scribus/scribus/icons/Makefile.am (revision 357)
@@ -1,10 +1,12 @@
####### kdevelop will overwrite this part!!! (begin)##########
-EXTRA_DIST = nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift.xpm Text.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline.png triangle.png Stiftalt.xpm beziertool.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table.png scribusdoc.png documentinfo.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png
+EXTRA_DIST = nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift.xpm Text.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline.png triangle.png Stiftalt.xpm beziertool.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table.png scribusdoc.png documentinfo.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png
install-data-local:
$(mkinstalldirs) $(prefix)/share/scribus/icons/
+ $(INSTALL_DATA) $(srcdir)/find.png $(prefix)/share/scribus/icons/find.png
+ $(INSTALL_DATA) $(srcdir)/find16.png $(prefix)/share/scribus/icons/find16.png
$(INSTALL_DATA) $(srcdir)/compfile16.png $(prefix)/share/scribus/icons/compfile16.png
$(INSTALL_DATA) $(srcdir)/reload16.png $(prefix)/share/scribus/icons/reload16.png
$(INSTALL_DATA) $(srcdir)/compfile.png $(prefix)/share/scribus/icons/compfile.png
@@ -302,6 +304,8 @@
-rm -f $(prefix)/share/scribus/icons/compfile.png
-rm -f $(prefix)/share/scribus/icons/reload.png
-rm -f $(prefix)/share/scribus/icons/exit22.png
+ -rm -f $(prefix)/share/scribus/icons/find16.png
+ -rm -f $(prefix)/share/scribus/icons/find.png
####### kdevelop will overwrite this part!!! (end)############
/trunk/Scribus/scribus/icons/find.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/Scribus/scribus/scribusdoc.h
===================================================================
--- trunk/Scribus/scribus/scribusdoc.h (revision 356)
+++ trunk/Scribus/scribus/scribusdoc.h (revision 357)
@@ -490,6 +490,8 @@
bool GCRMode;
double BaseGrid;
double BaseOffs;
+ QColor STEcolor;
+ QString STEfont;
};
/**
* the Document Class
Index: trunk/Scribus/scribus/libabout/about.cpp
===================================================================
--- trunk/Scribus/scribus/libabout/about.cpp (revision 356)
+++ trunk/Scribus/scribus/libabout/about.cpp (revision 357)
@@ -56,7 +56,7 @@
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
- QString bu = tr("%1. %2 %3 ").arg("01").arg("August").arg("2004");
+ QString bu = tr("%1. %2 %3 ").arg("02").arg("August").arg("2004");
#ifdef HAVE_CMS
bu += "C";
#else
Index: trunk/Scribus/scribus/search.cpp
===================================================================
--- trunk/Scribus/scribus/search.cpp (revision 356)
+++ trunk/Scribus/scribus/search.cpp (revision 357)
@@ -326,14 +326,13 @@
void SearchReplace::slotSearch()
{
if (SMode)
+ Doc->ActPage->slotDoCurs(false);
+ slotDoSearch();
+ if (SMode)
{
- Doc->ActPage->slotDoCurs(false);
- slotDoSearch();
Doc->ActPage->slotDoCurs(true);
Doc->ActPage->RefreshItem(Item, true);
}
- else
- slotDoSearch();
}
void SearchReplace::slotDoSearch()
@@ -507,57 +506,129 @@
{
if (ScApp->CurrStED != NULL)
{
+ int p, i;
+ ScApp->CurrStED->Editor->getCursorPosition(&p, &i);
+ uint inde = 0;
+ int as = i;
+ uint fpa = p;
+ int fch = i;
+ found = false;
if (ScApp->CurrStED->Editor->StyledText.count() != 0)
{
- for (uint pa = 0; pa < ScApp->CurrStED->Editor->StyledText.count(); ++pa)
+ for (uint pa = p; pa < ScApp->CurrStED->Editor->StyledText.count(); ++pa)
{
SEditor::ChList *chars;
chars = ScApp->CurrStED->Editor->StyledText.at(pa);
- for (uint e = 0; e < chars->count(); ++e)
+ if (SText->isChecked())
{
- if (SText->isChecked())
+ if (Word->isChecked())
{
- QString chx = chars->at(e)->ch;
+ QRegExp rx( "(\\b"+sText+"\\b)" );
if (CaseIgnore->isChecked())
- chx = chx.lower();
- found = chx == sText.mid(inde, 1) ? true : false;
- if ((Word->isChecked()) && (inde == 0) && (chx[0].isSpace()))
- found = true;
+ as = rx.search( ScApp->CurrStED->Editor->text(pa).lower(), i );
+ else
+ as = rx.search( ScApp->CurrStED->Editor->text(pa), i );
}
else
+ {
+ if (CaseIgnore->isChecked())
+ as = ScApp->CurrStED->Editor->text(pa).lower().find(sText, i);
+ else
+ as = ScApp->CurrStED->Editor->text(pa).find(sText, i);
+ }
+ if (as != -1)
+ {
+ fch = as;
+ fpa = pa;
found = true;
- if (found)
- {
- if (rep)
+ inde = 0;
+ for (uint ap = 0; ap < sText.length(); ++ap)
{
- DoReplace->setEnabled(true);
- AllReplace->setEnabled(true);
- }
- if (SText->isChecked())
- {
- if (inde == 0)
- ReplStart = e;
+ struct PtiSmall *hg;
+ hg = chars->at(as+ap);
+ if ((SSize->isChecked()) && (hg->csize != sSize))
+ found = false;
+ if ((SFont->isChecked()) && (hg->cfont != sFont))
+ found = false;
+ if ((SStyle->isChecked()) && (hg->cab != sStyle))
+ found = false;
+ if ((SStroke->isChecked()) && (hg->cstroke != sCol))
+ found = false;
+ if ((SStrokeS->isChecked()) && (hg->cshade2 != sStrokeSh))
+ found = false;
+ if ((SFillS->isChecked()) && (hg->cshade != sFillSh))
+ found = false;
+ if ((SEffect->isChecked()) && ((hg->cstyle & 127) != sEff))
+ found = false;
+ if ((SFill->isChecked()) && (hg->ccolor != fCol))
+ found = false;
inde++;
- if ((Word->isChecked()) && (inde == 1) && (chars->at(e)->ch[0].isSpace()))
- {
- inde--;
- }
- if ((Word->isChecked()) && (inde == sText.length()) && (!chars->at(QMIN(chars->count()-1,e+1))->ch[0].isSpace()))
- {
- inde = 0;
- found = false;
- }
- else
- {
- if (inde == sText.length())
- break;
- }
}
- else
+ i = as + inde;
+ if (found)
break;
}
+ else
+ {
+ i = 0;
+ inde = 0;
+ }
}
+ else
+ {
+ for (uint e = i; e < chars->count(); ++e)
+ {
+ found = true;
+ inde = 1;
+ struct PtiSmall *hg;
+ hg = chars->at(e);
+ if ((SSize->isChecked()) && (hg->csize != sSize))
+ found = false;
+ if ((SFont->isChecked()) && (hg->cfont != sFont))
+ found = false;
+ if ((SStyle->isChecked()) && (hg->cab != sStyle))
+ found = false;
+ if ((SStroke->isChecked()) && (hg->cstroke != sCol))
+ found = false;
+ if ((SStrokeS->isChecked()) && (hg->cshade2 != sStrokeSh))
+ found = false;
+ if ((SFillS->isChecked()) && (hg->cshade != sFillSh))
+ found = false;
+ if ((SEffect->isChecked()) && ((hg->cstyle & 127) != sEff))
+ found = false;
+ if ((SFill->isChecked()) && (hg->ccolor != fCol))
+ found = false;
+ if (found)
+ {
+ fch = e;
+ fpa = pa;
+ break;
+ }
+ }
+ if (found)
+ break;
+ else
+ i = 0;
+ }
}
+ if (found)
+ {
+ ScApp->CurrStED->Editor->setSelection(fpa, fch, fpa, fch+inde);
+ ScApp->CurrStED->updateProps(fpa, fch);
+ ScApp->CurrStED->Editor->setCursorPosition(fpa, fch+inde);
+ if (rep)
+ {
+ DoReplace->setEnabled(true);
+ AllReplace->setEnabled(true);
+ }
+ }
+ else
+ {
+ QMessageBox::information(this, tr("Search/Replace"), tr("Search finished"), tr("OK"));
+ NotFound = false;
+ ScApp->CurrStED->Editor->removeSelection();
+ ScApp->CurrStED->Editor->setCursorPosition(0, 0);
+ }
}
}
}
@@ -566,9 +637,10 @@
void SearchReplace::slotReplace()
{
if (SMode)
+ Doc->ActPage->slotDoCurs(false);
+ slotDoReplace();
+ if (SMode)
{
- Doc->ActPage->slotDoCurs(false);
- slotDoReplace();
Doc->ActPage->slotDoCurs(true);
Doc->ActPage->RefreshItem(Item, true);
}
@@ -576,113 +648,153 @@
void SearchReplace::slotDoReplace()
{
- QString repl, sear;
- uint cs, cx;
- struct Pti *hg;
- if (RText->isChecked())
+ if (SMode)
{
- repl = RTextVal->text();
- sear = STextVal->text();
- if (sear.length() == repl.length())
+ QString repl, sear;
+ uint cs, cx;
+ struct Pti *hg;
+ if (RText->isChecked())
{
- for (cs = 0; cs < sear.length(); ++cs)
- Item->Ptext.at(ReplStart+cs)->ch = repl[cs];
- }
- else
- {
- if (sear.length() < repl.length())
+ repl = RTextVal->text();
+ sear = STextVal->text();
+ if (sear.length() == repl.length())
{
for (cs = 0; cs < sear.length(); ++cs)
Item->Ptext.at(ReplStart+cs)->ch = repl[cs];
- for (cx = cs; cx < repl.length(); ++cx)
+ }
+ else
+ {
+ if (sear.length() < repl.length())
{
- hg = new Pti;
- hg->ch = repl[cx];
- if (RSize->isChecked())
- hg->csize = qRound(RSizeVal->value() * 10.0);
- else
- hg->csize = Doc->CurrFontSize;
- if (RFill->isChecked())
- hg->ccolor = RFillVal->currentText();
- else
- hg->ccolor = Doc->CurrTextFill;
- hg->cshade = Doc->CurrTextFillSh;
- if (RStroke->isChecked())
- hg->cstroke = RStrokeVal->currentText();
- else
- hg->cstroke = Doc->CurrTextStroke;
- hg->cshade2 = Doc->CurrTextStrokeSh;
- hg->cscale = Doc->CurrTextScale;
- hg->cselect = true;
- hg->cstyle = Doc->CurrentStyle;
- if (RStyle->isChecked())
- hg->cab = RStyleVal->currentItem();
- else
- hg->cab = Doc->CurrentABStil;
- if (Doc->Vorlagen[hg->cab].Font != "")
+ for (cs = 0; cs < sear.length(); ++cs)
+ Item->Ptext.at(ReplStart+cs)->ch = repl[cs];
+ for (cx = cs; cx < repl.length(); ++cx)
{
- hg->cfont = Doc->Vorlagen[hg->cab].Font;
- hg->csize = Doc->Vorlagen[hg->cab].FontSize;
- hg->cstyle = Doc->Vorlagen[hg->cab].FontEffect;
+ hg = new Pti;
+ hg->ch = repl[cx];
+ if (RSize->isChecked())
+ hg->csize = qRound(RSizeVal->value() * 10.0);
+ else
+ hg->csize = Doc->CurrFontSize;
+ if (RFill->isChecked())
+ hg->ccolor = RFillVal->currentText();
+ else
+ hg->ccolor = Doc->CurrTextFill;
+ hg->cshade = Doc->CurrTextFillSh;
+ if (RStroke->isChecked())
+ hg->cstroke = RStrokeVal->currentText();
+ else
+ hg->cstroke = Doc->CurrTextStroke;
+ hg->cshade2 = Doc->CurrTextStrokeSh;
+ hg->cscale = Doc->CurrTextScale;
+ hg->cselect = true;
+ hg->cstyle = Doc->CurrentStyle;
+ if (RStyle->isChecked())
+ hg->cab = RStyleVal->currentItem();
+ else
+ hg->cab = Doc->CurrentABStil;
+ if (Doc->Vorlagen[hg->cab].Font != "")
+ {
+ hg->cfont = Doc->Vorlagen[hg->cab].Font;
+ hg->csize = Doc->Vorlagen[hg->cab].FontSize;
+ hg->cstyle = Doc->Vorlagen[hg->cab].FontEffect;
+ }
+ if (RFont->isChecked())
+ hg->cfont = RFontVal->currentText();
+ else
+ hg->cfont = Doc->CurrFont;
+ hg->cextra = 0;
+ hg->xp = 0;
+ hg->yp = 0;
+ hg->PRot = 0;
+ hg->PtransX = 0;
+ hg->PtransY = 0;
+ Item->Ptext.insert(ReplStart+cx, hg);
}
- if (RFont->isChecked())
- hg->cfont = RFontVal->currentText();
- else
- hg->cfont = Doc->CurrFont;
- hg->cextra = 0;
- hg->xp = 0;
- hg->yp = 0;
- hg->PRot = 0;
- hg->PtransX = 0;
- hg->PtransY = 0;
- Item->Ptext.insert(ReplStart+cx, hg);
+ Item->CPos = ReplStart+cx;
}
- Item->CPos = ReplStart+cx;
+ else
+ {
+ for (cs = 0; cs < repl.length(); ++cs)
+ Item->Ptext.at(ReplStart+cs)->ch = repl[cs];
+ for (uint cxx = cs; cxx < sear.length(); ++cxx)
+ Item->Ptext.remove(ReplStart+cs);
+ Item->CPos = ReplStart+cs;
+ }
}
- else
- {
- for (cs = 0; cs < repl.length(); ++cs)
- Item->Ptext.at(ReplStart+cs)->ch = repl[cs];
- for (uint cxx = cs; cxx < sear.length(); ++cxx)
- Item->Ptext.remove(ReplStart+cs);
- Item->CPos = ReplStart+cs;
- }
}
- }
- if (RStyle->isChecked())
- emit NewAbs(RStyleVal->currentItem());
- if (RFill->isChecked())
- Doc->ActPage->ItemTextBrush(RFillVal->currentText());
- if (RFillS->isChecked())
- Doc->ActPage->ItemTextBrushS(RFillSVal->getValue());
- if (RStroke->isChecked())
- Doc->ActPage->ItemTextPen(RStrokeVal->currentText());
- if (RStrokeS->isChecked())
- Doc->ActPage->ItemTextPenS(RStrokeSVal->getValue());
- if (RFont->isChecked())
- emit NewFont(RFontVal->currentText());
- if (RSize->isChecked())
- Doc->ActPage->chFSize(qRound(RSizeVal->value() * 10.0));
- if (REffect->isChecked())
- {
- int s = REffVal->getStyle();
- Doc->CurrentStyle = s;
- if (Item->Ptext.count() != 0)
+ if (RStyle->isChecked())
+ emit NewAbs(RStyleVal->currentItem());
+ if (RFill->isChecked())
+ Doc->ActPage->ItemTextBrush(RFillVal->currentText());
+ if (RFillS->isChecked())
+ Doc->ActPage->ItemTextBrushS(RFillSVal->getValue());
+ if (RStroke->isChecked())
+ Doc->ActPage->ItemTextPen(RStrokeVal->currentText());
+ if (RStrokeS->isChecked())
+ Doc->ActPage->ItemTextPenS(RStrokeSVal->getValue());
+ if (RFont->isChecked())
+ emit NewFont(RFontVal->currentText());
+ if (RSize->isChecked())
+ Doc->ActPage->chFSize(qRound(RSizeVal->value() * 10.0));
+ if (REffect->isChecked())
{
- for (uint a = 0; a < Item->Ptext.count(); ++a)
+ int s = REffVal->getStyle();
+ Doc->CurrentStyle = s;
+ if (Item->Ptext.count() != 0)
{
- if (Item->Ptext.at(a)->cselect)
+ for (uint a = 0; a < Item->Ptext.count(); ++a)
{
- Item->Ptext.at(a)->cstyle &= ~127;
- Item->Ptext.at(a)->cstyle |= s;
+ if (Item->Ptext.at(a)->cselect)
+ {
+ Item->Ptext.at(a)->cstyle &= ~127;
+ Item->Ptext.at(a)->cstyle |= s;
+ }
}
}
}
+ for (uint a = 0; a < Item->Ptext.count(); ++a)
+ Item->Ptext.at(a)->cselect = false;
+ }
+ else
+ {
+ if (ScApp->CurrStED != NULL)
+ {
+ if (RStyle->isChecked())
+ ScApp->CurrStED->newAlign(RStyleVal->currentItem());
+ if (RFill->isChecked())
+ ScApp->CurrStED->newTxFill(RFillVal->currentItem(), -1);
+ if (RFillS->isChecked())
+ ScApp->CurrStED->newTxFill(-1, RFillSVal->getValue());
+ if (RStroke->isChecked())
+ ScApp->CurrStED->newTxStroke(RStrokeVal->currentItem(), -1);
+ if (RStrokeS->isChecked())
+ ScApp->CurrStED->newTxStroke(-1, RStrokeSVal->getValue());
+ if (RFont->isChecked())
+ ScApp->CurrStED->newTxFont(RFontVal->currentText());
+ if (RSize->isChecked())
+ ScApp->CurrStED->newTxSize(RSizeVal->value());
+ if (REffect->isChecked())
+ ScApp->CurrStED->newTxStyle(REffVal->getStyle());
+ if (RText->isChecked())
+ {
+ disconnect(ScApp->CurrStED->Editor, SIGNAL(cursorPositionChanged(int, int)), ScApp->CurrStED, SLOT(updateProps(int, int)));
+ int PStart, PEnd, SelStart, SelEnd;
+ ScApp->CurrStED->Editor->getSelection(&PStart, &SelStart, &PEnd, &SelEnd);
+ ScApp->CurrStED->Editor->insChars(RTextVal->text());
+ ScApp->CurrStED->Editor->setSelection(PStart, SelStart, PEnd, SelEnd);
+ ScApp->CurrStED->Editor->removeSelectedText();
+ ScApp->CurrStED->Editor->setStyle(ScApp->CurrStED->Editor->CurrentStyle);
+ ScApp->CurrStED->Editor->setFarbe(ScApp->CurrStED->Editor->CurrTextFill, ScApp->CurrStED->Editor->CurrTextFillSh);
+ ScApp->CurrStED->Editor->insert(RTextVal->text());
+ connect(ScApp->CurrStED->Editor, SIGNAL(cursorPositionChanged(int, int)), ScApp->CurrStED, SLOT(updateProps(int, int)));
+ ScApp->CurrStED->newAlign(ScApp->CurrStED->Editor->CurrentABStil);
+ }
}
+ }
DoReplace->setEnabled(false);
AllReplace->setEnabled(false);
- for (uint a = 0; a < Item->Ptext.count(); ++a)
- Item->Ptext.at(a)->cselect = false;
+ slotDoSearch();
}
void SearchReplace::slotReplaceAll()
@@ -691,12 +803,15 @@
{
Doc->ActPage->slotDoCurs(false);
Doc->DoDrawing = false;
- do
- {
- slotDoReplace();
- slotDoSearch();
- }
- while (NotFound);
+ }
+ do
+ {
+ slotDoReplace();
+// slotDoSearch();
+ }
+ while (NotFound);
+ if (SMode)
+ {
Doc->DoDrawing = true;
Doc->ActPage->slotDoCurs(true);
Doc->ActPage->RefreshItem(Item, true);
@@ -709,6 +824,8 @@
STextVal->setEnabled(setter);
Word->setEnabled(setter);
CaseIgnore->setEnabled(setter);
+ if (setter)
+ STextVal->setFocus();
}
void SearchReplace::enableStyleSearch()
@@ -754,6 +871,8 @@
void SearchReplace::enableTxReplace()
{
RTextVal->setEnabled(RText->isChecked());
+ if (RText->isChecked())
+ RTextVal->setFocus();
}
void SearchReplace::enableStyleReplace()
/trunk/Scribus/scribus/scribus.cpp
401,6 → 401,8
Prefs.gs_exe = "gs";
Prefs.BaseGrid = 14.4;
Prefs.BaseOffs = 0.0;
Prefs.STEcolor = QColor(white);
Prefs.STEfont = font().toString();
PDef.Pname = "";
PDef.Dname = "";
PDef.Command = "";
676,7 → 678,7
SetKeyEntry(12, tr("Clear"), edid4, 0);
SetKeyEntry(13, tr("Select all"), edid5, CTRL+Key_A);
editMenu->insertSeparator();
Sear = editMenu->insertItem( tr("&Search/Replace..."), this, SLOT(SearchText()));
Sear = editMenu->insertItem(loadIcon("find16.png"), tr("&Search/Replace..."), this, SLOT(SearchText()));
editMenu->insertSeparator();
MenID = editMenu->insertItem( tr("C&olors..."), this , SLOT(slotEditColors()));
SetKeyEntry(14, tr("Colors..."), MenID, 0);
8339,12 → 8341,10
{
if (doc->ActPage->SelItem.count() != 0)
{
doc->DoDrawing = false;
b = doc->ActPage->SelItem.at(0);
if (doc->Trenner->Language != b->Language)
doc->Trenner->slotNewDict(b->Language);
doc->Trenner->slotHyphenate(b);
doc->DoDrawing = true;
}
}
}
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
192,7 → 192,10
Doku->DragElements.clear();
}
else
{
Doku->setUnModified();
Prog->slotDocCh();
}
Doku->loading = false;
}
 
/trunk/Scribus/scribus/plugins/fontpreview/fontpreview.cpp
6,13 → 6,11
return QObject::tr("&Fonts Preview");
}
 
 
int Type()
{
return 1;
}
 
 
/**
Create dialog and insert font into Style meny when user accepts.
*/
19,8 → 17,13
void Run(QWidget *d, ScribusApp *plug)
{
FontPreview *dlg = new FontPreview(plug, d, "dlg", TRUE, 0);
if (dlg->exec()==QDialog::Accepted)
plug->SetNewFont(dlg->fontList->currentText());
if (dlg->exec() == QDialog::Accepted)
{
if (plug->DLLinput == "")
plug->SetNewFont(dlg->fontList->currentText());
else
plug->DLLReturn = dlg->fontList->currentText();
}
delete dlg;
}
 
/trunk/Scribus/scribus/plugins/fontpreview/ui.cpp
70,10 → 70,15
fontList->sort();
 
QListBoxItem *item;
if (carrier->doc->ActPage->SelItem.count() != 0)
item = fontList->findItem(carrier->doc->CurrFont);
if (carrier->DLLinput != "")
item = fontList->findItem(carrier->DLLinput);
else
item = fontList->findItem(carrier->Prefs.DefFont);
{
if (carrier->doc->ActPage->SelItem.count() != 0)
item = fontList->findItem(carrier->doc->CurrFont);
else
item = fontList->findItem(carrier->Prefs.DefFont);
}
if (item != 0)
{
fontList_changed(item);
/trunk/Scribus/scribus/plugins/psimport/importps.cpp
233,7 → 233,10
Doku->DragElements.clear();
}
else
{
Doku->setUnModified();
Prog->slotDocCh();
}
}
else
{
/trunk/Scribus/scribus/story.h
216,10 → 216,12
 
QPopupMenu* fmenu;
QPopupMenu* emenu;
QPopupMenu* settingsMenu;
QToolBar* FileTools;
QToolButton* DatNeu;
QToolButton* DatOpe;
QToolButton* DatSav;
QToolButton* DatFin;
QToolButton* DatClo;
QToolButton* DatCan;
QToolButton* DatRel;
257,6 → 259,8
bool firstSet;
 
public slots:
void setBackPref();
void setFontPref();
void newTxFill(int c, int s);
void newTxStroke(int c, int s);
void newTxFont(const QString &f);
279,6 → 283,7
void Do_cut();
void Do_del();
void Do_insSp();
void Do_fontPrev();
void CopyAvail(bool u);
void updateTextFrame();
void SearchText();
/trunk/Scribus/scribus/scribusXml.cpp
2780,6 → 2780,8
dc.setAttribute("FRV", static_cast<int>(Vor->FramesShown));
dc.setAttribute("SHOWMARGIN", static_cast<int>(Vor->MarginsShown));
dc.setAttribute("SHOWBASE", static_cast<int>(Vor->BaseShown));
dc.setAttribute("STECOLOR", Vor->STEcolor.name());
dc.setAttribute("STEFONT", Vor->STEfont);
elem.appendChild(dc);
QDomElement dc1=docu.createElement("GRID");
dc1.setAttribute("MINOR",Vor->DminGrid);
3048,6 → 3050,10
Vorein->FramesShown = static_cast<bool>(QStoInt(dc.attribute("FRV","1")));
Vorein->MarginsShown = static_cast<bool>(QStoInt(dc.attribute("SHOWMARGIN","1")));
Vorein->BaseShown = static_cast<bool>(QStoInt(dc.attribute("SHOWBASE","1")));
if (dc.hasAttribute("STECOLOR"))
Vorein->STEcolor = QColor(dc.attribute("STECOLOR"));
if (dc.hasAttribute("STEFONT"))
Vorein->STEfont = dc.attribute("STEFONT");
}
if (dc.tagName()=="GRID")
{