bugfix: set default page color to white

svn path=/trunk/kdegraphics/kdvi/; revision=238720
This commit is contained in:
Stefan Kebekus 2003-07-23 07:17:38 +00:00
parent 9e66104d04
commit 30d4ba08a4

View file

@ -12,8 +12,10 @@ extern const char psheader[];
pageInfo::pageInfo(QString _PostScriptString) { pageInfo::pageInfo(QString _PostScriptString) {
PostScriptString = new QString(_PostScriptString); PostScriptString = new QString(_PostScriptString);
Gfx = NULL; Gfx = NULL;
background = Qt::white;
} }
pageInfo::~pageInfo() { pageInfo::~pageInfo() {
if (PostScriptString != 0L) if (PostScriptString != 0L)
delete PostScriptString; delete PostScriptString;
@ -60,6 +62,7 @@ void ghostscript_interface::setPostScript(int page, QString PostScript) {
*(pageList.find(page)->PostScriptString) = PostScript; *(pageList.find(page)->PostScriptString) = PostScript;
} }
void ghostscript_interface::setIncludePath(const QString &_includePath) { void ghostscript_interface::setIncludePath(const QString &_includePath) {
if (_includePath.isEmpty()) if (_includePath.isEmpty())
includePath = "*"; // Allow all files includePath = "*"; // Allow all files
@ -67,7 +70,12 @@ void ghostscript_interface::setIncludePath(const QString &_includePath) {
includePath = _includePath+"/*"; includePath = _includePath+"/*";
} }
void ghostscript_interface::setColor(int page, QColor background_color) { void ghostscript_interface::setColor(int page, QColor background_color) {
#ifdef DEBUG_PSGS
kdDebug(4300) << "ghostscript_interface::setColor( " << page << ", " << background_color << " )" << endl;
#endif
if (pageList.find(page) == 0) { if (pageList.find(page) == 0) {
pageInfo *info = new pageInfo(QString::null); pageInfo *info = new pageInfo(QString::null);
info->background = background_color; info->background = background_color;
@ -84,6 +92,10 @@ void ghostscript_interface::setColor(int page, QColor background_color) {
// always guaranteed to be valid // always guaranteed to be valid
QColor ghostscript_interface::getBackgroundColor(int page) { QColor ghostscript_interface::getBackgroundColor(int page) {
#ifdef DEBUG_PSGS
kdDebug(4300) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl;
#endif
if (pageList.find(page) == 0) if (pageList.find(page) == 0)
return Qt::white; return Qt::white;
else else
@ -93,7 +105,6 @@ QColor ghostscript_interface::getBackgroundColor(int page) {
void ghostscript_interface::clear(void) { void ghostscript_interface::clear(void) {
PostScriptHeaderString->truncate(0); PostScriptHeaderString->truncate(0);
MemoryCache.clear(); MemoryCache.clear();
DiskCache.clear(); DiskCache.clear();
@ -101,6 +112,7 @@ void ghostscript_interface::clear(void) {
pageList.clear(); pageList.clear();
} }
void ghostscript_interface::gs_generate_graphics_file(int page, QString filename) { void ghostscript_interface::gs_generate_graphics_file(int page, QString filename) {
emit(setStatusBarText(i18n("Generating PostScript graphics..."))); emit(setStatusBarText(i18n("Generating PostScript graphics...")));
@ -160,7 +172,6 @@ void ghostscript_interface::gs_generate_graphics_file(int page, QString filename
QPixmap *ghostscript_interface::graphics(int page) { QPixmap *ghostscript_interface::graphics(int page) {
pageInfo *info = pageList.find(page); pageInfo *info = pageList.find(page);
// No PostScript? Then return immediately. // No PostScript? Then return immediately.