1 diff -urN scribus-1.2.0.final/scribus/newfile.cpp ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/newfile.cpp
2 --- scribus-1.2.0.final/scribus/newfile.cpp 2004-08-25 17:41:13.000000000 -0500
3 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/newfile.cpp 2004-08-31 18:27:31.000000000 -0500
9 +// definitions for clear reading the code - pv
12 +#define USERFORMAT 30
14 extern QPixmap loadIcon(QString nam);
16 NewDoc::NewDoc( QWidget* parent, preV *Vor )
19 QString units[] = { tr(" pt"), tr(" mm"), tr(" in"), tr(" p")};
21 - ein = units[Vor->Einheit];
22 - switch (Vor->Einheit)
33 - Umrech = 1.0 / 72.0;
37 - Umrech = 1.0 / 12.0;
41 + // pv - removed switch hell
42 + double umr[] = {1.0, 0.3527777, (1.0 / 72.0), (1.0 / 12.0)};
43 + int dec[] = {2, 3, 4, 2};
45 einheit = Vor->Einheit;
46 + ein = units[einheit];
47 + Umrech = umr[einheit];
48 + decimals = dec[einheit];
50 setCaption( tr( "New Document" ) );
51 setIcon(loadIcon("AppIcon.png"));
54 void NewDoc::code_repeat(int m)
56 + // #869 pv - auto-flip landscape/portrait based on the height:width ratio
57 + if (ComboBox1->currentItem() == USERFORMAT)
59 + if (Breite->value() > Hoehe->value())
60 + ComboBox2->setCurrentItem(LANDSCAPE);
62 + ComboBox2->setCurrentItem(PORTRAIT);
70 double AltUmrech = Umrech;
71 double val, oldB, oldBM, oldH, oldHM;
72 + // pv - removed switch hell
73 + double umr[] = {1.0, 0.3527777, (1.0 / 72.0), (1.0 / 12.0)};
74 + int dec[] = {100, 1000, 10000, 100};
76 disconnect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int)));
77 disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int)));
78 disconnect(TopR, SIGNAL(valueChanged(int)), this, SLOT(setTop(int)));
80 Hoehe->getValues(&oldH, &oldHM, &decimals, &val);
94 - Umrech = 1.0 / 72.0;
98 - Umrech = 1.0 / 12.0;
106 Breite->setValues(oldB * Umrech, oldBM * Umrech, decimals, Pagebr * Umrech);
107 Hoehe->setValues(oldH * Umrech, oldHM * Umrech, decimals, Pageho * Umrech);
110 void NewDoc::ExitOK()
112 - if (ComboBox1->currentItem() == 30)
114 Pagebr = Breite->value() / Umrech;
115 Pageho = Hoehe->value() / Umrech;
121 - double br = Pagebr;
128 void NewDoc::setOrien(int ori)
129 @@ -423,10 +402,10 @@
130 Breite->setValue(Hoehe->value());
137 + // #869 pv - defined constants added + code repeat (check w/h)
138 + (ori == PORTRAIT) ? Orient = PORTRAIT : Orient = LANDSCAPE;
139 + code_repeat(666); // just check w/h
141 RightR->setMaxValue(Breite->value() - LeftR->value());
142 LeftR->setMaxValue(Breite->value() - RightR->value());
143 TopR->setMaxValue(Hoehe->value() - BottomR->value());
146 void NewDoc::setPGsize()
148 - if (ComboBox1->currentItem() == 30)
149 + if (ComboBox1->currentItem() == USERFORMAT)
150 setSize(ComboBox1->currentItem());
153 @@ -458,15 +437,22 @@
154 355, 250, 178, 125, 89, 462, 298, 312, 542, 595, 1224, 612, 612, 792};
155 int page_y[] = {3368, 2380, 1684, 1190, 842, 595, 421, 297, 210, 148, 4008, 2836, 2004, 1418, 1002, 709,
156 501, 355, 250, 178, 125, 649, 683, 624, 720, 935, 792, 1008, 792, 1225};
158 + if (gr == USERFORMAT)
160 Breite->setEnabled(true);
161 Hoehe->setEnabled(true);
165 + // pv - correct handling of the disabled spins
166 + if (ComboBox2->currentItem() == PORTRAIT)
171 + Pagebr = page_y[gr];
172 + Pageho = page_x[gr];
175 Breite->setValue(Pagebr * Umrech);
176 Hoehe->setValue(Pageho * Umrech);
177 diff -urN scribus-1.2.0.final/scribus/page.cpp ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/page.cpp
178 --- scribus-1.2.0.final/scribus/page.cpp 2004-08-25 17:27:25.000000000 -0500
179 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/page.cpp 2004-08-31 18:27:31.000000000 -0500
180 @@ -5464,12 +5464,42 @@
193 + b = doku->ActPage->SelItem.at(0);
194 + if ((m->button() == MidButton) && (b->PType == 4))
199 + cc = QApplication::clipboard()->text(QClipboard::Selection);
201 + cc = QApplication::clipboard()->text(QClipboard::Clipboard);
204 + Serializer *ss = new Serializer("");
206 + int st = doku->CurrentABStil;
207 + ss->GetText(b, st, doku->Vorlagen[st].Font, doku->Vorlagen[st].FontSize, true);
209 + if (doku->Trenner->AutoCheck)
210 + doku->Trenner->slotHyphenate(b);
214 + if (ScApp->Buffer2.startsWith("<SCRIBUSTEXT"))
215 + ScApp->slotEditPaste();
222 b = doku->ActPage->SelItem.at(0);
224 @@ -5494,6 +5524,34 @@
225 qApp->setOverrideCursor(QCursor(ArrowCursor), true);
230 + if ((m->button() == MidButton) && (b->PType == 4))
235 + cc = QApplication::clipboard()->text(QClipboard::Selection);
237 + cc = QApplication::clipboard()->text(QClipboard::Clipboard);
240 + Serializer *ss = new Serializer("");
242 + int st = doku->CurrentABStil;
243 + ss->GetText(b, st, doku->Vorlagen[st].Font, doku->Vorlagen[st].FontSize, true);
245 + if (doku->Trenner->AutoCheck)
246 + doku->Trenner->slotHyphenate(b);
250 + if (ScApp->Buffer2.startsWith("<SCRIBUSTEXT"))
251 + ScApp->slotEditPaste();
259 diff -urN scribus-1.2.0.final/scribus/scribus.cpp ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/scribus.cpp
260 --- scribus-1.2.0.final/scribus/scribus.cpp 2004-08-23 17:06:34.000000000 -0500
261 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/scribus.cpp 2004-08-31 18:27:32.000000000 -0500
262 @@ -4233,9 +4233,9 @@
265 #if QT_VERSION >= 0x030100
266 - cc = ClipB->text(QClipboard::Clipboard);
267 + cc = ClipB->text(QClipboard::Selection);
269 - cc = ClipB->text(QClipboard::Selection);
270 + cc = ClipB->text(QClipboard::Clipboard);
274 diff -urN scribus-1.2.0.final/scribus/seiten.cpp ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/seiten.cpp
275 --- scribus-1.2.0.final/scribus/seiten.cpp 2004-08-01 10:42:03.000000000 -0500
276 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/seiten.cpp 2004-08-31 18:27:32.000000000 -0500
277 @@ -813,16 +813,18 @@
283 - p.setBackgroundColor(white);
284 - p.setBackgroundMode(QPainter::OpaqueMode);
285 - p.setPen(QPen(black, 1, SolidLine, FlatCap, MiterJoin));
286 - p.setFont(QFont("Helvetica", 12, QFont::Bold));
287 - tmp = tmp.setNum(nr+1);
288 - QRect b = p.boundingRect(3,0, ret.width(), ret.height(), Qt::AlignCenter, tmp);
289 - p.drawRect(QRect(b.x()-2, b.y()-2, b.width()+4, b.height()+4));
290 - p.drawText(b, Qt::AlignCenter, tmp);
295 + p.setBackgroundColor(white);
296 + p.setBackgroundMode(QPainter::OpaqueMode);
297 + p.setPen(QPen(black, 1, SolidLine, FlatCap, MiterJoin));
298 + p.setFont(QFont("Helvetica", 12, QFont::Bold));
299 + tmp = tmp.setNum(nr+1);
300 + QRect b = p.boundingRect(3,0, ret.width(), ret.height(), Qt::AlignCenter, tmp);
301 + p.drawRect(QRect(b.x()-2, b.y()-2, b.width()+4, b.height()+4));
302 + p.drawText(b, Qt::AlignCenter, tmp);
307 diff -urN scribus-1.2.0.final/scribus/story.cpp ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/story.cpp
308 --- scribus-1.2.0.final/scribus/story.cpp 2004-08-24 16:47:54.000000000 -0500
309 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/story.cpp 2004-08-31 18:27:32.000000000 -0500
311 viewport()->setAcceptDrops(false);
313 connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipChange()));
314 + connect(QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(SelClipChange()));
317 void SEditor::keyPressEvent(QKeyEvent *k)
318 @@ -1171,11 +1172,13 @@
319 if ((hasSelectedText()) && (selectedText() != ""))
321 disconnect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipChange()));
322 + disconnect(QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(SelClipChange()));
323 tBuffer = selectedText();
325 QApplication::clipboard()->setText(tBuffer, QClipboard::Clipboard);
327 connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipChange()));
328 + connect(QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(SelClipChange()));
331 emit SideBarUp(true);
332 @@ -1198,19 +1201,29 @@
334 emit SideBarUp(false);
337 getCursorPosition(&p, &i);
343 - QString data = QApplication::clipboard()->text(QClipboard::Clipboard);
344 + QString data = QApplication::clipboard()->text(QClipboard::Selection);
346 + data = QApplication::clipboard()->text(QClipboard::Clipboard);
349 data.replace(QRegExp("\r"), "");
350 data.replace(QRegExp("\n"), QChar(13));
357 + emit SideBarUp(true);
364 emit SideBarUp(true);
365 emit SideBarUpdate();
366 @@ -1226,6 +1239,12 @@
370 +void SEditor::SelClipChange()
376 void SEditor::ClipChange()
379 diff -urN scribus-1.2.0.final/scribus/story.h ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/story.h
380 --- scribus-1.2.0.final/scribus/story.h 2004-08-20 16:38:23.000000000 -0500
381 +++ ../../../2004-08-31/scribus-1.2.0.final+cvs20040831/scribus/story.h 2004-08-31 18:27:32.000000000 -0500
386 + void SelClipChange();
389 void setProps(int, int);