/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp |
---|
5690,10 → 5690,10 |
{ |
doc->dontResize = true; |
PageItem_Table *tableitem = currItem->asTable(); |
int rows = attrs.valueAsInt("Rows",1); |
int cols = attrs.valueAsInt("Columns",1); |
tableitem->insertRows(1,rows-1); |
tableitem->insertColumns(1,cols-1); |
int rows = attrs.valueAsInt("Rows", 1); |
int cols = attrs.valueAsInt("Columns", 1); |
tableitem->insertRows(1, rows - 1); |
tableitem->insertColumns(1, cols - 1); |
tableitem->setStyle(attrs.valueAsString("TableStyle")); |
// QString rowPositions(attrs.valueAsString("RowPositions")); |
// QStringList slRowPositions=rowPositions.split(" "); |
/trunk/Scribus/scribus/plugins/gettext/docxim/docxim.cpp |
---|
131,28 → 131,28 |
QDomElement docElem = designMapDom.documentElement(); |
for (QDomElement drawPag = docElem.firstChildElement(); !drawPag.isNull(); drawPag = drawPag.nextSiblingElement()) |
{ |
if (drawPag.tagName() == "a:themeElements") |
if (drawPag.tagName() != "a:themeElements") |
continue; |
for (QDomElement spf = drawPag.firstChildElement(); !spf.isNull(); spf = spf.nextSiblingElement()) |
{ |
for (QDomElement spf = drawPag.firstChildElement(); !spf.isNull(); spf = spf.nextSiblingElement()) |
if (spf.tagName() != "a:fontScheme") |
continue; |
for (QDomElement spr = spf.firstChildElement(); !spr.isNull(); spr = spr.nextSiblingElement()) |
{ |
if (spf.tagName() == "a:fontScheme") |
if (spr.tagName() == "a:minorFont") |
{ |
for (QDomElement spr = spf.firstChildElement(); !spr.isNull(); spr = spr.nextSiblingElement()) |
{ |
if (spr.tagName() == "a:minorFont") |
{ |
QDomElement sty = spr.firstChildElement("a:latin"); |
if (!sty.isNull()) |
themeFont1 = sty.attribute("typeface"); |
} |
else if (spr.tagName() == "a:majorFont") |
{ |
QDomElement sty = spr.firstChildElement("a:latin"); |
if (!sty.isNull()) |
themeFont2 = sty.attribute("typeface"); |
} |
} |
QDomElement sty = spr.firstChildElement("a:latin"); |
if (!sty.isNull()) |
themeFont1 = sty.attribute("typeface"); |
} |
else if (spr.tagName() == "a:majorFont") |
{ |
QDomElement sty = spr.firstChildElement("a:latin"); |
if (!sty.isNull()) |
themeFont2 = sty.attribute("typeface"); |
} |
} |
} |
} |
317,17 → 317,17 |
{ |
if (spt.tagName() == "w:t") |
{ |
QString m_txt = spt.text(); |
if (m_txt.count() > 0) |
QString txt = spt.text(); |
if (txt.length() > 0) |
{ |
m_txt.replace(QChar(10), SpecialChars::LINEBREAK); |
m_txt.replace(QChar(12), SpecialChars::FRAMEBREAK); |
m_txt.replace(QChar(30), SpecialChars::NBHYPHEN); |
m_txt.replace(QChar(160), SpecialChars::NBSPACE); |
txt.replace(QChar(10), SpecialChars::LINEBREAK); |
txt.replace(QChar(12), SpecialChars::FRAMEBREAK); |
txt.replace(QChar(30), SpecialChars::NBHYPHEN); |
txt.replace(QChar(160), SpecialChars::NBSPACE); |
int posT = textItem->itemText.length(); |
textItem->itemText.insertChars(posT, m_txt); |
textItem->itemText.insertChars(posT, txt); |
textItem->itemText.applyStyle(posT, currentParagraphStyle); |
textItem->itemText.applyCharStyle(posT, m_txt.length(), currentParagraphStyle.charStyle()); |
textItem->itemText.applyCharStyle(posT, txt.length(), currentParagraphStyle.charStyle()); |
} |
} |
else if (spt.tagName() == "w:tab") |
625,16 → 625,16 |
{ |
if (spt.tagName() == "w:t") |
{ |
QString m_txt = spt.text(); |
if (m_txt.count() > 0) |
QString txt = spt.text(); |
if (txt.length() > 0) |
{ |
m_txt.replace(QChar(10), SpecialChars::LINEBREAK); |
m_txt.replace(QChar(12), SpecialChars::FRAMEBREAK); |
m_txt.replace(QChar(30), SpecialChars::NBHYPHEN); |
m_txt.replace(QChar(160), SpecialChars::NBSPACE); |
textItem->itemText.insertChars(textItem->itemText.length(), m_txt); |
txt.replace(QChar(10), SpecialChars::LINEBREAK); |
txt.replace(QChar(12), SpecialChars::FRAMEBREAK); |
txt.replace(QChar(30), SpecialChars::NBHYPHEN); |
txt.replace(QChar(160), SpecialChars::NBSPACE); |
textItem->itemText.insertChars(textItem->itemText.length(), txt); |
textItem->itemText.applyStyle(textItem->itemText.length(), currentParagraphStyle); |
textItem->itemText.applyCharStyle(textItem->itemText.length(), m_txt.length(), currentParagraphStyle.charStyle()); |
textItem->itemText.applyCharStyle(textItem->itemText.length(), txt.length(), currentParagraphStyle.charStyle()); |
} |
} |
else if (spt.tagName() == "w:tab") |
680,10 → 680,10 |
if (!PrefsManager::instance().appPrefs.fontPrefs.GFontSub.contains(fontName)) |
{ |
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
MissingFont dia(nullptr, fontName, m_Doc); |
static_cast<void>(dia.exec()); |
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::changeOverrideCursor(QCursor(Qt::WaitCursor)); |
PrefsManager::instance().appPrefs.fontPrefs.GFontSub[fontName] = dia.getReplacementFont(); |
fontName = dia.getReplacementFont(); |
} |
/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp |
---|
599,12 → 599,12 |
baseX = m_Doc->currentPage()->xOffset(); |
baseY = m_Doc->currentPage()->yOffset(); |
} |
if ((!ret) && (interactive)) |
if (!ret && interactive) |
{ |
baseX = m_Doc->currentPage()->xOffset(); |
baseY = m_Doc->currentPage()->yOffset(); |
} |
if ((ret) || (!interactive)) |
if (ret || !interactive) |
{ |
if (docWidth > docHeight) |
m_Doc->setPageOrientation(1); |
1678,7 → 1678,7 |
return true; |
} |
bool EmfPlug::checkClip(FPointArray &clip) |
bool EmfPlug::checkClip(const FPointArray &clip) |
{ |
bool ret = true; |
QRectF clipRect = clip.toQPainterPath(false).boundingRect(); |
1914,7 → 1914,7 |
currentDC.m_WorldMap = mm; |
} |
QPointF EmfPlug::intersectBoundingRect(PageItem *item, const QLineF& gradientVector) |
QPointF EmfPlug::intersectBoundingRect(const PageItem *item, const QLineF& gradientVector) |
{ |
QPointF interPoint; |
QPointF gradEnd; |
2038,9 → 2038,9 |
continue; |
} |
const FPoint& base = gpath.point(a); |
const FPoint& c1 = gpath.point(a+1); |
const FPoint& base2 = gpath.point(a+2); |
const FPoint& c2 = gpath.point(a+3); |
const FPoint& c1 = gpath.point(a + 1); |
const FPoint& base2 = gpath.point(a + 2); |
const FPoint& c2 = gpath.point(a + 3); |
FPoint cn1 = (1.0 - nearT) * base + nearT * c1; |
FPoint cn2 = (1.0 - nearT) * cn1 + nearT * ((1.0 - nearT) * c1 + nearT * c2); |
FPoint cn3 = (1.0 - nearT) * ((1.0 - nearT) * c1 + nearT * c2) + nearT * ((1.0 - nearT) * c2 + nearT * base2); |
2982,7 → 2982,7 |
else if (hBitCount == 1) |
colorsUsed = 2; |
} |
for (quint32 pa = 0; pa < colorsUsed; pa++) |
for (quint32 pa = 0; pa < colorsUsed; ++pa) |
{ |
quint8 r, g, b, a; |
dsH >> b >> g >> r >> a; |
3004,7 → 3004,7 |
img.fill(0); |
if (hBitCount == 32) |
{ |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
QRgb *dst = (QRgb*)img.scanLine(hHeight - yy - 1); |
for (qint32 xx = 0; xx < hWidth; xx++) |
3018,10 → 3018,10 |
} |
else if (hBitCount == 24) |
{ |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
QRgb *dst = (QRgb*)img.scanLine(hHeight - yy - 1); |
for (qint32 xx = 0; xx < hWidth; xx++) |
for (qint32 xx = 0; xx < hWidth; ++xx) |
{ |
quint8 r, g, b; |
dsB >> b >> g >> r; |
3033,10 → 3033,10 |
} |
else if (hBitCount == 16) |
{ |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
QRgb *dst = (QRgb*)img.scanLine(hHeight - yy - 1); |
for (qint32 xx = 0; xx < hWidth; xx++) |
for (qint32 xx = 0; xx < hWidth; ++xx) |
{ |
quint16 dt; |
quint8 r, g, b; |
3055,7 → 3055,7 |
img = QImage(hWidth, hHeight, QImage::Format_Indexed8); |
img.fill(0); |
img.setColorTable(colorTbl); |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
char *dst = (char*)img.scanLine(hHeight - yy - 1); |
dsB.readRawData(dst, hWidth); |
3065,7 → 3065,7 |
} |
else if (hBitCount == 4) |
{ |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
QRgb *dst = (QRgb*)img.scanLine(hHeight - yy - 1); |
for (qint32 xx = 0; xx < hWidth; xx += 2) |
3092,7 → 3092,7 |
img.fill(0); |
img.setColorTable(colorTbl); |
int bpl = img.bytesPerLine(); |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
char *dst = (char*)img.scanLine(hHeight - yy - 1); |
dsB.readRawData(dst, bpl); |
3106,7 → 3106,7 |
pattern.resize(14); |
pattern.fill(0); |
quint16 bmType = 0x4D42; |
quint32 bmSize = bitsBits.count() + headerBits.count() + 14; |
quint32 bmSize = bitsBits.size() + headerBits.size() + 14; |
QDataStream pa(&pattern, QIODevice::WriteOnly); |
pa.setByteOrder(QDataStream::LittleEndian); |
pa << bmType; |
3122,10 → 3122,10 |
dsB.setByteOrder(QDataStream::LittleEndian); |
img = QImage(hWidth, hHeight, QImage::Format_ARGB32); |
img.fill(0); |
for (qint32 yy = 0; yy < hHeight; yy++) |
for (qint32 yy = 0; yy < hHeight; ++yy) |
{ |
QRgb *dst = (QRgb*)img.scanLine(hHeight - yy - 1); |
for (qint32 xx = 0; xx < hWidth; xx++) |
for (qint32 xx = 0; xx < hWidth; ++xx) |
{ |
quint8 r, g, b, a; |
dsB >> b >> g >> r >> a; |
5336,12 → 5336,12 |
QList<quint8> pTypes; |
if (!relativeCoordinates) |
{ |
for (quint32 a = 0; a < count; a++) |
for (quint32 a = 0; a < count; ++a) |
{ |
QPointF p = getEMFPPoint(ds, compressedPoints); |
points.append(p); |
} |
for (quint32 b = 0; b < count; b++) |
for (quint32 b = 0; b < count; ++b) |
{ |
if (rleEncodedType) |
{ |
5348,7 → 5348,7 |
quint8 cc, flg; |
ds >> cc >> flg; |
cc = cc & 0x3F; |
for (quint8 ccc = 0; ccc < cc; ccc++) |
for (quint8 ccc = 0; ccc < cc; ++ccc) |
{ |
pTypes.append(flg); |
} |
5361,7 → 5361,7 |
pTypes.append(val); |
} |
} |
for (quint32 c = 0; c < count; c++) |
for (quint32 c = 0; c < count; ++c) |
{ |
QPointF p = points[c]; |
quint8 pfl = (pTypes[c] & 0xF0) >> 4; |
5372,8 → 5372,8 |
polyline.svgLineTo(p.x(), p.y()); |
else if (pty == U_PPT_Bezier) |
{ |
QPointF p2 = points[c+1]; |
QPointF p3 = points[c+2]; |
QPointF p2 = points[c + 1]; |
QPointF p3 = points[c + 2]; |
polyline.svgCurveToCubic(p.x(), p.y(), p2.x(), p2.y(), p3.x(), p3.y()); |
c += 2; |
pfl = (pTypes[c] & 0xF0) >> 4; |
5545,16 → 5545,15 |
return out; |
} |
QPolygonF EmfPlug::gdip_open_curve_tangents(QPolygonF &points, double tension) |
QPolygonF EmfPlug::gdip_open_curve_tangents(const QPolygonF &points, double tension) |
{ |
double coefficient = tension / 3.0; |
int i; |
int count = points.count(); |
QPolygonF tangents; |
tangents.fill(QPointF(0,0), count); |
if (count <= 2) |
return tangents; |
for (i = 0; i < count; i++) |
for (int i = 0; i < count; i++) |
{ |
int r = i + 1; |
int s = i - 1; |
5567,16 → 5566,15 |
return tangents; |
} |
QPolygonF EmfPlug::gdip_closed_curve_tangents(QPolygonF &points, double tension) |
QPolygonF EmfPlug::gdip_closed_curve_tangents(const QPolygonF &points, double tension) |
{ |
double coefficient = tension / 3.0; |
int i; |
int count = points.count(); |
QPolygonF tangents; |
tangents.fill(QPointF(0,0), count); |
if (count <= 2) |
return tangents; |
for (i = 0; i < count; i++) |
for (int i = 0; i < count; i++) |
{ |
int r = i + 1; |
int s = i - 1; |
5589,7 → 5587,7 |
return tangents; |
} |
void EmfPlug::append_curve(QPainterPath &path, QPolygonF &points, QPolygonF &tangents, bool type) |
void EmfPlug::append_curve(QPainterPath &path, const QPolygonF &points, const QPolygonF &tangents, bool type) |
{ |
int i; |
path.moveTo(points[0]); |
/trunk/Scribus/scribus/plugins/import/emf/importemf.h |
---|
148,7 → 148,7 |
void parseHeader(const QString& fName, double &x, double &y, double &b, double &h); |
bool convert(const QString& fn); |
// Common functions |
bool checkClip(FPointArray &clip); |
bool checkClip(const FPointArray &clip); |
void aligntoQuadWord(QDataStream &ds); |
double convertDevice2Pts(double in); |
QPointF convertDevice2Pts(QPointF in); |
160,7 → 160,7 |
QPointF getPoint(QDataStream &ds, bool size); |
quint32 getColor(QDataStream &ds); |
void setWTransform(const QTransform& mm, quint32 how); |
QPointF intersectBoundingRect(PageItem *item, const QLineF& gradientVector); |
QPointF intersectBoundingRect(const PageItem *item, const QLineF& gradientVector); |
void finishItem(PageItem* ite, bool fill = true); |
void invalidateClipGroup(); |
void createClipGroup(); |
236,9 → 236,9 |
double getEMFPDistance(QDataStream &ds, bool size); |
QPointF convertEMFPLogical2Pts(QPointF in, quint16 unit); |
double convertEMFPLogical2Pts(double in, quint16 unit); |
QPolygonF gdip_open_curve_tangents(QPolygonF &points, double tension); |
QPolygonF gdip_closed_curve_tangents(QPolygonF &points, double tension); |
void append_curve(QPainterPath &path, QPolygonF &points, QPolygonF &tangents, bool type); |
QPolygonF gdip_open_curve_tangents(const QPolygonF &points, double tension); |
QPolygonF gdip_closed_curve_tangents(const QPolygonF &points, double tension); |
void append_curve(QPainterPath &path, const QPolygonF &points, const QPolygonF &tangents, bool type); |
void GdipAddPathCurve(QPainterPath &path, QPolygonF &points, float tension); |
void GdipAddPathClosedCurve(QPainterPath &path, QPolygonF &points, float tension); |
void handleEMFPDrawImageData(QPointF p1, QPointF p2, QPointF p3, quint8 flagsH); |
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp |
---|
1237,12 → 1237,12 |
if (!textPath.empty()) |
{ |
QPainterPath guidePath = textPath.toQPainterPath(false); |
for (int a = 0; a < textLines.count(); a++) |
for (int a = 0; a < textLines.count(); ++a) |
{ |
XarTextLine txLin = textLines[a]; |
TextY += gc->LineHeight; |
xpos = 0; |
for (int c = 0; c < txLin.textData.count(); c++) |
for (int c = 0; c < txLin.textData.count(); ++c) |
{ |
XarText txDat = txLin.textData[c]; |
xpos += txDat.FontKerning * (txDat.FontSize * 72.0 / 96.0); |
1256,7 → 1256,7 |
textFont.setItalic(txDat.FontItalic); |
textFont.setUnderline(txDat.FontUnderline); |
textFont.setStretch(txDat.FontStretch * 100); |
for (int b = 0; b < txDat.itemText.count(); b++) |
for (int b = 0; b < txDat.itemText.length(); ++b) |
{ |
painterPath = QPainterPath(); |
QString ch = txDat.itemText.at(b); |
1376,12 → 1376,12 |
} |
else |
{ |
for (int a = 0; a < textLines.count(); a++) |
for (int a = 0; a < textLines.count(); ++a) |
{ |
XarTextLine txLin = textLines[a]; |
TextY += gc->LineHeight; |
xpos = 0; |
for (int b = 0; b < txLin.textData.count(); b++) |
for (int b = 0; b < txLin.textData.count(); ++b) |
{ |
XarText txDat = txLin.textData[b]; |
painterPath = QPainterPath(); |
/trunk/Scribus/scribus/scribusdoc.cpp |
---|
2909,7 → 2909,7 |
{ |
if (it->ID == layerID) |
{ |
if (it->isPrintable!=isPrintable && UndoManager::undoEnabled()) |
if (it->isPrintable != isPrintable && UndoManager::undoEnabled()) |
{ |
auto *ss = new SimpleState(isPrintable ? Um::PrintLayer : Um::DoNotPrintLayer, "", Um::IPrint); |
ss->set("PRINT_LAYER"); |
2918,7 → 2918,7 |
m_undoManager->action(this, ss, it->Name, Um::ILayer); |
} |
it->isPrintable = isPrintable; |
found=true; |
found = true; |
break; |
} |
} |