Fix bad cast of GooString* to const char* in DefaultAppearance
Casting GooString*
to const char*
was probably a reminder from a time where GooString layout had been under poppler control. Nowadays GooString
derives from std::string
and we must not rely upon the memory layout.
The bug leads to DefaultAppearance::getFontName() always returning an invalid Object. The offending code is reachable via AnnotFreeText::generateFreeTextAppearance.
I found this "accidentally" during preparing another MR, and am not yet sure in which scenario we actually observe a malfunction. By looking at the code I'd say it should only happen in rare cases where we have documents where FreeText annotations were added by external readers that provide DA, but not AP.