@@ -1574,7 +1574,7 @@ namespace QgsWms
1574
1574
bool QgsWmsParameters::isForce2D () const
1575
1575
{
1576
1576
bool force2D = false ;
1577
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
1577
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
1578
1578
1579
1579
if ( options.contains ( DxfFormatOption::FORCE_2D ) )
1580
1580
{
@@ -1587,7 +1587,7 @@ namespace QgsWms
1587
1587
bool QgsWmsParameters::noMText () const
1588
1588
{
1589
1589
bool noMText = false ;
1590
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
1590
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
1591
1591
1592
1592
if ( options.contains ( DxfFormatOption::NO_MTEXT ) )
1593
1593
{
@@ -2146,7 +2146,7 @@ namespace QgsWms
2146
2146
QStringList QgsWmsParameters::dxfLayerAttributes () const
2147
2147
{
2148
2148
QStringList attributes;
2149
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
2149
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
2150
2150
2151
2151
if ( options.contains ( DxfFormatOption::LAYERATTRIBUTES ) )
2152
2152
{
@@ -2159,7 +2159,7 @@ namespace QgsWms
2159
2159
bool QgsWmsParameters::dxfUseLayerTitleAsName () const
2160
2160
{
2161
2161
bool use = false ;
2162
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
2162
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
2163
2163
2164
2164
if ( options.contains ( DxfFormatOption::USE_TITLE_AS_LAYERNAME ) )
2165
2165
{
@@ -2171,7 +2171,7 @@ namespace QgsWms
2171
2171
2172
2172
double QgsWmsParameters::dxfScale () const
2173
2173
{
2174
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
2174
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
2175
2175
2176
2176
double scale = -1 ;
2177
2177
if ( options.contains ( DxfFormatOption::SCALE ) )
@@ -2184,7 +2184,7 @@ namespace QgsWms
2184
2184
2185
2185
QgsDxfExport::SymbologyExport QgsWmsParameters::dxfMode () const
2186
2186
{
2187
- const QMap<DxfFormatOption, QString> options = dxfFormatOptions ();
2187
+ const QMap<DxfFormatOption, QString> options = formatOptions<QgsWmsParameters::DxfFormatOption> ();
2188
2188
2189
2189
QgsDxfExport::SymbologyExport symbol = QgsDxfExport::NoSymbology;
2190
2190
@@ -2210,37 +2210,14 @@ namespace QgsWms
2210
2210
{
2211
2211
QString codec = QStringLiteral ( " ISO-8859-1" );
2212
2212
2213
- if ( dxfFormatOptions ().contains ( DxfFormatOption::CODEC ) )
2213
+ if ( formatOptions<QgsWmsParameters::DxfFormatOption> ().contains ( DxfFormatOption::CODEC ) )
2214
2214
{
2215
- codec = dxfFormatOptions ()[ DxfFormatOption::CODEC ];
2215
+ codec = formatOptions<QgsWmsParameters::DxfFormatOption> ()[ DxfFormatOption::CODEC ];
2216
2216
}
2217
2217
2218
2218
return codec;
2219
2219
}
2220
2220
2221
- QMap<QgsWmsParameters::DxfFormatOption, QString> QgsWmsParameters::dxfFormatOptions () const
2222
- {
2223
- QMap<QgsWmsParameters::DxfFormatOption, QString> options;
2224
-
2225
- const QMetaEnum metaEnum ( QMetaEnum::fromType<QgsWmsParameters::DxfFormatOption>() );
2226
- const QStringList opts = mWmsParameters .value ( QgsWmsParameter::FORMAT_OPTIONS ).toStringList ( ' ;' );
2227
-
2228
- for ( auto it = opts.constBegin (); it != opts.constEnd (); ++it )
2229
- {
2230
- const int equalIdx = it->indexOf ( ' :' );
2231
- if ( equalIdx > 0 && equalIdx < ( it->length () - 1 ) )
2232
- {
2233
- const QString name = it->left ( equalIdx ).toUpper ();
2234
- const QgsWmsParameters::DxfFormatOption option =
2235
- ( QgsWmsParameters::DxfFormatOption ) metaEnum.keyToValue ( name.toStdString ().c_str () );
2236
- const QString value = it->right ( it->length () - equalIdx - 1 );
2237
- options.insert ( option, value );
2238
- }
2239
- }
2240
-
2241
- return options;
2242
- }
2243
-
2244
2221
bool QgsWmsParameters::writeGeoPdf () const
2245
2222
{
2246
2223
bool geoPdf = false ;
0 commit comments