Skip to content

Commit

Permalink
Revert "Add '{title}' and '{layer}' functionality to the Export dialog (
Browse files Browse the repository at this point in the history
fix #3363)"

Fix crash reported on v1.2.36/v1.3-beta17, ctx->activeDocument() can
be nullptr.

This reverts commit 1f5e4cf to fix #3431
  • Loading branch information
dacap committed Jul 19, 2022
1 parent f920e9d commit da58670
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions src/app/commands/cmd_save_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "app/file/gif_format.h"
#include "app/file/png_format.h"
#include "app/file_selector.h"
#include "app/filename_formatter.h"
#include "app/i18n/strings.h"
#include "app/job.h"
#include "app/modules/gui.h"
Expand Down Expand Up @@ -391,11 +390,7 @@ void SaveFileCopyAsCommand::onExecute(Context* context)
if (!result)
return;

FilenameInfo fnInfo;
fnInfo
.filename(context->activeDocument()->name())
.layerName(win.layersValue());
outputFilename = filename_formatter(win.outputFilenameValue(), fnInfo);
outputFilename = win.outputFilenameValue();

if (askOverwrite &&
base::is_file(outputFilename)) {
Expand Down
5 changes: 0 additions & 5 deletions src/app/doc_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,6 @@ Doc* DocExporter::exportSheet(Context* ctx, base::task_token& token)
// Save the image files.
if (!m_textureFilename.empty()) {
DX_TRACE("DocExporter::exportSheet", m_textureFilename);
// filename_formatter usage to include {title} key word on CLI.
FilenameInfo fnInfo;
fnInfo.filename(ctx->activeDocument()->name());
m_textureFilename = filename_formatter(m_textureFilename.c_str(), fnInfo);

textureDocument->setFilename(m_textureFilename.c_str());
int ret = save_document(ctx, textureDocument.get());
if (ret == 0)
Expand Down

0 comments on commit da58670

Please sign in to comment.