linmaogithub / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

Centralize casting to CPDF_Object subclasses via ToXXX() functions and AsXXX() methods. #201

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Something along the line of:

CPDF_Dictionary* CPDF_Object::AsDictionary() {
  return type == CPDF_DICTIONARY ? (CPDF_Dictionary*)this : nullptr;
}

CPDF_Dictionary* ToDictionary(CPDF_Object* ptr) {
  return ptr ? ptr->AsDictionary() : nullptr;
}

at which point, dozens of casts bite the dust.

Original issue reported on code.google.com by tsepez@chromium.org on 8 Sep 2015 at 5:33

GoogleCodeExporter commented 8 years ago

Original comment by tsepez@chromium.org on 8 Sep 2015 at 5:33