Pdf export : Remove theme change before export to PDF

Crash seen on Windows related to theme change as part of export to PDF. This is related to export of plots to PDF in dark mode. Investigate other solution.
This commit is contained in:
Magne Sjaastad 2022-03-04 13:58:01 +01:00 committed by Kristian Bendiksen
parent 001e918238
commit ffc1769a5f

View File

@ -29,7 +29,6 @@
#include "RimViewWindow.h"
#include "RiuFileDialogTools.h"
#include "RiuGuiTheme.h"
#include "RiuPlotMainWindow.h"
#include "RicSnapshotFilenameGenerator.h"
@ -87,9 +86,8 @@ void RicSnapshotViewToFileFeature::saveSnapshotAs( const QString& fileName, cons
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToFileFeature::savePlotPdfReportAs( const QString& fileName, RimPlotWindow* plot )
{
auto currentTheme = RiuGuiTheme::currentGuiTheme();
if ( !plot || !plot->viewWidget() ) return;
RiuGuiTheme::updateGuiTheme( RiaDefines::ThemeEnum::LIGHT );
RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots();
QCoreApplication::processEvents();
QFile pdfFile( fileName );
@ -136,7 +134,6 @@ void RicSnapshotViewToFileFeature::savePlotPdfReportAs( const QString& fileName,
{
RiaLogging::error( QString( "Could not write PDF to %1" ).arg( fileName ) );
}
RiuGuiTheme::updateGuiTheme( currentTheme );
}
//--------------------------------------------------------------------------------------------------