From: asl Date: Mon, 24 Mar 2008 08:04:32 +0000 (+0000) Subject: PAL18573: geometric entities are created with incorrect name X-Git-Tag: V5_0_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d2ac54f583f848170bf672f12164bca9cdc50dd2;p=modules%2Fgeom.git PAL18573: geometric entities are created with incorrect name --- diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx index 4f7270c09..3b434925f 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx @@ -476,7 +476,7 @@ GEOM::GEOM_Object_ptr BlocksGUI_ExplodeDlg::getFather( GEOM::GEOM_Object_ptr ) // Function : getNewObjectName // Purpose : Redefine this method to return proper name for a new object //================================================================ -const char* BlocksGUI_ExplodeDlg::getNewObjectName() const +QString BlocksGUI_ExplodeDlg::getNewObjectName() const { - return ""; + return QString::null; } diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h index 05cbb3345..eaa59afbb 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h @@ -48,7 +48,7 @@ protected: virtual bool execute( ObjectList& ); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr ); - virtual const char* getNewObjectName() const; + virtual QString getNewObjectName() const; private: void Init(); diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx index 24b693a38..4f466c745 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx @@ -597,7 +597,7 @@ GEOM::GEOM_Object_ptr EntityGUI_SubShapeDlg::getFather( GEOM::GEOM_Object_ptr ) return myObject; } -const char* EntityGUI_SubShapeDlg::getNewObjectName() const +QString EntityGUI_SubShapeDlg::getNewObjectName() const { - return ""; + return QString::null; } diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.h b/src/EntityGUI/EntityGUI_SubShapeDlg.h index 27d71f38e..6d64deb1c 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.h +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.h @@ -48,7 +48,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr ); - virtual const char* getNewObjectName() const; + virtual QString getNewObjectName() const; private slots: void ClickOnOk(); diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 73d1a04be..d2c9cfdeb 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -902,9 +902,9 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::getFather( GEOM::GEOM_Object_ptr theObj ) // Function : getNewObjectName // Purpose : Redefine this method to return proper name for a new object //================================================================ -const char* GEOMBase_Helper::getNewObjectName() const +QString GEOMBase_Helper::getNewObjectName() const { - return ""; + return QString::null; } //================================================================ diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index 2e02f3530..3a13c3f1f 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -171,7 +171,7 @@ protected: // for or a nil reference if should be published // as a top-level object. - virtual const char* getNewObjectName() const; + virtual QString getNewObjectName() const; virtual void addSubshapesToStudy(); GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName ); diff --git a/src/GEOMBase/GEOMBase_Skeleton.cxx b/src/GEOMBase/GEOMBase_Skeleton.cxx index b1a50b0af..34538ae90 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.cxx +++ b/src/GEOMBase/GEOMBase_Skeleton.cxx @@ -224,9 +224,9 @@ void GEOMBase_Skeleton::initName( const QString& thePrefix ) // function : getNewObjectName() // purpose : returns contents of Name field //================================================================================= -const char* GEOMBase_Skeleton::getNewObjectName() const +QString GEOMBase_Skeleton::getNewObjectName() const { - return myMainFrame->ResultName->text().toLatin1().constData(); + return myMainFrame->ResultName->text(); } //================================================================================= diff --git a/src/GEOMBase/GEOMBase_Skeleton.h b/src/GEOMBase/GEOMBase_Skeleton.h index f674edf84..b41134016 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.h +++ b/src/GEOMBase/GEOMBase_Skeleton.h @@ -70,7 +70,7 @@ protected: /*! returns contents of "Name" field */ - virtual const char* getNewObjectName() const; + virtual QString getNewObjectName() const; /*! returns id of a selected "constructor" radio button or '-1' in case of error */ diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index f40ff99d9..017dd7030 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -774,7 +774,7 @@ bool GroupGUI_GroupDlg::execute( ObjectList& objects ) _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) ); if ( SO ) { _PTR(StudyBuilder) aBuilder (study->studyDS()->NewBuilder()); - aBuilder->SetName( SO, getNewObjectName() ); + aBuilder->SetName( SO, getNewObjectName().toLatin1().constData() ); } } } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index 44277ab71..2edd2a186 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -531,7 +531,7 @@ bool RepairGUI_GlueDlg::onAcceptLocal() for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) { QString aName( "" ); if ( nbObjs > 1 ) { - aName = strlen( getNewObjectName() ) ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) ); + aName = getNewObjectName().length() ? GEOMBase::GetDefaultName( getNewObjectName() ) : GEOMBase::GetDefaultName( getPrefix( *it ) ); } else { aName = getNewObjectName();