r17035 by jghali - merge trunk revisions up to r17034
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 27 00:48:55 UTC 2011
Author: jghali
Date: Sun Nov 27 00:48:54 2011
New Revision: 17035
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17035
Log:
merge trunk revisions up to r17034
Modified:
branches/ScribusOIF/scribus/canvasmode.cpp
branches/ScribusOIF/scribus/canvasmode_edit.cpp
branches/ScribusOIF/scribus/canvasmode_objimport.cpp
branches/ScribusOIF/scribus/canvasmode_rotate.cpp
branches/ScribusOIF/scribus/fonts/scfontmetrics.cpp
branches/ScribusOIF/scribus/pageitem_pathtext.cpp
branches/ScribusOIF/scribus/pageitem_pathtext.h
branches/ScribusOIF/scribus/pdflib_core.cpp
branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
branches/ScribusOIF/scribus/plugins/import/cgm/importcgm.cpp
branches/ScribusOIF/scribus/plugins/import/cvg/importcvg.cpp
branches/ScribusOIF/scribus/plugins/import/drw/importdrw.cpp
branches/ScribusOIF/scribus/plugins/import/idml/importidmlimpl.cpp
branches/ScribusOIF/scribus/plugins/import/oodraw/oodrawimp.cpp
branches/ScribusOIF/scribus/plugins/import/pdf/importpdf.cpp
branches/ScribusOIF/scribus/plugins/import/wpg/importwpg.cpp
branches/ScribusOIF/scribus/plugins/scriptplugin/scriptercore.cpp
branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
branches/ScribusOIF/scribus/prefsmanager.cpp
branches/ScribusOIF/scribus/pslib.cpp
branches/ScribusOIF/scribus/scimagecacheproxy.cpp
branches/ScribusOIF/scribus/scimgdataloader_pdf.cpp
branches/ScribusOIF/scribus/scimgdataloader_psd.cpp
branches/ScribusOIF/scribus/scpageoutput.cpp
branches/ScribusOIF/scribus/scribusview.cpp
branches/ScribusOIF/scribus/ui/charselectenhanced.cpp
branches/ScribusOIF/scribus/ui/curvewidget.cpp
branches/ScribusOIF/scribus/ui/prefs_guides.cpp
branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
Modified: branches/ScribusOIF/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/canvasmode.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode.cpp Sun Nov 27 00:48:54 2011
@@ -64,6 +64,7 @@
#include "undomanager.h"
#include "units.h"
#include "util_icon.h"
+#include "util_math.h"
#include <QMdiArea>
#include <QMdiSubWindow>
@@ -228,6 +229,8 @@
psx->setClipping(true);
psx->setClipRegion(QRegion ( m_canvas->exposedRect() ) );
+ const double markWidth = 8.0 / m_canvas->scale();
+ const double halfMarkWidth = 4.0 / m_canvas->scale();
if (m_doc->m_Selection->isMultipleSelection())
{
PageItem *curItem(0);
@@ -240,32 +243,33 @@
}
psx->save();
- psx->setPen(m_pen["selection-group"]);
- psx->setBrush(m_brush["selection-group"]);
double lineAdjust(psx->pen().width()/m_canvas->scale());
double x, y, w, h;
m_doc->m_Selection->setGroupRect();
m_doc->m_Selection->getVisualGroupRect(&x, &y, &w, &h);
- const double markWidth = 4 / m_canvas->scale();
- const double halfMarkWidth = 2 / m_canvas->scale();
psx->translate(x,y);
x = -lineAdjust;
y = -lineAdjust;
// tt.start();
+ psx->setBrush(Qt::NoBrush);
+ psx->setPen(QPen(Qt::white, 3.0 / m_canvas->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
psx->drawRect(QRectF(x, y, w, h));
+ psx->setPen(m_pen["selection-group"]);
+ psx->setBrush(m_brush["selection-group"]);
+ psx->drawRect(QRectF(x, y, w, h));
if(drawHandles)
{
- psx->setBrush(m_brush["handle"]);
+ psx->setBrush(Qt::green);
psx->setPen(m_pen["handle"]);
psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
- psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
- psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
- psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w/2.0 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w/2.0 - halfMarkWidth, y, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w-markWidth, y+h/2.0 - halfMarkWidth, markWidth, markWidth));
psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
psx->drawRect(QRectF(x, y, markWidth, markWidth));
- psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x, y+h/2.0 - halfMarkWidth, markWidth, markWidth));
psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
}
// tg=tt.elapsed();
@@ -282,8 +286,6 @@
if (!m_doc->Items->contains(currItem))
continue;
psx->save();
- psx->setPen(m_pen["selection-group-inside"]);
- psx->setBrush(m_brush["selection-group-inside"]);
double lineAdjust(psx->pen().width()/m_canvas->scale());
double x, y, w, h;
w = currItem->visualWidth() ;
@@ -302,8 +304,12 @@
x = currItem->asLine() ? 0 : -lineAdjust;
y = currItem->asLine() ? 0 : -lineAdjust;
}
-
+ psx->setBrush(Qt::NoBrush);
+ psx->setPen(QPen(Qt::white, 3.0 / m_canvas->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
psx->drawRect(QRectF(x, y, w, h));
+ psx->setPen(m_pen["selection-group-inside"]);
+ psx->setBrush(m_brush["selection-group-inside"]);
+ psx->drawRect(QRectF(x, y, w, h));
psx->restore();
}
@@ -312,8 +318,6 @@
else if (m_doc->m_Selection->count() != 0)
{
// ds = "S" + QString::number(m_doc->m_Selection->count())+" ";
- const double markWidth = 4 / m_canvas->scale();
- const double halfMarkWidth = 2 / m_canvas->scale();
uint docSelectionCount = m_doc->m_Selection->count();
PageItem *currItem;
@@ -331,15 +335,23 @@
if (currItem->Parent != NULL)
{
QTransform t = currItem->getCombinedTransform();
- psx->setTransform(t, true);
- w = currItem->visualWidth();
- h = currItem->visualHeight();
+ psx->translate(t.dx(), t.dy());
+ psx->rotate(getRotationDFromMatrix(t));
+ double sx = 1.0;
+ double sy = 1.0;
+ getScaleFromMatrix(t, sx, sy);
+ // psx->setTransform(t, true);
+ w = currItem->visualWidth() * sx;
+ h = currItem->visualHeight() * sy;
// x = currItem->asLine() ? 0 : (currItem->visualXPos() - currItem->xPos() - lineAdjust);
// y = currItem->asLine() ? (h / -2.0) : (currItem->visualYPos() - currItem->yPos() - lineAdjust);
// w = currItem->width();
// h = currItem->height();
x = -lineAdjust;
y = -lineAdjust;
+ psx->setBrush(Qt::NoBrush);
+ psx->setPen(QPen(Qt::white, 3.0 / m_canvas->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+ psx->drawRect(QRectF(x, y, w, h));
psx->setPen(m_pen["selection-group-inside"]);
psx->setBrush(m_brush["selection-group-inside"]);
psx->drawRect(QRectF(x, y, w, h));
@@ -362,27 +374,33 @@
}
w = currItem->visualWidth();
h = currItem->visualHeight();
+ psx->setBrush(Qt::NoBrush);
+ psx->setPen(QPen(Qt::white, 3.0 / m_canvas->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+ psx->drawRect(QRectF(x, y, w, h));
+ psx->setPen(m_pen["selection"]);
+ psx->setBrush(m_brush["selection"]);
psx->drawRect(QRectF(x, y, w, h));
if(drawHandles && !currItem->locked())
{
- psx->setBrush(m_brush["handle"]);
- psx->setPen(m_pen["handle"]);
if(currItem->asLine())
{
psx->setRenderHint(QPainter::Antialiasing);
+ psx->setBrush(Qt::green);
+ psx->setPen(m_pen["handle"]);
psx->drawEllipse(QRectF(x+w-markWidth, y+h/2.0-markWidth, 2* markWidth,2* markWidth));
- // psx->setBrush(Qt::blue); // sometimes we forget which is what :)
psx->drawEllipse(QRectF(x-markWidth, y+h/2.0-markWidth, 2* markWidth, 2* markWidth));
}
else
{
+ psx->setBrush(Qt::green);
+ psx->setPen(m_pen["handle"]);
psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
- psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
- psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
- psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w/2.0 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w/2.0 - halfMarkWidth, y, markWidth, markWidth));
+ psx->drawRect(QRectF(x+w-markWidth, y+h/2.0 - halfMarkWidth, markWidth, markWidth));
psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
psx->drawRect(QRectF(x, y, markWidth, markWidth));
- psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
+ psx->drawRect(QRectF(x, y+h/2.0 - halfMarkWidth, markWidth, markWidth));
psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
}
}
Modified: branches/ScribusOIF/scribus/canvasmode_edit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/canvasmode_edit.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_edit.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_edit.cpp Sun Nov 27 00:48:54 2011
@@ -522,11 +522,6 @@
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
bool inText;
- double Rxp = 0;
- double Ryp = 0;
-// Not used said gcc
-// double Rxpd = 0;
-// double Rypd = 0;
PageItem *currItem;
m_canvas->PaintSizeRect(QRect());
FPoint npf, npf2;
@@ -543,8 +538,6 @@
Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
// QRect mpo(m->x()-m_doc->guidesPrefs().grabRad, m->y()-m_doc->guidesPrefs().grabRad, m_doc->guidesPrefs().grabRad*2, m_doc->guidesPrefs().grabRad*2);
// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
- Ryp = Myp;
- Rxp = Mxp;
SeRx = Mxp;
SeRy = Myp;
if (m->button() == Qt::MidButton)
Modified: branches/ScribusOIF/scribus/canvasmode_objimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/canvasmode_objimport.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_objimport.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_objimport.cpp Sun Nov 27 00:48:54 2011
@@ -128,8 +128,6 @@
void CanvasMode_ObjImport::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-
m->accept();
if (commonMouseMove(m))
@@ -189,7 +187,6 @@
void CanvasMode_ObjImport::mouseReleaseEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m_canvas->m_viewMode.m_MouseButtonPressed = false;
m_canvas->resetRenderMode();
m->accept();
Modified: branches/ScribusOIF/scribus/canvasmode_rotate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/canvasmode_rotate.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_rotate.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_rotate.cpp Sun Nov 27 00:48:54 2011
@@ -197,7 +197,6 @@
m_canvasPressCoord = mousePointDoc;
double Rxp = 0, Ryp = 0;
- double Rxpd = 0, Rypd = 0;
PageItem *currItem;
m_canvas->PaintSizeRect(QRect());
QRect tx;
@@ -210,10 +209,8 @@
m_view->registerMousePress(m->globalPos());
QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
Rxp = m_doc->ApplyGridF(m_canvasPressCoord).x();
- Rxpd = m_canvasPressCoord.x() - Rxp;
m_canvasPressCoord.setX( qRound(Rxp) );
Ryp = m_doc->ApplyGridF(m_canvasPressCoord).y();
- Rypd = m_canvasPressCoord.y() - Ryp;
m_canvasPressCoord.setY( qRound(Ryp) );
if (m->button() == Qt::MidButton)
{
@@ -384,15 +381,12 @@
m_canvasCurrCoord = mousePointDoc;
m_angleConstrained = false;
- double newX, newY;
PageItem *currItem;
QRect tx;
m->accept();
if (GetItem(&currItem))
{
- newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
- newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
m_angleConstrained = ((m->modifiers() & Qt::ControlModifier) != Qt::NoModifier);
if (m_view->moveTimerElapsed() && m_canvas->m_viewMode.m_MouseButtonPressed)
{
@@ -452,8 +446,6 @@
{
if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
{
- newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
- newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
QPoint startP = m_canvas->canvasToGlobal(m_canvasPressCoord);
m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
if (!m_view->redrawMarker->isVisible())
Modified: branches/ScribusOIF/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- branches/ScribusOIF/scribus/fonts/scfontmetrics.cpp (original)
+++ branches/ScribusOIF/scribus/fonts/scfontmetrics.cpp Sun Nov 27 00:48:54 2011
@@ -239,12 +239,13 @@
qreal uniEM = static_cast<qreal>(face->units_per_EM);
qreal m_descent = face->descender / uniEM;
- qreal m_height = face->height / uniEM;
- if (m_height == 0)
- m_height = (face->bbox.yMax - face->bbox.yMin) / uniEM;
+ qreal m_height = qMax(face->height / uniEM, (face->bbox.yMax - face->bbox.yMin) / uniEM);
+// if (m_height == 0)
+// m_height = (face->bbox.yMax - face->bbox.yMin) / uniEM;
int h = qRound(m_height * s) + 1;
qreal a = m_descent * s + 1;
+ a = 0;
int w = qRound((face->bbox.xMax - face->bbox.xMin) / uniEM) * s * (ts.length()+1);
if (w < 1)
w = s * (ts.length()+1);
Modified: branches/ScribusOIF/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/pageitem_pathtext.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_pathtext.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem_pathtext.cpp Sun Nov 27 00:48:54 2011
@@ -51,7 +51,7 @@
using namespace std;
PageItem_PathText::PageItem_PathText(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline)
- : PageItem(pa, PageItem::PathText, x, y, w, h, w2, fill, outline)
+ : PageItem(pa, PageItem::PathText, x, y, w, h, w2, fill, outline), itemRenderText(pa)
{
// firstChar = 0;
// MaxChars = itemText.length();
Modified: branches/ScribusOIF/scribus/pageitem_pathtext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/pageitem_pathtext.h
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_pathtext.h (original)
+++ branches/ScribusOIF/scribus/pageitem_pathtext.h Sun Nov 27 00:48:54 2011
@@ -46,6 +46,7 @@
virtual bool createInfoGroup(QFrame *, QGridLayout *);
virtual void applicableActions(QStringList& actionList);
virtual QString infoDescription();
+ StoryText itemRenderText;
protected:
virtual void DrawObj_Item(ScPainter *p, QRectF e);
Modified: branches/ScribusOIF/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/pdflib_core.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pdflib_core.cpp (original)
+++ branches/ScribusOIF/scribus/pdflib_core.cpp Sun Nov 27 00:48:54 2011
@@ -62,6 +62,7 @@
#include "pageitem.h"
#include "pageitem_textframe.h"
#include "pageitem_group.h"
+#include "pageitem_pathtext.h"
#include "pdfoptions.h"
#include "prefscontext.h"
#include "prefsmanager.h"
@@ -2395,75 +2396,6 @@
}
break;
case PageItem::PathText:
- if (ite->PoShow)
- {
- if (ite->PoLine.size() > 3)
- {
- PutPage("q\n");
- if ((ite->lineColor() != CommonStrings::None) || (!ite->NamedLStyle.isEmpty()) || (!ite->strokePattern().isEmpty()) || (ite->GrTypeStroke > 0))
- {
- if (((ite->lineTransparency() != 0) || (ite->lineBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
- PutPage(PDF_TransparenzStroke(ite));
- if (ite->NamedLStyle.isEmpty())
- {
- if (!ite->strokePattern().isEmpty())
- {
- if (ite->patternStrokePath)
- {
- QPainterPath path = ite->PoLine.toQPainterPath(false);
- PutPage(HandleBrushPattern(ite, path, pag, pag->pageNr()));
- }
- else
- {
- if (!PDF_PatternFillStroke(tmpOut, ite, 1))
- return false;
- PutPage(tmpOut);
- PutPage(SetClipPath(ite, false));
- PutPage("S\n");
- }
- }
- else if (ite->GrTypeStroke > 0)
- {
- if (!PDF_GradientFillStroke(tmpOut, ite, true))
- return false;
- PutPage("q\n");
- PutPage(tmpOut);
- PutPage(SetClipPath(ite, false));
- PutPage("S\n");
- PutPage("Q\n");
- }
- else
- {
- PutPage(SetClipPath(ite, false));
- PutPage("S\n");
- }
- }
- else
- {
- multiLine ml = doc.MLineStyles[ite->NamedLStyle];
- for (int it = ml.size()-1; it > -1; it--)
- {
- if ((ml[it].Color != CommonStrings::None) && (ml[it].Width != 0))
- {
- PutPage(setStrokeMulti(&ml[it]));
- PutPage(SetClipPath(ite, false));
- PutPage("S\n");
- }
- }
- }
- }
- PutPage("Q\n");
- }
- }
- if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
- {
- if (ite->GrMask > 0)
- PutPage("q\n");
- PutPage(PDF_TransparenzFill(ite));
- }
- PutPage(setTextSt(ite, pag->pageNr(), pag));
- if (ite->GrMask > 0)
- PutPage("Q\n");
break;
case PageItem::OSGFrame:
break;
@@ -3193,7 +3125,7 @@
if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
continue;
QString name = QString("/master_page_obj_%1_%2").arg(mPageIndex).arg(qHash(ite));
- if (! ite->asTextFrame())
+ if ((!ite->asTextFrame()) && (!ite->asPathText()))
PutPage(name+" Do\n");
else
{
@@ -4938,13 +4870,16 @@
}
else
{
+ ite->OwnPage = PNr;
+ ite->asPathText()->layout();
+ ite->OwnPage = savedOwnPage;
double CurX = 0;
- for (int d = ite->firstInFrame(); d <= ite->lastInFrame(); ++d)
- {
- const ScText * const hl = ite->itemText.item(d);
+ for (int d = 0; d < ite->asPathText()->itemRenderText.length(); ++d)
+ {
+ const ScText * const hl = ite->asPathText()->itemRenderText.item(d);
const QChar ch = hl->ch;
- const CharStyle& chstyle(ite->itemText.charStyle(d));
- const ParagraphStyle& pstyle(ite->itemText.paragraphStyle(d));
+ const CharStyle& chstyle(ite->asPathText()->itemRenderText.charStyle(d));
+ const ParagraphStyle& pstyle(ite->asPathText()->itemRenderText.paragraphStyle(d));
if (SpecialChars::isBreak(ch, true) || (ch == QChar(10)))
continue;
if (chstyle.effects() & ScStyle_SuppressSpace)
@@ -10118,7 +10053,6 @@
QString tmp;
int ResO;
BookMItem* ip;
- QTreeWidgetItem* pp;
QString Inhal = "";
QMap<int,QString> Inha;
if ((Bvie->topLevelItemCount() != 0) && (Options.Bookmarks) && (BookMinUse))
@@ -10126,7 +10060,6 @@
int Basis = ObjCounter - 1;
Outlines.Count = Bvie->topLevelItemCount();
ip = (BookMItem*)Bvie->topLevelItem(0);
- pp = Bvie->topLevelItem(0);
Outlines.First = ip->ItemNr+Basis;
Outlines.Last = ((BookMItem*) Bvie->topLevelItem(Outlines.Count - 1))->ItemNr+Basis;
QTreeWidgetItemIterator it(Bvie);
Modified: branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/ai/importai.cpp Sun Nov 27 00:48:54 2011
@@ -2124,10 +2124,6 @@
{
int indY = meshYSize - currentMeshYPos - 1;
int indX = currentMeshXPos;
- FPoint p2 = FPoint(meshNode1PointX, meshNode1PointY);
- FPoint p1 = FPoint(meshNode2PointX, meshNode2PointY);
- FPoint p4 = FPoint(meshNode3PointX, meshNode3PointY);
- FPoint p3 = FPoint(meshNode4PointX, meshNode4PointY);
meshGradientArray[indY+1][indX+1].gridPoint = FPoint(meshNode2PointX, meshNode2PointY);
meshGradientArray[indY+1][indX+1].controlTop = FPoint(meshNode2Control2X, meshNode2Control2Y);
meshGradientArray[indY+1][indX+1].controlLeft = FPoint(meshNode2Control1X, meshNode2Control1Y);
Modified: branches/ScribusOIF/scribus/plugins/import/cgm/importcgm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/cgm/importcgm.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/cgm/importcgm.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/cgm/importcgm.cpp Sun Nov 27 00:48:54 2011
@@ -132,7 +132,7 @@
interactive = (flags & LoadSavePlugin::lfInteractive);
importerFlags = flags;
cancel = false;
- double x, y, b, h;
+ double b, h;
bool ret = false;
CustColors.clear();
QFileInfo fi = QFileInfo(fName);
@@ -162,8 +162,6 @@
else
progressDialog = NULL;
/* Set default Page to size defined in Preferences */
- x = 0.0;
- y = 0.0;
b = 0.0;
h = 0.0;
if (progressDialog)
Modified: branches/ScribusOIF/scribus/plugins/import/cvg/importcvg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/cvg/importcvg.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/cvg/importcvg.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/cvg/importcvg.cpp Sun Nov 27 00:48:54 2011
@@ -128,7 +128,7 @@
interactive = (flags & LoadSavePlugin::lfInteractive);
importerFlags = flags;
cancel = false;
- double x, y, b, h;
+ double b, h;
bool ret = false;
CustColors.clear();
QFileInfo fi = QFileInfo(fName);
@@ -158,8 +158,6 @@
else
progressDialog = NULL;
/* Set default Page to size defined in Preferences */
- x = 0.0;
- y = 0.0;
b = 0.0;
h = 0.0;
if (progressDialog)
Modified: branches/ScribusOIF/scribus/plugins/import/drw/importdrw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/drw/importdrw.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/drw/importdrw.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/drw/importdrw.cpp Sun Nov 27 00:48:54 2011
@@ -145,7 +145,7 @@
interactive = (flags & LoadSavePlugin::lfInteractive);
importerFlags = flags;
cancel = false;
- double x, y, b, h;
+ double b, h;
bool ret = false;
QFileInfo fi = QFileInfo(fName);
if ( !ScCore->usingGUI() )
@@ -174,8 +174,6 @@
else
progressDialog = NULL;
/* Set default Page to size defined in Preferences */
- x = 0.0;
- y = 0.0;
b = 0.0;
h = 0.0;
if (progressDialog)
Modified: branches/ScribusOIF/scribus/plugins/import/idml/importidmlimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/idml/importidmlimpl.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/idml/importidmlimpl.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/idml/importidmlimpl.cpp Sun Nov 27 00:48:54 2011
@@ -70,18 +70,12 @@
// bool success = false;
bool showProgress;
//cancel = false;
- double x,y,b,h;
// bool ret = false;
QFileInfo fi = QFileInfo(fnameIn);
baseFile = QDir::cleanPath(QDir::toNativeSeparators(fi.absolutePath()+"/"));
if(!ScCore->usingGUI())
- showProgress=false;
+ showProgress = false;
/* Implement Progress Dialog Later */
-
- x = 0.0;
- y = 0.0;
- b = 0.0;
- h = 0.0;
/**
Here, first we parse the idml document, in the order designmap.xml,preferences.xml, fonts.xml, styles.xml, gradiant.xml, all the stories will be transformed into Story Objects, and finally all the master spreads and spreads.
Modified: branches/ScribusOIF/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/oodraw/oodrawimp.cpp Sun Nov 27 00:48:54 2011
@@ -1648,12 +1648,12 @@
QByteArray data = d.toLatin1();
const char *ptr = data.constData();
const char *end = data.constData() + data.length() + 1;
- double contrlx, contrly, curx, cury, subpathx, subpathy, tox, toy, x1, y1, x2, y2, xc, yc;
+ double contrlx, contrly, curx, cury, tox, toy, x1, y1, x2, y2, xc, yc;
double px1, py1, px2, py2, px3, py3;
bool relative;
FirstM = true;
char command = *(ptr++), lastCommand = ' ';
- subpathx = subpathy = curx = cury = contrlx = contrly = 0.0;
+ curx = cury = contrlx = contrly = 0.0;
while( ptr < end )
{
if( *ptr == ' ' )
@@ -1668,8 +1668,8 @@
ptr = getCoord( ptr, tox );
ptr = getCoord( ptr, toy );
WasM = true;
- subpathx = curx = relative ? curx + tox : tox;
- subpathy = cury = relative ? cury + toy : toy;
+ curx = relative ? curx + tox : tox;
+ cury = relative ? cury + toy : toy;
svgMoveTo(curx, cury );
break;
}
@@ -1715,8 +1715,6 @@
case 'z':
case 'Z':
{
-// curx = subpathx;
-// cury = subpathy;
svgClosePath(ite);
break;
}
Modified: branches/ScribusOIF/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/pdf/importpdf.cpp Sun Nov 27 00:48:54 2011
@@ -22,16 +22,12 @@
#include <cstdlib>
#include "commonstrings.h"
-#include "ui/customfdialog.h"
#include "loadsaveplugin.h"
-#include "ui/missing.h"
-#include "ui/multiprogressdialog.h"
#include "pagesize.h"
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "prefstable.h"
-#include "ui/propertiespalette.h"
#include "rawimage.h"
#include "scclocale.h"
#include "sccolorengine.h"
@@ -50,6 +46,10 @@
#include "util_icon.h"
#include "util_math.h"
+#include "ui/customfdialog.h"
+#include "ui/missing.h"
+#include "ui/multiprogressdialog.h"
+#include "ui/propertiespalette.h"
PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
{
Modified: branches/ScribusOIF/scribus/plugins/import/wpg/importwpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/import/wpg/importwpg.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/wpg/importwpg.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/wpg/importwpg.cpp Sun Nov 27 00:48:54 2011
@@ -492,7 +492,7 @@
interactive = (flags & LoadSavePlugin::lfInteractive);
importerFlags = flags;
cancel = false;
- double x, y, b, h;
+ double b, h;
bool ret = false;
QFileInfo fi = QFileInfo(fName);
if ( !ScCore->usingGUI() )
@@ -520,8 +520,6 @@
else
progressDialog = NULL;
/* Set default Page to size defined in Preferences */
- x = 0.0;
- y = 0.0;
b = 0.0;
h = 0.0;
if (progressDialog)
Modified: branches/ScribusOIF/scribus/plugins/scriptplugin/scriptercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/scriptplugin/scriptercore.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/scriptplugin/scriptercore.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/scriptplugin/scriptercore.cpp Sun Nov 27 00:48:54 2011
@@ -327,6 +327,7 @@
QClipboard *cp = QApplication::clipboard();
cp->setText(errorMsg);
ScCore->closeSplash();
+ qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
QMessageBox::warning(ScCore->primaryMainWindow(),
tr("Script error"),
"<qt><p>"
Modified: branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp Sun Nov 27 00:48:54 2011
@@ -36,6 +36,7 @@
#include "canvas.h"
#include "cmsettings.h"
#include "commonstrings.h"
+#include "pageitem_pathtext.h"
#include "prefsmanager.h"
#include "prefsfile.h"
#include "prefscontext.h"
@@ -978,15 +979,13 @@
}
}
}
- double x, y, wide;
+ double wide;
QString chstr;
- for (int a = 0; a < Item->itemText.length(); ++a)
- {
- x = 0.0;
- y = 0.0;
- ScText *hl = Item->itemText.item(a);
- const CharStyle& charStyle(Item->itemText.charStyle(a));
- chstr = Item->itemText.text(a,1);
+ for (int a = 0; a < Item->asPathText()->itemRenderText.length(); ++a)
+ {
+ ScText *hl = Item->asPathText()->itemRenderText.item(a);
+ const CharStyle& charStyle(Item->asPathText()->itemRenderText.charStyle(a));
+ chstr = Item->asPathText()->itemRenderText.text(a,1);
if ((chstr == QChar(13)) || (chstr == QChar(29)))
continue;
if (chstr == QChar(30))
Modified: branches/ScribusOIF/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/prefsmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/prefsmanager.cpp (original)
+++ branches/ScribusOIF/scribus/prefsmanager.cpp Sun Nov 27 00:48:54 2011
@@ -1868,7 +1868,6 @@
csm.findPaletteLocations();
csm.findPalettes();
csm.findUserPalettes();
- ScColor lf = ScColor();
QDomNode DOC=elem.firstChild();
if (!DOC.namedItem("CheckProfile").isNull())
appPrefs.verifierPrefs.checkerPrefsList.clear();
Modified: branches/ScribusOIF/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/pslib.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pslib.cpp (original)
+++ branches/ScribusOIF/scribus/pslib.cpp Sun Nov 27 00:48:54 2011
@@ -40,6 +40,7 @@
#include "scconfig.h"
#include "pluginapi.h"
#include "pageitem_latexframe.h"
+#include "pageitem_pathtext.h"
#include "prefsmanager.h"
#include "scclocale.h"
#include "sccolorengine.h"
@@ -327,7 +328,6 @@
bool PSLib::PutInterleavedImageMaskToStream(const QByteArray& image, const QByteArray& mask, bool gray)
{
int pending = 0;
- int bIndex = 0;
unsigned char bytes[1505];
const unsigned char* imageData = (const unsigned char*) image.constData();
const unsigned char* maskData = (const unsigned char*) mask.constData();
@@ -345,7 +345,6 @@
for (int i = 0; i < pixels; ++i)
{
- bIndex = 4 *i;
bytes[pending++] = maskData [i];
bytes[pending++] = *imageData++; // cyan/black
if (channels > 1)
@@ -1711,6 +1710,7 @@
double tsz;
int h, s, v, k;
int d;
+ int savedOwnPage;
ScText *hl;
QVector<double> dum;
QChar chstr;
@@ -2151,6 +2151,8 @@
}
break;
case PageItem::PathText:
+ if (master)
+ break;
if (c->PoShow)
{
if (c->PoLine.size() > 3)
@@ -2196,11 +2198,14 @@
}
#ifndef NLS_PROTO
#if 0 // FIXME_OIF
-
- for (d = c->firstInFrame(); d <= c->lastInFrame(); ++d)
- {
- hl = c->itemText.item(d);
- const CharStyle & style(c->itemText.charStyle(d));
+ savedOwnPage = c->OwnPage;
+ c->OwnPage = PNr-1;
+ c->asPathText()->layout();
+ c->OwnPage = savedOwnPage;
+ for (d = 0; d < c->asPathText()->itemRenderText.length(); ++d)
+ {
+ hl = c->asPathText()->itemRenderText.item(d);
+ const CharStyle & style(c->asPathText()->itemRenderText.charStyle(d));
if ((hl->ch == QChar(13)) || (hl->ch == QChar(30)) || (hl->ch == QChar(9)) || (hl->ch == QChar(28)))
continue;
QPointF tangt = QPointF( cos(hl->PRot), sin(hl->PRot) );
@@ -2331,11 +2336,7 @@
PS_save();
PS_translate(0, -(tsz / 10.0));
double Ulen = hl->glyph.xadvance;
- double Upos, Uwid, kern;
- if (style.effects() & ScStyle_StartOfLine)
- kern = 0;
- else
- kern = style.fontSize() * style.tracking() / 10000.0;
+ double Upos, Uwid;
if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
{
if (style.underlineOffset() != -1)
@@ -2402,11 +2403,7 @@
PS_save();
PS_translate(0, -(tsz / 10.0));
double Ulen = hl->glyph.xadvance;
- double Upos, Uwid, kern;
- if (hl->effects() & ScStyle_StartOfLine)
- kern = 0;
- else
- kern = style.fontSize() * style.tracking() / 10000.0;
+ double Upos, Uwid;
if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
{
if (style.strikethruOffset() != -1)
@@ -2479,11 +2476,7 @@
{
PS_save();
double Ulen = hl->glyph.xadvance;
- double Upos, Uwid, kern;
- if (style.effects() & ScStyle_StartOfLine)
- kern = 0;
- else
- kern = style.fontSize() * style.tracking() / 10000.0;
+ double Upos, Uwid;
if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
{
if (style.underlineOffset() != -1)
@@ -2556,11 +2549,7 @@
{
PS_save();
double Ulen = hl->glyph.xadvance;
- double Upos, Uwid, kern;
- if (hl->effects() & ScStyle_StartOfLine)
- kern = 0;
- else
- kern = style.fontSize() * style.tracking() / 10000.0;
+ double Upos, Uwid;
if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
{
if (style.strikethruOffset() != -1)
@@ -2691,6 +2680,8 @@
continue;
if ((!a->pageName().isEmpty()) && (c->asTextFrame()))
continue;
+ if ((!a->pageName().isEmpty()) && (c->asPathText()))
+ continue;
if ((!a->pageName().isEmpty()) && (c->asImageFrame()) && ((sep) || (!farb)))
continue;
//if ((!Art) && (view->SelItem.count() != 0) && (!c->Select))
@@ -2724,6 +2715,8 @@
if (c->LayerID != ll.ID)
continue;
if ((!a->pageName().isEmpty()) && (c->asTextFrame()))
+ continue;
+ if ((!a->pageName().isEmpty()) && (c->asPathText()))
continue;
if ((!a->pageName().isEmpty()) && (c->asImageFrame()) && ((sep) || (!farb)))
continue;
@@ -2814,7 +2807,7 @@
ScQApp->processEvents();
if ((ite->LayerID != layer.ID) || (!ite->printEnabled()))
continue;
- if (!(ite->asTextFrame()) && !(ite->asImageFrame()))
+ if (!(ite->asTextFrame()) && !(ite->asImageFrame()) && !(ite->asPathText()))
{
int mpIndex = Doc->MasterNames[page->MPageNam];
PS_UseTemplate(QString("mp_obj_%1_%2").arg(mpIndex).arg(qHash(ite)));
@@ -2911,6 +2904,448 @@
}
PS_restore();
}
+ else if (ite->asPathText())
+ {
+ double tsz;
+ int d;
+ ScText *hl;
+ QChar chstr;
+ PS_save();
+ PS_translate(ite->xPos() - mPage->xOffset(), mPage->height() - (ite->yPos() - mPage->yOffset()));
+ if (ite->PoShow)
+ {
+ if (ite->PoLine.size() > 3)
+ {
+ PS_save();
+ if (ite->NamedLStyle.isEmpty()) //&& (c->lineWidth() != 0.0))
+ {
+ if ((!ite->strokePattern().isEmpty()) && (ite->patternStrokePath))
+ {
+ QPainterPath path = ite->PoLine.toQPainterPath(false);
+ HandleBrushPattern(ite, path, mPage, PNr, sep, farb, ic, gcr, true);
+ }
+ else
+ {
+ SetClipPath(&ite->PoLine, false);
+ if (!ite->strokePattern().isEmpty())
+ HandleStrokePattern(ite);
+ else if (ite->GrTypeStroke > 0)
+ HandleGradientFillStroke(ite, gcr);
+ else if (ite->lineColor() != CommonStrings::None)
+ putColor(ite->lineColor(), ite->lineShade(), false);
+ }
+ }
+ else
+ {
+ multiLine ml = Doc->MLineStyles[ite->NamedLStyle];
+ for (int it = ml.size()-1; it > -1; it--)
+ {
+ if (ml[it].Color != CommonStrings::None) //&& (ml[it].Width != 0))
+ {
+ SetColor(ml[it].Color, ml[it].Shade, &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ PS_setlinewidth(ml[it].Width);
+ PS_setcapjoin(static_cast<Qt::PenCapStyle>(ml[it].LineEnd), static_cast<Qt::PenJoinStyle>(ml[it].LineJoin));
+ PS_setdash(static_cast<Qt::PenStyle>(ml[it].Dash), 0, dum);
+ SetClipPath(&ite->PoLine, false);
+ putColor(ml[it].Color, ml[it].Shade, false);
+ }
+ }
+ }
+ PS_restore();
+ }
+ }
+ #ifndef NLS_PROTO
+ #if 0 // FIXME_OIF
+ int savedOwnPage = ite->OwnPage;
+ ite->OwnPage = PNr;
+ ite->asPathText()->layout();
+ ite->OwnPage = savedOwnPage;
+ for (d = 0; d < ite->asPathText()->itemRenderText.length(); ++d)
+ {
+ hl = ite->asPathText()->itemRenderText.item(d);
+ const CharStyle & style(ite->asPathText()->itemRenderText.charStyle(d));
+ if ((hl->ch == QChar(13)) || (hl->ch == QChar(30)) || (hl->ch == QChar(9)) || (hl->ch == QChar(28)))
+ continue;
+ QPointF tangt = QPointF( cos(hl->PRot), sin(hl->PRot) );
+ tsz = style.fontSize();
+ chstr = hl->ch;
+ if (hl->ch == QChar(29))
+ chstr = ' ';
+ if (hl->ch == QChar(0xA0))
+ chstr = ' ';
+ if (style.effects() & 32)
+ {
+ if (chstr.toUpper() != chstr)
+ chstr = chstr.toUpper();
+ }
+ if (style.effects() & 64)
+ {
+ if (chstr.toUpper() != chstr)
+ {
+ tsz = style.fontSize() * Doc->typographicPrefs().valueSmallCaps / 100;
+ chstr = chstr.toUpper();
+ }
+ }
+ if (style.effects() & 1)
+ tsz = style.fontSize() * Doc->typographicPrefs().scalingSuperScript / 100;
+ if (style.effects() & 2)
+ tsz = style.fontSize() * Doc->typographicPrefs().scalingSubScript / 100;
+ if (style.fillColor() != CommonStrings::None)
+ {
+ SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ }
+ if (hl->hasObject())
+ {
+ PS_save();
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, -hl->PDx, 0.0) + "\n");
+ if (ite->textPathFlipped)
+ {
+ PutStream("[1 0 0 -1 0 0]\n");
+ PutStream("[0 0 0 0 0 0] concatmatrix\n"); //???????
+ }
+ if (ite->textPathType == 0)
+ PutStream( MatrixToStr(tangt.x(), -tangt.y(), -tangt.y(), -tangt.x(), hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 1)
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 2)
+ {
+ double a = 1;
+ double b = -1;
+ if (tangt.x()< 0)
+ {
+ a = -1;
+ b = 1;
+ }
+ if (fabs(tangt.x()) > 0.1)
+ PutStream( MatrixToStr(a, (tangt.y() / tangt.x()) * b, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else
+ PutStream( MatrixToStr(a, 4.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ }
+ PutStream("[0.0 0.0 0.0 0.0 0.0 0.0] concatmatrix\nconcat\n");
+ // PS_translate(0, (tsz / 10.0));
+ if (ite->BaseOffs != 0)
+ PS_translate(0, -ite->BaseOffs);
+ if (style.scaleH() != 1000)
+ PS_scale(style.scaleH() / 1000.0, 1);
+ QList<PageItem*> emG = hl->embedded.getGroupedItems();
+ for (int em = 0; em < emG.count(); ++em)
+ {
+ PageItem* embedded = emG.at(em);
+ PS_save();
+ PS_translate(embedded->gXpos * (style.scaleH() / 1000.0), ((embedded->gHeight * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)));
+ if (style.baselineOffset() != 0)
+ PS_translate(0, embedded->gHeight * (style.baselineOffset() / 1000.0));
+ if (style.scaleH() != 1000)
+ PS_scale(style.scaleH() / 1000.0, 1);
+ if (style.scaleV() != 1000)
+ PS_scale(1, style.scaleV() / 1000.0);
+ ProcessItem(Doc, mPage, embedded, PNr, sep, farb, ic, gcr, true, true);
+ PS_restore();
+ }
+ PS_restore();
+ continue;
+ }
+ /* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
+ if (FontSubsetMap.contains(style.font().scName()))
+ {
+ // uint chr = chstr.unicode();
+ uint chr = style.font().char2CMap(chstr);
+ if (style.font().canRender(chstr))
+ {
+ PS_save();
+ if (style.fillColor() != CommonStrings::None)
+ {
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, -hl->PDx, 0.0) + "\n");
+ if (ite->textPathFlipped)
+ {
+ PutStream("[1.0 0.0 0.0 -1.0 0.0 0.0]\n");
+ PutStream("[0.0 0.0 0.0 0.0 0.0 0.0] concatmatrix\n");
+ }
+ if (ite->textPathType == 0)
+ PutStream( MatrixToStr(tangt.x(), -tangt.y(), -tangt.y(), -tangt.x(), hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 1)
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 2)
+ {
+ double a = 1;
+ double b = -1;
+ if (tangt.x() < 0)
+ {
+ a = -1;
+ b = 1;
+ }
+ if (fabs(tangt.x()) > 0.1)
+ PutStream( MatrixToStr(a, (tangt.y() / tangt.x()) * b, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else
+ PutStream( MatrixToStr(a, 4.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ }
+ PutStream("[0.0 0.0 0.0 0.0 0.0 0.0] concatmatrix\nconcat\n");
+ PS_translate(0, (tsz / 10.0));
+ if (ite->BaseOffs != 0)
+ PS_translate(0, -ite->BaseOffs);
+ if (hl->glyph.xoffset !=0 || hl->glyph.yoffset != 0)
+ PS_translate(hl->glyph.xoffset, -hl->glyph.yoffset);
+ if (style.scaleH() != 1000)
+ PS_scale(style.scaleH() / 1000.0, 1);
+ if (((style.effects() & ScStyle_Underline) && !SpecialChars::isBreak(chstr)) //FIXME && (chstr != QChar(13)))
+ || ((style.effects() & ScStyle_UnderlineWords) && !chstr.isSpace() && !SpecialChars::isBreak(chstr)))
+ {
+ PS_save();
+ PS_translate(0, -(tsz / 10.0));
+ double Ulen = hl->glyph.xadvance;
+ double Upos, Uwid;
+ if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
+ {
+ if (style.underlineOffset() != -1)
+ Upos = (style.underlineOffset() / 1000.0) * (style.font().descent(style.fontSize() / 10.0));
+ else
+ Upos = style.font().underlinePos(style.fontSize() / 10.0);
+ if (style.underlineWidth() != -1)
+ Uwid = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
+ else
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ else
+ {
+ Upos = style.font().underlinePos(style.fontSize() / 10.0);
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ if (style.baselineOffset() != 0)
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
+ if (style.fillColor() != CommonStrings::None)
+ {
+ SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ }
+ PS_setlinewidth(Uwid);
+ if (style.effects() & ScStyle_Subscript)
+ {
+ PS_moveto(hl->glyph.xoffset , Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, Upos);
+ }
+ else
+ {
+ PS_moveto(hl->glyph.xoffset , hl->glyph.yoffset+Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, hl->glyph.yoffset+Upos);
+ }
+ putColor(style.fillColor(), style.fillShade(), false);
+ PS_restore();
+ }
+ if (chstr != ' ')
+ {
+ if ((style.effects() & ScStyle_Shadowed) && (style.strokeColor() != CommonStrings::None))
+ {
+ PS_save();
+ PS_translate(style.fontSize() * style.shadowXOffset() / 10000.0, style.fontSize() * style.shadowYOffset() / 10000.0);
+ putColorNoDraw(style.strokeColor(), style.strokeShade(), gcr);
+ PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, false);
+ PS_restore();
+ }
+ putColorNoDraw(style.fillColor(), style.fillShade(), gcr);
+ PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, false);
+ if ((style.effects() & ScStyle_Outline))
+ {
+ if ((style.strokeColor() != CommonStrings::None) && ((tsz * style.outlineWidth() / 10000.0) != 0))
+ {
+ PS_save();
+ PS_setlinewidth(tsz * style.outlineWidth() / 10000.0);
+ putColorNoDraw(style.strokeColor(), style.strokeShade(), gcr);
+ PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, true);
+ PS_restore();
+ }
+ }
+ }
+ if ((style.effects() & ScStyle_Strikethrough) && (chstr != SpecialChars::PARSEP))
+ {
+ PS_save();
+ PS_translate(0, -(tsz / 10.0));
+ double Ulen = hl->glyph.xadvance;
+ double Upos, Uwid;
+ if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
+ {
+ if (style.strikethruOffset() != -1)
+ Upos = (style.strikethruOffset() / 1000.0) * (style.font().ascent(style.fontSize() / 10.0));
+ else
+ Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
+ if (style.strikethruWidth() != -1)
+ Uwid = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
+ else
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ else
+ {
+ Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ if (style.baselineOffset() != 0)
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
+ if (style.fillColor() != CommonStrings::None)
+ {
+ SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ }
+ PS_setlinewidth(Uwid);
+ PS_moveto(hl->glyph.xoffset , Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, Upos);
+ putColor(style.fillColor(), style.fillShade(), false);
+ PS_restore();
+ }
+ }
+ PS_restore();
+ }
+ }
+ else
+ {
+ uint glyph = hl->glyph.glyph;
+ PS_selectfont(style.font().replacementName(), tsz / 10.0);
+ PS_save();
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, -hl->PDx, 0.0) + "\n");
+ if (ite->textPathFlipped)
+ {
+ PutStream("[1.0 0.0 0.0 -1.0 0.0 0.0]\n");
+ PutStream("[0.0 0.0 0.0 0.0 0.0 0.0] concatmatrix\n");
+ }
+ if (ite->textPathType == 0)
+ PutStream( MatrixToStr(tangt.x(), -tangt.y(), -tangt.y(), -tangt.x(), hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 1)
+ PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else if (ite->textPathType == 2)
+ {
+ double a = 1;
+ double b = -1;
+ if (tangt.x() < 0)
+ {
+ a = -1;
+ b = 1;
+ }
+ if (fabs(tangt.x()) > 0.1)
+ PutStream( MatrixToStr(a, (tangt.y() / tangt.x()) * b, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ else
+ PutStream( MatrixToStr(a, 4.0, 0.0, -1.0, hl->PtransX, -hl->PtransY) + "\n");
+ }
+ PutStream("[0.0 0.0 0.0 0.0 0.0 0.0] concatmatrix\nconcat\n");
+ if (ite->BaseOffs != 0)
+ PS_translate(0, -ite->BaseOffs);
+ if (hl->glyph.xoffset !=0 || hl->glyph.yoffset != 0)
+ PS_translate(hl->glyph.xoffset, -hl->glyph.yoffset);
+ if (((style.effects() & ScStyle_Underline) && !SpecialChars::isBreak(chstr)) //FIXME && (chstr != QChar(13)))
+ || ((style.effects() & ScStyle_UnderlineWords) && !chstr.isSpace() && !SpecialChars::isBreak(chstr)))
+ {
+ PS_save();
+ double Ulen = hl->glyph.xadvance;
+ double Upos, Uwid;
+ if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
+ {
+ if (style.underlineOffset() != -1)
+ Upos = (style.underlineOffset() / 1000.0) * (style.font().descent(style.fontSize() / 10.0));
+ else
+ Upos = style.font().underlinePos(style.fontSize() / 10.0);
+ if (style.underlineWidth() != -1)
+ Uwid = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
+ else
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ else
+ {
+ Upos = style.font().underlinePos(style.fontSize() / 10.0);
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ if (style.baselineOffset() != 0)
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
+ if (style.fillColor() != CommonStrings::None)
+ {
+ SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ }
+ PS_setlinewidth(Uwid);
+ if (style.effects() & ScStyle_Subscript)
+ {
+ PS_moveto(hl->glyph.xoffset , Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, Upos);
+ }
+ else
+ {
+ PS_moveto(hl->glyph.xoffset , hl->glyph.yoffset+Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, hl->glyph.yoffset+Upos);
+ }
+ putColor(style.fillColor(), style.fillShade(), false);
+ PS_restore();
+ }
+ if (chstr != ' ')
+ {
+ if ((style.effects() & ScStyle_Shadowed) && (style.strokeColor() != CommonStrings::None))
+ {
+ PS_save();
+ PS_translate(style.fontSize() * style.shadowXOffset() / 10000.0, style.fontSize() * style.shadowYOffset() / 10000.0);
+ PS_show_xyG(style.font().replacementName(), glyph, 0, 0, style.strokeColor(), style.strokeShade());
+ PS_restore();
+ }
+ PS_show_xyG(style.font().replacementName(), glyph, 0, 0, style.fillColor(), style.fillShade());
+ if ((style.effects() & ScStyle_Outline))
+ {
+ if ((style.strokeColor() != CommonStrings::None) && ((tsz * style.outlineWidth() / 10000.0) != 0))
+ {
+ uint gl = style.font().char2CMap(chstr);
+ FPointArray gly = style.font().glyphOutline(gl);
+ QTransform chma;
+ chma.scale(tsz / 100.0, tsz / 100.0);
+ gly.map(chma);
+ PS_save();
+ PS_setlinewidth(tsz * style.outlineWidth() / 10000.0);
+ PS_translate(0, tsz / 10.0);
+ SetColor(style.strokeColor(), style.strokeShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ SetClipPath(&gly);
+ PS_closepath();
+ putColor(style.strokeColor(), style.strokeShade(), false);
+ PS_restore();
+ }
+ }
+ }
+ if ((style.effects() & ScStyle_Strikethrough) && (chstr != SpecialChars::PARSEP))
+ {
+ PS_save();
+ double Ulen = hl->glyph.xadvance;
+ double Upos, Uwid;
+ if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
+ {
+ if (style.strikethruOffset() != -1)
+ Upos = (style.strikethruOffset() / 1000.0) * (style.font().ascent(style.fontSize() / 10.0));
+ else
+ Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
+ if (style.strikethruWidth() != -1)
+ Uwid = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
+ else
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ else
+ {
+ Upos = style.font().strikeoutPos(style.fontSize() / 10.0);
+ Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
+ }
+ if (style.baselineOffset() != 0)
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
+ if (style.fillColor() != CommonStrings::None)
+ if (style.fillColor() != CommonStrings::None)
+ {
+ SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
+ PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
+ }
+ PS_setlinewidth(Uwid);
+ PS_moveto(hl->glyph.xoffset , Upos);
+ PS_lineto(hl->glyph.xoffset+Ulen, Upos);
+ putColor(style.fillColor(), style.fillShade(), false);
+ PS_restore();
+ }
+ PS_restore();
+ }
+ }
+ #endif
+ #endif
+ PS_restore();
+ }
if (!success)
break;
}
@@ -2987,6 +3422,8 @@
if (item->LayerID != layer.ID)
continue;
if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
+ continue;
+ if ((!page->pageName().isEmpty()) && (item->asPathText()))
continue;
if ((!page->pageName().isEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
continue;
@@ -3025,6 +3462,8 @@
if (item->LayerID != layer.ID)
continue;
if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
+ continue;
+ if ((!page->pageName().isEmpty()) && (item->asPathText()))
continue;
if ((!page->pageName().isEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
continue;
@@ -4595,11 +5034,7 @@
{
// double Ulen = cstyle.font().glyphWidth(glyph, cstyle.fontSize()) * glyphs.scaleH;
double Ulen = glyphs.xadvance;
- double Upos, lw, kern;
- if (cstyle.effects() & ScStyle_StartOfLine)
- kern = 0;
- else
- kern = cstyle.fontSize() * cstyle.tracking() / 10000.0;
+ double Upos, lw;
if ((cstyle.underlineOffset() != -1) || (cstyle.underlineWidth() != -1))
{
if (cstyle.underlineOffset() != -1)
@@ -4728,11 +5163,7 @@
{
// double Ulen = cstyle.font().glyphWidth(glyph, cstyle.fontSize()) * glyphs.scaleH;
double Ulen = glyphs.xadvance;
- double Upos, lw, kern;
- if (cstyle.effects() & 16384)
- kern = 0;
- else
- kern = cstyle.fontSize() * cstyle.tracking() / 10000.0;
+ double Upos, lw;
if ((cstyle.strikethruOffset() != -1) || (cstyle.strikethruWidth() != -1))
{
if (cstyle.strikethruOffset() != -1)
Modified: branches/ScribusOIF/scribus/scimagecacheproxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/scimagecacheproxy.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scimagecacheproxy.cpp (original)
+++ branches/ScribusOIF/scribus/scimagecacheproxy.cpp Sun Nov 27 00:48:54 2011
@@ -422,7 +422,6 @@
QString oldBase;
QString oldRefName;
QString oldImgName;
- bool haveOldMeta = false;
bool haveOldRef = false;
ScLockedFileRW meta(absolutePath(metaName()));
@@ -463,7 +462,6 @@
return false;
}
- haveOldMeta = true;
oldRefName = oldBase + "." + referenceSuffix;
oldImgName = oldBase + "." + imageSuffix;
Modified: branches/ScribusOIF/scribus/scimgdataloader_pdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/scimgdataloader_pdf.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scimgdataloader_pdf.cpp (original)
+++ branches/ScribusOIF/scribus/scimgdataloader_pdf.cpp Sun Nov 27 00:48:54 2011
@@ -116,7 +116,6 @@
bool ScImgDataLoader_PDF::preloadAlphaChannel(const QString& fn, int page, int gsRes, bool& hasAlpha)
{
- float xres, yres;
// short resolutionunit = 0;
initialize();
@@ -130,8 +129,6 @@
QString tmpFile = QDir::toNativeSeparators(ScPaths::getTempFileDir() + "sc.png");
QString picFile = QDir::toNativeSeparators(fn);
QStringList args;
- xres = gsRes;
- yres = gsRes;
args.append("-r"+QString::number(gsRes));
// args.append("-sOutputFile=\""+tmpFile + "\"");
args.append("-sOutputFile="+tmpFile);
Modified: branches/ScribusOIF/scribus/scimgdataloader_psd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/scimgdataloader_psd.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scimgdataloader_psd.cpp (original)
+++ branches/ScribusOIF/scribus/scimgdataloader_psd.cpp Sun Nov 27 00:48:54 2011
@@ -135,7 +135,6 @@
{
ScColorMgmtEngine engine(ScCore->defaultEngine);
bool isCMYK = false;
- float xres = 72.0, yres = 72.0;
if (!QFile::exists(fn))
return false;
bool valid = m_imageInfoRecord.isRequest;
@@ -181,8 +180,6 @@
m_imageInfoRecord.colorspace = ColorSpaceGray;
else if (header.color_mode == CM_DUOTONE)
m_imageInfoRecord.colorspace = ColorSpaceDuotone;
- xres = m_imageInfoRecord.xres;
- yres = m_imageInfoRecord.yres;
f.close();
if (thumbnail)
{
Modified: branches/ScribusOIF/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/scpageoutput.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scpageoutput.cpp (original)
+++ branches/ScribusOIF/scribus/scpageoutput.cpp Sun Nov 27 00:48:54 2011
@@ -906,11 +906,9 @@
FPoint point = FPoint(0, 0);
FPoint tangent = FPoint(0, 0);
uint seg = 0;
- double chs, dx, segLen = 0;
double CurX = item->textToFrameDistLeft(); // item->CurX = item->textToFrameDistLeft()
- double CurY = 0;
QString actFill, actStroke;
- double actFillShade, actStrokeShade;
+ double actFillShade, actStrokeShade, dx;
StoryText& itemText = item->itemText;
if (item->pathTextShowFrame())
{
@@ -945,7 +943,6 @@
CurX += itemText.item(0)->fontSize() * itemText.charStyle(0).tracking() / 10000.0;
totalTextLen += itemText.charStyle(0).fontSize() * itemText.charStyle(0).tracking() / 10000.0;
}
- segLen = item->PoLine.lenPathSeg(seg);
for (int a = 0; a < itemText.length(); ++a)
{
hl = itemText.item(a);
@@ -986,13 +983,11 @@
int currPathIndex = 0;
for (int a = item->firstInFrame(); a < itemText.length(); ++a)
{
- CurY = 0;
hl = itemText.item(a);
chstr = hl->ch;
if (chstr[0] == SpecialChars::PAGENUMBER || chstr[0] == SpecialChars::PARSEP || chstr[0] == SpecialChars::PAGECOUNT
|| chstr[0] == SpecialChars::TAB || chstr[0] == SpecialChars::LINEBREAK)
continue;
- chs = hl->fontSize();
if (a < itemText.length()-1)
chstr += itemText.text(a+1, 1);
hl->glyph.yadvance = 0;
@@ -1202,10 +1197,9 @@
FPoint ColBound;
QRegion cm;
int a;
- double lineCorr;
QString chstr, chstr2, chstr3;
ScText *hl;
- double desc, asce, tabDist;
+ double desc, asce;
QRect e2;
painter->save();
@@ -1222,10 +1216,6 @@
painter->setupPolygon(&item->PoLine);
fillPath(item, painter, clip);
}
- if (item->lineColor() != CommonStrings::None)
- lineCorr = item->lineWidth() / 2.0;
- else
- lineCorr = 0;
if ((item->isAnnotation()) && (item->annotation().Type() == 2) && (!item->Pfile.isEmpty()) && (item->PictureIsAvailable) && (item->imageShown()) && (item->annotation().UseIcons()))
{
painter->save();
@@ -1253,7 +1243,6 @@
for (uint ll=0; ll < item->itemText.lines(); ++ll)
{
LineSpec ls = item->itemText.line(ll);
- tabDist = ls.x;
double CurX = ls.x;
for (a = ls.firstItem; a <= ls.lastItem; ++a)
{
@@ -1317,7 +1306,6 @@
else*/
CurX += hl->glyph.wide();
}
- tabDist = CurX;
}
}
}
Modified: branches/ScribusOIF/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/scribusview.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.cpp (original)
+++ branches/ScribusOIF/scribus/scribusview.cpp Sun Nov 27 00:48:54 2011
@@ -3434,14 +3434,14 @@
if (currItem->asPathText())
{
- for (int a = 0; a < currItem->itemText.length(); ++a)
+ for (int a = 0; a < currItem->asPathText()->itemRenderText.length(); ++a)
{
pts.resize(0);
x = 0.0;
y = 0.0;
- ScText * hl = currItem->itemText.item(a);
- const CharStyle& charStyle(currItem->itemText.charStyle(a));
- chstr = currItem->itemText.text(a,1);
+ ScText * hl = currItem->asPathText()->itemRenderText.item(a);
+ const CharStyle& charStyle(currItem->asPathText()->itemRenderText.charStyle(a));
+ chstr = currItem->asPathText()->itemRenderText.text(a,1);
if ((chstr == QChar(13)) || (chstr == QChar(29)))
continue;
if (chstr == QChar(30))
@@ -3493,8 +3493,8 @@
chma.scale(hl->glyph.scaleH * charStyle.fontSize() / 100.00, hl->glyph.scaleV * charStyle.fontSize() / 100.0);
if (currItem->reversed())
{
- if (a < currItem->itemText.length()-1)
- wide = hl->font().charWidth(chstr[0], hl->fontSize(), currItem->itemText.text(a+1));
+ if (a < currItem->asPathText()->itemRenderText.length()-1)
+ wide = hl->font().charWidth(chstr[0], hl->fontSize(), currItem->asPathText()->itemRenderText.text(a+1));
else
wide = hl->font().charWidth(chstr[0], hl->fontSize());
chma3.scale(-1, 1);
@@ -3603,7 +3603,7 @@
bb->PoLine.map(finalMat * shmap);
bb->setFillColor(hl->strokeColor());
bb->setFillShade(hl->strokeShade());
- if (currItem->itemText.charStyle(a).effects() & ScStyle_Outline)
+ if (currItem->asPathText()->itemRenderText.charStyle(a).effects() & ScStyle_Outline)
{
bb->setLineColor(hl->strokeColor());
bb->setLineShade(hl->strokeShade());
@@ -3637,7 +3637,7 @@
bb->setRotation(currItem->rotation());
bb->setFillColor(hl->fillColor());
bb->setFillShade(hl->fillShade());
- if (currItem->itemText.charStyle(a).effects() & ScStyle_Outline)
+ if (currItem->asPathText()->itemRenderText.charStyle(a).effects() & ScStyle_Outline)
{
bb->setLineColor(hl->strokeColor());
bb->setLineShade(hl->strokeShade());
Modified: branches/ScribusOIF/scribus/ui/charselectenhanced.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/ui/charselectenhanced.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/charselectenhanced.cpp (original)
+++ branches/ScribusOIF/scribus/ui/charselectenhanced.cpp Sun Nov 27 00:48:54 2011
@@ -70,7 +70,6 @@
{
// tDebug("scanFont start");
uint charcode;
- uint gindex;
QString gname;
allClasses.clear();
charactersFull.clear();
@@ -107,7 +106,6 @@
it != glyphs.end(); ++it)
{
charcode = it.value().first.unicode();
- gindex = it.key();
gname = it.value().second;
charactersFull.append(charcode);
if ((charcode >= 0x0020) && (charcode <= 0x007F))
Modified: branches/ScribusOIF/scribus/ui/curvewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/ui/curvewidget.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/curvewidget.cpp (original)
+++ branches/ScribusOIF/scribus/ui/curvewidget.cpp Sun Nov 27 00:48:54 2011
@@ -52,11 +52,9 @@
void KCurve::paintEvent(QPaintEvent *)
{
- int x, y;
+ int x = 0;
int wWidth = width() - 1;
int wHeight = height() - 1;
- x = 0;
- y = 0;
// Drawing selection or all histogram values.
QPainter p1;
p1.begin(this);
Modified: branches/ScribusOIF/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/ui/prefs_guides.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_guides.cpp (original)
+++ branches/ScribusOIF/scribus/ui/prefs_guides.cpp Sun Nov 27 00:48:54 2011
@@ -44,7 +44,7 @@
int renderStackCount = renderStackOrder.count();
for (int r = renderStackCount - 1; r > -1; r--)
{
- QListWidgetItem *item;
+ QListWidgetItem *item(0);
int it = renderStackOrder[r];
if (it == 4)
item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
@@ -56,8 +56,11 @@
item = new QListWidgetItem( tr("Baseline Grid"), guidePlacementListBox);
else if (it == 0)
item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
- item->setData(Qt::UserRole, it);
- item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+ if (item)
+ {
+ item->setData(Qt::UserRole, it);
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+ }
}
int grTy = gridTypeCombo->currentIndex();
gridTypeCombo->clear();
@@ -104,7 +107,7 @@
int renderStackCount = renderStackOrder.count();
for (int r = renderStackCount - 1; r > -1; r--)
{
- QListWidgetItem *item;
+ QListWidgetItem *item(0);
int it = renderStackOrder[r];
if (it == 4)
item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
@@ -116,8 +119,11 @@
item = new QListWidgetItem( tr("BaselineGrid"), guidePlacementListBox);
else if (it == 0)
item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
- item->setData(Qt::UserRole, it);
- item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+ if (item)
+ {
+ item->setData(Qt::UserRole, it);
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+ }
}
guideSnapDistanceSpinBox->setValue(prefsData->guidesPrefs.guideRad);
guideGrabRadiusSpinBox->setValue(prefsData->guidesPrefs.grabRadius);
Modified: branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17035&path=/branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertywidget_dropcap.cpp Sun Nov 27 00:48:54 2011
@@ -1,167 +1,167 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-
-#include "propertywidget_dropcap.h"
-#include "scribus.h"
-#include "units.h"
-#include "util.h"
-
-PropertyWidget_DropCap::PropertyWidget_DropCap(QWidget *parent) : QFrame(parent)
-{
- m_ScMW = 0;
-
- setupUi(this);
- setFrameStyle(QFrame::Box | QFrame::Plain);
- setLineWidth(1);
- layout()->setAlignment( Qt::AlignTop );
-
- languageChange();
-
- if (!m_doc) return;
- dropCapCharStyleCombo->updateFormatList();
-}
-
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+#include "propertywidget_dropcap.h"
+#include "scribus.h"
+#include "units.h"
+#include "util.h"
+
+PropertyWidget_DropCap::PropertyWidget_DropCap(QWidget *parent) : QFrame(parent)
+{
+ m_ScMW = 0;
+
+ setupUi(this);
+ setFrameStyle(QFrame::Box | QFrame::Plain);
+ setLineWidth(1);
+ layout()->setAlignment( Qt::AlignTop );
+
+ languageChange();
+
+ if (!m_doc) return;
+ dropCapCharStyleCombo->updateFormatList();
+}
+
void PropertyWidget_DropCap::setMainWindow(ScribusMainWindow* mw)
{
m_ScMW = mw;
connect(m_ScMW, SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
-}
-
-void PropertyWidget_DropCap::setDoc(ScribusDoc *doc)
-{
- m_doc = doc;
- dropCapCharStyleCombo->setDoc(doc);
-
- if (!m_doc)
- return;
-
- m_unitRatio = m_doc->unitRatio();
- m_unitIndex = m_doc->unitIndex();
- dropCapOffset->setSuffix(unitGetSuffixFromIndex(0));
-}
-
-void PropertyWidget_DropCap::unitChange()
-{
- if (!m_doc)
- return;
-
- m_unitRatio = m_doc->unitRatio();
- m_unitIndex = m_doc->unitIndex();
-
- dropCapOffset->blockSignals(true);
- dropCapOffset->setNewUnit( m_unitIndex );
- dropCapOffset->blockSignals(false);
-}
-
-void PropertyWidget_DropCap::updateCharStyles()
-{
- dropCapCharStyleCombo->updateFormatList();
-}
-
-void PropertyWidget_DropCap::displayCharStyle(const QString& name)
-{
- bool blocked = dropCapCharStyleCombo->blockSignals(true);
- dropCapCharStyleCombo->setFormat(name);
- dropCapCharStyleCombo->blockSignals(blocked);
-}
-
-void PropertyWidget_DropCap::enableDropCap(bool enable)
-{
- dropCapLines->setEnabled(enable);
- dropCapOffset->setEnabled(enable);
- dropCapCharStyleCombo->setEnabled(enable);
-}
-
-void PropertyWidget_DropCap::updateStyle(const ParagraphStyle& newCurrent)
-{
- disconnectSignals ();
- dropCapBox->setChecked(newCurrent.hasDropCap());
- dropCapLines->setValue(newCurrent.dropCapLines());
- dropCapOffset->setValue(newCurrent.dropCapOffset() * m_unitRatio);
- displayCharStyle(newCurrent.dcCharStyleName());
- connectSignals ();
-}
-
-void PropertyWidget_DropCap::connectSignals()
-{
- connect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()));
- connect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()));
- connect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()));
- connect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
-}
-
-void PropertyWidget_DropCap::disconnectSignals()
-{
- disconnect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()));
- disconnect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()));
- disconnect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()));
- disconnect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
-}
-
-void PropertyWidget_DropCap::handleDropCapUse()
-{
- if (!m_doc) return;
- ParagraphStyle newStyle;
- newStyle.setHasDropCap(dropCapBox->isChecked());
- m_doc->itemSelection_ApplyParagraphStyle(newStyle);
- enableDropCap(dropCapBox->isChecked());
-}
-
-void PropertyWidget_DropCap::handleDropCapLines()
-{
- if (!m_doc) return;
- ParagraphStyle newStyle;
- newStyle.setDropCapLines(dropCapLines->value());
- m_doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-void PropertyWidget_DropCap::handleDropCapOffset()
-{
- if (!m_doc) return;
- ParagraphStyle newStyle;
- newStyle.setDropCapOffset(dropCapOffset->value());
- m_doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
-void PropertyWidget_DropCap::handleDropCapCharStyle()
-{
- if (!m_doc) return;
- ParagraphStyle newStyle;
- QString name = dropCapCharStyleCombo->currentText();
- if (!name.isEmpty())
- newStyle.setDcCharStyleName(name);
- m_doc->itemSelection_ApplyParagraphStyle(newStyle);
-}
-
+}
+
+void PropertyWidget_DropCap::setDoc(ScribusDoc *doc)
+{
+ m_doc = doc;
+ dropCapCharStyleCombo->setDoc(doc);
+
+ if (!m_doc)
+ return;
+
+ m_unitRatio = m_doc->unitRatio();
+ m_unitIndex = m_doc->unitIndex();
+ dropCapOffset->setSuffix(unitGetSuffixFromIndex(0));
+}
+
+void PropertyWidget_DropCap::unitChange()
+{
+ if (!m_doc)
+ return;
+
+ m_unitRatio = m_doc->unitRatio();
+ m_unitIndex = m_doc->unitIndex();
+
+ dropCapOffset->blockSignals(true);
+ dropCapOffset->setNewUnit( m_unitIndex );
+ dropCapOffset->blockSignals(false);
+}
+
+void PropertyWidget_DropCap::updateCharStyles()
+{
+ dropCapCharStyleCombo->updateFormatList();
+}
+
+void PropertyWidget_DropCap::displayCharStyle(const QString& name)
+{
+ bool blocked = dropCapCharStyleCombo->blockSignals(true);
+ dropCapCharStyleCombo->setFormat(name);
+ dropCapCharStyleCombo->blockSignals(blocked);
+}
+
+void PropertyWidget_DropCap::enableDropCap(bool enable)
+{
+ dropCapLines->setEnabled(enable);
+ dropCapOffset->setEnabled(enable);
+ dropCapCharStyleCombo->setEnabled(enable);
+}
+
+void PropertyWidget_DropCap::updateStyle(const ParagraphStyle& newCurrent)
+{
+ disconnectSignals ();
+ dropCapBox->setChecked(newCurrent.hasDropCap());
+ dropCapLines->setValue(newCurrent.dropCapLines());
+ dropCapOffset->setValue(newCurrent.dropCapOffset() * m_unitRatio);
+ displayCharStyle(newCurrent.dcCharStyleName());
+ connectSignals ();
+}
+
+void PropertyWidget_DropCap::connectSignals()
+{
+ connect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()));
+ connect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()));
+ connect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()));
+ connect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
+}
+
+void PropertyWidget_DropCap::disconnectSignals()
+{
+ disconnect(dropCapBox, SIGNAL(stateChanged(int)), this, SLOT(handleDropCapUse()));
+ disconnect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines()));
+ disconnect(dropCapOffset, SIGNAL(valueChanged(double)), this, SLOT(handleDropCapOffset()));
+ disconnect(dropCapCharStyleCombo, SIGNAL(activated(int)), this, SLOT(handleDropCapCharStyle()));
+}
+
+void PropertyWidget_DropCap::handleDropCapUse()
+{
+ if (!m_doc) return;
+ ParagraphStyle newStyle;
+ newStyle.setHasDropCap(dropCapBox->isChecked());
+ m_doc->itemSelection_ApplyParagraphStyle(newStyle);
+ enableDropCap(dropCapBox->isChecked());
+}
+
+void PropertyWidget_DropCap::handleDropCapLines()
+{
+ if (!m_doc) return;
+ ParagraphStyle newStyle;
+ newStyle.setDropCapLines(dropCapLines->value());
+ m_doc->itemSelection_ApplyParagraphStyle(newStyle);
+}
+
+void PropertyWidget_DropCap::handleDropCapOffset()
+{
+ if (!m_doc) return;
+ ParagraphStyle newStyle;
+ newStyle.setDropCapOffset(dropCapOffset->value());
+ m_doc->itemSelection_ApplyParagraphStyle(newStyle);
+}
+
+void PropertyWidget_DropCap::handleDropCapCharStyle()
+{
+ if (!m_doc) return;
+ ParagraphStyle newStyle;
+ QString name = dropCapCharStyleCombo->currentText();
+ if (!name.isEmpty())
+ newStyle.setDcCharStyleName(name);
+ m_doc->itemSelection_ApplyParagraphStyle(newStyle);
+}
+
void PropertyWidget_DropCap::handleUpdateRequest(int updateFlags)
{
if (updateFlags & reqCharStylesUpdate)
updateCharStyles();
if (updateFlags & reqStyleComboDocUpdate)
setDoc(m_doc ? m_doc : 0);
-}
-
-void PropertyWidget_DropCap::changeEvent(QEvent *e)
-{
- if (e->type() == QEvent::LanguageChange)
- {
- languageChange();
- return;
- }
- QWidget::changeEvent(e);
-}
-
-void PropertyWidget_DropCap::languageChange()
-{
- dropCapBox->setText(tr("Use Drop Caps"));
- dropCapLinesLabel->setText(tr("Drop Caps lines"));
- dropCapOffsetLabel->setText(tr("Drop Caps offset"));
- dropCapCharStyleLabel->setText(tr("Drop Cap use character style..."));
- dropCapCharStyleCombo->setToolTip("<qt>" + tr("Choose chracter style or leave blank for use default paragraph style"));
-}
-
+}
+
+void PropertyWidget_DropCap::changeEvent(QEvent *e)
+{
+ if (e->type() == QEvent::LanguageChange)
+ {
+ languageChange();
+ return;
+ }
+ QWidget::changeEvent(e);
+}
+
+void PropertyWidget_DropCap::languageChange()
+{
+ dropCapBox->setText(tr("Use Drop Caps"));
+ dropCapLinesLabel->setText(tr("Drop Caps lines"));
+ dropCapOffsetLabel->setText(tr("Drop Caps offset"));
+ dropCapCharStyleLabel->setText(tr("Drop Cap use character style..."));
+ dropCapCharStyleCombo->setToolTip("<qt>" + tr("Choose chracter style or leave blank for use default paragraph style"));
+}
+
More information about the scribus-commit
mailing list