Kaydet (Commit) 6996c650 authored tarafından Chris Sherlock's avatar Chris Sherlock

tdf#31814 drawinglayer: dump EmfPlusRecordTypeComment records

When we get an EMF+ comment record (which is NOT an EMF comment
record, EMF has comment records which is how you store EMF+
records, EMF+ records also have comment records for "private
data") then if we are a debug build then dump the private data
to stdout.

To make this work, set:

SAL_LOG=+INFO.cppcanvas.emf+WARN.cppcanvas.emf

Change-Id: I293875f45b692971379a5945ff7feb273bc54c73
Reviewed-on: https://gerrit.libreoffice.org/42558Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst d64dd405
......@@ -46,6 +46,7 @@ namespace emfplushelper
{
case EmfPlusRecordTypeHeader: return "EmfPlusRecordTypeHeader";
case EmfPlusRecordTypeEndOfFile: return "EmfPlusRecordTypeEndOfFile";
case EmfPlusRecordTypeComment: return "EmfPlusRecordTypeComment";
case EmfPlusRecordTypeGetDC: return "EmfPlusRecordTypeGetDC";
case EmfPlusRecordTypeObject: return "EmfPlusRecordTypeObject";
case EmfPlusRecordTypeFillRects: return "EmfPlusRecordTypeFillRects";
......@@ -809,6 +810,33 @@ namespace emfplushelper
SAL_INFO("cppcanvas.emf", "EMF+ EndOfFile");
break;
}
case EmfPlusRecordTypeComment:
{
#if OSL_DEBUG_LEVEL > 1
unsigned char data;
OUString hexdata;
SAL_INFO("cppcanvas.emf", "EMF+ Comment");
SAL_INFO("cppcanvas.emf", "\tdatasize: 0x" << std::hex << dataSize << std::dec);
for (sal_uInt32 i=0; i<dataSize; i++)
{
rMS.ReadUChar(data);
if (i % 16 == 0)
hexdata += "\n";
OUString padding;
if ((data & 0xF0) == 0)
padding = "0";
hexdata += "0x" + padding + OUString::number(data, 16) + " ";
}
SAL_INFO("cppcanvas.emf", "\t" << hexdata);
#endif
break;
}
case EmfPlusRecordTypeGetDC:
{
SAL_INFO("cppcanvas.emf", "EMF+ GetDC");
......@@ -1194,6 +1222,7 @@ namespace emfplushelper
// read the layout rectangle
float lx, ly, lw, lh;
rMS.ReadFloat(lx).ReadFloat(ly).ReadFloat(lw).ReadFloat(lh);
SAL_INFO("cppcanvas.emf", "EMF+ DrawString layoutRect: " << lx << "," << ly << " - " << lw << "x" << lh);
// parse the string
OUString text = read_uInt16s_ToOUString(rMS, stringLength);
......
......@@ -37,7 +37,7 @@ namespace emfplushelper
// EMF+ commands
#define EmfPlusRecordTypeHeader 0x4001
#define EmfPlusRecordTypeEndOfFile 0x4002
//TODO EmfPlusRecordTypeComment 0x4003
#define EmfPlusRecordTypeComment 0x4003
#define EmfPlusRecordTypeGetDC 0x4004
//TODO EmfPlusRecordTypeMultiFormatStart 0x4005
//TODO EmfPlusRecordTypeMultiFormatSection 0x4006
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment