Drop the temporary QgsRectangle::createNull static, not more needed

This commit is contained in:
Sandro Santilli 2023-10-22 21:30:17 +02:00 committed by Nyall Dawson
parent 376f9798cd
commit f42699979c
5 changed files with 4 additions and 21 deletions

View File

@ -59,7 +59,6 @@ Copy constructor
~QgsRectangle();
static QgsRectangle fromWkt( const QString &wkt );
%Docstring
Creates a new rectangle from a ``wkt`` string.

View File

@ -1204,7 +1204,7 @@ QgsRectangle QgsGeometry::boundingBox() const
{
return d->geometry->boundingBox();
}
return QgsRectangle::createNull();
return QgsRectangle();
}
QgsBox3D QgsGeometry::boundingBox3D() const

View File

@ -99,22 +99,6 @@ class CORE_EXPORT QgsRectangle
// see https://github.com/qgis/QGIS/pull/4720#issuecomment-308652392
~QgsRectangle() = default;
/**
* Creates a null rectangle.
*
* This is a temporary method to use while the default
* constructor is still not constructing a null rectangle.
*
* \since QGIS 3.34
*/
static QgsRectangle createNull() SIP_SKIP
{
// TODO: remove this method once the default constructor gives a null
QgsRectangle rectNull;
rectNull.setNull(); // TODO: have setNull() return *this ?
return rectNull;
}
/**
* Creates a new rectangle from a \a wkt string.
* The WKT must contain only 5 vertices, representing a rectangle aligned with X and Y axes.

View File

@ -837,7 +837,7 @@ void TestQgsGeometry::fromPolyline()
void TestQgsGeometry::fromRect()
{
QgsRectangle rectNull = QgsRectangle::createNull();
QgsRectangle rectNull;
QgsGeometry fromRect = QgsGeometry::fromRect( rectNull );
QVERIFY( fromRect.isNull() );
@ -2183,7 +2183,7 @@ void TestQgsGeometry::orientedMinimumBoundingBox()
void TestQgsGeometry::boundingBox()
{
QgsGeometry geomTest;
QgsRectangle nullRect = QgsRectangle::createNull();
QgsRectangle nullRect;
QCOMPARE( geomTest.boundingBox(), nullRect );
geomTest = QgsGeometry::fromWkt( QStringLiteral( "LINESTRING(-1 -2, 4 5)" ) );

View File

@ -83,7 +83,7 @@ void TestQgsVirtualLayerProvider::testConstructor()
QString uri;
std::unique_ptr<QgsVectorDataProvider> prov( new QgsVirtualLayerProvider( uri, opts ) );
const QgsRectangle rectNull = QgsRectangle::createNull();
const QgsRectangle rectNull;
QCOMPARE( prov->sourceExtent(), rectNull );
}