From 35041d679089939f562b5796d98d6d1997de5727 Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 28 Feb 2006 07:18:09 +0000 Subject: [PATCH] no message --- src/QDS/QDS_Datum.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index 14dce09f8..419ce1d88 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -941,15 +941,26 @@ void QDS_Datum::initialize() void QDS_Datum::unitSystemChanged( const QString& unitSystem ) { - QString labText = label(); - QString unitText = unitsToText( units() ); + QString labText = label().stripWhiteSpace(); + QString unitText = unitsToText( units() ).stripWhiteSpace(); if ( flags() & UnitsWithLabel ) { if ( labText.isEmpty() ) labText = unitText; else if ( !unitText.isEmpty() ) - labText = QString( "%1 (%2)" ).arg( labText ).arg( unitText ); + { + int pos = labText.length() - 1; + while ( pos >= 0 && labText.at( pos ) == ':' ) + pos--; + + pos++; + + QString first = labText.mid( 0, pos ).stripWhiteSpace(); + QString second = labText.mid( pos ).stripWhiteSpace(); + + labText = QString( "%1 (%2)%3" ).arg( first ).arg( unitText ).arg( second ).stripWhiteSpace(); + } unitText = QString::null; } -- 2.39.2