Lines 538-544
Link Here
|
538 |
pdfdoc_changed_error(L); \ |
538 |
pdfdoc_changed_error(L); \ |
539 |
uout = new_Object_userdata(L); \ |
539 |
uout = new_Object_userdata(L); \ |
540 |
uout->d = new Object(); \ |
540 |
uout->d = new Object(); \ |
541 |
((in *) uin->d)->function((Object *) uout->d); \ |
541 |
*((Object *)uout->d) = ((in *) uin->d)->function(); \ |
542 |
uout->atype = ALLOC_LEPDF; \ |
542 |
uout->atype = ALLOC_LEPDF; \ |
543 |
uout->pc = uin->pc; \ |
543 |
uout->pc = uin->pc; \ |
544 |
uout->pd = uin->pd; \ |
544 |
uout->pd = uin->pd; \ |
Lines 668-680
Link Here
|
668 |
|
668 |
|
669 |
static int m_Array_incRef(lua_State * L) |
669 |
static int m_Array_incRef(lua_State * L) |
670 |
{ |
670 |
{ |
671 |
int i; |
|
|
672 |
udstruct *uin; |
671 |
udstruct *uin; |
673 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Array); |
672 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Array); |
674 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
673 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
675 |
pdfdoc_changed_error(L); |
674 |
pdfdoc_changed_error(L); |
676 |
i = ((Array *) uin->d)->incRef(); |
675 |
lua_pushinteger(L, 1); |
677 |
lua_pushinteger(L, i); |
|
|
678 |
return 1; |
676 |
return 1; |
679 |
} |
677 |
} |
680 |
|
678 |
|
Lines 685-692
Link Here
|
685 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Array); |
683 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Array); |
686 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
684 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
687 |
pdfdoc_changed_error(L); |
685 |
pdfdoc_changed_error(L); |
688 |
i = ((Array *) uin->d)->decRef(); |
686 |
lua_pushinteger(L, 1); |
689 |
lua_pushinteger(L, i); |
|
|
690 |
return 1; |
687 |
return 1; |
691 |
} |
688 |
} |
692 |
|
689 |
|
Lines 702-708
Link Here
|
702 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
699 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
703 |
|| (uobj->pd != NULL && uobj->pd->pc != uobj->pc)) |
700 |
|| (uobj->pd != NULL && uobj->pd->pc != uobj->pc)) |
704 |
pdfdoc_changed_error(L); |
701 |
pdfdoc_changed_error(L); |
705 |
((Array *) uin->d)->add(((Object *) uobj->d)); |
702 |
((Array *) uin->d)->add(std::move(*((Object *) uobj->d))); |
706 |
return 0; |
703 |
return 0; |
707 |
} |
704 |
} |
708 |
|
705 |
|
Lines 718-724
Link Here
|
718 |
if (i > 0 && i <= len) { |
715 |
if (i > 0 && i <= len) { |
719 |
uout = new_Object_userdata(L); |
716 |
uout = new_Object_userdata(L); |
720 |
uout->d = new Object(); |
717 |
uout->d = new Object(); |
721 |
((Array *) uin->d)->get(i - 1, (Object *) uout->d); |
718 |
*((Object *) uout->d) = ((Array *) uin->d)->get(i - 1); |
722 |
uout->atype = ALLOC_LEPDF; |
719 |
uout->atype = ALLOC_LEPDF; |
723 |
uout->pc = uin->pc; |
720 |
uout->pc = uin->pc; |
724 |
uout->pd = uin->pd; |
721 |
uout->pd = uin->pd; |
Lines 739-745
Link Here
|
739 |
if (i > 0 && i <= len) { |
736 |
if (i > 0 && i <= len) { |
740 |
uout = new_Object_userdata(L); |
737 |
uout = new_Object_userdata(L); |
741 |
uout->d = new Object(); |
738 |
uout->d = new Object(); |
742 |
((Array *) uin->d)->getNF(i - 1, (Object *) uout->d); |
739 |
*((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1); |
743 |
uout->atype = ALLOC_LEPDF; |
740 |
uout->atype = ALLOC_LEPDF; |
744 |
uout->pc = uin->pc; |
741 |
uout->pc = uin->pc; |
745 |
uout->pd = uin->pd; |
742 |
uout->pd = uin->pd; |
Lines 953-977
Link Here
|
953 |
|
950 |
|
954 |
static int m_Dict_incRef(lua_State * L) |
951 |
static int m_Dict_incRef(lua_State * L) |
955 |
{ |
952 |
{ |
956 |
int i; |
|
|
957 |
udstruct *uin; |
953 |
udstruct *uin; |
958 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); |
954 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); |
959 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
955 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
960 |
pdfdoc_changed_error(L); |
956 |
pdfdoc_changed_error(L); |
961 |
i = ((Dict *) uin->d)->incRef(); |
957 |
lua_pushinteger(L, 1); |
962 |
lua_pushinteger(L, i); |
|
|
963 |
return 1; |
958 |
return 1; |
964 |
} |
959 |
} |
965 |
|
960 |
|
966 |
static int m_Dict_decRef(lua_State * L) |
961 |
static int m_Dict_decRef(lua_State * L) |
967 |
{ |
962 |
{ |
968 |
int i; |
|
|
969 |
udstruct *uin; |
963 |
udstruct *uin; |
970 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); |
964 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); |
971 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
965 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
972 |
pdfdoc_changed_error(L); |
966 |
pdfdoc_changed_error(L); |
973 |
i = ((Dict *) uin->d)->decRef(); |
967 |
lua_pushinteger(L, 1); |
974 |
lua_pushinteger(L, i); |
|
|
975 |
return 1; |
968 |
return 1; |
976 |
} |
969 |
} |
977 |
|
970 |
|
Lines 986-992
Link Here
|
986 |
pdfdoc_changed_error(L); |
979 |
pdfdoc_changed_error(L); |
987 |
s = copyString(luaL_checkstring(L, 2)); |
980 |
s = copyString(luaL_checkstring(L, 2)); |
988 |
uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); |
981 |
uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); |
989 |
((Dict *) uin->d)->add(s, ((Object *) uobj->d)); |
982 |
((Dict *) uin->d)->add(s, std::move(*((Object *) uobj->d))); |
990 |
return 0; |
983 |
return 0; |
991 |
} |
984 |
} |
992 |
|
985 |
|
Lines 999-1005
Link Here
|
999 |
pdfdoc_changed_error(L); |
992 |
pdfdoc_changed_error(L); |
1000 |
s = luaL_checkstring(L, 2); |
993 |
s = luaL_checkstring(L, 2); |
1001 |
uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); |
994 |
uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); |
1002 |
((Dict *) uin->d)->set(s, ((Object *) uobj->d)); |
995 |
((Dict *) uin->d)->set(s, std::move(*((Object *) uobj->d))); |
1003 |
return 0; |
996 |
return 0; |
1004 |
} |
997 |
} |
1005 |
|
998 |
|
Lines 1027-1033
Link Here
|
1027 |
s = luaL_checkstring(L, 2); |
1020 |
s = luaL_checkstring(L, 2); |
1028 |
uout = new_Object_userdata(L); |
1021 |
uout = new_Object_userdata(L); |
1029 |
uout->d = new Object(); |
1022 |
uout->d = new Object(); |
1030 |
((Dict *) uin->d)->lookup(s, (Object *) uout->d); |
1023 |
*((Object *) uout->d) = ((Dict *) uin->d)->lookup(s); |
1031 |
uout->atype = ALLOC_LEPDF; |
1024 |
uout->atype = ALLOC_LEPDF; |
1032 |
uout->pc = uin->pc; |
1025 |
uout->pc = uin->pc; |
1033 |
uout->pd = uin->pd; |
1026 |
uout->pd = uin->pd; |
Lines 1044-1050
Link Here
|
1044 |
s = luaL_checkstring(L, 2); |
1037 |
s = luaL_checkstring(L, 2); |
1045 |
uout = new_Object_userdata(L); |
1038 |
uout = new_Object_userdata(L); |
1046 |
uout->d = new Object(); |
1039 |
uout->d = new Object(); |
1047 |
((Dict *) uin->d)->lookupNF(s, (Object *) uout->d); |
1040 |
*((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s); |
1048 |
uout->atype = ALLOC_LEPDF; |
1041 |
uout->atype = ALLOC_LEPDF; |
1049 |
uout->pc = uin->pc; |
1042 |
uout->pc = uin->pc; |
1050 |
uout->pd = uin->pd; |
1043 |
uout->pd = uin->pd; |
Lines 1096-1102
Link Here
|
1096 |
if (i > 0 && i <= len) { |
1089 |
if (i > 0 && i <= len) { |
1097 |
uout = new_Object_userdata(L); |
1090 |
uout = new_Object_userdata(L); |
1098 |
uout->d = new Object(); |
1091 |
uout->d = new Object(); |
1099 |
((Dict *) uin->d)->getVal(i - 1, (Object *) uout->d); |
1092 |
*((Object *) uout->d) = ((Dict *) uin->d)->getVal(i - 1); |
1100 |
uout->atype = ALLOC_LEPDF; |
1093 |
uout->atype = ALLOC_LEPDF; |
1101 |
uout->pc = uin->pc; |
1094 |
uout->pc = uin->pc; |
1102 |
uout->pd = uin->pd; |
1095 |
uout->pd = uin->pd; |
Lines 1117-1123
Link Here
|
1117 |
if (i > 0 && i <= len) { |
1110 |
if (i > 0 && i <= len) { |
1118 |
uout = new_Object_userdata(L); |
1111 |
uout = new_Object_userdata(L); |
1119 |
uout->d = new Object(); |
1112 |
uout->d = new Object(); |
1120 |
((Dict *) uin->d)->getValNF(i - 1, (Object *) uout->d); |
1113 |
*((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1); |
1121 |
uout->atype = ALLOC_LEPDF; |
1114 |
uout->atype = ALLOC_LEPDF; |
1122 |
uout->pc = uin->pc; |
1115 |
uout->pc = uin->pc; |
1123 |
uout->pd = uin->pd; |
1116 |
uout->pd = uin->pd; |
Lines 1381-1389
Link Here
|
1381 |
pdfdoc_changed_error(L); |
1374 |
pdfdoc_changed_error(L); |
1382 |
luaL_checktype(L, 2, LUA_TBOOLEAN); |
1375 |
luaL_checktype(L, 2, LUA_TBOOLEAN); |
1383 |
if (lua_toboolean(L, 2) != 0) |
1376 |
if (lua_toboolean(L, 2) != 0) |
1384 |
((Object *) uin->d)->initBool(gTrue); |
1377 |
*((Object *) uin->d) = Object(gTrue); |
1385 |
else |
1378 |
else |
1386 |
((Object *) uin->d)->initBool(gFalse); |
1379 |
*((Object *) uin->d) = Object(gFalse); |
1387 |
return 0; |
1380 |
return 0; |
1388 |
} |
1381 |
} |
1389 |
|
1382 |
|
Lines 1395-1401
Link Here
|
1395 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1388 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1396 |
pdfdoc_changed_error(L); |
1389 |
pdfdoc_changed_error(L); |
1397 |
i = luaL_checkint(L, 2); |
1390 |
i = luaL_checkint(L, 2); |
1398 |
((Object *) uin->d)->initInt(i); |
1391 |
*((Object *) uin->d) = Object(i); |
1399 |
return 0; |
1392 |
return 0; |
1400 |
} |
1393 |
} |
1401 |
|
1394 |
|
Lines 1407-1413
Link Here
|
1407 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1400 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1408 |
pdfdoc_changed_error(L); |
1401 |
pdfdoc_changed_error(L); |
1409 |
d = luaL_checknumber(L, 2); |
1402 |
d = luaL_checknumber(L, 2); |
1410 |
((Object *) uin->d)->initReal(d); |
1403 |
*((Object *) uin->d) = Object(d); |
1411 |
return 0; |
1404 |
return 0; |
1412 |
} |
1405 |
} |
1413 |
|
1406 |
|
Lines 1422-1428
Link Here
|
1422 |
pdfdoc_changed_error(L); |
1415 |
pdfdoc_changed_error(L); |
1423 |
s = luaL_checklstring(L, 2, &len); |
1416 |
s = luaL_checklstring(L, 2, &len); |
1424 |
gs = new GooString(s, len); |
1417 |
gs = new GooString(s, len); |
1425 |
((Object *) uin->d)->initString(gs); |
1418 |
*((Object *) uin->d) = Object(gs); |
1426 |
return 0; |
1419 |
return 0; |
1427 |
} |
1420 |
} |
1428 |
|
1421 |
|
Lines 1434-1440
Link Here
|
1434 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1427 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1435 |
pdfdoc_changed_error(L); |
1428 |
pdfdoc_changed_error(L); |
1436 |
s = luaL_checkstring(L, 2); |
1429 |
s = luaL_checkstring(L, 2); |
1437 |
((Object *) uin->d)->initName(s); |
1430 |
*((Object *) uin->d) = Object(objName, s); |
1438 |
return 0; |
1431 |
return 0; |
1439 |
} |
1432 |
} |
1440 |
|
1433 |
|
Lines 1444-1456
Link Here
|
1444 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1437 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1445 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1438 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1446 |
pdfdoc_changed_error(L); |
1439 |
pdfdoc_changed_error(L); |
1447 |
((Object *) uin->d)->initNull(); |
1440 |
*((Object *) uin->d) = Object(objNull); |
1448 |
return 0; |
1441 |
return 0; |
1449 |
} |
1442 |
} |
1450 |
|
1443 |
|
1451 |
static int m_Object_initArray(lua_State * L) |
1444 |
static int m_Object_initArray(lua_State * L) |
1452 |
{ |
1445 |
{ |
1453 |
udstruct *uin, *uxref; |
1446 |
udstruct *uin, *uxref; |
|
|
1447 |
Array *a; |
1454 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1448 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1455 |
uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); |
1449 |
uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); |
1456 |
if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) |
1450 |
if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) |
Lines 1458-1464
Link Here
|
1458 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1452 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1459 |
|| (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) |
1453 |
|| (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) |
1460 |
pdfdoc_changed_error(L); |
1454 |
pdfdoc_changed_error(L); |
1461 |
((Object *) uin->d)->initArray((XRef *) uxref->d); |
1455 |
a = new Array((XRef *) uxref->d); |
|
|
1456 |
*((Object *) uin->d) = Object(a); |
1462 |
return 0; |
1457 |
return 0; |
1463 |
} |
1458 |
} |
1464 |
|
1459 |
|
Lines 1469-1474
Link Here
|
1469 |
static int m_Object_initDict(lua_State * L) |
1464 |
static int m_Object_initDict(lua_State * L) |
1470 |
{ |
1465 |
{ |
1471 |
udstruct *uin, *uxref; |
1466 |
udstruct *uin, *uxref; |
|
|
1467 |
Dict *d; |
1472 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1468 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1473 |
uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); |
1469 |
uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); |
1474 |
if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) |
1470 |
if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) |
Lines 1476-1482
Link Here
|
1476 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1472 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1477 |
|| (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) |
1473 |
|| (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) |
1478 |
pdfdoc_changed_error(L); |
1474 |
pdfdoc_changed_error(L); |
1479 |
((Object *) uin->d)->initDict((XRef *) uxref->d); |
1475 |
d = new Dict((XRef *) uxref->d); |
|
|
1476 |
*((Object *) uin->d) = Object(d); |
1480 |
return 0; |
1477 |
return 0; |
1481 |
} |
1478 |
} |
1482 |
|
1479 |
|
Lines 1490-1496
Link Here
|
1490 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1487 |
if ((uin->pd != NULL && uin->pd->pc != uin->pc) |
1491 |
|| (ustream->pd != NULL && ustream->pd->pc != ustream->pc)) |
1488 |
|| (ustream->pd != NULL && ustream->pd->pc != ustream->pc)) |
1492 |
pdfdoc_changed_error(L); |
1489 |
pdfdoc_changed_error(L); |
1493 |
((Object *) uin->d)->initStream((Stream *) ustream->d); |
1490 |
*((Object *) uin->d) = Object((Stream *) ustream->d); |
1494 |
return 0; |
1491 |
return 0; |
1495 |
} |
1492 |
} |
1496 |
|
1493 |
|
Lines 1503-1509
Link Here
|
1503 |
pdfdoc_changed_error(L); |
1500 |
pdfdoc_changed_error(L); |
1504 |
num = luaL_checkint(L, 2); |
1501 |
num = luaL_checkint(L, 2); |
1505 |
gen = luaL_checkint(L, 3); |
1502 |
gen = luaL_checkint(L, 3); |
1506 |
((Object *) uin->d)->initRef(num, gen); |
1503 |
*((Object *) uin->d) = Object(num, gen); |
1507 |
return 0; |
1504 |
return 0; |
1508 |
} |
1505 |
} |
1509 |
|
1506 |
|
Lines 1515-1521
Link Here
|
1515 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1512 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1516 |
pdfdoc_changed_error(L); |
1513 |
pdfdoc_changed_error(L); |
1517 |
s = luaL_checkstring(L, 2); |
1514 |
s = luaL_checkstring(L, 2); |
1518 |
((Object *) uin->d)->initCmd(CHARP_CAST s); |
1515 |
*((Object *) uin->d) = Object(objCmd, CHARP_CAST s); |
1519 |
return 0; |
1516 |
return 0; |
1520 |
} |
1517 |
} |
1521 |
|
1518 |
|
Lines 1525-1531
Link Here
|
1525 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1522 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1526 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1523 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1527 |
pdfdoc_changed_error(L); |
1524 |
pdfdoc_changed_error(L); |
1528 |
((Object *) uin->d)->initError(); |
1525 |
*((Object *) uin->d) = Object(objError); |
1529 |
return 0; |
1526 |
return 0; |
1530 |
} |
1527 |
} |
1531 |
|
1528 |
|
Lines 1535-1541
Link Here
|
1535 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1532 |
uin = (udstruct *) luaL_checkudata(L, 1, M_Object); |
1536 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1533 |
if (uin->pd != NULL && uin->pd->pc != uin->pc) |
1537 |
pdfdoc_changed_error(L); |
1534 |
pdfdoc_changed_error(L); |
1538 |
((Object *) uin->d)->initEOF(); |
1535 |
*((Object *) uin->d) = Object(objEOF); |
1539 |
return 0; |
1536 |
return 0; |
1540 |
} |
1537 |
} |
1541 |
|
1538 |
|
Lines 1551-1557
Link Here
|
1551 |
pdfdoc_changed_error(L); |
1548 |
pdfdoc_changed_error(L); |
1552 |
uout = new_Object_userdata(L); |
1549 |
uout = new_Object_userdata(L); |
1553 |
uout->d = new Object(); |
1550 |
uout->d = new Object(); |
1554 |
((Object *) uin->d)->fetch((XRef *) uxref->d, (Object *) uout->d); |
1551 |
*((Object *) uout->d) = ((Object *) uin->d)->fetch((XRef *) uxref->d); |
1555 |
uout->atype = ALLOC_LEPDF; |
1552 |
uout->atype = ALLOC_LEPDF; |
1556 |
uout->pc = uin->pc; |
1553 |
uout->pc = uin->pc; |
1557 |
uout->pd = uin->pd; |
1554 |
uout->pd = uin->pd; |
Lines 1816-1822
Link Here
|
1816 |
pdfdoc_changed_error(L); |
1813 |
pdfdoc_changed_error(L); |
1817 |
if (!((Object *) uin->d)->isArray()) |
1814 |
if (!((Object *) uin->d)->isArray()) |
1818 |
luaL_error(L, "Object is not an Array"); |
1815 |
luaL_error(L, "Object is not an Array"); |
1819 |
((Object *) uin->d)->arrayAdd((Object *) uobj->d); |
1816 |
((Object *) uin->d)->arrayAdd(std::move(*((Object *) uobj->d))); |
1820 |
return 0; |
1817 |
return 0; |
1821 |
} |
1818 |
} |
1822 |
|
1819 |
|
Lines 1833-1839
Link Here
|
1833 |
if (i > 0 && i <= len) { |
1830 |
if (i > 0 && i <= len) { |
1834 |
uout = new_Object_userdata(L); |
1831 |
uout = new_Object_userdata(L); |
1835 |
uout->d = new Object(); |
1832 |
uout->d = new Object(); |
1836 |
((Object *) uin->d)->arrayGet(i - 1, (Object *) uout->d); |
1833 |
*((Object *) uout->d) = ((Object *) uin->d)->arrayGet(i - 1); |
1837 |
uout->atype = ALLOC_LEPDF; |
1834 |
uout->atype = ALLOC_LEPDF; |
1838 |
uout->pc = uin->pc; |
1835 |
uout->pc = uin->pc; |
1839 |
uout->pd = uin->pd; |
1836 |
uout->pd = uin->pd; |
Lines 1857-1863
Link Here
|
1857 |
if (i > 0 && i <= len) { |
1854 |
if (i > 0 && i <= len) { |
1858 |
uout = new_Object_userdata(L); |
1855 |
uout = new_Object_userdata(L); |
1859 |
uout->d = new Object(); |
1856 |
uout->d = new Object(); |
1860 |
((Object *) uin->d)->arrayGetNF(i - 1, (Object *) uout->d); |
1857 |
*((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1); |
1861 |
uout->atype = ALLOC_LEPDF; |
1858 |
uout->atype = ALLOC_LEPDF; |
1862 |
uout->pc = uin->pc; |
1859 |
uout->pc = uin->pc; |
1863 |
uout->pd = uin->pd; |
1860 |
uout->pd = uin->pd; |
Lines 1897-1903
Link Here
|
1897 |
pdfdoc_changed_error(L); |
1894 |
pdfdoc_changed_error(L); |
1898 |
if (!((Object *) uin->d)->isDict()) |
1895 |
if (!((Object *) uin->d)->isDict()) |
1899 |
luaL_error(L, "Object is not a Dict"); |
1896 |
luaL_error(L, "Object is not a Dict"); |
1900 |
((Object *) uin->d)->dictAdd(copyString(s), (Object *) uobj->d); |
1897 |
((Object *) uin->d)->dictAdd(copyString(s), std::move(*((Object *) uobj->d))); |
1901 |
return 0; |
1898 |
return 0; |
1902 |
} |
1899 |
} |
1903 |
|
1900 |
|
Lines 1915-1921
Link Here
|
1915 |
pdfdoc_changed_error(L); |
1912 |
pdfdoc_changed_error(L); |
1916 |
if (!((Object *) uin->d)->isDict()) |
1913 |
if (!((Object *) uin->d)->isDict()) |
1917 |
luaL_error(L, "Object is not a Dict"); |
1914 |
luaL_error(L, "Object is not a Dict"); |
1918 |
((Object *) uin->d)->dictSet(s, (Object *) uobj->d); |
1915 |
((Object *) uin->d)->dictSet(s, std::move(*((Object *) uobj->d))); |
1919 |
return 0; |
1916 |
return 0; |
1920 |
} |
1917 |
} |
1921 |
|
1918 |
|
Lines 1930-1936
Link Here
|
1930 |
if (((Object *) uin->d)->isDict()) { |
1927 |
if (((Object *) uin->d)->isDict()) { |
1931 |
uout = new_Object_userdata(L); |
1928 |
uout = new_Object_userdata(L); |
1932 |
uout->d = new Object(); |
1929 |
uout->d = new Object(); |
1933 |
((Object *) uin->d)->dictLookup(s, (Object *) uout->d); |
1930 |
*((Object *) uout->d) = ((Object *) uin->d)->dictLookup(s); |
1934 |
uout->atype = ALLOC_LEPDF; |
1931 |
uout->atype = ALLOC_LEPDF; |
1935 |
uout->pc = uin->pc; |
1932 |
uout->pc = uin->pc; |
1936 |
uout->pd = uin->pd; |
1933 |
uout->pd = uin->pd; |
Lines 1950-1956
Link Here
|
1950 |
if (((Object *) uin->d)->isDict()) { |
1947 |
if (((Object *) uin->d)->isDict()) { |
1951 |
uout = new_Object_userdata(L); |
1948 |
uout = new_Object_userdata(L); |
1952 |
uout->d = new Object(); |
1949 |
uout->d = new Object(); |
1953 |
((Object *) uin->d)->dictLookupNF(s, (Object *) uout->d); |
1950 |
*((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s); |
1954 |
uout->atype = ALLOC_LEPDF; |
1951 |
uout->atype = ALLOC_LEPDF; |
1955 |
uout->pc = uin->pc; |
1952 |
uout->pc = uin->pc; |
1956 |
uout->pd = uin->pd; |
1953 |
uout->pd = uin->pd; |
Lines 1991-1997
Link Here
|
1991 |
if (i > 0 && i <= len) { |
1988 |
if (i > 0 && i <= len) { |
1992 |
uout = new_Object_userdata(L); |
1989 |
uout = new_Object_userdata(L); |
1993 |
uout->d = new Object(); |
1990 |
uout->d = new Object(); |
1994 |
((Object *) uin->d)->dictGetVal(i - 1, (Object *) uout->d); |
1991 |
*((Object *) uout->d) = ((Object *) uin->d)->dictGetVal(i - 1); |
1995 |
uout->atype = ALLOC_LEPDF; |
1992 |
uout->atype = ALLOC_LEPDF; |
1996 |
uout->pc = uin->pc; |
1993 |
uout->pc = uin->pc; |
1997 |
uout->pd = uin->pd; |
1994 |
uout->pd = uin->pd; |
Lines 2015-2021
Link Here
|
2015 |
if (i > 0 && i <= len) { |
2012 |
if (i > 0 && i <= len) { |
2016 |
uout = new_Object_userdata(L); |
2013 |
uout = new_Object_userdata(L); |
2017 |
uout->d = new Object(); |
2014 |
uout->d = new Object(); |
2018 |
((Object *) uin->d)->dictGetValNF(i - 1, (Object *) uout->d); |
2015 |
*((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1); |
2019 |
uout->atype = ALLOC_LEPDF; |
2016 |
uout->atype = ALLOC_LEPDF; |
2020 |
uout->pc = uin->pc; |
2017 |
uout->pc = uin->pc; |
2021 |
uout->pd = uin->pd; |
2018 |
uout->pd = uin->pd; |
Lines 2243-2249
Link Here
|
2243 |
m_poppler_get_poppler(Page, Dict, getPieceInfo); |
2240 |
m_poppler_get_poppler(Page, Dict, getPieceInfo); |
2244 |
m_poppler_get_poppler(Page, Dict, getSeparationInfo); |
2241 |
m_poppler_get_poppler(Page, Dict, getSeparationInfo); |
2245 |
m_poppler_get_poppler(Page, Dict, getResourceDict); |
2242 |
m_poppler_get_poppler(Page, Dict, getResourceDict); |
2246 |
m_poppler_get_OBJECT(Page, getAnnots); |
2243 |
m_poppler_get_OBJECT(Page, getAnnotsObject); |
2247 |
|
2244 |
|
2248 |
m_poppler_get_OBJECT(Page, getContents); |
2245 |
m_poppler_get_OBJECT(Page, getContents); |
2249 |
|
2246 |
|
Lines 2270-2276
Link Here
|
2270 |
{"getPieceInfo", m_Page_getPieceInfo}, |
2267 |
{"getPieceInfo", m_Page_getPieceInfo}, |
2271 |
{"getSeparationInfo", m_Page_getSeparationInfo}, |
2268 |
{"getSeparationInfo", m_Page_getSeparationInfo}, |
2272 |
{"getResourceDict", m_Page_getResourceDict}, |
2269 |
{"getResourceDict", m_Page_getResourceDict}, |
2273 |
{"getAnnots", m_Page_getAnnots}, |
2270 |
{"getAnnots", m_Page_getAnnotsObject}, |
2274 |
{"getContents", m_Page_getContents}, |
2271 |
{"getContents", m_Page_getContents}, |
2275 |
{"__tostring", m_Page__tostring}, |
2272 |
{"__tostring", m_Page__tostring}, |
2276 |
{NULL, NULL} // sentinel |
2273 |
{NULL, NULL} // sentinel |
Lines 2520-2526
Link Here
|
2520 |
if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { |
2517 |
if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { |
2521 |
uout = new_Object_userdata(L); |
2518 |
uout = new_Object_userdata(L); |
2522 |
uout->d = new Object(); |
2519 |
uout->d = new Object(); |
2523 |
((PdfDocument *) uin->d)->doc->getDocInfo((Object *) uout->d); |
2520 |
*((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfo(); |
2524 |
uout->atype = ALLOC_LEPDF; |
2521 |
uout->atype = ALLOC_LEPDF; |
2525 |
uout->pc = uin->pc; |
2522 |
uout->pc = uin->pc; |
2526 |
uout->pd = uin->pd; |
2523 |
uout->pd = uin->pd; |
Lines 2538-2544
Link Here
|
2538 |
if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { |
2535 |
if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { |
2539 |
uout = new_Object_userdata(L); |
2536 |
uout = new_Object_userdata(L); |
2540 |
uout->d = new Object(); |
2537 |
uout->d = new Object(); |
2541 |
((PdfDocument *) uin->d)->doc->getDocInfoNF((Object *) uout->d); |
2538 |
*((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfoNF(); |
2542 |
uout->atype = ALLOC_LEPDF; |
2539 |
uout->atype = ALLOC_LEPDF; |
2543 |
uout->pc = uin->pc; |
2540 |
uout->pc = uin->pc; |
2544 |
uout->pd = uin->pd; |
2541 |
uout->pd = uin->pd; |
Lines 2841-2847
Link Here
|
2841 |
uout = new_Object_userdata(L); |
2838 |
uout = new_Object_userdata(L); |
2842 |
uout->d = new Object(); |
2839 |
uout->d = new Object(); |
2843 |
origin = (Object *) (((Attribute *) uin->d)->getValue()); |
2840 |
origin = (Object *) (((Attribute *) uin->d)->getValue()); |
2844 |
origin->copy ( ((Object *)uout->d) ); |
2841 |
*((Object *) uout->d) = origin->copy(); |
2845 |
uout->atype = ALLOC_LEPDF; |
2842 |
uout->atype = ALLOC_LEPDF; |
2846 |
uout->pc = uin->pc; |
2843 |
uout->pc = uin->pc; |
2847 |
uout->pd = uin->pd; |
2844 |
uout->pd = uin->pd; |
Lines 3320-3326
Link Here
|
3320 |
parent = root->findParentElement(i-1); |
3317 |
parent = root->findParentElement(i-1); |
3321 |
if (parent != NULL) { |
3318 |
if (parent != NULL) { |
3322 |
uout = new_StructElement_userdata(L); |
3319 |
uout = new_StructElement_userdata(L); |
3323 |
uout->d = new StructElement( *parent ); |
3320 |
uout->d = (StructElement *) parent; |
3324 |
uout->atype = ALLOC_LEPDF; |
3321 |
uout->atype = ALLOC_LEPDF; |
3325 |
uout->pc = uin->pc; |
3322 |
uout->pc = uin->pc; |
3326 |
uout->pd = uin->pd; |
3323 |
uout->pd = uin->pd; |
Lines 3370-3376
Link Here
|
3370 |
gen = luaL_checkint(L, 3); |
3367 |
gen = luaL_checkint(L, 3); |
3371 |
uout = new_Object_userdata(L); |
3368 |
uout = new_Object_userdata(L); |
3372 |
uout->d = new Object(); |
3369 |
uout->d = new Object(); |
3373 |
((XRef *) uin->d)->fetch(num, gen, (Object *) uout->d); |
3370 |
*((Object *) uout->d) = ((XRef *) uin->d)->fetch(num, gen); |
3374 |
uout->atype = ALLOC_LEPDF; |
3371 |
uout->atype = ALLOC_LEPDF; |
3375 |
uout->pc = uin->pc; |
3372 |
uout->pc = uin->pc; |
3376 |
uout->pd = uin->pd; |
3373 |
uout->pd = uin->pd; |