Skip to content

Commit 3298749

Browse files
author
mhugent
committed
fix for a bug which prevented commiting changed multiline geometries
git-svn-id: http://svn.osgeo.org/qgis/trunk@5419 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a064a59 commit 3298749

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/core/qgsgeometry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ bool QgsGeometry::deleteVertexAt(QgsGeometryVertexIndex atVertex)
642642
int pointindex = 0;
643643
for(int linenr = 0; linenr < *nLines; ++linenr)
644644
{
645+
memcpy(newBufferPtr, ptr, sizeof(int) + 1);
645646
ptr += (sizeof(int) + 1);
646647
newBufferPtr += (sizeof(int) + 1);
647648
nPoints = (int*)ptr;
@@ -885,6 +886,7 @@ bool QgsGeometry::insertVertexBefore(double x, double y, QgsGeometryVertexIndex
885886

886887
for(int linenr = 0; linenr < *nLines; ++linenr)
887888
{
889+
memcpy(newBufferPtr, ptr, sizeof(int) + 1);
888890
ptr += (sizeof(int) + 1);
889891
newBufferPtr += (sizeof(int) + 1);
890892
nPoints = (int*)ptr;

src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,10 @@ bool QgsPostgresProvider::changeGeometryValues(std::map<int, QgsGeometry> & geom
19371937
sql+="::bytea',"+srid+")";
19381938
sql+=" WHERE " +primaryKey+"="+QString::number(iter->first);
19391939

1940+
#ifdef QGISDEBUG
1941+
qWarning(sql);
1942+
#endif
1943+
19401944
#ifdef QGISDEBUG
19411945
std::cerr << "QgsPostgresProvider::changeGeometryValues: Updating with '"
19421946
<< sql.toLocal8Bit().data()

0 commit comments

Comments
 (0)