Skip to content
Permalink
Browse files
fix #7386
  • Loading branch information
jef-n committed Mar 18, 2013
1 parent bfde7c8 commit 5743f52c8f5026a5b89b12b261e2a0eabb55b5ff
Showing with 38 additions and 39 deletions.
  1. +7 −8 src/app/qgsattributedialog.cpp
  2. +3 −3 src/app/qgsfieldsproperties.cpp
  3. +28 −28 src/core/composer/qgscomposition.cpp
@@ -99,11 +99,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
tabWidget = new QTabWidget( mDialog );
gridLayout->addWidget( tabWidget );

for ( QList<QgsAttributeEditorElement*>::const_iterator tIt = vl->attributeEditorElements().begin(); tIt != vl->attributeEditorElements().end(); ++tIt )
foreach ( const QgsAttributeEditorElement *widgDef, vl->attributeEditorElements() )
{
QgsAttributeEditorElement* widgDef = *tIt;

QWidget* tabPage = new QWidget( tabWidget );

tabWidget->addTab( tabPage, widgDef->name() );
QGridLayout *tabPageLayout = new QGridLayout( tabPage );

@@ -230,16 +229,16 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
for ( int fldIdx = 0; fldIdx < theFields.count(); ++fldIdx )
{
QList<QWidget *> myWidgets = mDialog->findChildren<QWidget*>( theFields[fldIdx].name() );
if ( !myWidgets.size() )
if ( myWidgets.isEmpty() )
continue;

for ( QList<QWidget *>::const_iterator itw = myWidgets.begin(); itw != myWidgets.end(); ++itw )
foreach ( QWidget *w, myWidgets )
{
QgsAttributeEditor::createAttributeEditor( mDialog, *itw, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
QgsAttributeEditor::createAttributeEditor( mDialog, w, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );

if ( vl->editType( fldIdx ) != QgsVectorLayer::Immutable )
if ( vl->editType( fldIdx ) != QgsVectorLayer::Immutable && w->isEnabled() )
{
( *itw )->setEnabled(( *itw )->isEnabled() && vl->isEditable() && vl->fieldEditable( fldIdx ) );
w->setEnabled( vl->isEditable() && vl->fieldEditable( fldIdx ) );
}
}
}
@@ -487,11 +487,11 @@ void QgsFieldsProperties::attributeTypeDialog()
QPair<QString, QString> checkStates = mCheckedStates.value( index, mLayer->checkedState( index ) );
attributeTypeDialog.setCheckedState( checkStates.first, checkStates.second );

attributeTypeDialog.setDateFormat( mLayer->dateFormat( index ) );
attributeTypeDialog.setDateFormat( mDateFormat.value( index, mLayer->dateFormat( index ) ) );

attributeTypeDialog.setIndex( index, mEditTypeMap.value( index, mLayer->editType( index ) ) );
attributeTypeDialog.setFieldEditable( mFieldEditables.value( index, mLayer->fieldEditable( index ) ) );

attributeTypeDialog.setFieldEditable( mLayer->fieldEditable( index ) );
attributeTypeDialog.setIndex( index, mEditTypeMap.value( index, mLayer->editType( index ) ) );

if ( !attributeTypeDialog.exec() )
return;
@@ -293,7 +293,7 @@ const QgsComposerItem* QgsComposition::getComposerItemByUuid( QString theUuid, b
}
}
}
return 0;
}
*/
@@ -313,7 +313,7 @@ const QgsComposerItem* QgsComposition::getComposerItemByUuid( QString theUuid )
}
}
}

return 0;
}

@@ -491,14 +491,14 @@ bool QgsComposition::loadFromTemplate( const QDomDocument& doc, QMap<QString, QS
return false;
}

// remove all uuid attributes since we don't want duplicates UUIDS
QDomNodeList composerItemsNodes = importDoc.elementsByTagName("ComposerItem");
for (int i=0; i<composerItemsNodes.count(); ++i)
// remove all uuid attributes since we don't want duplicates UUIDS
QDomNodeList composerItemsNodes = importDoc.elementsByTagName( "ComposerItem" );
for ( int i = 0; i < composerItemsNodes.count(); ++i )
{
QDomNode composerItemNode = composerItemsNodes.at(i);
if( composerItemNode.isElement() )
QDomNode composerItemNode = composerItemsNodes.at( i );
if ( composerItemNode.isElement() )
{
composerItemNode.toElement().removeAttribute("uuid");
composerItemNode.toElement().removeAttribute( "uuid" );
}
}

@@ -514,10 +514,10 @@ bool QgsComposition::loadFromTemplate( const QDomDocument& doc, QMap<QString, QS
void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore,
bool addUndoCommands, QPointF* pos, bool pasteInPlace )
{
QPointF* pasteInPlacePt;
if( pasteInPlace )
QPointF* pasteInPlacePt = 0;
if ( pasteInPlace )
{
pasteInPlacePt = new QPointF(0, pageNumberAt( *pos ) * (mPageHeight+mSpaceBetweenPages) );
pasteInPlacePt = new QPointF( 0, pageNumberAt( *pos ) * ( mPageHeight + mSpaceBetweenPages ) );
}
QDomNodeList composerLabelList = elem.elementsByTagName( "ComposerLabel" );
for ( int i = 0; i < composerLabelList.size(); ++i )
@@ -527,10 +527,10 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
newLabel->readXML( currentComposerLabelElem, doc );
if ( pos )
{
if ( pasteInPlace )
if ( pasteInPlacePt )
{
newLabel->setItemPosition( newLabel->transform().dx(), fmod(newLabel->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newLabel->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newLabel->setItemPosition( newLabel->transform().dx(), fmod( newLabel->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newLabel->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -563,8 +563,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newMap->setItemPosition( newMap->transform().dx(), fmod(newMap->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newMap->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newMap->setItemPosition( newMap->transform().dx(), fmod( newMap->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newMap->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -588,8 +588,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newArrow->setItemPosition( newArrow->transform().dx(), fmod(newArrow->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newArrow->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newArrow->setItemPosition( newArrow->transform().dx(), fmod( newArrow->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newArrow->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -613,8 +613,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newScaleBar->setItemPosition( newScaleBar->transform().dx(), fmod(newScaleBar->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newScaleBar->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newScaleBar->setItemPosition( newScaleBar->transform().dx(), fmod( newScaleBar->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newScaleBar->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -638,8 +638,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newShape->setItemPosition( newShape->transform().dx(), fmod(newShape->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newShape->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newShape->setItemPosition( newShape->transform().dx(), fmod( newShape->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newShape->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -663,8 +663,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newPicture->setItemPosition( newPicture->transform().dx(), fmod(newPicture->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newPicture->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newPicture->setItemPosition( newPicture->transform().dx(), fmod( newPicture->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newPicture->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -688,8 +688,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newLegend->setItemPosition( newLegend->transform().dx(), fmod(newLegend->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newLegend->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newLegend->setItemPosition( newLegend->transform().dx(), fmod( newLegend->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newLegend->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{
@@ -713,8 +713,8 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
{
if ( pasteInPlace )
{
newTable->setItemPosition( newTable->transform().dx(), fmod(newTable->transform().dy(), (paperHeight()+spaceBetweenPages()) ) );
newTable->move( pasteInPlacePt->x(),pasteInPlacePt->y() );
newTable->setItemPosition( newTable->transform().dx(), fmod( newTable->transform().dy(), ( paperHeight() + spaceBetweenPages() ) ) );
newTable->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
{

0 comments on commit 5743f52

Please sign in to comment.