Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 629752
Collapse All | Expand All

(-)a/scribus/plugins/import/pdf/importpdf.cpp (-9 / +86 lines)
Lines 22-27 for which a new license (GPL+exception) is in place. Link Here
22
#include <poppler/PageTransition.h>
22
#include <poppler/PageTransition.h>
23
#include <poppler/ViewerPreferences.h>
23
#include <poppler/ViewerPreferences.h>
24
#include <poppler/poppler-config.h>
24
#include <poppler/poppler-config.h>
25
#include <poppler/cpp/poppler-version.h>
25
#include <poppler/SplashOutputDev.h>
26
#include <poppler/SplashOutputDev.h>
26
#include <poppler/splash/SplashBitmap.h>
27
#include <poppler/splash/SplashBitmap.h>
27
28
Lines 59-64 for which a new license (GPL+exception) is in place. Link Here
59
#include "ui/multiprogressdialog.h"
60
#include "ui/multiprogressdialog.h"
60
#include "ui/propertiespalette.h"
61
#include "ui/propertiespalette.h"
61
62
63
#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
64
	  ((major) * 10000)				\
65
	+ ((minor) *   100)				\
66
	+ ((micro) *     1))
67
#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
68
62
PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
69
PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
63
{
70
{
64
	tmpSele = new Selection(this, false);
71
	tmpSele = new Selection(this, false);
Lines 507-518 bool PdfPlug::convert(const QString& fn) Link Here
507
							{
514
							{
508
								for (int i = 0; i < order->getLength (); ++i)
515
								for (int i = 0; i < order->getLength (); ++i)
509
								{
516
								{
517
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
518
									Object orderItem = order->get(i);
519
#else
510
									Object orderItem;
520
									Object orderItem;
511
									order->get(i, &orderItem);
521
									order->get(i, &orderItem);
522
#endif
512
									if (orderItem.isDict())
523
									if (orderItem.isDict())
513
									{
524
									{
525
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
526
										Object ref = order->getNF(i);		
527
#else
514
										Object ref;
528
										Object ref;
515
										order->getNF(i, &ref);
529
										order->getNF(i, &ref);
530
#endif
516
										if (ref.isRef())
531
										if (ref.isRef())
517
										{
532
										{
518
											OptionalContentGroup *oc = ocg->findOcgByRef(ref.getRef());
533
											OptionalContentGroup *oc = ocg->findOcgByRef(ref.getRef());
Lines 523-529 bool PdfPlug::convert(const QString& fn) Link Here
523
												ocgNames.append(ocgName);
538
												ocgNames.append(ocgName);
524
											}
539
											}
525
										}
540
										}
541
#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
526
										ref.free();
542
										ref.free();
543
#endif
527
									}
544
									}
528
									else
545
									else
529
									{
546
									{
Lines 597-635 bool PdfPlug::convert(const QString& fn) Link Here
597
							dev->layersSetByOCG = true;
614
							dev->layersSetByOCG = true;
598
						}
615
						}
599
#endif
616
#endif
617
618
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
619
						Object info = pdfDoc->getDocInfo();
620
						if (info.isDict())
621
						{
622
							Object obj;
623
							Dict *infoDict = info.getDict();
624
							obj = infoDict->lookup((char*) "Title");
625
							if (obj.isString())
626
							{
627
								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
628
							}
629
							obj = infoDict->lookup((char*) "Author");
630
							if (obj.isString())
631
							{
632
								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
633
							}
634
							obj = infoDict->lookup((char*) "Subject");
635
							if (obj.isString())
636
							{
637
								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
638
							}
639
							obj = infoDict->lookup((char*) "Keywords");
640
							if (obj.isString())
641
							{
642
								//		s1 = obj.getString();
643
								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
644
							}
645
						}
646
						info = Object();
647
#else
600
						Object info;
648
						Object info;
601
						pdfDoc->getDocInfo(&info);
649
						pdfDoc->getDocInfo(&info);
602
						if (info.isDict())
650
						if (info.isDict())
603
						{
651
						{
604
							Object obj;
652
							Object obj;
605
						//	GooString *s1;
653
							//	GooString *s1;
606
							Dict *infoDict = info.getDict();
654
							Dict *infoDict = info.getDict();
607
							if (infoDict->lookup((char*)"Title", &obj )->isString())
655
							if (infoDict->lookup((char*)"Title", &obj)->isString())
608
							{
656
							{
609
						//		s1 = obj.getString();
657
								//		s1 = obj.getString();
610
								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
658
								m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
611
								obj.free();
659
								obj.free();
612
							}
660
							}
613
							if (infoDict->lookup((char*)"Author", &obj )->isString())
661
							if (infoDict->lookup((char*)"Author", &obj)->isString())
614
							{
662
							{
615
						//		s1 = obj.getString();
663
								//		s1 = obj.getString();
616
								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
664
								m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
617
								obj.free();
665
								obj.free();
618
							}
666
							}
619
							if (infoDict->lookup((char*)"Subject", &obj )->isString())
667
							if (infoDict->lookup((char*)"Subject", &obj)->isString())
620
							{
668
							{
621
						//		s1 = obj.getString();
669
								//		s1 = obj.getString();
622
								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
670
								m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
623
								obj.free();
671
								obj.free();
624
							}
672
							}
625
							if (infoDict->lookup((char*)"Keywords", &obj )->isString())
673
							if (infoDict->lookup((char*)"Keywords", &obj)->isString())
626
							{
674
							{
627
						//		s1 = obj.getString();
675
								//		s1 = obj.getString();
628
								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
676
								m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
629
								obj.free();
677
								obj.free();
630
							}
678
							}
631
						}
679
						}
632
						info.free();
680
						info.free();
681
#endif
633
						if (cropped)
682
						if (cropped)
634
						{
683
						{
635
							QRectF crBox = getCBox(contentRect, pageNs[0]);
684
							QRectF crBox = getCBox(contentRect, pageNs[0]);
Lines 746-753 bool PdfPlug::convert(const QString& fn) Link Here
746
									pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
795
									pdfDoc->displayPage(dev, pp, hDPI, vDPI, rotate, useMediaBox, crop, printing, NULL, NULL, dev->annotations_callback, dev);
747
							}
796
							}
748
							PDFPresentationData ef;
797
							PDFPresentationData ef;
798
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
799
							Object trans = pdfDoc->getPage(pp)->getTrans();
800
							Object *transi = &trans;
801
#else
749
							Object trans;
802
							Object trans;
750
							Object *transi = pdfDoc->getPage(pp)->getTrans(&trans);
803
							Object *transi = pdfDoc->getPage(pp)->getTrans(&trans);
804
#endif
751
							if (transi->isDict())
805
							if (transi->isDict())
752
							{
806
							{
753
								m_Doc->pdfOptions().PresentMode = true;
807
								m_Doc->pdfOptions().PresentMode = true;
Lines 793-824 bool PdfPlug::convert(const QString& fn) Link Here
793
								delete pgTrans;
847
								delete pgTrans;
794
							}
848
							}
795
							m_Doc->currentPage()->PresentVals = ef;
849
							m_Doc->currentPage()->PresentVals = ef;
850
#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
796
							trans.free();
851
							trans.free();
797
							transi->free();
852
							transi->free();
853
#endif
798
						}
854
						}
799
						int numjs = pdfDoc->getCatalog()->numJS();
855
						int numjs = pdfDoc->getCatalog()->numJS();
800
						if (numjs > 0)
856
						if (numjs > 0)
801
						{
857
						{
802
							NameTree *jsNameTreeP = new NameTree();
858
							NameTree *jsNameTreeP = new NameTree();
859
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
860
							Object catDict = pdfDoc->getXRef()->getCatalog();
861
#else
803
							Object catDict;
862
							Object catDict;
804
							pdfDoc->getXRef()->getCatalog(&catDict);
863
							pdfDoc->getXRef()->getCatalog(&catDict);
864
#endif
805
							if (catDict.isDict())
865
							if (catDict.isDict())
806
							{
866
							{
867
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
868
								Object names = catDict.dictLookup("Names");
869
#else
807
								Object names;
870
								Object names;
808
								catDict.dictLookup("Names", &names);
871
								catDict.dictLookup("Names", &names);
872
#endif
809
								if (names.isDict())
873
								if (names.isDict())
810
								{
874
								{
875
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
876
									Object obj = names.dictLookup("JavaScript");
877
									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
878
#else
811
									Object obj;
879
									Object obj;
812
									names.dictLookup("JavaScript", &obj);
880
									names.dictLookup("JavaScript", &obj);
813
									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
881
									jsNameTreeP->init(pdfDoc->getXRef(), &obj);
814
									obj.free();
882
									obj.free();
883
#endif
815
								}
884
								}
816
								for (int a = 0; a < numjs; a++)
885
								for (int a = 0; a < numjs; a++)
817
								{
886
								{
818
									m_Doc->JavaScripts.insert(UnicodeParsedString(jsNameTreeP->getName(a)), UnicodeParsedString(pdfDoc->getCatalog()->getJS(a)));
887
									m_Doc->JavaScripts.insert(UnicodeParsedString(jsNameTreeP->getName(a)), UnicodeParsedString(pdfDoc->getCatalog()->getJS(a)));
819
								}
888
								}
889
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
890
								names = catDict.dictLookup("OpenAction");
891
#else
820
								names.free();
892
								names.free();
821
								catDict.dictLookup("OpenAction", &names);
893
								catDict.dictLookup("OpenAction", &names);
894
#endif
822
								if (names.isDict())
895
								if (names.isDict())
823
								{
896
								{
824
									LinkAction *linkAction = NULL;
897
									LinkAction *linkAction = NULL;
Lines 839-847 bool PdfPlug::convert(const QString& fn) Link Here
839
										}
912
										}
840
									}
913
									}
841
								}
914
								}
915
#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
842
								names.free();
916
								names.free();
917
#endif
843
							}
918
							}
919
#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 58, 0)
844
							catDict.free();
920
							catDict.free();
921
#endif
845
							delete jsNameTreeP;
922
							delete jsNameTreeP;
846
						}
923
						}
847
						m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)qMin(15, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
924
						m_Doc->pdfOptions().Version = (PDFOptions::PDFVersion)qMin(15, qMax(13, pdfDoc->getPDFMajorVersion() * 10 + pdfDoc->getPDFMinorVersion()));
(-)a/scribus/plugins/import/pdf/slaoutput.cpp (-2 / +172 lines)
Lines 6-11 for which a new license (GPL+exception) is in place. Link Here
6
*/
6
*/
7
7
8
#include "slaoutput.h"
8
#include "slaoutput.h"
9
#include <poppler/cpp/poppler-version.h>
9
#include <poppler/GlobalParams.h>
10
#include <poppler/GlobalParams.h>
10
#include <poppler/poppler-config.h>
11
#include <poppler/poppler-config.h>
11
#include <poppler/FileSpec.h>
12
#include <poppler/FileSpec.h>
Lines 19-29 for which a new license (GPL+exception) is in place. Link Here
19
#include "util_math.h"
20
#include "util_math.h"
20
#include <tiffio.h>
21
#include <tiffio.h>
21
22
23
#define POPPLER_VERSION_ENCODE(major, minor, micro) (	\
24
	  ((major) * 10000)				\
25
	+ ((minor) *   100)				\
26
	+ ((micro) *     1))
27
#define POPPLER_ENCODED_VERSION POPPLER_VERSION_ENCODE(POPPLER_VERSION_MAJOR, POPPLER_VERSION_MINOR, POPPLER_VERSION_MICRO)
28
22
LinkSubmitForm::LinkSubmitForm(Object *actionObj)
29
LinkSubmitForm::LinkSubmitForm(Object *actionObj)
23
{
30
{
24
	Object obj1, obj2, obj3;
31
	Object obj1, obj2, obj3;
25
	fileName = NULL;
32
	fileName = NULL;
26
	m_flags = 0;
33
	m_flags = 0;
34
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
35
	if (actionObj->isDict())
36
	{
37
		obj1 = actionObj->dictLookup("F");
38
		if (!obj1.isNull())
39
		{
40
			if (obj1.isDict())
41
			{
42
				obj3 = obj1.dictLookup("FS");
43
				if (!obj3.isNull())
44
				{
45
					if (obj3.isName())
46
					{
47
						char *name = obj3.getName();
48
						if (!strcmp(name, "URL"))
49
						{
50
							obj2 = obj1.dictLookup("F");
51
							if (!obj2.isNull())
52
								fileName = obj2.getString()->copy();
53
						}
54
					}
55
				}
56
			}
57
		}
58
		obj1 = actionObj->dictLookup("Flags");
59
		if (!obj1.isNull())
60
		{
61
			if (obj1.isNum())
62
				m_flags = obj1.getInt();
63
		}
64
	}
65
#else
27
	if (actionObj->isDict())
66
	if (actionObj->isDict())
28
	{
67
	{
29
		if (!actionObj->dictLookup("F", &obj1)->isNull())
68
		if (!actionObj->dictLookup("F", &obj1)->isNull())
Lines 54-59 LinkSubmitForm::LinkSubmitForm(Object *actionObj) Link Here
54
		}
93
		}
55
		obj1.free();
94
		obj1.free();
56
	}
95
	}
96
#endif
57
}
97
}
58
98
59
LinkSubmitForm::~LinkSubmitForm()
99
LinkSubmitForm::~LinkSubmitForm()
Lines 66-76 LinkImportData::LinkImportData(Object *actionObj) Link Here
66
{
106
{
67
	Object obj1, obj3;
107
	Object obj1, obj3;
68
	fileName = NULL;
108
	fileName = NULL;
109
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
110
	if (actionObj->isDict())
111
	{
112
		obj1 = actionObj->dictLookup("F");
113
		if (!obj1.isNull())
114
		{
115
			obj3 = getFileSpecNameForPlatform(&obj1);
116
			if (!obj3.isNull())
117
			{
118
				fileName = obj3.getString()->copy();
119
			}
120
		}
121
	}
122
#else
69
	if (actionObj->isDict())
123
	if (actionObj->isDict())
70
	{
124
	{
71
		if (!actionObj->dictLookup("F", &obj1)->isNull())
125
		if (!actionObj->dictLookup("F", &obj1)->isNull())
72
		{
126
		{
73
			if (getFileSpecNameForPlatform (&obj1, &obj3))
127
			if (getFileSpecNameForPlatform(&obj1, &obj3))
74
			{
128
			{
75
				fileName = obj3.getString()->copy();
129
				fileName = obj3.getString()->copy();
76
				obj3.free();
130
				obj3.free();
Lines 78-83 LinkImportData::LinkImportData(Object *actionObj) Link Here
78
		}
132
		}
79
		obj1.free();
133
		obj1.free();
80
	}
134
	}
135
#endif
81
}
136
}
82
137
83
LinkImportData::~LinkImportData()
138
LinkImportData::~LinkImportData()
Lines 256-261 LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano) Link Here
256
	Object obj;
311
	Object obj;
257
	Ref refa = ano->getRef();
312
	Ref refa = ano->getRef();
258
	Object additionalActions;
313
	Object additionalActions;
314
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
315
	obj = xref->fetch(refa.num, refa.gen);
316
	if (obj.isDict())
317
	{
318
		Dict* adic = obj.getDict();
319
		additionalActions = adic->lookupNF("A");
320
		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
321
		if (additionalActionsObject.isDict())
322
		{
323
			Object actionObject = additionalActionsObject.dictLookup("S");
324
			if (actionObject.isName("ImportData"))
325
			{
326
				linkAction = new LinkImportData(&additionalActionsObject);
327
			}
328
			else if (actionObject.isName("SubmitForm"))
329
			{
330
				linkAction = new LinkSubmitForm(&additionalActionsObject);
331
			}
332
		}
333
	}
334
#else
259
	Object *act = xref->fetch(refa.num, refa.gen, &obj);
335
	Object *act = xref->fetch(refa.num, refa.gen, &obj);
260
	if (act)
336
	if (act)
261
	{
337
	{
Lines 283-288 LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano) Link Here
283
		}
359
		}
284
	}
360
	}
285
	obj.free();
361
	obj.free();
362
#endif
286
	return linkAction;
363
	return linkAction;
287
}
364
}
288
365
Lines 293-298 LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a Link Here
293
	Object obj;
370
	Object obj;
294
	Ref refa = ano->getRef();
371
	Ref refa = ano->getRef();
295
	Object additionalActions;
372
	Object additionalActions;
373
374
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
375
	obj = xref->fetch(refa.num, refa.gen);
376
	if (obj.isDict())
377
	{
378
		Dict* adic = obj.getDict();
379
		additionalActions = adic->lookupNF("AA");
380
		Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
381
		if (additionalActionsObject.isDict())
382
		{
383
			Object actionObject = additionalActionsObject.dictLookup(key);
384
			if (actionObject.isDict())
385
				linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());
386
		}
387
	}
388
#else
296
	Object *act = xref->fetch(refa.num, refa.gen, &obj);
389
	Object *act = xref->fetch(refa.num, refa.gen, &obj);
297
	if (act)
390
	if (act)
298
	{
391
	{
Lines 313-318 LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *a Link Here
313
		}
406
		}
314
	}
407
	}
315
	obj.free();
408
	obj.free();
409
#endif
316
	return linkAction;
410
	return linkAction;
317
}
411
}
318
412
Lines 838-843 bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, Link Here
838
	{
932
	{
839
		Object obj1;
933
		Object obj1;
840
		Ref refa = annota->getRef();
934
		Ref refa = annota->getRef();
935
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
936
		obj1 = xref->fetch(refa.num, refa.gen);
937
		if (obj1.isDict())
938
		{
939
			Dict* dict = obj1.getDict();
940
			Object obj2 = dict->lookup("Kids");
941
			//childs
942
			if (obj2.isArray())
943
			{
944
				// Load children
945
				QList<int> radList;
946
				for (int i = 0; i < obj2.arrayGetLength(); i++)
947
				{
948
					Object childRef = obj2.arrayGetNF(i);
949
					if (!childRef.isRef())
950
						continue;
951
					Object childObj = obj2.arrayGet(i);
952
					if (!childObj.isDict())
953
						continue;
954
					const Ref ref = childRef.getRef();
955
					radList.append(ref.num);
956
				}
957
				QString tmTxt = UnicodeParsedString(annota->getName());
958
				m_radioMap.insert(tmTxt, radList);
959
			}
960
		}
961
#else
841
		Object *act = xref->fetch(refa.num, refa.gen, &obj1);
962
		Object *act = xref->fetch(refa.num, refa.gen, &obj1);
842
		if (act && act->isDict())
963
		if (act && act->isDict())
843
		{
964
		{
Lines 873-878 bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, Link Here
873
			obj2.free();
994
			obj2.free();
874
		}
995
		}
875
		obj1.free();
996
		obj1.free();
997
#endif
876
	}
998
	}
877
	return retVal;
999
	return retVal;
878
}
1000
}
Lines 3007-3012 void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef) Link Here
3007
		}
3129
		}
3008
		else
3130
		else
3009
		{
3131
		{
3132
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
3133
			dictObj = dictRef->fetch(xref);
3134
			if (!dictObj.isDict())
3135
				return;
3136
			dict = dictObj.getDict();
3137
			dictType = dict->lookup("Type");
3138
			if (dictType.isName("OCG"))
3139
			{
3140
				oc = contentConfig->findOcgByRef(dictRef->getRef());
3141
				if (oc)
3142
				{
3143
					//					qDebug() << "Begin OCG Content with Name " << UnicodeParsedString(oc->getName());
3144
					m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));
3145
					mSte.ocgName = UnicodeParsedString(oc->getName());
3146
				}
3147
			}
3148
#else
3010
			dictRef->fetch(xref, &dictObj);
3149
			dictRef->fetch(xref, &dictObj);
3011
			if (!dictObj.isDict())
3150
			if (!dictObj.isDict())
3012
			{
3151
			{
Lines 3027-3032 void SlaOutputDev::beginMarkedContent(char *name, Object *dictRef) Link Here
3027
			}
3166
			}
3028
			dictType.free();
3167
			dictType.free();
3029
			dictObj.free();
3168
			dictObj.free();
3169
#endif
3030
		}
3170
		}
3031
	}
3171
	}
3032
	m_mcStack.push(mSte);
3172
	m_mcStack.push(mSte);
Lines 3046-3059 void SlaOutputDev::beginMarkedContent(char *name, Dict *properties) Link Here
3046
		{
3186
		{
3047
			if (layersSetByOCG)
3187
			if (layersSetByOCG)
3048
				return;
3188
				return;
3049
			Object obj;
3050
			QString lName = QString("Layer_%1").arg(layerNum + 1);
3189
			QString lName = QString("Layer_%1").arg(layerNum + 1);
3190
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
3191
			Object obj = properties->lookup((char*) "Title");
3192
			if (obj.isString())
3193
				lName = QString(obj.getString()->getCString());
3194
#else
3195
			Object obj;
3051
			if (properties->lookup((char*)"Title", &obj))
3196
			if (properties->lookup((char*)"Title", &obj))
3052
			{
3197
			{
3053
				if (obj.isString())
3198
				if (obj.isString())
3054
					lName =  QString(obj.getString()->getCString());
3199
					lName =  QString(obj.getString()->getCString());
3055
				obj.free();
3200
				obj.free();
3056
			}
3201
			}
3202
#endif
3057
			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
3203
			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
3058
			{
3204
			{
3059
				if (it->Name == lName)
3205
				if (it->Name == lName)
Lines 3066-3071 void SlaOutputDev::beginMarkedContent(char *name, Dict *properties) Link Here
3066
			if (!firstLayer)
3212
			if (!firstLayer)
3067
				currentLayer = m_doc->addLayer(lName, true);
3213
				currentLayer = m_doc->addLayer(lName, true);
3068
			firstLayer = false;
3214
			firstLayer = false;
3215
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 58, 0)
3216
			obj = properties->lookup((char*) "Visible");
3217
			if (obj.isBool())
3218
				m_doc->setLayerVisible(currentLayer, obj.getBool());
3219
			obj = properties->lookup((char*) "Editable");
3220
			if (obj.isBool())
3221
				m_doc->setLayerLocked(currentLayer, !obj.getBool());
3222
			obj = properties->lookup((char*) "Printed");
3223
			if (obj.isBool())
3224
				m_doc->setLayerPrintable(currentLayer, obj.getBool());
3225
			obj = properties->lookup((char*)"Color");
3226
			if (obj.isArray())
3227
			{
3228
				Object obj1;
3229
				obj1 = obj.arrayGet(0);
3230
				int r = obj1.getNum() / 256;
3231
				obj1 = obj.arrayGet(1);
3232
				int g = obj1.getNum() / 256;
3233
				obj1 = obj.arrayGet(2);
3234
				int b = obj1.getNum() / 256;
3235
				m_doc->setLayerMarker(currentLayer, QColor(r, g, b));
3236
			}
3237
#else
3069
			if (properties->lookup((char*)"Visible", &obj))
3238
			if (properties->lookup((char*)"Visible", &obj))
3070
			{
3239
			{
3071
				if (obj.isBool())
3240
				if (obj.isBool())
Lines 3102-3107 void SlaOutputDev::beginMarkedContent(char *name, Dict *properties) Link Here
3102
				}
3271
				}
3103
				obj.free();
3272
				obj.free();
3104
			}
3273
			}
3274
#endif
3105
		}
3275
		}
3106
	}
3276
	}
3107
}
3277
}

Return to bug 629752