2018-07-20 11:53:16 +02:00
|
|
|
Index: texk/web2c/pdftexdir/pdftosrc.cc
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/pdftosrc.cc
|
|
|
|
+++ texk/web2c/pdftexdir/pdftosrc.cc
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
2018-07-20 11:53:16 +02:00
|
|
|
Stream *s;
|
|
|
|
Object srcStream, srcName, catalogDict;
|
|
|
|
FILE *outfile;
|
|
|
|
- char *outname;
|
|
|
|
+ const char *outname = NULL;
|
|
|
|
int objnum = 0, objgen = 0;
|
|
|
|
bool extract_xref_table = false;
|
|
|
|
int c;
|
|
|
|
Index: texk/web2c/pdftexdir/pdftoepdf.cc
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/pdftoepdf.cc
|
|
|
|
+++ texk/web2c/pdftexdir/pdftoepdf.cc
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -279,7 +279,7 @@ static int getNewObjectNumber(Ref ref)
|
2018-07-20 11:53:16 +02:00
|
|
|
|
|
|
|
static void copyObject(Object *);
|
|
|
|
|
|
|
|
-static void copyName(char *s)
|
|
|
|
+static void copyName(const char *s)
|
|
|
|
{
|
|
|
|
pdf_puts("/");
|
|
|
|
for (; *s != 0; s++) {
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -291,7 +291,7 @@ static void copyName(char *s)
|
2018-07-20 11:53:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyDictEntry(Object * obj, int i)
|
|
|
|
+static void copyDictEntry(const Object * obj, int i)
|
|
|
|
{
|
|
|
|
Object obj1;
|
|
|
|
copyName(obj->dictGetKey(i));
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -301,7 +301,7 @@ static void copyDictEntry(Object * obj,
|
2018-07-20 11:53:16 +02:00
|
|
|
pdf_puts("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyDict(Object * obj)
|
|
|
|
+static void copyDict(const Object * obj)
|
|
|
|
{
|
|
|
|
int i, l;
|
|
|
|
if (!obj->isDict())
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -311,10 +311,10 @@ static void copyDict(Object * obj)
|
2018-07-20 11:53:16 +02:00
|
|
|
copyDictEntry(obj, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyFontDict(Object * obj, InObj * r)
|
|
|
|
+static void copyFontDict(const Object * obj, InObj * r)
|
|
|
|
{
|
|
|
|
int i, l;
|
2019-01-02 10:34:52 +01:00
|
|
|
- char *key;
|
|
|
|
+ const char *key;
|
|
|
|
if (!obj->isDict())
|
|
|
|
pdftex_fail("PDF inclusion: invalid dict type <%s>",
|
|
|
|
obj->getTypeName());
|
|
|
|
@@ -386,7 +386,7 @@ static void copyProcSet(Object * obj)
|
2018-07-20 11:53:16 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyFont(char *tag, Object * fontRef)
|
|
|
|
+static void copyFont(const char *tag, Object * fontRef)
|
|
|
|
{
|
|
|
|
Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
|
|
|
|
stemV;
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -471,7 +471,7 @@ static void copyFontResources(Object * obj)
|
|
|
|
pdf_puts(">>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyOtherResources(Object * obj, char *key)
|
|
|
|
+static void copyOtherResources(Object * obj, const char *key)
|
|
|
|
{
|
|
|
|
// copies all other resources (write_epdf handles Fonts and ProcSets),
|
|
|
|
|
|
|
|
@@ -558,8 +558,8 @@ static void copyObject(Object * obj)
|
2018-07-20 11:53:16 +02:00
|
|
|
Object obj1;
|
|
|
|
int i, l, c;
|
|
|
|
Ref ref;
|
|
|
|
- char *p;
|
|
|
|
- GString *s;
|
|
|
|
+ const char *p;
|
|
|
|
+ const GString *s;
|
|
|
|
if (obj->isBool()) {
|
|
|
|
pdf_printf("%s", obj->getBool()? "true" : "false");
|
|
|
|
} else if (obj->isInt()) {
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -662,7 +662,7 @@ static void writeRefs()
|
|
|
|
static void writeEncodings()
|
|
|
|
{
|
|
|
|
UsedEncoding *r, *n;
|
|
|
|
- char *glyphNames[256], *s;
|
|
|
|
+ const char *glyphNames[256], *s;
|
|
|
|
int i;
|
|
|
|
for (r = encodingList; r != 0; r = r->next) {
|
|
|
|
for (i = 0; i < 256; i++) {
|
|
|
|
@@ -690,7 +690,7 @@ static void writeEncodings()
|
|
|
|
}
|
|
|
|
|
|
|
|
// get the pagebox according to the pagebox_spec
|
|
|
|
-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
|
|
|
|
+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
|
|
|
|
{
|
|
|
|
if (pagebox_spec == pdfboxspecmedia)
|
|
|
|
return page->getMediaBox();
|
|
|
|
@@ -722,7 +722,7 @@ read_pdf_info(char *image_name, char *page_name, int page_num,
|
|
|
|
{
|
|
|
|
PdfDocument *pdf_doc;
|
|
|
|
Page *page;
|
|
|
|
- PDFRectangle *pagebox;
|
|
|
|
+ const PDFRectangle *pagebox;
|
|
|
|
#ifdef POPPLER_VERSION
|
|
|
|
int pdf_major_version_found, pdf_minor_version_found;
|
|
|
|
#else
|
|
|
|
@@ -829,7 +829,7 @@ void write_epdf(void)
|
|
|
|
Object groupDict;
|
|
|
|
bool writeSepGroup = false;
|
|
|
|
Object info;
|
|
|
|
- char *key;
|
|
|
|
+ const char *key;
|
|
|
|
char s[256];
|
|
|
|
int i, l;
|
|
|
|
int rotate;
|
|
|
|
@@ -856,7 +856,7 @@ void write_epdf(void)
|
|
|
|
pageObj = xref->fetch(pageRef->num, pageRef->gen);
|
|
|
|
pageDict = pageObj.getDict();
|
|
|
|
rotate = page->getRotate();
|
|
|
|
- PDFRectangle *pagebox;
|
|
|
|
+ const PDFRectangle *pagebox;
|
|
|
|
// write the Page header
|
|
|
|
pdf_puts("/Type /XObject\n");
|
|
|
|
pdf_puts("/Subtype /Form\n");
|
2018-07-20 11:53:16 +02:00
|
|
|
Index: texk/web2c/pdftexdir/epdf.c
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/epdf.c
|
|
|
|
+++ texk/web2c/pdftexdir/epdf.c
|
|
|
|
@@ -69,7 +69,7 @@ int get_fn_objnum(fd_entry * fd)
|
|
|
|
* leading slashes, but without blanks between them, like: /a/b/c
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
-void epdf_mark_glyphs(fd_entry * fd, char *charset)
|
|
|
|
+void epdf_mark_glyphs(fd_entry * fd, const char *charset)
|
|
|
|
{
|
|
|
|
char *p, *q, *s;
|
|
|
|
char *glyph;
|
|
|
|
Index: texk/web2c/pdftexdir/mapfile.c
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/mapfile.c
|
|
|
|
+++ texk/web2c/pdftexdir/mapfile.c
|
|
|
|
@@ -682,7 +682,7 @@ static boolean fm_valid_for_font_replace
|
|
|
|
* used for Type1 font replacement when embedding of PDF files
|
|
|
|
*/
|
|
|
|
|
|
|
|
-fm_entry *lookup_fontmap(char *ps_name)
|
|
|
|
+fm_entry *lookup_fontmap(const char *ps_name)
|
|
|
|
{
|
|
|
|
fm_entry *fm, *fm2, tmp;
|
|
|
|
char *a, *b, *c, *d, *e, *s;
|
|
|
|
Index: texk/web2c/pdftexdir/pdftex-common.h
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/pdftex-common.h
|
|
|
|
+++ texk/web2c/pdftexdir/pdftex-common.h
|
|
|
|
@@ -67,7 +67,7 @@ extern void zpdfbeginobj(integer, intege
|
|
|
|
extern void embed_whole_font(fd_entry *);
|
|
|
|
extern fd_entry *epdf_create_fontdescriptor(fm_entry *, int);
|
|
|
|
extern void epdf_free(void);
|
|
|
|
-extern void epdf_mark_glyphs(fd_entry *, char *);
|
|
|
|
+extern void epdf_mark_glyphs(fd_entry *, const char *);
|
|
|
|
extern int get_fd_objnum(fd_entry *);
|
|
|
|
extern int get_fn_objnum(fd_entry *);
|
|
|
|
extern int is_subsetable(fm_entry *);
|
|
|
|
@@ -76,7 +76,7 @@ extern int is_subsetable(fm_entry *);
|
|
|
|
extern char notdef[];
|
|
|
|
|
|
|
|
/* mapfile.c */
|
|
|
|
-extern fm_entry *lookup_fontmap(char *);
|
|
|
|
+extern fm_entry *lookup_fontmap(const char *);
|
|
|
|
#undef fd_entry
|
|
|
|
#undef fm_entry
|
|
|
|
|
2019-01-02 10:34:52 +01:00
|
|
|
@@ -101,7 +101,7 @@ extern void tex_printf(const char *, ...);
|
|
|
|
extern void write_epdf(void);
|
|
|
|
|
|
|
|
/* writeenc.c */
|
|
|
|
-extern void epdf_write_enc(char **, int);
|
|
|
|
+extern void epdf_write_enc(const char **, int);
|
|
|
|
|
|
|
|
/* writeimg.c */
|
|
|
|
extern float epdf_width;
|
|
|
|
Index: texk/web2c/pdftexdir/writeenc.c
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/pdftexdir/writeenc.c
|
|
|
|
+++ texk/web2c/pdftexdir/writeenc.c
|
|
|
|
@@ -83,7 +83,7 @@ fe_entry *get_fe_entry(char *s)
|
|
|
|
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
-void epdf_write_enc(char **glyph_names, int fe_objnum)
|
|
|
|
+void epdf_write_enc(const char **glyph_names, int fe_objnum)
|
|
|
|
{
|
|
|
|
int i, i_old;
|
|
|
|
assert(glyph_names != NULL);
|
|
|
|
Index: texk/web2c/luatexdir/image/pdftoepdf.w
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/luatexdir/image/pdftoepdf.w
|
|
|
|
+++ texk/web2c/luatexdir/image/pdftoepdf.w
|
|
|
|
@@ -361,9 +361,9 @@ void copyReal(PDF pdf, double d)
|
|
|
|
pdf->cave = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyString(PDF pdf, GooString * string)
|
|
|
|
+static void copyString(PDF pdf, const GooString * string)
|
|
|
|
{
|
|
|
|
- char *p;
|
|
|
|
+ const char *p;
|
|
|
|
unsigned char c;
|
|
|
|
size_t i, l;
|
|
|
|
p = string->getCString();
|
|
|
|
@@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooString * string)
|
|
|
|
pdf->cave = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static void copyName(PDF pdf, char *s)
|
|
|
|
+static void copyName(PDF pdf, const char *s)
|
|
|
|
{
|
|
|
|
pdf_out(pdf, '/');
|
|
|
|
for (; *s != 0; s++) {
|
|
|
|
@@ -527,7 +527,7 @@ static void writeRefs(PDF pdf, PdfDocument * pdf_doc)
|
|
|
|
|
|
|
|
/* get the pagebox coordinates according to the pagebox_spec */
|
|
|
|
|
|
|
|
-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
|
|
|
|
+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
|
|
|
|
{
|
|
|
|
switch (pagebox_spec) {
|
|
|
|
case PDF_BOX_SPEC_MEDIA:
|
|
|
|
@@ -584,7 +584,7 @@ void read_pdf_info(image_dict * idict)
|
|
|
|
Catalog *catalog;
|
|
|
|
Page *page;
|
|
|
|
int rotate;
|
|
|
|
- PDFRectangle *pagebox;
|
|
|
|
+ const PDFRectangle *pagebox;
|
|
|
|
int pdf_major_version_found, pdf_minor_version_found;
|
|
|
|
float xsize, ysize, xorig, yorig;
|
|
|
|
if (isInit == gFalse) {
|
|
|
|
@@ -721,7 +721,7 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
|
|
|
|
Ref *pageref;
|
|
|
|
Dict *pageDict;
|
|
|
|
Object obj1, contents, pageobj, pagesobj1, pagesobj2, *op1, *op2, *optmp;
|
|
|
|
- PDFRectangle *pagebox;
|
|
|
|
+ const PDFRectangle *pagebox;
|
|
|
|
int i, l;
|
|
|
|
double bbox[4];
|
|
|
|
/* char s[256]; */
|
|
|
|
Index: texk/web2c/luatexdir/lua/lepdflib.cc
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/luatexdir/lua/lepdflib.cc
|
|
|
|
+++ texk/web2c/luatexdir/lua/lepdflib.cc
|
|
|
|
@@ -591,7 +591,7 @@ static const struct luaL_Reg epdflib_f[] = {
|
|
|
|
#define m_poppler_get_poppler(in, out, function) \
|
|
|
|
static int m_##in##_##function(lua_State * L) \
|
|
|
|
{ \
|
|
|
|
- out *o; \
|
|
|
|
+ const out *o; \
|
|
|
|
udstruct *uin, *uout; \
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc) \
|
|
|
|
@@ -599,7 +599,8 @@ static int m_##in##_##function(lua_State * L) \
|
|
|
|
o = ((in *) uin->d)->function(); \
|
|
|
|
if (o != NULL) { \
|
|
|
|
uout = new_##out##_userdata(L); \
|
|
|
|
- uout->d = o; \
|
|
|
|
+ uout->d = (void *)(o); \
|
|
|
|
+ uout->atype = ALLOC_POPPLER; \
|
|
|
|
uout->pc = uin->pc; \
|
|
|
|
uout->pd = uin->pd; \
|
|
|
|
} else \
|
|
|
|
@@ -669,7 +670,7 @@ static int m_##in##_##function(lua_State * L) \
|
|
|
|
#define m_poppler_get_GOOSTRING(in, function) \
|
|
|
|
static int m_##in##_##function(lua_State * L) \
|
|
|
|
{ \
|
|
|
|
- GooString *gs; \
|
|
|
|
+ const GooString *gs; \
|
|
|
|
udstruct *uin; \
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc) \
|
|
|
|
@@ -1807,7 +1808,7 @@ static int m_Object_getNum(lua_State * L)
|
|
|
|
|
|
|
|
static int m_Object_getString(lua_State * L)
|
|
|
|
{
|
|
|
|
- GooString *gs;
|
|
|
|
+ const GooString *gs;
|
|
|
|
udstruct *uin;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
@@ -2465,7 +2466,7 @@ m_PDFDoc_INT(getErrorCode);
|
|
|
|
|
|
|
|
static int m_PDFDoc_getFileName(lua_State * L)
|
|
|
|
{
|
|
|
|
- GooString *gs;
|
|
|
|
+ const GooString *gs;
|
|
|
|
udstruct *uin;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
@@ -2553,7 +2554,7 @@ m_PDFDoc_INT(getNumPages);
|
|
|
|
|
|
|
|
static int m_PDFDoc_readMetadata(lua_State * L)
|
|
|
|
{
|
|
|
|
- GooString *gs;
|
|
|
|
+ const GooString *gs;
|
|
|
|
udstruct *uin;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
@@ -2571,7 +2572,7 @@ static int m_PDFDoc_readMetadata(lua_State * L)
|
|
|
|
|
|
|
|
static int m_PDFDoc_getStructTreeRoot(lua_State * L)
|
|
|
|
{
|
|
|
|
- StructTreeRoot *obj;
|
|
|
|
+ const StructTreeRoot *obj;
|
|
|
|
udstruct *uin, *uout;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
@@ -2579,7 +2580,8 @@ static int m_PDFDoc_getStructTreeRoot(lua_State * L)
|
|
|
|
if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
|
|
|
|
obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
|
|
|
|
uout = new_StructTreeRoot_userdata(L);
|
|
|
|
- uout->d = obj;
|
|
|
|
+ uout->d = (void *)(obj);
|
|
|
|
+ uout->atype = ALLOC_POPPLER;
|
|
|
|
uout->pc = uin->pc;
|
|
|
|
uout->pd = uin->pd;
|
|
|
|
} else
|
|
|
|
@@ -2610,7 +2612,7 @@ static int m_PDFDoc_findPage(lua_State * L)
|
|
|
|
static int m_PDFDoc_getLinks(lua_State * L)
|
|
|
|
{
|
|
|
|
int i, pages;
|
|
|
|
- Links *links;
|
|
|
|
+ const Links *links;
|
|
|
|
udstruct *uin, *uout;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
@@ -2621,7 +2623,8 @@ static int m_PDFDoc_getLinks(lua_State * L)
|
|
|
|
links = ((PdfDocument *) uin->d)->doc->getLinks(i);
|
|
|
|
if (links != NULL) {
|
|
|
|
uout = new_Links_userdata(L);
|
|
|
|
- uout->d = links;
|
|
|
|
+ uout->d = (void *)(links);
|
|
|
|
+ uout->atype = ALLOC_POPPLER;
|
|
|
|
uout->pc = uin->pc;
|
|
|
|
uout->pd = uin->pd;
|
|
|
|
} else
|
|
|
|
@@ -2634,7 +2637,7 @@ static int m_PDFDoc_getLinks(lua_State * L)
|
|
|
|
static int m_PDFDoc_findDest(lua_State * L)
|
|
|
|
{
|
|
|
|
GooString *name;
|
|
|
|
- LinkDest *dest;
|
|
|
|
+ const LinkDest *dest;
|
|
|
|
const char *s;
|
|
|
|
size_t len;
|
|
|
|
udstruct *uin, *uout;
|
|
|
|
@@ -2647,7 +2650,8 @@ static int m_PDFDoc_findDest(lua_State * L)
|
|
|
|
dest = ((PdfDocument *) uin->d)->doc->findDest(name);
|
|
|
|
if (dest != NULL) {
|
|
|
|
uout = new_LinkDest_userdata(L);
|
|
|
|
- uout->d = dest;
|
|
|
|
+ uout->d = (void *)(dest);
|
|
|
|
+ uout->atype = ALLOC_POPPLER;
|
|
|
|
uout->pc = uin->pc;
|
|
|
|
uout->pd = uin->pd;
|
|
|
|
} else
|
|
|
|
@@ -3227,7 +3231,7 @@ static int m_StructElement_setRevision(lua_State * L)
|
|
|
|
static int m_StructElement_getText(lua_State * L)
|
|
|
|
{
|
|
|
|
GBool i;
|
|
|
|
- GooString *gs;
|
|
|
|
+ const GooString *gs;
|
|
|
|
udstruct *uin;
|
|
|
|
uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
|
|
|
|
if (uin->pd != NULL && uin->pd->pc != uin->pc)
|
|
|
|
Index: texk/web2c/xetexdir/pdfimage.cpp
|
|
|
|
===================================================================
|
|
|
|
--- texk/web2c/xetexdir/pdfimage.cpp
|
|
|
|
+++ texk/web2c/xetexdir/pdfimage.cpp
|
|
|
|
@@ -78,7 +78,7 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)
|
|
|
|
|
|
|
|
Page* page = doc->getCatalog()->getPage(page_num);
|
|
|
|
|
|
|
|
- PDFRectangle* r;
|
|
|
|
+ const PDFRectangle* r;
|
|
|
|
switch (pdf_box) {
|
|
|
|
default:
|
|
|
|
case pdfbox_crop:
|
|
|
|
@@ -98,32 +98,33 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ PDFRectangle r2 = *r;
|
|
|
|
int RotAngle = 0;
|
|
|
|
RotAngle = (int)page->getRotate() % 360;
|
|
|
|
if (RotAngle < 0)
|
|
|
|
RotAngle += 360;
|
|
|
|
if (RotAngle == 90 || RotAngle == 270) {
|
|
|
|
double tmpvalue;
|
|
|
|
- if (r->x1 > r->x2) {
|
|
|
|
- tmpvalue = r->x1;
|
|
|
|
- r->x1 = r->x2;
|
|
|
|
- r->x2 = tmpvalue;
|
|
|
|
+ if (r2.x1 > r2.x2) {
|
|
|
|
+ tmpvalue = r2.x1;
|
|
|
|
+ r2.x1 = r2.x2;
|
|
|
|
+ r2.x2 = tmpvalue;
|
|
|
|
}
|
|
|
|
- if (r->y1 > r->y2) {
|
|
|
|
- tmpvalue = r->y1;
|
|
|
|
- r->y1 = r->y2;
|
|
|
|
- r->y2 = tmpvalue;
|
|
|
|
+ if (r2.y1 > r2.y2) {
|
|
|
|
+ tmpvalue = r2.y1;
|
|
|
|
+ r2.y1 = r2.y2;
|
|
|
|
+ r2.y2 = tmpvalue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- tmpvalue = r->x2;
|
|
|
|
- r->x2 = r->x1 + r->y2 - r->y1;
|
|
|
|
- r->y2 = r->y1 + tmpvalue - r->x1;
|
|
|
|
+ tmpvalue = r2.x2;
|
|
|
|
+ r2.x2 = r2.x1 + r2.y2 - r2.y1;
|
|
|
|
+ r2.y2 = r2.y1 + tmpvalue - r2.x1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- box->x = 72.27 / 72 * my_fmin(r->x1, r->x2);
|
|
|
|
- box->y = 72.27 / 72 * my_fmin(r->y1, r->y2);
|
|
|
|
- box->wd = 72.27 / 72 * fabs(r->x2 - r->x1);
|
|
|
|
- box->ht = 72.27 / 72 * fabs(r->y2 - r->y1);
|
|
|
|
+ box->x = 72.27 / 72 * my_fmin(r2.x1, r2.x2);
|
|
|
|
+ box->y = 72.27 / 72 * my_fmin(r2.y1, r2.y2);
|
|
|
|
+ box->wd = 72.27 / 72 * fabs(r2.x2 - r2.x1);
|
|
|
|
+ box->ht = 72.27 / 72 * fabs(r2.y2 - r2.y1);
|
|
|
|
|
|
|
|
delete doc;
|
|
|
|
|