|
Lines 31-37
Link Here
|
| 31 |
namespace Poppler { |
31 |
namespace Poppler { |
| 32 |
|
32 |
|
| 33 |
/* borrowed from kpdf */ |
33 |
/* borrowed from kpdf */ |
| 34 |
TQString unicodeToTQString(Unicode* u, int len) |
34 |
TQString unicodeToTQString(CONST_064 Unicode* u, int len) |
| 35 |
{ |
35 |
{ |
| 36 |
TQString ret; |
36 |
TQString ret; |
| 37 |
ret.setLength(len); |
37 |
ret.setLength(len); |
|
Lines 41-47
TQString unicodeToTQString(Unicode* u, int len)
Link Here
|
| 41 |
return ret; |
41 |
return ret; |
| 42 |
} |
42 |
} |
| 43 |
|
43 |
|
| 44 |
TQString UnicodeParsedString(GooString *s1) |
44 |
TQString UnicodeParsedString(CONST_064 GooString *s1) |
| 45 |
{ |
45 |
{ |
| 46 |
GBool isUnicode; |
46 |
GBool isUnicode; |
| 47 |
int i; |
47 |
int i; |
|
Lines 86-92
GooString *TQStringToGooString(const TQString &s)
Link Here
|
| 86 |
} |
86 |
} |
| 87 |
|
87 |
|
| 88 |
|
88 |
|
| 89 |
void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, GooList * items ) |
89 |
void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, CONST_064 GooList * items ) |
| 90 |
{ |
90 |
{ |
| 91 |
int numItems = items->getLength(); |
91 |
int numItems = items->getLength(); |
| 92 |
for ( int i = 0; i < numItems; ++i ) |
92 |
for ( int i = 0; i < numItems; ++i ) |
|
Lines 96-102
void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, G
Link Here
|
| 96 |
|
96 |
|
| 97 |
// 1. create element using outlineItem's title as tagName |
97 |
// 1. create element using outlineItem's title as tagName |
| 98 |
TQString name; |
98 |
TQString name; |
| 99 |
Unicode * uniChar = outlineItem->getTitle(); |
99 |
CONST_064 Unicode * uniChar = outlineItem->getTitle(); |
| 100 |
int titleLength = outlineItem->getTitleLength(); |
100 |
int titleLength = outlineItem->getTitleLength(); |
| 101 |
name = unicodeToTQString(uniChar, titleLength); |
101 |
name = unicodeToTQString(uniChar, titleLength); |
| 102 |
if ( name.isEmpty() ) |
102 |
if ( name.isEmpty() ) |
|
Lines 106-123
void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, G
Link Here
|
| 106 |
parent->appendChild( item ); |
106 |
parent->appendChild( item ); |
| 107 |
|
107 |
|
| 108 |
// 2. find the page the link refers to |
108 |
// 2. find the page the link refers to |
| 109 |
::LinkAction * a = outlineItem->getAction(); |
109 |
CONST_064 ::LinkAction * a = outlineItem->getAction(); |
| 110 |
if ( a && ( a->getKind() == actionGoTo || a->getKind() == actionGoToR ) ) |
110 |
if ( a && ( a->getKind() == actionGoTo || a->getKind() == actionGoToR ) ) |
| 111 |
{ |
111 |
{ |
| 112 |
// page number is contained/referenced in a LinkGoTo |
112 |
// page number is contained/referenced in a LinkGoTo |
| 113 |
LinkGoTo * g = static_cast< LinkGoTo * >( a ); |
113 |
CONST_064 LinkGoTo * g = static_cast< CONST_064 LinkGoTo * >( a ); |
| 114 |
LinkDest * destination = g->getDest(); |
114 |
CONST_064 LinkDest * destination = g->getDest(); |
| 115 |
if ( !destination && g->getNamedDest() ) |
115 |
if ( !destination && g->getNamedDest() ) |
| 116 |
{ |
116 |
{ |
| 117 |
// no 'destination' but an internal 'named reference'. we could |
117 |
// no 'destination' but an internal 'named reference'. we could |
| 118 |
// get the destination for the page now, but it's VERY time consuming, |
118 |
// get the destination for the page now, but it's VERY time consuming, |
| 119 |
// so better storing the reference and provide the viewport on demand |
119 |
// so better storing the reference and provide the viewport on demand |
| 120 |
GooString *s = g->getNamedDest(); |
120 |
CONST_064 GooString *s = g->getNamedDest(); |
| 121 |
TQChar *charArray = new TQChar[s->getLength()]; |
121 |
TQChar *charArray = new TQChar[s->getLength()]; |
| 122 |
for (int i = 0; i < s->getLength(); ++i) charArray[i] = TQChar(s->getCString()[i]); |
122 |
for (int i = 0; i < s->getLength(); ++i) charArray[i] = TQChar(s->getCString()[i]); |
| 123 |
TQString aux(charArray, s->getLength()); |
123 |
TQString aux(charArray, s->getLength()); |
|
Lines 131-144
void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, G
Link Here
|
| 131 |
} |
131 |
} |
| 132 |
if ( a->getKind() == actionGoToR ) |
132 |
if ( a->getKind() == actionGoToR ) |
| 133 |
{ |
133 |
{ |
| 134 |
LinkGoToR * g2 = static_cast< LinkGoToR * >( a ); |
134 |
CONST_064 LinkGoToR * g2 = static_cast< CONST_064 LinkGoToR * >( a ); |
| 135 |
item.setAttribute( "ExternalFileName", g2->getFileName()->getCString() ); |
135 |
item.setAttribute( "ExternalFileName", g2->getFileName()->getCString() ); |
| 136 |
} |
136 |
} |
| 137 |
} |
137 |
} |
| 138 |
|
138 |
|
| 139 |
// 3. recursively descend over children |
139 |
// 3. recursively descend over children |
| 140 |
outlineItem->open(); |
140 |
outlineItem->open(); |
| 141 |
GooList * children = outlineItem->getKids(); |
141 |
CONST_064 GooList * children = outlineItem->getKids(); |
| 142 |
if ( children ) |
142 |
if ( children ) |
| 143 |
addTocChildren( docSyn, &item, children ); |
143 |
addTocChildren( docSyn, &item, children ); |
| 144 |
} |
144 |
} |