Ignore:
Timestamp:
2003-07-18T04:50:19+12:00 (21 years ago)
Author:
sjboddie
Message:

More changes to the new document formatting code. Added an
AllowExtendedOptions format option which must be set to allow other
new options to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/documentaction.cpp

    r4936 r4972  
    2525
    2626#include <string.h>
    27 #include <sstream>
    2827
    2928#include "documentaction.h"
     
    592591         ((*format_here).second == "true"))
    593592      formatinfo.DocumentUseHTML = true;
     593    else if (((*format_here).first == "AllowExtendedOptions") &&
     594         ((*format_here).second == "true"))
     595      formatinfo.AllowExtendedOptions = true;
    594596    else
    595597      formatinfo.formatstrings[(*format_here).first] = (*format_here).second;
     
    907909      text_tmap options;
    908910      options["text"] = docresponse.doc;
    909       options["DocImage"] = get_cover_image();
    910 
    911       ostringstream tmpstr(ostringstream::binary);
    912       if (args["gc"] == "1") {
    913      expanded_contents (args, 0, false, browsers, formatinfo,
    914                 collectproto, disp, outconvert, tmpstr,
    915                 logout);
    916       } else {
    917      contracted_contents (args, 0, false, browsers, formatinfo,
    918                   collectproto, disp, outconvert, tmpstr, logout);
    919       }
    920       text_t tmp = (char *)(tmpstr.str().c_str());
    921       int len = tmp.size();
    922       char *ctmp = tmp.getcstr();
    923       utf8inconvertclass utf82text_t;
    924       utf82text_t.setinput(ctmp, len);
    925       convertclass::status_t status;
    926       utf82text_t.convert(tmp, status);
    927       options["DocTOC"] = tmp;
    928       delete ctmp;
    929 
    930       options["DocumentButtonDetach"] = "_document:imagedetach_";
    931       if (args["hl"] == "1") {
    932      options["DocumentButtonHighlight"] = "_document:imagenohighlight_";
    933       } else {
    934      options["DocumentButtonHighlight"] = "_document:imagehighlight_";
    935       }
    936       if (args["gc"] == "1") {
    937      options["DocumentButtonExpandContents"] = "_document:imagecontracttoc_";
    938       } else {
    939      options["DocumentButtonExpandContents"] = "_document:imageexpandtoc_";
    940       }
    941       if (args["gt"] == "1") {
    942      options["DocumentButtonExpandText"] = "_document:imagecontracttext_";
    943       } else {
    944      options["DocumentButtonExpandText"] = "_document:imageexpandtext_";
     911
     912      if (formatinfo.AllowExtendedOptions) {
     913    load_extended_options(options, args, browsers, formatinfo,
     914                  collectproto, disp, outconvert, logout);
    945915      }
    946916     
Note: See TracChangeset for help on using the changeset viewer.