summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-04-26 19:44:07 +0000
committerKurt Zenker <kz@openoffice.org>2006-04-26 19:44:07 +0000
commit65d6f61c78ac10271ce8a22d9d0867d727ff9efe (patch)
tree0f75cdaee85ebb5fd50ab568a8e016f4a03b7d11 /xmloff
parentb5b42d41b64571e43b821971e6d0381ae9d3f7f6 (diff)
INTEGRATION: CWS impress91 (1.17.82); FILE MERGED
2006/04/04 11:01:30 cl 1.17.82.1: #i62742# detect OOo 1.x and StarOffice 7 for build id
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/meta/xmlmetai.cxx60
1 files changed, 35 insertions, 25 deletions
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index acca46bbc08a..31eb7e055ab3 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: xmlmetai.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: vg $ $Date: 2006-04-07 14:54:46 $
+ * last change: $Author: kz $ $Date: 2006-04-26 20:44:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -622,32 +622,42 @@ void SfxXMLMetaElementContext::EndElement()
break;
case XML_TOK_META_GENERATOR:
{
+ OUString sBuildId;
// skip to second product
sal_Int32 nBegin = sContent.indexOf( ' ' );
- if( nBegin == -1 )
- break;
-
- // skip to build information
- nBegin = sContent.indexOf( '/', nBegin );
- if( nBegin == -1 )
- break;
-
- sal_Int32 nEnd = sContent.indexOf( 'm', nBegin );
- if( nEnd == -1 )
- break;
-
- OUStringBuffer sBuffer( sContent.copy( nBegin+1, nEnd-nBegin-1 ) );
-
- const OUString sBuildCompare( RTL_CONSTASCII_USTRINGPARAM( "$Build-" ) );
-
- nBegin = sContent.indexOf( sBuildCompare, nEnd );
- if( nBegin == -1 )
- break;
+ if( nBegin != -1 )
+ {
+ // skip to build information
+ nBegin = sContent.indexOf( '/', nBegin );
+ if( nBegin != -1 )
+ {
+ sal_Int32 nEnd = sContent.indexOf( 'm', nBegin );
+ if( nEnd != -1 )
+ {
+ OUStringBuffer sBuffer( sContent.copy( nBegin+1, nEnd-nBegin-1 ) );
+ const OUString sBuildCompare( RTL_CONSTASCII_USTRINGPARAM( "$Build-" ) );
+ nBegin = sContent.indexOf( sBuildCompare, nEnd );
+ if( nBegin != -1 )
+ {
+ sBuffer.append( (sal_Unicode)'$' );
+ sBuffer.append( sContent.copy( nBegin+sBuildCompare.getLength() ) );
+ sBuildId = sBuffer.makeStringAndClear();
+ }
+ }
+ }
+ }
- sBuffer.append( (sal_Unicode)'$' );
- sBuffer.append( sContent.copy( nBegin+sBuildCompare.getLength() ) );
+ if( sBuildId.getLength() == 0 )
+ {
+ if( (sContent.compareToAscii( RTL_CONSTASCII_STRINGPARAM("StarOffice 7") ) == 0) ||
+ (sContent.compareToAscii( RTL_CONSTASCII_STRINGPARAM("StarSuite 7") ) == 0) ||
+ (sContent.compareToAscii( RTL_CONSTASCII_STRINGPARAM("OpenOffice.org 1") ) == 0) )
+ {
+ sBuildId = OUString::createFromAscii( "645$8687" );
+ }
+ }
- try
+ if( sBuildId.getLength() ) try
{
Reference< XPropertySet > xSet( GetImport().getImportInfo() );
if( xSet.is() )
@@ -655,7 +665,7 @@ void SfxXMLMetaElementContext::EndElement()
const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
- xSet->setPropertyValue( aPropName, uno::makeAny( sBuffer.makeStringAndClear() ) );
+ xSet->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
}
}
catch( Exception& e )