diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-07 18:04:12 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-08 14:23:05 -0400 |
commit | 63114e6d863de32e2d93f0da54caca928916d9c2 (patch) | |
tree | 5325f9c76cbee3f144ad89079d9071bbead176e3 /editeng/source/uno | |
parent | aac15b638410f181133dc15343136b4e9a1675ba (diff) |
Create SvxFieldData instance directly from the UNO textfield object.
Change-Id: Ifa8210ffdf29624689f547b436fd687a2de82eb1
Diffstat (limited to 'editeng/source/uno')
-rw-r--r-- | editeng/source/uno/unofield.cxx | 5 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 9 |
2 files changed, 6 insertions, 8 deletions
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 50c578f567ee..5333ac313596 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -90,7 +90,7 @@ const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId ) { MAP_CHAR_LEN("DateTime"), WID_DATE, &::getCppuType((const util::DateTime*)0), 0, 0 }, { MAP_CHAR_LEN("IsFixed"), WID_BOOL1, &::getBooleanCppuType(), 0, 0 }, { MAP_CHAR_LEN("IsDate"), WID_BOOL2, &::getBooleanCppuType(), 0, 0 }, - { MAP_CHAR_LEN("NumberFormat"), WID_INT32, &::getCppuType((const sal_Int16*)0), 0, 0 }, + { MAP_CHAR_LEN("NumberFormat"), WID_INT32, &::getCppuType((const sal_Int32*)0), 0, 0 }, {0,0,0,0,0,0} }; static SfxItemPropertySet aExDateTimeFieldPropertySet_Impl(aExDateTimeFieldPropertyMap_Impl); @@ -849,6 +849,9 @@ uno::Any SAL_CALL SvxUnoTextField::getPropertyValue( const OUString& PropertyNam if (PropertyName == UNO_TC_PROP_ANCHOR) return uno::makeAny(mxAnchor); + if (PropertyName == UNO_TC_PROP_TEXTFIELD_TYPE) + return uno::makeAny(mnServiceId); + uno::Any aValue; const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMap().getByName( PropertyName ); diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 52d31bb56aae..56a26357cbf7 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1799,11 +1799,6 @@ void SAL_CALL SvxUnoTextBase::insertTextContent( const uno::Reference< text::XTe if (!pForwarder) return; - SvxUnoTextField* pField = SvxUnoTextField::getImplementation( xContent ); - - if (pField == NULL) - throw lang::IllegalArgumentException(); - uno::Reference<beans::XPropertySet> xPropSet(xRange, uno::UNO_QUERY); if (!xPropSet.is()) throw lang::IllegalArgumentException(); @@ -1813,8 +1808,8 @@ void SAL_CALL SvxUnoTextBase::insertTextContent( const uno::Reference< text::XTe if (!bAbsorb) aSel.Start = aSel.End; - SvxFieldData* pFieldData = pField->CreateFieldData(); - if( pFieldData == NULL ) + SvxFieldData* pFieldData = SvxFieldData::Create(xContent); + if (!pFieldData) throw lang::IllegalArgumentException(); SvxFieldItem aField( *pFieldData, EE_FEATURE_FIELD ); |