Changeset 2875


Ignore:
Timestamp:
2001-12-02T11:04:38+13:00 (21 years ago)
Author:
sjboddie
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/niupepa/src/recpt/niupepabrowsetools.cpp

    r2874 r2875  
    3636                     ostream &logout) {
    3737
    38   bool hastxt = false, hasimg = false, hasprevimg = false, haspdf = false;
     38  bool hastxt = false, hasimg = false, hasprevimg = false;
    3939  text_tarray buttons;
    4040  text_t &arg_gg = args["gg"];
     
    4646  metadata.insert ("hasimg");
    4747  metadata.insert ("hasprevimg");
    48   metadata.insert ("haspdf");
    4948  metadata.insert ("doctype");
    5049  if (!get_info (arg_d, args["c"], metadata, false, collectproto, response, logout))
     
    5453  if (response.docInfo[0].metadata["hasimg"].values[0] == "1") hasimg = true;
    5554  if (response.docInfo[0].metadata["hasprevimg"].values[0] == "1") hasprevimg = true;
    56   if (response.docInfo[0].metadata["haspdf"].values[0] == "1") haspdf = true;
    5755
    5856  MetadataInfo_tmap::iterator it = response.docInfo[0].metadata.find ("doctype");
     
    9391      buttons.push_back ("_document:imageviewabstract_(" + abstract + "&gg=text)");
    9492
    95     if (haspdf) buttons.push_back ("_document:imagepdf_");
    96 
     93    // see if paper has a pdf
     94    text_t top;
     95    get_top (arg_d, top);
     96    metadata.insert("haspdf");
     97    if (get_info (top, args["c"], metadata, false, collectproto, response, logout)) {
     98      if (response.docInfo[0].metadata["haspdf"].values[0] == "1") {
     99    buttons.push_back ("_document:imagepdf_");
     100      }
     101    }
    97102  }
    98103
Note: See TracChangeset for help on using the changeset viewer.