diff options
author | Noel Power <noel.power@novell.com> | 2011-02-21 12:10:36 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-02-21 12:41:46 +0000 |
commit | 3e7e5f2f56758427048eb576ea4ae3622dd35531 (patch) | |
tree | 574f1512bd0cd2750207e7e0a9ea672694fb3e99 /sw/source/core/unocore/unobkm.cxx | |
parent | f2425c4bb0732e6e5ea8f081d677314f03575aeb (diff) |
make docx import cater for enhanced fields
introduced some new services for enhanced fields ( checkbox & dropdown ) that wrap existing implementations.
Diffstat (limited to 'sw/source/core/unocore/unobkm.cxx')
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index e4d85ec72b1f..301402dd909a 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -617,6 +617,7 @@ IFieldmark::parameter_map_t* SwXFieldmarkParameters::getCoreParameters() void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTextRange ) throw(lang::IllegalArgumentException, uno::RuntimeException) { + attachToRangeEx( xTextRange, ( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) ); } @@ -677,4 +678,27 @@ SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark & rMark) return xMark; } +void SAL_CALL +SwXODFCheckboxField::setPropertyValue(const OUString& PropertyName, + const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) +{ + if ( PropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Checked") ) ) ) + { + const ::sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()); + sal_Bool bChecked( sal_False ); + if ( pCheckboxFm && ( rValue >>= bChecked ) ) + { + // evil #TODO #FIXME + ((::sw::mark::ICheckboxFieldmark*)(pCheckboxFm))->SetChecked( bChecked ); + } + else + throw uno::RuntimeException(); + } + else + throw lang::IllegalArgumentException(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |