Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions graf2d/gpad/src/TPad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5123,6 +5123,9 @@ void TPad::Print(const char *filename, Option_t *option)
TString opt = !option ? opt_default : option;
Bool_t image = kFALSE;

Bool_t title = kFALSE;
if (strstr(opt,"Title:")) title = kTRUE;

if (!fs1.Length()) {
psname = GetName();
psname += opt;
Expand All @@ -5140,25 +5143,25 @@ void TPad::Print(const char *filename, Option_t *option)

// Save pad/canvas in alternative formats
TImage::EImageFileTypes gtype = TImage::kUnknown;
if (strstr(opt, "gif+")) {
if (!title && strstr(opt, "gif+")) {
gtype = TImage::kAnimGif;
image = kTRUE;
} else if (strstr(opt, "gif")) {
} else if (!title && strstr(opt, "gif")) {
gtype = TImage::kGif;
image = kTRUE;
} else if (strstr(opt, "png")) {
} else if (!title && strstr(opt, "png")) {
gtype = TImage::kPng;
image = kTRUE;
} else if (strstr(opt, "jpg")) {
} else if (!title && strstr(opt, "jpg")) {
gtype = TImage::kJpeg;
image = kTRUE;
} else if (strstr(opt, "tiff")) {
} else if (!title && strstr(opt, "tiff")) {
gtype = TImage::kTiff;
image = kTRUE;
} else if (strstr(opt, "xpm")) {
} else if (!title && strstr(opt, "xpm")) {
gtype = TImage::kXpm;
image = kTRUE;
} else if (strstr(opt, "bmp")) {
} else if (!title && strstr(opt, "bmp")) {
gtype = TImage::kBmp;
image = kTRUE;
}
Expand Down Expand Up @@ -5209,32 +5212,32 @@ void TPad::Print(const char *filename, Option_t *option)
}

//==============Save pad/canvas as a C++ script==============================
if (strstr(opt,"cxx")) {
if (!title && strstr(opt,"cxx")) {
GetCanvas()->SaveSource(psname, "");
return;
}

//==============Save pad/canvas as a root file===============================
if (strstr(opt,"root")) {
if (!title && strstr(opt,"root")) {
if (gDirectory) gDirectory->SaveObjectAs(this,psname.Data(),"");
return;
}

//==============Save pad/canvas as a XML file================================
if (strstr(opt,"xml")) {
if (!title && strstr(opt,"xml")) {
// Plugin XML driver
if (gDirectory) gDirectory->SaveObjectAs(this,psname.Data(),"");
return;
}

//==============Save pad/canvas as a JSON file================================
if (strstr(opt,"json")) {
if (!title && strstr(opt,"json")) {
if (gDirectory) gDirectory->SaveObjectAs(this,psname.Data(),"");
return;
}

//==============Save pad/canvas as a SVG file================================
if (strstr(opt,"svg")) {
if (!title && strstr(opt,"svg")) {
gVirtualPS = (TVirtualPS*)gROOT->GetListOfSpecials()->FindObject(psname);

Bool_t noScreen = kFALSE;
Expand Down Expand Up @@ -5275,7 +5278,7 @@ void TPad::Print(const char *filename, Option_t *option)
}

//==============Save pad/canvas as a TeX file================================
if (strstr(opt,"tex") || strstr(opt,"Standalone")) {
if (!title && (strstr(opt,"tex") || strstr(opt,"Standalone"))) {
gVirtualPS = (TVirtualPS*)gROOT->GetListOfSpecials()->FindObject(psname);

Bool_t noScreen = kFALSE;
Expand Down Expand Up @@ -5363,7 +5366,7 @@ void TPad::Print(const char *filename, Option_t *option)
if (!gVirtualPS || mustOpen) {

const char *pluginName = "ps"; // Plugin Postscript driver
if (strstr(opt,"pdf") || strstr(opt,"Title:") || strstr(opt,"EmbedFonts"))
if (strstr(opt,"pdf") || title || strstr(opt,"EmbedFonts"))
pluginName = "pdf";
else if (image)
pluginName = "image"; // Plugin TImageDump driver
Expand Down
Loading