@@ -90,12 +90,19 @@ void QgsGrassEditNewPoint::mouseClick(QgsPoint & point, Qt::ButtonState button)
90
90
e->updateSymb ();
91
91
e->displayUpdated ();
92
92
93
- if ( e->mAttributes ) delete e->mAttributes ;
94
- e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , line, e->mQgisApp );
93
+ if ( e->mAttributes )
94
+ {
95
+ e->mAttributes ->clear ();
96
+ }
97
+ else
98
+ {
99
+ e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , line, e->mQgisApp );
100
+ }
95
101
for ( int i = 0 ; i < e->mCats ->n_cats ; i++ ) {
96
102
e->addAttributes ( e->mCats ->field [i], e->mCats ->cat [i] );
97
103
}
98
104
e->mAttributes ->show ();
105
+ e->mAttributes ->raise ();
99
106
}
100
107
101
108
@@ -170,12 +177,19 @@ void QgsGrassEditNewLine::mouseClick(QgsPoint & point, Qt::ButtonState button)
170
177
e->updateSymb ();
171
178
e->displayUpdated ();
172
179
173
- if ( e->mAttributes ) delete e->mAttributes ;
174
- e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , line, e->mQgisApp );
180
+ if ( e->mAttributes )
181
+ {
182
+ e->mAttributes ->clear ();
183
+ }
184
+ else
185
+ {
186
+ e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , line, e->mQgisApp );
187
+ }
175
188
for ( int i = 0 ; i < e->mCats ->n_cats ; i++ ) {
176
189
e->addAttributes ( e->mCats ->field [i], e->mCats ->cat [i] );
177
190
}
178
191
e->mAttributes ->show ();
192
+ e->mAttributes ->raise ();
179
193
}
180
194
Vect_reset_line ( e->mEditPoints );
181
195
break ;
@@ -756,21 +770,26 @@ void QgsGrassEditAttributes::mouseClick(QgsPoint & point, Qt::ButtonState button
756
770
std::cerr << " mSelectedLine = " << e->mSelectedLine << std::endl;
757
771
#endif
758
772
759
- if ( e->mAttributes ) {
760
- delete e->mAttributes ;
761
- e->mAttributes = 0 ;
773
+ if ( e->mAttributes )
774
+ {
775
+ e->mAttributes ->clear ();
776
+ e->mAttributes ->raise ();
762
777
}
763
778
764
779
if ( e->mSelectedLine ) { // highlite
765
780
e->displayElement ( e->mSelectedLine , e->mSymb [QgsGrassEdit::SYMB_HIGHLIGHT], e->mSize );
766
781
767
782
e->mProvider ->readLine ( NULL , e->mCats , e->mSelectedLine );
768
783
769
- e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , e->mSelectedLine , e->mQgisApp );
784
+ if ( !e->mAttributes )
785
+ {
786
+ e->mAttributes = new QgsGrassAttributes ( e, e->mProvider , e->mSelectedLine , e->mQgisApp );
787
+ }
770
788
for ( int i = 0 ; i < e->mCats ->n_cats ; i++ ) {
771
789
e->addAttributes ( e->mCats ->field [i], e->mCats ->cat [i] );
772
790
}
773
791
e->mAttributes ->show ();
792
+ e->mAttributes ->raise ();
774
793
}
775
794
776
795
}
0 commit comments