diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-09-05 17:22:24 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-09-11 09:26:59 +0200 |
commit | cbcfda9b2079ea4ef83b2a42828408b5f70f7692 (patch) | |
tree | fabe2bd09b1aff1edc079e8216c6714d68c0e65b /sd | |
parent | 64bc62f77a0783b40583c4f6e7a4e1a935e1695a (diff) |
add XPropertyList enum, factory, and associated cleanup
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/UnoDocumentSettings.cxx | 343 |
1 files changed, 131 insertions, 212 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index b09c4c4e74d5..24c9332e3756 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -30,6 +30,7 @@ #include "precompiled_sd.hxx" #include <vector> +#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> @@ -98,7 +99,6 @@ namespace sd virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XMultiPropertySet - // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); @@ -115,6 +115,8 @@ namespace sd virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); private: + void AssignURL( XPropertyListType t, const Any* pValue, bool *pOk, bool *pChanged ); + void ExtractURL( XPropertyListType t, Any* pValue ); Reference< XModel > mxModel; SdXImpressDocument* mpModel; }; @@ -221,6 +223,62 @@ DocumentSettings::~DocumentSettings() throw() { } +static bool SetPropertyList( SdDrawDocument *pDoc, XPropertyListType t, XPropertyList *pList ) +{ + switch (t) { + case XCOLOR_LIST: pDoc->SetColorTable( static_cast<XColorList *>(pList) ); break; + case XDASH_LIST: pDoc->SetDashList( static_cast<XDashList *>(pList) ); break; + case XLINE_END_LIST: pDoc->SetLineEndList( static_cast<XLineEndList *>(pList) ); break; + case XHATCH_LIST: pDoc->SetHatchList( static_cast<XHatchList *>(pList) ); break; + case XGRADIENT_LIST: pDoc->SetGradientList( static_cast<XGradientList *>(pList) ); break; + case XBITMAP_LIST: pDoc->SetBitmapList( static_cast<XBitmapList *>(pList) ); break; + default: + return false; + } + return true; +} + +static XPropertyList *GetPropertyList( SdDrawDocument *pDoc, XPropertyListType t) +{ + switch (t) { + case XCOLOR_LIST: return pDoc->GetColorTable(); + case XDASH_LIST: return pDoc->GetDashList(); + case XLINE_END_LIST: return pDoc->GetLineEndList(); + case XHATCH_LIST: return pDoc->GetHatchList(); + case XGRADIENT_LIST: return pDoc->GetGradientList(); + case XBITMAP_LIST: return pDoc->GetBitmapList(); + default: + return NULL; + } +} + +void DocumentSettings::AssignURL( XPropertyListType t, const Any* pValue, bool *pOk, bool *pChanged ) +{ + OUString aURL; + if( !(bool)( *pValue >>= aURL ) ) + return; + + SdDrawDocument* pDoc = mpModel->GetDoc(); + + sal_Int32 nSlash = aURL.lastIndexOf('/'); + rtl::OUString aPath, aName; + if (nSlash < -1) + aName = aURL; + else { + aName = aURL.copy( nSlash + 1 ); + aPath = aURL.copy( 0, nSlash ); + } + + XPropertyList *pList = XPropertyList::CreatePropertyList( + t, aPath, (XOutdevItemPool*)&pDoc->GetPool() ); + pList->SetName( aName ); + + if( pList->Load() ) + *pOk = *pChanged = SetPropertyList( pDoc, t, pList ); + else + delete pList; +} + void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, const Any* pValues ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { ::SolarMutexGuard aGuard; @@ -230,7 +288,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( NULL == pDoc || NULL == pDocSh ) throw UnknownPropertyException(); - sal_Bool bOk, bChanged = sal_False, bValue = sal_False, bOptionsChanged = false; + sal_Bool bValue = sal_False; + bool bOk, bChanged = false, bOptionsChanged = false; SdOptionsPrintItem aOptionsPrintItem( ATTR_OPTIONS_PRINT ); @@ -249,147 +308,38 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c for( ; *ppEntries; ppEntries++, pValues++ ) { - bOk = sal_False; + bOk = false; switch( (*ppEntries)->mnHandle ) { case HANDLE_COLORTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - XColorList* pColTab = new XColorList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pColTab->SetName( aURL.getName() ); - if( pColTab->Load() ) - { - pDoc->SetColorTable( pColTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + AssignURL( XCOLOR_LIST, pValues, &bOk, &bChanged ); break; - case HANDLE_DASHTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - XDashList* pDashTab = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pDashTab->SetName( aURL.getName() ); - if( pDashTab->Load() ) - { - pDoc->SetDashList( pDashTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + case HANDLE_DASHTABLEURL: + AssignURL( XDASH_LIST, pValues, &bOk, &bChanged ); break; - case HANDLE_LINEENDTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - XLineEndList* pTab = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pTab->SetName( aURL.getName() ); - if( pTab->Load() ) - { - pDoc->SetLineEndList( pTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + case HANDLE_LINEENDTABLEURL: + AssignURL( XLINE_END_LIST, pValues, &bOk, &bChanged ); break; - case HANDLE_HATCHTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - XHatchList* pTab = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pTab->SetName( aURL.getName() ); - if( pTab->Load() ) - { - pDoc->SetHatchList( pTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + case HANDLE_HATCHTABLEURL: + AssignURL( XHATCH_LIST, pValues, &bOk, &bChanged ); break; - case HANDLE_GRADIENTTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - XGradientList* pTab = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pTab->SetName( aURL.getName() ); - if( pTab->Load() ) - { - pDoc->SetGradientList( pTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + case HANDLE_GRADIENTTABLEURL: + AssignURL( XGRADIENT_LIST, pValues, &bOk, &bChanged ); break; - case HANDLE_BITMAPTABLEURL: - { - OUString aURLString; - if( *pValues >>= aURLString ) - { - INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - XBitmapList* pTab = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); - pTab->SetName( aURL.getName() ); - if( pTab->Load() ) - { - pDoc->SetBitmapList( pTab ); - bOk = sal_True; - bChanged = sal_True; - } - } - } + case HANDLE_BITMAPTABLEURL: + AssignURL( XBITMAP_LIST, pValues, &bOk, &bChanged ); break; + case HANDLE_FORBIDDENCHARS: - { - bOk = sal_True; - } + bOk = true; break; + case HANDLE_APPLYUSERDATA: { sal_Bool bApplyUserData = sal_False; @@ -397,7 +347,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { bChanged = ( bApplyUserData != pDocSh->IsUseUserData() ); pDocSh->SetUseUserData( bApplyUserData ); - bOk = sal_True; + bOk = true; } } break; @@ -410,7 +360,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTNOTES: @@ -422,7 +372,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTHANDOUT: @@ -434,7 +384,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTOUTLINE: @@ -445,7 +395,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetOutline( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_SLIDESPERHANDOUT: @@ -458,7 +408,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetHandoutPages( static_cast< sal_uInt16 >( nValue ) ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } } break; @@ -470,7 +420,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetHandoutHorizontal( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; @@ -482,7 +432,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetPagename( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTDATE: @@ -493,7 +443,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetDate( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTTIME: @@ -504,7 +454,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetTime( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTHIDENPAGES: @@ -515,7 +465,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetHiddenPages( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTFITPAGE: @@ -526,7 +476,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetPagesize( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTTILEPAGE: @@ -537,7 +487,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetPagetile( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTBOOKLET: @@ -548,7 +498,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetBooklet( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTBOOKLETFRONT: @@ -559,7 +509,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetFrontPage( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTBOOKLETBACK: @@ -570,7 +520,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetBackPage( bValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } break; case HANDLE_PRINTQUALITY: @@ -583,7 +533,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c aPrintOpts.SetOutputQuality( (sal_uInt16)nValue ); bOptionsChanged = true; } - bOk = sal_True; + bOk = true; } } break; @@ -596,7 +546,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( SvxMeasureUnitToFieldUnit( nValue, nFieldUnit ) ) { pDoc->SetUIUnit((FieldUnit)nFieldUnit ); - bOk = sal_True; + bOk = true; } } } @@ -608,8 +558,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { Fraction aFract( nValue, pDoc->GetUIScale().GetDenominator() ); pDoc->SetUIScale( aFract ); - bOk = sal_True; - bChanged = sal_True; + bOk = true; + bChanged = true; } } break; @@ -620,8 +570,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { Fraction aFract( pDoc->GetUIScale().GetNumerator(), nValue ); pDoc->SetUIScale( aFract ); - bOk = sal_True; - bChanged = sal_True; + bOk = true; + bChanged = true; } } break; @@ -632,8 +582,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( (*pValues >>= nValue) && (nValue >= 0) ) { pDoc->SetDefaultTabulator((sal_uInt16)nValue); - bOk = sal_True; - bChanged = sal_True; + bOk = true; + bChanged = true; } } break; @@ -643,8 +593,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( (*pValues >>= nValue ) && (nValue >= SVX_CHARS_UPPER_LETTER ) && (nValue <= SVX_PAGEDESC) ) { pDoc->SetPageNumType((SvxNumType)nValue); - bOk = sal_True; - bChanged = sal_True; + bOk = true; + bChanged = true; } } break; @@ -653,7 +603,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c OUString aPrinterName; if( *pValues >>= aPrinterName ) { - bOk = sal_True; + bOk = true; if( aPrinterName.getLength() && pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { SfxPrinter *pTempPrinter = pDocSh->GetPrinter( sal_True ); @@ -671,7 +621,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c Sequence < sal_Int8 > aSequence; if ( *pValues >>= aSequence ) { - bOk = sal_True; + bOk = true; sal_uInt32 nSize = aSequence.getLength(); if( nSize ) { @@ -711,8 +661,8 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c sal_Bool bIsSummationOfParagraphs = sal_False; if ( *pValues >>= bIsSummationOfParagraphs ) { - bOk = sal_True; - bChanged = sal_True; + bOk = true; + bChanged = true; if ( pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS ) { sal_uInt32 nSum = bIsSummationOfParagraphs ? EE_CNTRL_ULSPACESUMMATION : 0; @@ -745,7 +695,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c sal_Int16 nCharCompressType = 0; if( *pValues >>= nCharCompressType ) { - bOk = sal_True; + bOk = true; pDoc->SetCharCompressType( (sal_uInt16)nCharCompressType ); SdDrawDocument* pDocument = pDocSh->GetDoc(); @@ -770,7 +720,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c sal_Bool bAsianPunct = sal_False; if( *pValues >>= bAsianPunct ) { - bOk = sal_True; + bOk = true; pDoc->SetKernAsianPunctuation( bAsianPunct ); SdDrawDocument* pDocument = pDocSh->GetDoc(); @@ -797,7 +747,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { bChanged = ( value != pDocSh->IsQueryLoadTemplate() ); pDocSh->SetQueryLoadTemplate( value ); - bOk = sal_True; + bOk = true; } } break; @@ -814,7 +764,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { pDoc->SetPrinterIndependentLayout (nValue); bChanged = (nValue != nOldValue); - bOk = sal_True; + bOk = true; } } break; @@ -827,7 +777,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { bChanged = ( pDocSh->IsLoadReadonly() != bNewValue ); pDocSh->SetLoadReadonly( bNewValue ); - bOk = sal_True; + bOk = true; } } break; @@ -839,7 +789,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c { bChanged = ( pDocSh->IsSaveVersionOnClose() != bNewValue ); pDocSh->SetSaveVersionOnClose( bNewValue ); - bOk = sal_True; + bOk = true; } } break; @@ -865,6 +815,19 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c mpModel->SetModified( sal_True ); } +void DocumentSettings::ExtractURL( XPropertyListType t, Any* pValue ) +{ + XPropertyList *pList = GetPropertyList( mpModel->GetDoc(), t ); + if( !pList ) + return; + + INetURLObject aPathURL( pList->GetPath() ); + aPathURL.insertName( pList->GetName() ); + aPathURL.setExtension( pList->GetDefaultExt() ); + OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); + *pValue <<= aPath; +} + void DocumentSettings::_getPropertyValues( const PropertyMapEntry** ppEntries, Any* pValue ) throw(UnknownPropertyException, WrappedTargetException ) { ::SolarMutexGuard aGuard; @@ -894,73 +857,29 @@ void DocumentSettings::_getPropertyValues( const PropertyMapEntry** ppEntries, A switch( (*ppEntries)->mnHandle ) { case HANDLE_COLORTABLEURL: - { - INetURLObject aPathURL( pDoc->GetColorTable()->GetPath() ); - aPathURL.insertName( pDoc->GetColorTable()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("soc") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XCOLOR_LIST, pValue ); break; case HANDLE_DASHTABLEURL: - { - INetURLObject aPathURL( pDoc->GetDashList()->GetPath() ); - aPathURL.insertName( pDoc->GetDashList()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("sod") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XDASH_LIST, pValue ); break; case HANDLE_LINEENDTABLEURL: - { - INetURLObject aPathURL( pDoc->GetLineEndList()->GetPath() ); - aPathURL.insertName( pDoc->GetLineEndList()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("soe") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XLINE_END_LIST, pValue ); break; case HANDLE_HATCHTABLEURL: - { - INetURLObject aPathURL( pDoc->GetHatchList()->GetPath() ); - aPathURL.insertName( pDoc->GetHatchList()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("soh") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XHATCH_LIST, pValue ); break; case HANDLE_GRADIENTTABLEURL: - { - INetURLObject aPathURL( pDoc->GetGradientList()->GetPath() ); - aPathURL.insertName( pDoc->GetGradientList()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("sog") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XGRADIENT_LIST, pValue ); break; case HANDLE_BITMAPTABLEURL: - { - INetURLObject aPathURL( pDoc->GetBitmapList()->GetPath() ); - aPathURL.insertName( pDoc->GetBitmapList()->GetName() ); - String aExt( RTL_CONSTASCII_USTRINGPARAM("sob") ); - aPathURL.setExtension( aExt ); - OUString aPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - *pValue <<= aPath; - } + ExtractURL( XBITMAP_LIST, pValue ); break; case HANDLE_FORBIDDENCHARS: *pValue <<= mpModel->getForbiddenCharsTable(); break; - case HANDLE_APPLYUSERDATA: *pValue <<= pDocSh->IsUseUserData(); break; - case HANDLE_PRINTDRAWING: *pValue <<= (sal_Bool)aPrintOpts.IsDraw(); break; |