diff options
Diffstat (limited to 'sfx2/source/doc/objuno.cxx')
-rw-r--r-- | sfx2/source/doc/objuno.cxx | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx index ac45ef594d..aae9062e78 100644 --- a/sfx2/source/doc/objuno.cxx +++ b/sfx2/source/doc/objuno.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,6 +45,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XCompatWriterDocProperties.hpp> #include <unotools/configmgr.hxx> #include <tools/inetdef.hxx> @@ -96,7 +97,7 @@ using namespace ::com::sun::star; #define PROPERTY_UNBOUND 0 #define PROPERTY_MAYBEVOID ::com::sun::star::beans::PropertyAttribute::MAYBEVOID -const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() +const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() { static SfxItemPropertyMapEntry aDocInfoPropertyMap_Impl[] = { @@ -104,6 +105,9 @@ const SfxItemPropertyMapEntry* lcl_GetDocInfoPropertyMap() { "AutoloadEnabled" , 15, MID_DOCINFO_AUTOLOADENABLED, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, { "AutoloadSecs" , 12, MID_DOCINFO_AUTOLOADSECS, &::getCppuType((const sal_Int32*)0), PROPERTY_UNBOUND, 0 }, { "AutoloadURL" , 11, MID_DOCINFO_AUTOLOADURL, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Category" , 8 , MID_CATEGORY, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Company" , 7 , MID_COMPANY, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, + { "Manager" , 7 , MID_MANAGER, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, { "CreationDate" , 12, WID_DATE_CREATED, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_MAYBEVOID, 0 }, { "DefaultTarget" , 13, MID_DOCINFO_DEFAULTTARGET, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, { "Description" , 11, MID_DOCINFO_DESCRIPTION, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, @@ -262,7 +266,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() ::comphelper::SequenceAsVector< ::com::sun::star::beans::Property > lProps; // copy "fix" props - //todo: os: this ugly thing should be replaced + //todo: os: this ugly thing should be replaced const SfxItemPropertyMapEntry* pFixProp = lcl_GetDocInfoPropertyMap(); while(pFixProp && pFixProp->pName) @@ -303,7 +307,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() //----------------------------------------------------------------------------- -::com::sun::star::beans::Property SAL_CALL MixedPropertySetInfo::getPropertyByName( +::com::sun::star::beans::Property SAL_CALL MixedPropertySetInfo::getPropertyByName( const ::rtl::OUString& sName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException ) @@ -324,7 +328,7 @@ MixedPropertySetInfo::~MixedPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) { return _aPropertyMap.hasPropertyByName( sName ) ? // "fix" prop? - sal_True : + sal_True : _xUDProps->getPropertySetInfo()->hasPropertyByName(sName); // "dynamic" prop? } @@ -807,6 +811,22 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co _pImp->m_xDocProps->setDefaultTarget(sTemp); break; // case WID_CONTENT_TYPE : // this is readonly! + case MID_CATEGORY: + case MID_MANAGER: + case MID_COMPANY: + { + uno::Reference< document::XCompatWriterDocProperties > xWriterProps( _pImp->m_xDocProps, uno::UNO_QUERY ); + if ( xWriterProps.is() ) + { + if ( nHandle == MID_CATEGORY ) + xWriterProps->setCategory( sTemp ); + else if ( nHandle == MID_MANAGER ) + xWriterProps->setManager( sTemp ); + else + xWriterProps->setCompany( sTemp ); + break; + } + } default: break; } @@ -1024,6 +1044,23 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co case MID_DOCINFO_CHARLOCALE: aValue <<= _pImp->m_xDocProps->getLanguage(); break; + case MID_CATEGORY: + case MID_MANAGER: + case MID_COMPANY: + { + uno::Reference< document::XCompatWriterDocProperties > xWriterProps( _pImp->m_xDocProps, uno::UNO_QUERY ); + if ( xWriterProps.is() ) + { + if ( nHandle == MID_CATEGORY ) + aValue <<= xWriterProps->getCategory(); + else if ( nHandle == MID_MANAGER ) + aValue <<= xWriterProps->getManager(); + else + aValue <<= xWriterProps->getCompany(); + break; + } + } + default: aValue <<= ::rtl::OUString(); break; |