summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorRadu Ioan <ioan.radu.g@gmail.com>2015-04-04 19:03:35 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-01 22:01:53 +0000
commit480ca7434a330b2678f9ef287cffd6d9cf27bed5 (patch)
tree9b3bdb2b00734a63c43354e62d5880d88ea9d086 /unotools
parent861a86dfca00bc42b57d70621605d5831e6305a5 (diff)
tdf#89790 - DOCX: saving LO version number in correct tag in app.xml
Converted existing method that provides application name and version in two functions Change-Id: I93b70da7c78ee5db3d6eb710a2a2a9f4b7b4fb86 Reviewed-on: https://gerrit.libreoffice.org/15151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/docinfohelper.cxx50
1 files changed, 33 insertions, 17 deletions
diff --git a/unotools/source/config/docinfohelper.cxx b/unotools/source/config/docinfohelper.cxx
index b5d0cf9aa7b4..0ea143cf89ec 100644
--- a/unotools/source/config/docinfohelper.cxx
+++ b/unotools/source/config/docinfohelper.cxx
@@ -41,30 +41,45 @@ OUString DocInfoHelper::GetGeneratorString()
{
aResult.append( aValue.replace( ' ', '_' ) );
aResult.append( '/' );
+ }
+
+ aValue = GetVersionString();
+ if ( !aValue.isEmpty() )
+ {
+ aResult.append( aValue );
+ }
+
+ return aResult.makeStringAndClear();
+}
+
+
+OUString DocInfoHelper::GetVersionString()
+{
+ OUStringBuffer aResult;
- aValue = utl::ConfigManager::getProductVersion();
+ // version is <product_versions>_<product_extension>$<platform>
+ OUString aValue( utl::ConfigManager::getProductVersion() );
+ if ( !aValue.isEmpty() )
+ {
+ aResult.append( aValue.replace( ' ', '_' ) );
+
+ aValue = utl::ConfigManager::getProductExtension();
if ( !aValue.isEmpty() )
{
aResult.append( aValue.replace( ' ', '_' ) );
-
- aValue = utl::ConfigManager::getProductExtension();
- if ( !aValue.isEmpty() )
- {
- aResult.append( aValue.replace( ' ', '_' ) );
- }
}
-
- OUString os( "$_OS" );
- OUString arch( "$_ARCH" );
- ::rtl::Bootstrap::expandMacros(os);
- ::rtl::Bootstrap::expandMacros(arch);
- aResult.append( '$' );
- aResult.append( os );
- aResult.append( '_' );
- aResult.append( arch );
- aResult.append( ' ' );
}
+ OUString os( "$_OS" );
+ OUString arch( "$_ARCH" );
+ ::rtl::Bootstrap::expandMacros(os);
+ ::rtl::Bootstrap::expandMacros(arch);
+ aResult.append( '$' );
+ aResult.append( os );
+ aResult.append( '_' );
+ aResult.append( arch );
+ aResult.append( ' ' );
+
// second product: LibreOffice_project/<build_information>
// build_information has '(' and '[' encoded as '$', ')' and ']' ignored
// and ':' replaced by '-'
@@ -97,6 +112,7 @@ OUString DocInfoHelper::GetGeneratorString()
return aResult.makeStringAndClear();
}
+
} // end of namespace utl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */