mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
#14404 Guard against whitespace in AppEnum serialization text and fix affected enums
This commit is contained in:
1 parent
c91e5fa9a7
commit
4c39ce3e6c
8 files changed
+42
-20
No files matched your search
@@ -33,7 +33,9 @@ namespace caf
|
||||
template <>
|
||||
void RimEquilibriumAxisAnnotation::ExportKeywordEnum::setUp()
|
||||
{
|
||||
addItem( RimEquilibriumAxisAnnotation::PlotAxisAnnotationType::PL_USER_DEFINED, "User Defined", "User Defined" );
|
||||
// The alias is the serialization text used by previous versions, as read back from XML, and maps
|
||||
// old project files to the correct enum value
|
||||
addItem( RimEquilibriumAxisAnnotation::PlotAxisAnnotationType::PL_USER_DEFINED, "USER_DEFINED", "User Defined", { "User" } );
|
||||
addItem( RimEquilibriumAxisAnnotation::PlotAxisAnnotationType::PL_EQUIL_WATER_OIL_CONTACT,
|
||||
"PL_EQUIL_WATER_OIL_CONTACT",
|
||||
"PL_EQUIL_WATER_OIL_CONTACT" );
|
||||
|
||||
@@ -25,11 +25,15 @@ namespace caf
|
||||
template <>
|
||||
void caf::AppEnum<RimContourMapResolutionTools::SamplingResolution>::setUp()
|
||||
{
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_FINE, "Extra Fine", "Extra Fine" );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::FINE, "Fine", "Fine" );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::NORMAL, "Normal", "Normal" );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::COARSE, "Coarse", "Coarse" );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_COARSE, "Extra Coarse", "Extra Coarse" );
|
||||
// The alias is the serialization text used by previous versions, as read back from XML, and maps
|
||||
// old project files to the correct enum value. EXTRA_FINE and EXTRA_COARSE have no alias, as their
|
||||
// legacy texts contained whitespace and were never read back correctly from XML
|
||||
// https://github.com/OPM/ResInsight/issues/14404
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_FINE, "EXTRA_FINE", "Extra Fine" );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::FINE, "FINE", "Fine", { "Fine" } );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::NORMAL, "NORMAL", "Normal", { "Normal" } );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::COARSE, "COARSE", "Coarse", { "Coarse" } );
|
||||
addItem( RimContourMapResolutionTools::SamplingResolution::EXTRA_COARSE, "EXTRA_COARSE", "Extra Coarse" );
|
||||
setDefault( RimContourMapResolutionTools::SamplingResolution::NORMAL );
|
||||
}
|
||||
}; // namespace caf
|
||||
|
||||
@@ -246,7 +246,7 @@ QString RimGridTimeHistoryCurve::quantityName() const
|
||||
{
|
||||
if ( geoMechTopItem->m_elementFace >= 0 )
|
||||
{
|
||||
text.append( ", " + caf::AppEnum<cvf::StructGridInterface::FaceType>::textFromIndex( geoMechTopItem->m_elementFace ) );
|
||||
text.append( ", " + caf::AppEnum<cvf::StructGridInterface::FaceType>::uiTextFromIndex( geoMechTopItem->m_elementFace ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user