Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25120 → Rev 25121

/branches/Version15x/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
293,9 → 293,9
m_Elements = Elements;
pushGroup();
m_importedColors = importedColors;
tmpSel = new Selection(m_doc, false);
importerFlags = flags;
currentLayer = m_doc->activeLayer();
m_tmpSel = new Selection(m_doc, false);
m_importerFlags = flags;
m_currentLayer = m_doc->activeLayer();
layersSetByOCG = false;
}
 
302,8 → 302,8
SlaOutputDev::~SlaOutputDev()
{
m_groupStack.clear();
tmpSel->clear();
delete tmpSel;
m_tmpSel->clear();
delete m_tmpSel;
delete m_fontEngine;
}
 
314,12 → 314,12
Object obj;
Ref refa = ano->getRef();
 
obj = xref->fetch(refa.num, refa.gen);
obj = m_xref->fetch(refa.num, refa.gen);
if (obj.isDict())
{
Dict* adic = obj.getDict();
POPPLER_CONST_075 Object POPPLER_REF additionalActions = adic->lookupNF("A");
Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
Object additionalActionsObject = additionalActions.fetch(m_pdfDoc->getXRef());
if (additionalActionsObject.isDict())
{
Object actionObject = additionalActionsObject.dictLookup("S");
349,17 → 349,17
Object obj;
Ref refa = ano->getRef();
 
obj = xref->fetch(refa.num, refa.gen);
obj = m_xref->fetch(refa.num, refa.gen);
if (obj.isDict())
{
Dict* adic = obj.getDict();
POPPLER_CONST_075 Object POPPLER_REF additionalActions = adic->lookupNF("AA");
Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
Object additionalActionsObject = additionalActions.fetch(m_pdfDoc->getXRef());
if (additionalActionsObject.isDict())
{
Object actionObject = additionalActionsObject.dictLookup(key);
if (actionObject.isDict())
linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());
linkAction = LinkAction::parseAction(&actionObject, m_pdfDoc->getCatalog()->getBaseURI());
}
}
return linkAction;
478,9 → 478,9
{
Ref dstr = dst->getPageRef();
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
pagNum = pdfDoc->findPage(dstr);
pagNum = m_pdfDoc->findPage(dstr);
#else
pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
pagNum = m_pdfDoc->findPage(dstr.num, dstr.gen);
#endif
}
else
496,9 → 496,9
if (ndst)
{
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
std::unique_ptr<LinkDest> dstn = m_pdfDoc->findDest(ndst);
#else
LinkDest *dstn = pdfDoc->findDest(ndst);
LinkDest *dstn = m_pdfDoc->findDest(ndst);
#endif
if (dstn)
{
508,9 → 508,9
{
Ref dstr = dstn->getPageRef();
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
pagNum = pdfDoc->findPage(dstr);
pagNum = m_pdfDoc->findPage(dstr);
#else
pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
pagNum = m_pdfDoc->findPage(dstr.num, dstr.gen);
#endif
}
else
544,9 → 544,9
if (ndst)
{
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
std::unique_ptr<LinkDest> dstn = m_pdfDoc->findDest(ndst);
#else
LinkDest *dstn = pdfDoc->findDest(ndst);
LinkDest *dstn = m_pdfDoc->findDest(ndst);
#endif
if (dstn)
{
708,7 → 708,7
m_graphicStack.top().strokeColor = CommonStrings::None;
}
}
QString m_currColorText = "Black";
QString currTextColor = "Black";
double fontSize = 12;
QString fontName = "";
QString itemText = "";
718,9 → 718,9
AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
const PDFRectangle& annotaRect = annota->getRect();
Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
Gfx* gfx = new Gfx(m_pdfDoc, annotOutDev, m_pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
#else
Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
Gfx *gfx = new Gfx(m_pdfDoc, annotOutDev, m_pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
#endif
ano->draw(gfx, false);
if (!bgFound)
727,7 → 727,7
m_graphicStack.top().fillColor = annotOutDev->currColorFill;
if (!fgFound)
m_graphicStack.top().strokeColor = annotOutDev->currColorStroke;
m_currColorText = annotOutDev->currColorText;
currTextColor = annotOutDev->currColorText;
fontSize = annotOutDev->fontSize;
fontName = UnicodeParsedString(annotOutDev->fontName);
itemText = UnicodeParsedString(annotOutDev->itemText);
808,7 → 808,7
ite->itemText.insertChars(UnicodeParsedString(achar->getNormalCaption()));
else
ite->itemText.insertChars(itemText);
applyTextStyle(ite, fontName, m_currColorText, fontSize);
applyTextStyle(ite, fontName, currTextColor, fontSize);
ite->annotation().addToFlag(Annotation::Flag_PushButton);
FormWidgetButton *btn = (FormWidgetButton*)fm;
if (!btn->isReadOnly())
821,7 → 821,7
if (btn)
{
ite->itemText.insertChars(UnicodeParsedString(btn->getContent()));
applyTextStyle(ite, fontName, m_currColorText, fontSize);
applyTextStyle(ite, fontName, currTextColor, fontSize);
ite->itemText.trim();
if (btn->isMultiline())
ite->annotation().addToFlag(Annotation::Flag_Multiline);
884,7 → 884,7
}
ite->itemText.insertChars(inh);
}
applyTextStyle(ite, fontName, m_currColorText, fontSize);
applyTextStyle(ite, fontName, currTextColor, fontSize);
if (!btn->isReadOnly())
ite->annotation().addToFlag(Annotation::Flag_Edit);
handleActions(ite, ano);
909,7 → 909,7
{
Object obj1;
Ref refa = annota->getRef();
obj1 = xref->fetch(refa.num, refa.gen);
obj1 = m_xref->fetch(refa.num, refa.gen);
if (obj1.isDict())
{
Dict* dict = obj1.getDict();
1002,9 → 1002,9
{
Ref dstr = dst->getPageRef();
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
pagNum = pdfDoc->findPage(dstr);
pagNum = m_pdfDoc->findPage(dstr);
#else
pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
pagNum = m_pdfDoc->findPage(dstr.num, dstr.gen);
#endif
}
else
1022,9 → 1022,9
if (ndst)
{
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
std::unique_ptr<LinkDest> dstn = m_pdfDoc->findDest(ndst);
#else
LinkDest *dstn = pdfDoc->findDest(ndst);
LinkDest *dstn = m_pdfDoc->findDest(ndst);
#endif
if (dstn)
{
1034,9 → 1034,9
{
Ref dstr = dstn->getPageRef();
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
pagNum = pdfDoc->findPage(dstr);
pagNum = m_pdfDoc->findPage(dstr);
#else
pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
pagNum = m_pdfDoc->findPage(dstr.num, dstr.gen);
#endif
}
else
1078,9 → 1078,9
if (ndst)
{
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
std::unique_ptr<LinkDest> dstn = m_pdfDoc->findDest(ndst);
#else
LinkDest *dstn = pdfDoc->findDest(ndst);
LinkDest *dstn = m_pdfDoc->findDest(ndst);
#endif
if (dstn)
{
1354,10 → 1354,10
 
void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
{
xref = xrefA;
catalog = catA;
pdfDoc = doc;
updateGUICounter = 0;
m_xref = xrefA;
m_catalog = catA;
m_pdfDoc = doc;
m_updateGUICounter = 0;
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
m_fontEngine = new SplashFontEngine(true, false, false, true);
#else
1367,7 → 1367,7
 
void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
{
m_formWidgets = pdfDoc->getPage(pageNum)->getFormWidgets();
m_formWidgets = m_pdfDoc->getPage(pageNum)->getFormWidgets();
m_radioMap.clear();
m_radioButtons.clear();
m_actPage = pageNum;
1382,19 → 1382,19
{
for (auto it = m_radioMap.begin(); it != m_radioMap.end(); ++it)
{
tmpSel->clear();
m_tmpSel->clear();
QList<int> refList = it.value();
for (int a = 0; a < refList.count(); a++)
{
if (m_radioButtons.contains(refList[a]))
{
tmpSel->addItem(m_radioButtons[refList[a]], true);
m_tmpSel->addItem(m_radioButtons[refList[a]], true);
m_Elements->removeAll(m_radioButtons[refList[a]]);
}
}
if (!tmpSel->isEmpty())
if (!m_tmpSel->isEmpty())
{
PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
PageItem *ite = m_doc->groupObjectsSelection(m_tmpSel);
ite->setItemName(it.key());
m_Elements->append(ite);
if (m_groupStack.count() != 0)
1422,13 → 1422,13
{
if ((gElements.Items.count() > 1) && (checkClip()))
{
tmpSel->clear();
m_tmpSel->clear();
for (int dre = 0; dre < gElements.Items.count(); ++dre)
{
tmpSel->addItem(gElements.Items.at(dre), true);
m_tmpSel->addItem(gElements.Items.at(dre), true);
m_Elements->removeAll(gElements.Items.at(dre));
}
PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
PageItem *ite = m_doc->groupObjectsSelection(m_tmpSel);
if (ite)
{
QPainterPath clippath = m_graphicStack.top().clipPath;
1463,7 → 1463,7
}
}
}
tmpSel->clear();
m_tmpSel->clear();
}
else
{
1510,7 → 1510,7
if (m_groupStack.count() <= 0)
return;
 
tmpSel->clear();
m_tmpSel->clear();
 
groupEntry gElements = m_groupStack.pop();
if (gElements.Items.count() <= 0)
1520,10 → 1520,10
{
for (int dre = 0; dre < gElements.Items.count(); ++dre)
{
tmpSel->addItem(gElements.Items.at(dre), true);
m_tmpSel->addItem(gElements.Items.at(dre), true);
m_Elements->removeAll(gElements.Items.at(dre));
}
PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
PageItem *ite = m_doc->groupObjectsSelection(m_tmpSel);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
ScPattern pat(m_doc);
1543,17 → 1543,17
QString id = QString("Pattern_from_PDF_%1S").arg(m_doc->docPatterns.count() + 1);
m_doc->addPattern(id, pat);
m_currentMask = id;
tmpSel->clear();
m_tmpSel->clear();
return;
}
PageItem *ite;
for (int dre = 0; dre < gElements.Items.count(); ++dre)
{
tmpSel->addItem(gElements.Items.at(dre), true);
m_tmpSel->addItem(gElements.Items.at(dre), true);
m_Elements->removeAll(gElements.Items.at(dre));
}
if ((gElements.Items.count() != 1) || (gElements.isolated))
ite = m_doc->groupObjectsSelection(tmpSel);
ite = m_doc->groupObjectsSelection(m_tmpSel);
else
ite = gElements.Items.first();
if (ite->isGroup())
1586,7 → 1586,7
m_groupStack.top().Items.append(ite);
}
 
tmpSel->clear();
m_tmpSel->clear();
}
 
void SlaOutputDev::setSoftMask(GfxState * /*state*/, POPPLER_CONST_070 double * bbox, GBool alpha, Function *transferFunc, GfxColor * /*backdropColor*/)
1679,7 → 1679,7
graphicState.strokeColor = getColor(state->getStrokeColorSpace(), state->getStrokeColor(), &graphicState.strokeShade);
QString output = convertPath(state->getPath());
if ((m_Elements->count() != 0) && (output == Coords)) // Path is the same as in last fill
if ((m_Elements->count() != 0) && (output == m_coords)) // Path is the same as in last fill
{
PageItem* ite = m_Elements->last();
ite->setLineColor(graphicState.strokeColor);
1687,8 → 1687,8
ite->setLineEnd(m_lineEnd);
ite->setLineJoin(m_lineJoin);
ite->setLineWidth(state->getTransformedLineWidth());
ite->setDashes(DashValues);
ite->setDashOffset(DashOffset);
ite->setDashes(m_dashValues);
ite->setDashOffset(m_dashOffset);
ite->setLineTransparency(1.0 - state->getStrokeOpacity());
return;
}
1702,7 → 1702,7
return;
 
int z;
if (pathIsClosed)
if (m_pathIsClosed)
z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, state->getTransformedLineWidth(), CommonStrings::None, graphicState.strokeColor);
else
z = m_doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, xCoor, yCoor, 10, 10, state->getTransformedLineWidth(), CommonStrings::None, graphicState.strokeColor);
1724,8 → 1724,8
lItem->setLineBlendmode(getBlendMode(state));
lItem->setLineEnd(m_lineEnd);
lItem->setLineJoin(m_lineJoin);
lItem->setDashes(DashValues);
lItem->setDashOffset(DashOffset);
lItem->setDashes(m_dashValues);
lItem->setDashOffset(m_dashOffset);
lItem->setTextFlowMode(PageItem::TextFlowDisabled);
m_doc->Items->removeAll(ite);
}
1736,8 → 1736,8
ite->setLineBlendmode(getBlendMode(state));
ite->setLineEnd(m_lineEnd);
ite->setLineJoin(m_lineJoin);
ite->setDashes(DashValues);
ite->setDashOffset(DashOffset);
ite->setDashes(m_dashValues);
ite->setDashOffset(m_dashOffset);
ite->setTextFlowMode(PageItem::TextFlowDisabled);
m_Elements->append(ite);
if (m_groupStack.count() != 0)
1751,8 → 1751,8
ite->setLineBlendmode(getBlendMode(state));
ite->setLineEnd(m_lineEnd);
ite->setLineJoin(m_lineJoin);
ite->setDashes(DashValues);
ite->setDashOffset(DashOffset);
ite->setDashes(m_dashValues);
ite->setDashOffset(m_dashOffset);
ite->setTextFlowMode(PageItem::TextFlowDisabled);
m_Elements->append(ite);
if (m_groupStack.count() != 0)
1797,13 → 1797,13
mm.rotate(angle);
clippedPath = mm.map(clippedPath);
 
Coords = output;
m_coords = output;
QRectF bbox = clippedPath.boundingRect();
if (!clippedPath.isEmpty() && !bbox.isNull())
{
graphicState.fillColor = getColor(state->getFillColorSpace(), state->getFillColor(), &graphicState.fillShade);
int z;
if (pathIsClosed)
if (m_pathIsClosed)
z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, graphicState.fillColor, CommonStrings::None);
else
z = m_doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, graphicState.fillColor, CommonStrings::None);
1924,8 → 1924,8
output += QString("L %1 %2").arg(0.0).arg(crect.height());
output += QString("L %1 %2").arg(0.0).arg(0.0);
output += QString("Z");
pathIsClosed = true;
Coords = output;
m_pathIsClosed = true;
m_coords = output;
 
const auto& graphicState = m_graphicStack.top();
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), bb.width(), bb.height(), 0, graphicState.fillColor, CommonStrings::None);
2046,8 → 2046,8
output += QString("L %1 %2").arg(0.0).arg(crect.height());
output += QString("L %1 %2").arg(0.0).arg(0.0);
output += QString("Z");
pathIsClosed = true;
Coords = output;
m_pathIsClosed = true;
m_coords = output;
 
const auto& graphicState = m_graphicStack.top();
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, graphicState.fillColor, CommonStrings::None);
2108,8 → 2108,8
output += QString("L %1 %2").arg(0.0).arg(crect.height());
output += QString("L %1 %2").arg(0.0).arg(0.0);
output += QString("Z");
pathIsClosed = true;
Coords = output;
m_pathIsClosed = true;
m_coords = output;
const double *ctm = state->getCTM();
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
const auto& graphicState = m_graphicStack.top();
2189,8 → 2189,8
output += QString("L %1 %2").arg(0.0).arg(crect.height());
output += QString("L %1 %2").arg(0.0).arg(0.0);
output += QString("Z");
pathIsClosed = true;
Coords = output;
m_pathIsClosed = true;
m_coords = output;
const double *ctm = state->getCTM();
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
const auto& graphicState = m_graphicStack.top();
2357,8 → 2357,8
QTransform mm = QTransform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
QTransform mmx = mm * m_ctm;
 
gfx = new Gfx(pdfDoc, this, resDict, &box, nullptr);
inPattern++;
gfx = new Gfx(m_pdfDoc, this, resDict, &box, nullptr);
m_inPattern++;
// Unset the clip path as it is unrelated to the pattern's coordinate space.
QPainterPath savedClip = m_graphicStack.top().clipPath;
m_graphicStack.top().clipPath = QPainterPath();
2368,7 → 2368,7
gfx->display(str);
#endif
m_graphicStack.top().clipPath = savedClip;
inPattern--;
m_inPattern--;
gElements = m_groupStack.pop();
m_doc->m_Selection->clear();
// double pwidth = 0;
2420,8 → 2420,8
output += QString("L %1 %2").arg(0.0).arg(crect.height());
output += QString("L %1 %2").arg(0.0).arg(0.0);
output += QString("Z");
pathIsClosed = true;
Coords = output;
m_pathIsClosed = true;
m_coords = output;
 
const auto& graphicState = m_graphicStack.top();
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, graphicState.fillColor, CommonStrings::None);
2802,7 → 2802,7
outline = m_ctm.map(outline);
outline = intersection(outline, m_graphicStack.top().clipPath);
 
if ((inPattern == 0) && (outline.isEmpty() || outline.boundingRect().isNull()))
if ((m_inPattern == 0) && (outline.isEmpty() || outline.boundingRect().isNull()))
return;
 
// Determine the width and height of the image by undoing the rotation part
2903,7 → 2903,7
}
delete tempFile;
}
if (inPattern == 0)
if (m_inPattern == 0)
{
outline.translate(xCoor - ite->xPos(), yCoor - ite->yPos());
// Undo the rotation of the clipping path as it is rotated together with the image.
2928,7 → 2928,7
mContent mSte;
mSte.name = QString(name);
mSte.ocgName = "";
if (importerFlags & LoadSavePlugin::lfCreateDoc)
if (m_importerFlags & LoadSavePlugin::lfCreateDoc)
{
if (dictRef->isNull())
return;
2935,7 → 2935,7
Object dictObj;
Dict *dict;
Object dictType;
OCGs *contentConfig = catalog->getOptContentConfig();
OCGs *contentConfig = m_catalog->getOptContentConfig();
OptionalContentGroup *oc;
if (dictRef->isRef())
{
2949,7 → 2949,7
}
else
{
dictObj = dictRef->fetch(xref);
dictObj = dictRef->fetch(m_xref);
if (!dictObj.isDict())
return;
dict = dictObj.getDict();
2977,13 → 2977,13
mSte.name = nam;
mSte.ocgName = "";
m_mcStack.push(mSte);
if (importerFlags & LoadSavePlugin::lfCreateDoc)
if (m_importerFlags & LoadSavePlugin::lfCreateDoc)
{
if (nam == "Layer") // Handle Adobe Illustrator Layer command
{
if (layersSetByOCG)
return;
QString lName = QString("Layer_%1").arg(layerNum + 1);
QString lName = QString("Layer_%1").arg(m_layerNum + 1);
Object obj = properties->lookup((char*) "Title");
if (obj.isString())
lName = QString(obj.getString()->getCString());
2995,20 → 2995,20
return;
}
}
layerNum++;
if (!firstLayer)
currentLayer = m_doc->addLayer(lName, true);
firstLayer = false;
m_layerNum++;
if (!m_firstLayer)
m_currentLayer = m_doc->addLayer(lName, true);
m_firstLayer = false;
 
obj = properties->lookup((char*) "Visible");
if (obj.isBool())
m_doc->setLayerVisible(currentLayer, obj.getBool());
m_doc->setLayerVisible(m_currentLayer, obj.getBool());
obj = properties->lookup((char*) "Editable");
if (obj.isBool())
m_doc->setLayerLocked(currentLayer, !obj.getBool());
m_doc->setLayerLocked(m_currentLayer, !obj.getBool());
obj = properties->lookup((char*) "Printed");
if (obj.isBool())
m_doc->setLayerPrintable(currentLayer, obj.getBool());
m_doc->setLayerPrintable(m_currentLayer, obj.getBool());
obj = properties->lookup((char*)"Color");
if (obj.isArray())
{
3019,7 → 3019,7
int g = obj1.getNum() / 256;
obj1 = obj.arrayGet(2);
int b = obj1.getNum() / 256;
m_doc->setLayerMarker(currentLayer, QColor(r, g, b));
m_doc->setLayerMarker(m_currentLayer, QColor(r, g, b));
}
}
}
3031,7 → 3031,7
if (m_mcStack.count() > 0)
{
mContent mSte = m_mcStack.pop();
if (importerFlags & LoadSavePlugin::lfCreateDoc)
if (m_importerFlags & LoadSavePlugin::lfCreateDoc)
{
if (mSte.name == "OC")
{
3111,7 → 3111,7
delete id;
else
{
fontLoc = gfxFont->locateFont((xref) ? xref : pdfDoc->getXRef(), nullptr);
fontLoc = gfxFont->locateFont((m_xref) ? m_xref : m_pdfDoc->getXRef(), nullptr);
if (!fontLoc)
{
error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
3123,11 → 3123,11
{
// if there is an embedded font, read it to memory
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
tmpBuf = gfxFont->readEmbFontFile((m_xref) ? m_xref : m_pdfDoc->getXRef());
if (! tmpBuf)
goto err2;
#else
tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
tmpBuf = gfxFont->readEmbFontFile(m_xref, &tmpBufLen);
if (!tmpBuf)
goto err2;
#endif
3507,25 → 3507,25
if (m_groupStack.count() != 0)
{
groupEntry gElements = m_groupStack.pop();
tmpSel->clear();
m_tmpSel->clear();
if (gElements.Items.count() > 0)
{
for (int dre = 0; dre < gElements.Items.count(); ++dre)
{
tmpSel->addItem(gElements.Items.at(dre), true);
m_tmpSel->addItem(gElements.Items.at(dre), true);
m_Elements->removeAll(gElements.Items.at(dre));
}
PageItem *ite;
if (gElements.Items.count() != 1)
ite = m_doc->groupObjectsSelection(tmpSel);
ite = m_doc->groupObjectsSelection(m_tmpSel);
else
ite = gElements.Items.first();
ite->setGroupClipping(false);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
for (int as = 0; as < tmpSel->count(); ++as)
for (int as = 0; as < m_tmpSel->count(); ++as)
{
m_Elements->append(tmpSel->itemAt(as));
m_Elements->append(m_tmpSel->itemAt(as));
}
if (m_groupStack.count() != 0)
applyMask(ite);
3532,12 → 3532,12
}
if (m_groupStack.count() != 0)
{
for (int as = 0; as < tmpSel->count(); ++as)
for (int as = 0; as < m_tmpSel->count(); ++as)
{
m_groupStack.top().Items.append(tmpSel->itemAt(as));
m_groupStack.top().Items.append(m_tmpSel->itemAt(as));
}
}
tmpSel->clear();
m_tmpSel->clear();
}
}
 
3695,7 → 3695,7
return QString();
 
QString output;
pathIsClosed = false;
m_pathIsClosed = false;
 
for (int i = 0; i < path->getNumSubpaths(); ++i)
{
3723,7 → 3723,7
if (subpath->isClosed())
{
output += QString("Z");
pathIsClosed = true;
m_pathIsClosed = true;
}
}
}
3758,11 → 3758,11
}
double *dashPattern;
int dashLength;
state->getLineDash(&dashPattern, &dashLength, &DashOffset);
state->getLineDash(&dashPattern, &dashLength, &m_dashOffset);
QVector<double> pattern(dashLength);
for (int i = 0; i < dashLength; ++i)
pattern[i] = dashPattern[i];
DashValues = pattern;
m_dashValues = pattern;
}
 
int SlaOutputDev::getBlendMode(GfxState *state)
3852,11 → 3852,11
}
// Code for updating our Progressbar, needs to be called this way, as we have no
// possibility to get the current fileposition.
updateGUICounter++;
if (updateGUICounter > 20)
m_updateGUICounter++;
if (m_updateGUICounter > 20)
{
qApp->processEvents();
updateGUICounter = 0;
m_updateGUICounter = 0;
}
}
 
/branches/Version15x/Scribus/scribus/plugins/import/pdf/slaoutput.h
385,10 → 385,10
 
void createImageFrame(QImage& image, GfxState *state, int numColorComponents);
 
bool pathIsClosed { false };
QVector<double> DashValues;
double DashOffset { 0.0 };
QString Coords;
bool m_pathIsClosed { false };
QVector<double> m_dashValues;
double m_dashOffset { 0.0 };
QString m_coords;
 
// Collect the paths of character glyphs for clipping of a whole text group.
QPainterPath m_clipTextPath;
395,7 → 395,7
 
QString m_currentMask;
QPointF m_currentMaskPosition;
Selection* tmpSel { nullptr };
Selection* m_tmpSel { nullptr };
QStringList *m_importedColors;
QTransform m_ctm;
struct F3Entry
409,15 → 409,15
QString ocgName;
};
QStack<mContent> m_mcStack;
int inPattern {0};
int layerNum {1};
int currentLayer { 0 };
bool firstLayer {true};
int importerFlags;
int updateGUICounter {0};
XRef *xref {nullptr}; // xref table for current document
PDFDoc *pdfDoc {nullptr};
Catalog *catalog {nullptr};
int m_inPattern {0};
int m_layerNum {1};
int m_currentLayer { 0 };
bool m_firstLayer {true};
int m_importerFlags;
int m_updateGUICounter {0};
XRef *m_xref {nullptr}; // xref table for current document
PDFDoc *m_pdfDoc {nullptr};
Catalog *m_catalog {nullptr};
SplashFontEngine *m_fontEngine {nullptr};
SplashFont *m_font {nullptr};
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 4, 0)