diff options
Diffstat (limited to 'svx/source/gallery2/gallery1.cxx')
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 4751c8107f..14ac81ebe9 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,12 +36,13 @@ #include <tools/vcompat.hxx> #include <ucbhelper/content.hxx> #include <unotools/ucbstreamhelper.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <sfx2/docfile.hxx> #include "gallery.hxx" -#include "galmisc.hxx" +#include "gallery.hrc" +#include "svx/galmisc.hxx" #include "galtheme.hxx" -#include "gallery1.hxx" +#include "svx/gallery1.hxx" #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/ucb/XContentAccess.hpp> @@ -245,10 +246,10 @@ void Gallery::ImplLoad( const String& rMultiPath ) sal_Bool bIsReadOnlyDir; bMultiPath = ( nTokenCount > 0 ); - + INetURLObject aCurURL(SvtPathOptions().GetConfigPath()); ImplLoadSubDirs( aCurURL, bIsReadOnlyDir ); - + if( !bIsReadOnlyDir ) aUserURL = aCurURL; @@ -259,9 +260,9 @@ void Gallery::ImplLoad( const String& rMultiPath ) for( USHORT i = 0UL; i < nTokenCount; i++ ) { aCurURL = INetURLObject(rMultiPath.GetToken( i, ';' )); - + ImplLoadSubDirs( aCurURL, bIsReadOnlyDir ); - + if( !bIsReadOnlyDir ) aUserURL = aCurURL; } @@ -290,7 +291,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR aProps.getArray()[ 0 ] = OUString::createFromAscii( "Url" ); uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); - + try { // check readonlyness the very hard way @@ -299,14 +300,14 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR aTestURL.Append( aTestFile ); SvStream* pTestStm = ::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE ); - + if( pTestStm ) { *pTestStm << 1; - + if( pTestStm->GetError() ) rbDirIsReadOnly = sal_True; - + delete pTestStm; KillFile( aTestURL ); } @@ -332,7 +333,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR while( xResultSet->next() ) { INetURLObject aThmURL( xContentAccess->queryContentIdentifierString() ); - + if(aThmURL.GetExtension().equalsIgnoreAsciiCaseAscii("thm")) { INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( OUString::createFromAscii( "sdg" ) ); @@ -341,7 +342,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR const OUString aReadOnlyProp( OUString::createFromAscii( "IsReadOnly" ) ); OUString aTitle; sal_Bool bReadOnly = sal_False; - + try { ::ucbhelper::Content aThmCnt( aThmURL.GetMainURL( INetURLObject::NO_DECODE ), xEnv ); @@ -524,7 +525,7 @@ void Gallery::ImplLoadImports() void Gallery::ImplWriteImportList() { - INetURLObject aURL( GetUserURL() ); + INetURLObject aURL( GetUserURL() ); aURL.Append( ( String( "gallery.sdi", RTL_TEXTENCODING_UTF8 ) ) ); SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC ); @@ -786,15 +787,15 @@ BOOL Gallery::RemoveTheme( const String& rThemeName ) { SfxListener aListener; GalleryTheme* pThm = AcquireTheme( rThemeName, aListener ); - + if( pThm ) { INetURLObject aThmURL( pThm->GetThmURL() ); INetURLObject aSdgURL( pThm->GetSdgURL() ); INetURLObject aSdvURL( pThm->GetSdvURL() ); - + ReleaseTheme( pThm, aListener ); - + KillFile( aThmURL ); KillFile( aSdgURL ); KillFile( aSdvURL ); @@ -919,3 +920,7 @@ void Gallery::ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener ) ImplDeleteCachedTheme( pTheme ); } } + +BOOL GalleryThemeEntry::IsDefault() const +{ return( ( nId > 0 ) && ( nId != ( RID_GALLERYSTR_THEME_MYTHEME - RID_GALLERYSTR_THEME_START ) ) ); } + |