This commit sets the framework for allowing expression functions to
use named parameters. Ie, instead of:
clamp(1,2,3)
you can use:
clamp( min:=1, value:=2, max:=3)
This also allows arguments to be switched, eg:
clamp( value:=2, max:=3, min:=1)
Additionally, it allows for a more structured definition of function
parameters to handle optional arguments and default values for
parameters. These are currently being done using a hacky infinite
argument list.
I've utilised the postgres ':=' syntax for specifying named arguments
to avoid potential collisions which may arise with the equality test
if we re-used just the '=' operator alone.
Sponsored by North Road
label font and margins when rendering as HTML.
This allows interactive choice of font, margins and colors and
avoids the need to manually set these with CSS within the
label HTML code.
subsets of attributes and the filter expression requires fields
which are not included in the attribute subset
Note: I've only fixed the providers which implement the vector
provider conformance unit tests. Other providers (eg GRASS) should
also implement a similar fix.
The code currently fallbacks to dealing with LongLong fields as
strings, which breaks the ProviderTestCase testMinValue() and
testMaxValue() tests, if we change the definition of the tests
of the memory provider to use a int8 field for the cnt field.
======================================================================
FAIL: testMaxValue (__main__.TestPyQgsMemoryProviderIndexed)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/even/qgis-git/Quantum-GIS.clean/tests/src/python/providertestbase.py", line 349, in testMaxValue
self.assertEqual(self.provider.maximumValue(1), 400)
AssertionError: u'400' != 400
======================================================================
FAIL: testMinValue (__main__.TestPyQgsMemoryProviderIndexed)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/even/qgis-git/Quantum-GIS.clean/tests/src/python/providertestbase.py", line 345, in testMinValue
self.assertEqual(self.provider.minimumValue(1), -200)
AssertionError: u'-200' != -200
If an iterator fails to open the spatialite database (mHandle == nullptr
in QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator() ),
a crash will occur at the destruction of the QgsSpatiaLiteFeatureSource,
due to the iterator not being removed from the list of active iterators.
Currently QgsSpatiaLiteFeatureIterator::close() does not call
iteratorClosed() if mHandle is invalid, which later causes
QgsAbstractFeatureSource::~QgsAbstractFeatureSource() to try calling
the close() method of a now defunct iterator.
If not applying the patch, the added test case crashes with:
177: src/providers/spatialite/qgsspatialiteconnection.cpp: 736: (openDb) [1ms] New sqlite connection for /tmp/test.sqlite.corrupt
177: src/providers/spatialite/qgsspatialiteconnection.cpp: 750: (openDb) [1ms] Failure while connecting to: /tmp/test.sqlite.corrupt
177:
177: invalid metadata tables
177: src/core/qgsfeaturerequest.cpp: 259: (~QgsAbstractFeatureSource) [0ms] closing active iterator
177: CMake Error at PyQgsSpatialiteProvider.cmake:22 (MESSAGE):
177: Test failed: Segmentation fault
Those components depend on sqlite3.h, but fails to add
explictly its paths, relying on it to be present in the other used
included paths, which may be not always the case in some setups.
This is a follow-up of 455a473a287ef278bbd7d91d13313cf43710c1da on
a clean build.
Those two fields are present in the vector layer properties. It
was possible to set a minScale bigger than the maxScale.
Now, the maxScale is forced to minScale if the user tries to
set it to a lower value.