Kaydet (Commit) 65d6f61c authored tarafından Kurt Zenker's avatar Kurt Zenker

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
üst b5b42d41
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: xmlmetai.cxx,v $ * $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 Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -622,32 +622,42 @@ void SfxXMLMetaElementContext::EndElement() ...@@ -622,32 +622,42 @@ void SfxXMLMetaElementContext::EndElement()
break; break;
case XML_TOK_META_GENERATOR: case XML_TOK_META_GENERATOR:
{ {
OUString sBuildId;
// skip to second product // skip to second product
sal_Int32 nBegin = sContent.indexOf( ' ' ); sal_Int32 nBegin = sContent.indexOf( ' ' );
if( nBegin == -1 ) if( nBegin != -1 )
break; {
// skip to build information
// skip to build information nBegin = sContent.indexOf( '/', nBegin );
nBegin = sContent.indexOf( '/', nBegin ); if( nBegin != -1 )
if( nBegin == -1 ) {
break; sal_Int32 nEnd = sContent.indexOf( 'm', nBegin );
if( nEnd != -1 )
sal_Int32 nEnd = sContent.indexOf( 'm', nBegin ); {
if( nEnd == -1 ) OUStringBuffer sBuffer( sContent.copy( nBegin+1, nEnd-nBegin-1 ) );
break; const OUString sBuildCompare( RTL_CONSTASCII_USTRINGPARAM( "$Build-" ) );
nBegin = sContent.indexOf( sBuildCompare, nEnd );
OUStringBuffer sBuffer( sContent.copy( nBegin+1, nEnd-nBegin-1 ) ); if( nBegin != -1 )
{
const OUString sBuildCompare( RTL_CONSTASCII_USTRINGPARAM( "$Build-" ) ); sBuffer.append( (sal_Unicode)'$' );
sBuffer.append( sContent.copy( nBegin+sBuildCompare.getLength() ) );
nBegin = sContent.indexOf( sBuildCompare, nEnd ); sBuildId = sBuffer.makeStringAndClear();
if( nBegin == -1 ) }
break; }
}
}
sBuffer.append( (sal_Unicode)'$' ); if( sBuildId.getLength() == 0 )
sBuffer.append( sContent.copy( nBegin+sBuildCompare.getLength() ) ); {
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() ); Reference< XPropertySet > xSet( GetImport().getImportInfo() );
if( xSet.is() ) if( xSet.is() )
...@@ -655,7 +665,7 @@ void SfxXMLMetaElementContext::EndElement() ...@@ -655,7 +665,7 @@ void SfxXMLMetaElementContext::EndElement()
const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId")); const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() ); Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) ) if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
xSet->setPropertyValue( aPropName, uno::makeAny( sBuffer.makeStringAndClear() ) ); xSet->setPropertyValue( aPropName, uno::makeAny( sBuildId ) );
} }
} }
catch( Exception& e ) catch( Exception& e )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment