compile error in main/vcl/unx/headless/svptext.cxx
A while back FreeBSD upgraded to Clang 6.0 which defaults to C++14
instead of GNU++98/C++98 like earlier versions of Clang and GCC.
This triggered some new compile errors in the OpenOffice source
that probably had just previously been warnings.
One of the new errors was a integer constant getting assigned to a
pointer in SvpGlyphPeer::RemovingGlyph(), which lives in
main/vcl/unx/headless/svptext.cxx. When I looked more closely at
this code to try to figure out the proper fix, I discovered that
this code is more broken than is immediately obvious.
There are two classes defined in main/vcl/inc/glyphcache.hxx that
each have a pair of similar members. The GlyphData class contains
the private struct ExtGlyphData, which in turn contains "int meInfo"
and "void* mpData". The ServerFont class contains the private
members "int mnExtInfo" and "void* mpExtData".
The GlyphData members are set in X11GlyphPeer::RemovingGlyph(),
X11GlyphPeer::SetRawBitmap(), and X11GlyphPeer::SetPixmap() in
main/vcl/unx/generic/gdi/gcach_xpeer.cxx, where the meInfo value
is one of the INFO_* enum values in gcach_xpeer.cxx, and mpData can
point to various different types of objects.
The ServerFont members are set in X11GlyphPeer::RemovingFont() and
X11GlyphPeer::GetGlyphSet() in main/vcl/unx/generic/gdi/gcach_xpeer.cxx,
where the mnExtInfo value is a subset of the enum containing INFO_*
values in gcach_xpeer.cxx, and the mpExtData value is a GlyphSet.
Over on the headless side, GlyphData meInfo and mpData values are
examined in in SvpGlyphPeer::GetGlyphBmp() and
SvpGlyphPeer::RemovingGlyph(), but they are never set. The expected
meInfo values come from the basebmp Format values in
main/basebmp/inc/basebmp/scanlineformats.hxx. Instead,the headless
code sets the ServerFont members in SvpGlyphPeer::GetGlyphBmp()
with the mnExtInfo value coming from the basebmp Format values and
the mpExtData value being a SvpGcpHelper* fetched from mpData. The
ServerFont members are not examined on the headless side.
The attached patch is my attempt at a fix. It builds, but I don't know
how to do a meaningful test of headless mode.
To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]