From: adv Date: Thu, 5 Dec 2013 07:31:47 +0000 (+0000) Subject: Image data storing corrected (Bug #177). X-Git-Tag: BR_hydro_v_0_4~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f0402a53eba86f2159f7abacde90439444667e1d;p=modules%2Fhydro.git Image data storing corrected (Bug #177). --- diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index 05bb314c..e589ae9c 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -285,9 +284,13 @@ QString HYDROData_Image::GetFilePath() const { QString aRes; - Handle(TDataStd_AsciiString) anAsciiStr; - if ( myLab.FindChild( DataTag_FilePath ).FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) ) - aRes = QString( anAsciiStr->Get().ToCString() ); + TDF_Label aLabel = myLab.FindChild( DataTag_FilePath, false ); + if ( !aLabel.IsNull() ) + { + Handle(TDataStd_AsciiString) anAsciiStr; + if ( aLabel.FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) ) + aRes = QString( anAsciiStr->Get().ToCString() ); + } return aRes; } @@ -713,21 +716,25 @@ void HYDROData_Image::ClearReferences() ClearReferenceObjects( 0 ); } -void HYDROData_Image::SetOperatorName(const QString theOpName) +void HYDROData_Image::SetOperatorName( const QString theOpName ) { - TDataStd_Name::Set(myLab.FindChild(DataTag_Operator), - TCollection_ExtendedString(theOpName.toLatin1().constData())); + TCollection_AsciiString anAsciiStr( theOpName.toStdString().c_str() ); + TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr ); } QString HYDROData_Image::OperatorName() const { - Handle(TDataStd_Name) aName; - if (myLab.FindChild(DataTag_Operator). - FindAttribute(TDataStd_Name::GetID(), aName)) { - TCollection_AsciiString aStr(aName->Get()); - return QString(aStr.ToCString()); + QString aRes; + + TDF_Label aLabel = myLab.FindChild( DataTag_Operator, false ); + if ( !aLabel.IsNull() ) + { + Handle(TDataStd_AsciiString) anAsciiStr; + if ( aLabel.FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) ) + aRes = QString( anAsciiStr->Get().ToCString() ); } - return QString(); + + return aRes; } void HYDROData_Image::SetArgs(const QByteArray& theArgs)