Ejemplo n.º 1
0
    /** {@inheritDoc} */
    public boolean equals(Object o) {
      if (o != null && o instanceof CachedTeXFormula) {
        CachedTeXFormula c = (CachedTeXFormula) o;
        boolean b =
            (c.f.equals(f)
                && c.style == style
                && c.type == type
                && c.size == size
                && c.inset == inset
                && c.fgcolor.equals(fgcolor));
        if (b) {
          if (c.width == -1) {
            c.width = width;
            c.height = height;
            c.depth = depth;
          } else if (width == -1) {
            width = c.width;
            height = c.height;
            depth = c.depth;
          }
        }

        return b;
      }

      return false;
    }