From 1ca4306f9d93573e8fe5063be11a4c5b00da66bc Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 21 Aug 2024 13:50:29 -0300 Subject: [PATCH] [win] Fix File > Export > Export As to other drive (fix #4607) This only affects the Windows platform. Regression introduced in db639072f77daf724f9eeb0642d7de61924db973 --- src/app/ui/export_file_window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/ui/export_file_window.cpp b/src/app/ui/export_file_window.cpp index a1c362469..a55def93d 100644 --- a/src/app/ui/export_file_window.cpp +++ b/src/app/ui/export_file_window.cpp @@ -199,6 +199,12 @@ void ExportFileWindow::setOutputFilename(const std::string& pathAndFilename) else { m_outputPath = base::get_file_path(m_doc->filename()); m_outputFilename = base::get_relative_path(pathAndFilename, base::get_file_path(m_doc->filename())); + + // Cannot find a relative path (e.g. we selected other drive) + if (m_outputFilename == pathAndFilename) { + m_outputPath = base::get_file_path(pathAndFilename); + m_outputFilename = base::get_file_name(pathAndFilename); + } } updateOutputFilenameEntry();