Skip to content
Permalink
Browse files

Some clazy warnings

  • Loading branch information
nyalldawson committed Oct 23, 2018
1 parent 8cf64c8 commit cc543d6b9d19dfc6f3836e6aecf854d2288e9ff3
Showing with 24 additions and 9 deletions.
  1. +23 −8 src/core/layout/qgslayoutexporter.cpp
  2. +1 −1 src/core/layout/qgslayoutexporter.h
@@ -47,6 +47,9 @@ class LayoutContextPreviewSettingRestorer
mLayout->renderContext().mIsPreviewRender = mPreviousSetting;
}

LayoutContextPreviewSettingRestorer( const LayoutContextPreviewSettingRestorer &other ) = delete;
LayoutContextPreviewSettingRestorer &operator=( const LayoutContextPreviewSettingRestorer &other ) = delete;

private:
QgsLayout *mLayout = nullptr;
bool mPreviousSetting = false;
@@ -75,6 +78,9 @@ class LayoutGuideHider
}
}

LayoutGuideHider( const LayoutGuideHider &other ) = delete;
LayoutGuideHider &operator=( const LayoutGuideHider &other ) = delete;

private:
QgsLayout *mLayout = nullptr;
QHash< QgsLayoutGuide *, bool > mPrevVisibility;
@@ -108,6 +114,9 @@ class LayoutItemHider
}
}

LayoutItemHider( const LayoutItemHider &other ) = delete;
LayoutItemHider &operator=( const LayoutItemHider &other ) = delete;

private:

QHash<QGraphicsItem *, bool> mPrevVisibility;
@@ -206,6 +215,9 @@ class LayoutItemCacheSettingRestorer
}
}

LayoutItemCacheSettingRestorer( const LayoutItemCacheSettingRestorer &other ) = delete;
LayoutItemCacheSettingRestorer &operator=( const LayoutItemCacheSettingRestorer &other ) = delete;

private:
QgsLayout *mLayout = nullptr;
QHash< QGraphicsItem *, QGraphicsItem::CacheMode > mPrevCacheMode;
@@ -296,6 +308,9 @@ class LayoutContextSettingsRestorer
mLayout->renderContext().setCurrentExportLayer( mPreviousExportLayer );
}

LayoutContextSettingsRestorer( const LayoutContextSettingsRestorer &other ) = delete;
LayoutContextSettingsRestorer &operator=( const LayoutContextSettingsRestorer &other ) = delete;

private:
QgsLayout *mLayout = nullptr;
double mPreviousDpi = 0;
@@ -1118,7 +1133,7 @@ void QgsLayoutExporter::updatePrinterPageSize( QgsLayout *layout, QPrinter &prin
printer.setPageMargins( QMarginsF( 0, 0, 0, 0 ) );
}

QgsLayoutExporter::ExportResult QgsLayoutExporter::renderToLayeredSvg( const SvgExportSettings &settings, double width, double height, int page, QRectF bounds, const QString &filename, int svgLayerId, const QString &layerName, QDomDocument &svg, QDomNode &svgDocRoot, bool includeMetadata ) const
QgsLayoutExporter::ExportResult QgsLayoutExporter::renderToLayeredSvg( const SvgExportSettings &settings, double width, double height, int page, const QRectF &bounds, const QString &filename, int svgLayerId, const QString &layerName, QDomDocument &svg, QDomNode &svgDocRoot, bool includeMetadata ) const
{
QBuffer svgBuffer;
{
@@ -1572,13 +1587,13 @@ bool QgsLayoutExporter::saveImage( const QImage &image, const QString &imageFile
}
if ( projectForMetadata )
{
w.setText( "Author", projectForMetadata->metadata().author() );
w.setText( QStringLiteral( "Author" ), projectForMetadata->metadata().author() );
const QString creator = QStringLiteral( "QGIS %1" ).arg( Qgis::QGIS_VERSION );
w.setText( "Creator", creator );
w.setText( "Producer", creator );
w.setText( "Subject", projectForMetadata->metadata().abstract() );
w.setText( "Created", projectForMetadata->metadata().creationDateTime().toString( Qt::ISODate ) );
w.setText( "Title", projectForMetadata->metadata().title() );
w.setText( QStringLiteral( "Creator" ), creator );
w.setText( QStringLiteral( "Producer" ), creator );
w.setText( QStringLiteral( "Subject" ), projectForMetadata->metadata().abstract() );
w.setText( QStringLiteral( "Created" ), projectForMetadata->metadata().creationDateTime().toString( Qt::ISODate ) );
w.setText( QStringLiteral( "Title" ), projectForMetadata->metadata().title() );

const QgsAbstractMetadataBase::KeywordMap keywords = projectForMetadata->metadata().keywords();
QStringList allKeywords;
@@ -1587,7 +1602,7 @@ bool QgsLayoutExporter::saveImage( const QImage &image, const QString &imageFile
allKeywords.append( QStringLiteral( "%1: %2" ).arg( it.key(), it.value().join( ',' ) ) );
}
const QString keywordString = allKeywords.join( ';' );
w.setText( "Keywords", keywordString );
w.setText( QStringLiteral( "Keywords" ), keywordString );
}
return w.write( image );
}
@@ -543,7 +543,7 @@ class CORE_EXPORT QgsLayoutExporter

static void updatePrinterPageSize( QgsLayout *layout, QPrinter &printer, int page );

ExportResult renderToLayeredSvg( const SvgExportSettings &settings, double width, double height, int page, QRectF bounds,
ExportResult renderToLayeredSvg( const SvgExportSettings &settings, double width, double height, int page, const QRectF &bounds,
const QString &filename, int svgLayerId, const QString &layerName,
QDomDocument &svg, QDomNode &svgDocRoot, bool includeMetadata ) const;

0 comments on commit cc543d6

Please sign in to comment.
You can’t perform that action at this time.