From f2a8b789a729f5650f03263657fdbf68f4f53944 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 13 Mar 2019 11:36:56 +0300 Subject: [PATCH] Additional commit for '[CEA 13302] Policy for c++ files ? using namespaces in c++ header files. boost_ptr / shared_ptr' --- src/MEDCalc/gui/WorkspaceController.cxx | 4 ++-- src/MEDCalc/gui/XmedDataModel.cxx | 16 ++++++++-------- src/MEDCalc/gui/XmedDataModel.hxx | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/MEDCalc/gui/WorkspaceController.cxx b/src/MEDCalc/gui/WorkspaceController.cxx index 97235c63a..6ad3394b3 100644 --- a/src/MEDCalc/gui/WorkspaceController.cxx +++ b/src/MEDCalc/gui/WorkspaceController.cxx @@ -288,7 +288,7 @@ void WorkspaceController::processMedEvent(const MEDCALC::MedEvent* event) { } else if ( event->type == MEDCALC::EVENT_REMOVE_FROM_WORKSPACE ) { STDLOG("remove field"); - std::map::iterator itr = dataModel->begin(); + std::map::iterator itr = dataModel->begin(); for ( ; itr != dataModel->end(); ++itr) { XmedDataObject* obj = dynamic_cast(itr->second); if (obj->getFieldHandler()->id == event->dataId) { @@ -301,7 +301,7 @@ void WorkspaceController::processMedEvent(const MEDCALC::MedEvent* event) { } else if ( event->type == MEDCALC::EVENT_CLEAN_WORKSPACE ) { STDLOG("clean workspace"); - std::map::iterator itr = dataModel->begin(); + std::map::iterator itr = dataModel->begin(); for ( ; itr != dataModel->end(); ++itr) { XmedDataObject* obj = dynamic_cast(itr->second); std::string itemNameId = obj->getNameId(); diff --git a/src/MEDCalc/gui/XmedDataModel.cxx b/src/MEDCalc/gui/XmedDataModel.cxx index b35a4d29a..8cec78412 100644 --- a/src/MEDCalc/gui/XmedDataModel.cxx +++ b/src/MEDCalc/gui/XmedDataModel.cxx @@ -33,16 +33,16 @@ XmedDataObject::XmedDataObject() : DataObject(), _presId(-1) { /*! This function specified the localization of the object in the * hierarchical organization */ -string XmedDataObject::getPath() { - string path = - string(_fieldHandler.meshname) + pathsep + +std::string XmedDataObject::getPath() { + std::string path = + std::string(_fieldHandler.meshname) + pathsep + _getTypedFieldLabel(); return path; } void XmedDataObject::setFieldHandler(MEDCALC::FieldHandler fieldHandler) { _fieldHandler = fieldHandler; - this->setLabel(string("it = ")+ToString(_fieldHandler.iteration)); + this->setLabel(std::string("it = ")+ToString(_fieldHandler.iteration)); } MEDCALC::FieldHandler * XmedDataObject::getFieldHandler() { return &_fieldHandler; @@ -59,7 +59,7 @@ int XmedDataObject::getPresentationId() const { return _presId; } * This function implements the convention for displaying a fieldname * characterized by its spatial discretisation type. */ -string XmedDataObject::_getTypedFieldLabel() { +std::string XmedDataObject::_getTypedFieldLabel() { // A field name could identify several MEDCoupling fields, that // differ by their spatial discretization on the mesh (values on // cells, values on nodes, ...). This spatial discretization is @@ -71,10 +71,10 @@ string XmedDataObject::_getTypedFieldLabel() { // 3 = ON_GAUSS_NE if ( _fieldHandler.type < 0 || _fieldHandler.type >= NB_TYPE_OF_FIELDS ) { - return string("UNKNOWN"); + return std::string("UNKNOWN"); } - string label(_fieldHandler.fieldname); - label +=" ("+string(mapTypeOfFieldLabel[_fieldHandler.type])+")"; + std::string label(_fieldHandler.fieldname); + label +=" ("+std::string(mapTypeOfFieldLabel[_fieldHandler.type])+")"; return label; } diff --git a/src/MEDCalc/gui/XmedDataModel.hxx b/src/MEDCalc/gui/XmedDataModel.hxx index 6630b95d4..71c08431a 100644 --- a/src/MEDCalc/gui/XmedDataModel.hxx +++ b/src/MEDCalc/gui/XmedDataModel.hxx @@ -35,7 +35,7 @@ class MEDCALCGUI_EXPORT XmedDataObject: public DataObject { public: XmedDataObject(); - virtual string getPath(); + virtual std::string getPath(); void setFieldHandler(MEDCALC::FieldHandler fieldHandler); MEDCALC::FieldHandler * getFieldHandler(); @@ -46,7 +46,7 @@ public: private: MEDCALC::FieldHandler _fieldHandler; int _presId; - string _getTypedFieldLabel(); + std::string _getTypedFieldLabel(); }; // -- 2.39.2