Skip to content
Permalink
Browse files

[Server] Reactivate the capability to print selection with Server 3.4

The capability to print selection has been removed by the commit aaa7003 to
prevent accidental selections showing in exports from composer.

It is reactivated only for QGIS Server.

Fixes #13459 QGIS Server WMS GetPrint request don't respect SELECTION parameter

It's a forward porting of #7185
  • Loading branch information
rldhont committed Oct 25, 2018
1 parent 3ff5c82 commit 74f278553218fb56730c0326c6a73b666e44f686
@@ -29,6 +29,7 @@ Stores information relating to the current rendering settings for a layout.
FlagUseAdvancedEffects,
FlagForceVectorOutput,
FlagHideCoverageLayer,
FlagDrawSelection,
};
typedef QFlags<QgsLayoutRenderContext::Flag> Flags;

@@ -1104,7 +1104,7 @@ QgsMapSettings QgsLayoutItemMap::mapSettings( const QgsRectangle &extent, QSizeF
jobMapSettings.setFlag( QgsMapSettings::ForceVectorOutput, true ); // force vector output (no caching of marker images etc.)
jobMapSettings.setFlag( QgsMapSettings::Antialiasing, mLayout->renderContext().flags() & QgsLayoutRenderContext::FlagAntialiasing );
jobMapSettings.setFlag( QgsMapSettings::DrawEditingInfo, false );
jobMapSettings.setFlag( QgsMapSettings::DrawSelection, false );
jobMapSettings.setFlag( QgsMapSettings::DrawSelection, mLayout->renderContext().flags() & QgsLayoutRenderContext::FlagDrawSelection );
jobMapSettings.setFlag( QgsMapSettings::UseAdvancedEffects, mLayout->renderContext().flags() & QgsLayoutRenderContext::FlagUseAdvancedEffects );
jobMapSettings.setTransformContext( mLayout->project()->transformContext() );
jobMapSettings.setPathResolver( mLayout->project()->pathResolver() );
@@ -45,6 +45,7 @@ class CORE_EXPORT QgsLayoutRenderContext : public QObject
FlagUseAdvancedEffects = 1 << 4, //!< Enable advanced effects such as blend modes.
FlagForceVectorOutput = 1 << 5, //!< Force output in vector format where possible, even if items require rasterization to keep their correct appearance.
FlagHideCoverageLayer = 1 << 6, //!< Hide coverage layer in outputs
FlagDrawSelection = 1 << 7, //!< Draw selection
};
Q_DECLARE_FLAGS( Flags, Flag )

@@ -66,7 +66,6 @@
#include "qgslayerrestorer.h"
#include "qgsdxfexport.h"
#include "qgssymbollayerutils.h"
#include "qgslayoutitemlegend.h"
#include "qgsserverexception.h"

#include <QImage>
@@ -80,6 +79,7 @@
#include "qgslayoutmanager.h"
#include "qgslayoutexporter.h"
#include "qgslayoutsize.h"
#include "qgslayoutrendercontext.h"
#include "qgslayoutmeasurement.h"
#include "qgsprintlayout.h"
#include "qgslayoutpagecollection.h"
@@ -450,7 +450,7 @@ namespace QgsWms

bool QgsRenderer::configurePrintLayout( QgsPrintLayout *c, const QgsMapSettings &mapSettings )
{

c->renderContext().setFlag( QgsLayoutRenderContext::FlagDrawSelection, true );
// Maps are configured first
QList<QgsLayoutItemMap *> maps;
c->layoutItems<QgsLayoutItemMap>( maps );

0 comments on commit 74f2785

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