summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-28 13:00:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-28 13:00:51 +0100
commita8f702693090d15c1f8d71ae78b68698d64a427d (patch)
tree50bcf87955da81efc655b6cd8f3b057ff8d37104 /cui
parentec9c985bfdb84d6c4feeae0ab21e0214d79d8d7a (diff)
break build id into multiple lines if using g log
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/about.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 455690497..3241a47c6 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -72,13 +72,34 @@ Image SfxApplication::GetApplicationLogo()
return Image( aBitmap );
}
-/* intense magic to get strong version information */
+/* get good version information */
static String
GetBuildId()
{
rtl::OUString sDefault;
- String sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) );
- OSL_ENSURE( sBuildId.Len() > 0, "No BUILDID in bootstrap file" );
+ rtl::OUString sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) );
+ //strip trailing - from ./g log
+ if (!sBuildId.isEmpty() && sBuildId.getStr()[sBuildId.getLength()-1] == '-')
+ {
+ rtl::OUStringBuffer aBuffer;
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OUString aToken = sBuildId.getToken( 0, '-', nIndex );
+ if (!aToken.isEmpty())
+ {
+ aBuffer.append(aToken);
+ if (nIndex % 5)
+ aBuffer.append(static_cast<sal_Unicode>('-'));
+ else
+ aBuffer.append(static_cast<sal_Unicode>('\n'));
+ }
+ }
+ while ( nIndex >= 0 );
+ sBuildId = aBuffer.makeStringAndClear();
+ }
+
+ OSL_ENSURE( sBuildId.getLength() > 0, "No BUILDID in bootstrap file" );
return sBuildId;
}