diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-07-16 13:57:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-16 14:16:47 +0100 |
commit | 6d6198393e0677710191248d6f7c9ec15d0f0e0f (patch) | |
tree | 4b1c10c38a6613323799857fb432a881be936f3a /svx/source/gallery2/galtheme.cxx | |
parent | 995b97632e3e6f0a789f0ee59fc3bcc6f24bf096 (diff) |
Resolves: fdo#42454 'imported' gallery format doesn't appear to exist
AFAICS an "imported" gallery can only be written if you already have an
imported gallery in the first place, i.e. its something coming from an earlier
version. All the way back to 2000, so I suspect its an earlier pre-OOo feature,
which can't arise in practice with no migration from staroffice configs to
OpenOffice.org or LibreOffice.
Change-Id: I9f248baadb20633da129d3bcacce3d7f92ef7510
Diffstat (limited to 'svx/source/gallery2/galtheme.cxx')
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 27caa5f5ef1d..e82289d5f970 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -79,9 +79,6 @@ GalleryTheme::GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ) bDragging ( sal_False ) { ImplCreateSvDrawStorage(); - - if( pThm->IsImported() ) - aImportName = pThm->GetThemeName(); } // ------------------------------------------------------------------------ @@ -104,15 +101,10 @@ GalleryTheme::~GalleryTheme() void GalleryTheme::ImplCreateSvDrawStorage() { - if( !pThm->IsImported() ) - { - aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); - // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) - if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) - aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); - } - else - aSvDrawStorageRef.Clear(); + aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); + // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) + if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) + aSvDrawStorageRef = new SvStorage( sal_False, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); } // ------------------------------------------------------------------------ @@ -256,19 +248,7 @@ INetURLObject GalleryTheme::ImplGetURL( const GalleryObject* pObject ) const INetURLObject aURL; if( pObject ) - { - if( IsImported() ) - { - INetURLObject aPathURL( GetParent()->GetImportURL( GetName() ) ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - aPathURL.Append( pObject->aURL.GetName() ); - aURL = aPathURL; - } - else - aURL = pObject->aURL; - } + aURL = pObject->aURL; return aURL; } @@ -536,7 +516,7 @@ bool GalleryTheme::ChangeObjectPos( size_t nOldPos, size_t nNewPos ) void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProgress ) { - if( !IsReadOnly() && !IsImported() ) + if( !IsReadOnly() ) { Graphic aGraphic; String aFormat; @@ -778,7 +758,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa aPathURL.removeFinalSlash(); pRet = new GalleryThemeEntry( aPathURL, aThemeName, String(rURL.GetBase()).Copy( 2, 6 ).ToInt32(), - bReadOnly, sal_False, sal_False, nThemeId, + bReadOnly, sal_False, nThemeId, bThemeNameFromResource ); } @@ -1432,7 +1412,6 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) String aThemeName; rtl_TextEncoding nTextEncoding; - aImportName = rtl::OUString(); rIStm >> nVersion; rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); rIStm >> nCount; @@ -1587,11 +1566,10 @@ const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL(); sal_uInt32 GalleryTheme::GetId() const { return pThm->GetId(); } void GalleryTheme::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName ) { pThm->SetId( nNewId, bResetThemeName ); } sal_Bool GalleryTheme::IsThemeNameFromResource() const { return pThm->IsNameFromResource(); } -sal_Bool GalleryTheme::IsImported() const { return pThm->IsImported(); } sal_Bool GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); } sal_Bool GalleryTheme::IsDefault() const { return pThm->IsDefault(); } sal_Bool GalleryTheme::IsModified() const { return pThm->IsModified(); } -const rtl::OUString& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); } +const rtl::OUString& GalleryTheme::GetName() const { return pThm->GetThemeName(); } void GalleryTheme::InsertAllThemes( ListBox& rListBox ) { |