3 HtmlLink::HtmlLink(const HtmlLink
& x
){
8 dest
=new GooString(x
.dest
);
11 HtmlLink::HtmlLink(double xmin
,double ymin
,double xmax
,double ymax
,GooString
* _dest
)
27 dest
=new GooString(_dest
);
30 HtmlLink::~HtmlLink(){
31 if (dest
) delete dest
;
34 GBool
HtmlLink::isEqualDest(const HtmlLink
& x
) const{
35 return (!strcmp(dest
->getCString(), x
.dest
->getCString()));
38 GBool
HtmlLink::inLink(double xmin
,double ymin
,double xmax
,double ymax
) const {
39 double y
=(ymin
+ymax
)/2;
40 if (y
>Ymax
) return gFalse
;
41 return (y
>Ymin
)&&(xmin
<Xmax
)&&(xmax
>Xmin
);
45 HtmlLink
& HtmlLink::operator=(const HtmlLink
& x
){
46 if (this==&x
) return *this;
47 if (dest
) {delete dest
;dest
=NULL
;}
52 dest
=new GooString(x
.dest
);
56 GooString
* HtmlLink::getLinkStart() {
57 GooString
*res
= new GooString("<A href=\"");
63 /*GooString* HtmlLink::Link(GooString* content){
64 //GooString* _dest=new GooString(dest);
65 GooString *tmp=new GooString("<a href=\"");
76 HtmlLinks::HtmlLinks(){
77 accu
=new GooVector
<HtmlLink
>();
80 HtmlLinks::~HtmlLinks(){
85 GBool
HtmlLinks::inLink(double xmin
,double ymin
,double xmax
,double ymax
,int& p
)const {
87 for(GooVector
<HtmlLink
>::iterator i
=accu
->begin();i
!=accu
->end();i
++){
88 if (i
->inLink(xmin
,ymin
,xmax
,ymax
)) {
89 p
=(i
- accu
->begin());
96 HtmlLink
* HtmlLinks::getLink(int i
) const{
97 GooVector
<HtmlLink
>::iterator g
=accu
->begin();