diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/xoutdev/xtabdash.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabgrdt.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabhtch.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtable.cxx | 48 | ||||
-rw-r--r-- | svx/source/xoutdev/xtablend.cxx | 2 |
5 files changed, 50 insertions, 6 deletions
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index a8e9c6b2bc3e..1c5109d84202 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -139,7 +139,7 @@ void XDashList::impDestroy() XDashList::XDashList( const String& rPath, XOutdevItemPool* pInPool) : - XPropertyList( XDASH_LIST, "sod", rPath, pInPool ), + XPropertyList( XDASH_LIST, rPath, pInPool ), mpData(0) { pBmpList = new BitmapList_impl(); diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 41f1e2891c8c..01365bdf922b 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -122,7 +122,7 @@ void XGradientList::impDestroy() } XGradientList::XGradientList( const String& rPath, XOutdevItemPool* pInPool ) : - XPropertyList( XGRADIENT_LIST, "sog", rPath, pInPool ), + XPropertyList( XGRADIENT_LIST, rPath, pInPool ), mpData( NULL ) { pBmpList = new BitmapList_impl(); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 060f4059215e..0f88610e975e 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -132,7 +132,7 @@ void XHatchList::impDestroy() XHatchList::XHatchList( const String& rPath, XOutdevItemPool* pInPool ) - : XPropertyList( XHATCH_LIST, "soh", rPath, pInPool ), + : XPropertyList( XHATCH_LIST, rPath, pInPool ), mpData( NULL ) { pBmpList = new BitmapList_impl(); diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 100dbe439c0b..7dafb736ba81 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -50,14 +50,12 @@ Color RGB_Color( ColorData nColorName ) XPropertyList::XPropertyList( XPropertyListType type, - const char *pDefaultExtension, const String& rPath, XOutdevItemPool* pInPool ) : eType ( type ), aName ( RTL_CONSTASCII_USTRINGPARAM( "standard" ) ), aPath ( rPath ), pXPool ( pInPool ), - pDefaultExt ( pDefaultExtension ), pBmpList ( NULL ), bListDirty ( true ), bBitmapsDirty ( true ), @@ -318,6 +316,24 @@ XPropertyListRef XPropertyList::CreatePropertyList( XPropertyListType t, return pRet; } +XPropertyListRef +XPropertyList::CreatePropertyListFromURL( XPropertyListType t, + const rtl::OUString & rURLStr, + XOutdevItemPool* pXPool ) +{ + INetURLObject aURL( rURLStr ); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); + aPathURL.removeFinalSlash(); + + XPropertyListRef pList = XPropertyList::CreatePropertyList( + t, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); + pList->SetName( aURL.getName() ); + + return pList; +} + // catch people being silly with ref counting ... void* XPropertyList::operator new (size_t nCount) @@ -330,4 +346,32 @@ void XPropertyList::operator delete(void *pPtr) return rtl_freeMemory( pPtr ); } +static struct { + XPropertyListType t; + const char *pExt; +} pExtnMap[] = { + { XCOLOR_LIST, "soc" }, + { XLINE_END_LIST, "soe" }, + { XDASH_LIST, "sod" }, + { XHATCH_LIST, "soh" }, + { XGRADIENT_LIST, "sog" }, + { XBITMAP_LIST, "sob" } +}; + +rtl::OUString XPropertyList::GetDefaultExt( XPropertyListType t ) +{ + for (size_t i = 0; i < SAL_N_ELEMENTS (pExtnMap); i++) + { + if( pExtnMap[i].t == t ) + return rtl::OUString::createFromAscii( pExtnMap[ i ].pExt ); + } + return rtl::OUString(); +} + +rtl::OUString XPropertyList::GetDefaultExtFilter( XPropertyListType t ) +{ + rtl::OUString aFilter( RTL_CONSTASCII_USTRINGPARAM( "*." ) ); + return aFilter + GetDefaultExt( t ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx index 312a1c1cc77d..7f2e9adcafca 100644 --- a/svx/source/xoutdev/xtablend.cxx +++ b/svx/source/xoutdev/xtablend.cxx @@ -143,7 +143,7 @@ void XLineEndList::impDestroy() } XLineEndList::XLineEndList( const String& rPath, XOutdevItemPool* _pXPool ) - : XPropertyList( XLINE_END_LIST, "soe", rPath, _pXPool ), + : XPropertyList( XLINE_END_LIST, rPath, _pXPool ), mpData(NULL) { pBmpList = new BitmapList_impl(); |