示例#1
0
  virtual bool insert_cell(const Cell& cell,
			   const std::string& mode,
			   const std::string& separator) {
    bool bold = false;
    int rr = 0, gg = 0, bb = 0;
    if (mode=="+++") {
      rr = HALF_COLOR;
      gg = FULL_COLOR;
      bb = HALF_COLOR;
      bold = true;
    } else if (mode=="---") {
      rr = FULL_COLOR;
      gg = HALF_COLOR;
      bb = HALF_COLOR;
    } else if (mode=="->") {
      rr = HALF_COLOR;
      gg = HALF_COLOR;
      bb = FULL_COLOR;
      bold = true;
    }
    if (rr!=0||gg!=0||bb!=0) {
      Poly<Appearance> appear = sheet.getCellAppearance(x,y);
      if (appear.isValid()) {
	appear->begin();
	appear->setBackgroundRgb16(rr,gg,bb,
				   AppearanceRange::full());
	if (bold) {
	  appear->setWeightBold(true,AppearanceRange::full());
	}
	appear->end();
      }
    }
    x++;
    return true;
  }
示例#2
0
  virtual bool begin_row(const std::string& mode) {
    row_mode = mode;
    bool bold = false;
    int rr = 0, gg = 0, bb = 0;
    if (row_mode=="+++") {
      rr = HALF_COLOR;
      gg = FULL_COLOR;
      bb = HALF_COLOR;
      bold = true;
    } else if (row_mode=="---") {
      rr = FULL_COLOR;
      gg = HALF_COLOR;
      bb = HALF_COLOR;
    } else if (row_mode=="!") {
      rr = HALF_COLOR;
      gg = HALF_COLOR;
      bb = HALF_COLOR;
    } else if (row_mode=="@@") {
      rr = HALF_COLOR;
      gg = FULL_COLOR;
      bb = FULL_COLOR;
      bold = true;
    }
    if (rr!=0||gg!=0||bb!=0) {
      Poly<Appearance> appear = sheet.getRowAppearance(y);
      if (appear.isValid()) {
	appear->begin();
	appear->setBackgroundRgb16(rr,gg,bb,
				   AppearanceRange::full());
	if (bold) {
	  appear->setWeightBold(true,AppearanceRange::full());
	}
	appear->end();
      }
    }
    return true;
  }