Build 1087:
1) If you can adjust PdfCompilerCompat.h for Borland, it would be nice. The
problem lies in __LINE__, this is a numeric (e.g. 500) without quotes.
*****The original:
#if (defined(_MSC_VER) && _MSC_VER <= 1200) || defined(__BORLANDC__) ||
defined(__TURBOC__)
# define PODOFO__FUNCTION__ (__FILE__ ":" __LINE__)
#else
# define PODOFO__FUNCTION__ __FUNCTION__
#endif
*****The new:
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
# define PODOFO__FUNCTION__ (__FILE__ ":" __LINE__)
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define PODOFO__FUNCTION__XSTR(x) PODOFO__FUNCTION__STR(x)
# define PODOFO__FUNCTION__STR(x) #x
# define PODOFO__FUNCTION__ (__FILE__ ":" PODOFO__FUNCTION__XSTR(__LINE__))
#else
# define PODOFO__FUNCTION__ __FUNCTION__
#endif
2) I get a memory exception when I try to use PdfPainter. Just instantiating
"PdfPainter painter;" is enough to acomplish this.
2.1) Looking at the default PdfPainter constuctor there is a C++ construct I
didn't know off, instantiating class variables after the ':'. This is hard
to debug.
Struck by a good thought I introduced a new class MircoPrintf to be able to
debug the PdfPainter default contstructor:
class MircoPrintf
{
public:
MircoPrintf(unsigned int pNr)
{
printf("Mirco %u\n",pNr);
}
};
In the PdfPainter.h class definition, in the protected section start with
the declaration of MircoPrintf Mirco0. After each variable introduce a new
MircoPrintf:
MircoPrintf Mirco0;
PdfStream* m_pCanvas;
MircoPrintf Mirco1;
PdfCanvas* m_pPage;
MircoPrintf Mirco2;
PdfFont* m_pFont;
MircoPrintf Mirco3;
unsigned short m_nTabWidth;
MircoPrintf Mirco4;
PdfColor m_curColor;
MircoPrintf Mirco5;
bool m_isTextOpen;
MircoPrintf Mirco6;
std::ostringstream m_oss;
MircoPrintf Mirco7;
double lpx, lpy, lpx2, lpy2, lpx3, lpy3, // points for this operation
lcx, lcy, // last "current" point
lrx, lry; // "reflect points"
MircoPrintf Mirco8;
PdfPainter::PdfPainter()
: Mirco8(8), Mirco7(7), Mirco6(6),
m_pCanvas( NULL ), Mirco5(5),
m_pPage( NULL ), Mirco4(4),
m_pFont( NULL ), Mirco3(3),
m_nTabWidth( 4 ), Mirco2(2),
m_curColor( PdfColor( 0.0, 0.0, 0.0 ) ), Mirco1(1),
m_isTextOpen( false ), Mirco0(0)
{
printf("PdfPainter::PdfPainter\n");
The output I see is:
Constructing PdfPainter
Mirco 0
Mirco 1
Mirco 2
Mirco 3
Mirco 4
PdfColor C
PdfColor C end
Mirco 5
Mirco 6
So the "std::ostringstream m_oss" must be the problem.
Because I recompiled the whole bunch with Borland, I'm assuming I did
something terribly wrong.
*Sigh*
********
********
********
Craig, you are totally right, it is a real pain in the ass to support
multiple compilers. It is asking for insanity and lots of compatibility
problems.
I'm going to switch back to MinGW to cross reference this is a Borland
problem.
Regards,
Mirco
------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users