summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-09-05 13:55:08 +0000
committerOliver Bolte <obo@openoffice.org>2005-09-05 13:55:08 +0000
commit7c1f088b1fbad11c646c3f443629b79e0d9c8043 (patch)
tree5b13fab7f93eacdacb59358ef58dcc971c7d30fe /xmloff
parent2aace7d69e7e0eb4264bbcd59b12891a7c6e8bd5 (diff)
INTEGRATION: CWS impress67 (1.14.200); FILE MERGED
2005/08/29 07:24:23 cl 1.14.200.1: #i42959# added getBuildIds()
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/meta/xmlmetai.cxx46
1 files changed, 44 insertions, 2 deletions
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index b5c0b9bf069a..56a5d503c1c5 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlmetai.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: rt $ $Date: 2004-11-26 13:02:27 $
+ * last change: $Author: obo $ $Date: 2005-09-05 14:55:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,12 @@
#include "xmluconv.hxx"
#endif
+using ::rtl::OUString;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::beans::XPropertySetInfo;
+
using namespace com::sun::star;
using namespace ::xmloff::token;
@@ -164,6 +170,7 @@ enum SfxXMLMetaElemTokens
XML_TOK_META_EDITINGDURATION,
XML_TOK_META_USERDEFINED,
XML_TOK_META_DOCUMENT_STATISTIC,
+ XML_TOK_META_GENERATOR,
XML_TOK_META_ELEM_END = XML_TOK_UNKNOWN
};
@@ -187,6 +194,7 @@ static __FAR_DATA SvXMLTokenMapEntry aMetaElemTokenMap[] =
{ XML_NAMESPACE_META, XML_EDITING_DURATION, XML_TOK_META_EDITINGDURATION },
{ XML_NAMESPACE_META, XML_USER_DEFINED, XML_TOK_META_USERDEFINED },
{ XML_NAMESPACE_META, XML_DOCUMENT_STATISTIC,XML_TOK_META_DOCUMENT_STATISTIC },
+ { XML_NAMESPACE_META, XML_GENERATOR, XML_TOK_META_GENERATOR },
XML_TOKEN_MAP_END
};
@@ -633,6 +641,40 @@ void SfxXMLMetaElementContext::EndElement()
break;
case XML_TOK_META_DOCUMENT_STATISTIC:
break;
+ case XML_TOK_META_GENERATOR:
+ {
+ // 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;
+
+ // cut off build id
+ sal_Int32 nEnd = sContent.indexOf( '$', nBegin );
+ if( nEnd == -1 )
+ break;
+
+ OUString sBuild( sContent.copy( nBegin+1, nEnd-nBegin-1 ) );
+ try
+ {
+ Reference< XPropertySet > xSet( GetImport().getImportInfo() );
+ if( xSet.is() )
+ {
+ const OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("BuildId"));
+ Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
+ if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
+ xSet->setPropertyValue( aPropName, uno::makeAny( sBuild ) );
+ }
+ }
+ catch( Exception& e )
+ {
+ }
+ }
+ break;
default:
DBG_ERROR("wrong element");
}