From d6112376d19342e920c886ca0ca422248dc63021 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 10 Nov 2011 07:49:34 +0000 Subject: [PATCH] Fix for the bug TC 6.4.0: Rename popup item disappeared from pop-up for View Params object. --- src/VISUGUI/VisuGUI.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 03c463be..8cd34066 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -4946,6 +4946,11 @@ bool VisuGUI::renameAllowed( const QString& entry) const { aType == VISU::TPOINTMAP3D || aType == VISU::TVIEW3D || aType == VISU::TPOINTMAP3D || aType == VISU::TGAUSSPOINTS) return true; + } else { + VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject); + bool anIsExist; + QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist); + return anIsExist && "VIEW3D" == aVal; } return false; } @@ -4966,6 +4971,7 @@ bool VisuGUI::renameObject( const QString& entry, const QString& name) { _PTR(SObject) aSObject = anObjectInfo.mySObject; if (aSObject) { VISU::Base_i* aBase = anObjectInfo.myBase; + VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject); if(aBase){ VISU::VISUType aType = aBase->GetType(); if( aType == VISU::TCOLOREDPRS3DHOLDER ) { @@ -5033,6 +5039,19 @@ bool VisuGUI::renameObject( const QString& entry, const QString& name) { return true; } } + //Rename visual params + } + } else { + bool anIsExist; + QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist); + if(anIsExist && "VIEW3D" == aVal) { + _PTR(GenericAttribute) anAttr; + if (aSObject->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName (anAttr); + if (!name.isEmpty()) { + aName->SetValue(qPrintable(name)); + } + } } } } -- 2.39.2