diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx index 9a4abd25b80e..1d22a25760ef 100644 --- a/sd/source/core/anminfo.cxx +++ b/sd/source/core/anminfo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: anminfo.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:16:46 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:41:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -323,7 +323,7 @@ void SdAnimationInfo::ReadData(SvStream& rIn) INetURLObject aURLObj(::URIHelper::SmartRelToAbs( aSoundFileRel, FALSE, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS )); - aSoundFile = aURLObj.PathToFileName(); + aSoundFile = aURLObj.GetMainURL(); } // ab hier werden Daten der Versionen > 1 eingelesen @@ -363,10 +363,7 @@ void SdAnimationInfo::ReadData(SvStream& rIn) INetURLObject aURLObj(::URIHelper::SmartRelToAbs(aBookmarkRel, FALSE, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS)); - if (eClickAction == presentation::ClickAction_DOCUMENT || eClickAction == presentation::ClickAction_PROGRAM) - aBookmark = aURLObj.GetMainURL(); - else - aBookmark = aURLObj.PathToFileName(); + aBookmark = aURLObj.GetMainURL(); } else rIn.ReadByteString( aBookmark, eTextEnc ); @@ -376,7 +373,7 @@ void SdAnimationInfo::ReadData(SvStream& rIn) INetURLObject aURLObjSound(::URIHelper::SmartRelToAbs(aSecondSoundFileRel, FALSE, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS)); - aSecondSoundFile = aURLObjSound.PathToFileName(); + aSecondSoundFile = aURLObjSound.GetMainURL(); rIn >> nTemp; bInvisibleInPresentation = (BOOL)nTemp; rIn >> nTemp; nVerb = (USHORT)nTemp; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 016a7d36c636..a79af0995872 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drawdoc.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: dl $ $Date: 2000-10-25 10:32:36 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:41:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,9 +102,6 @@ #ifndef _SVX_FONTITEM_HXX //autogen #include #endif -#ifndef _SFXINIMGR_HXX //autogen -#include -#endif #ifndef _SFXFLAGITEM_HXX //autogen #include #endif @@ -215,7 +212,7 @@ SdDrawDocument* SdDrawDocument::pDocLockedInsertingLinks = NULL; SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) : FmFormModel( #ifndef SVX_LIGHT - SFX_APP()->GetAppIniManager()->Get( SFX_KEY_PALETTE_PATH ), + SvtPathOptions().GetPalettePath(), #else String(), #endif diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 11df0995d428..ad9f0004d70d 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdpage2.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:16:46 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:42:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -543,7 +543,7 @@ void __EXPORT SdPage::ReadData(const SdrIOHeader& rHead, SvStream& rIn) INetURLObject aURLObj(::URIHelper::SmartRelToAbs(aSoundFileRel, FALSE, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS)); - aSoundFile = aURLObj.PathToFileName(); + aSoundFile = aURLObj.GetMainURL(); } // ab hier werden Daten der Versionen >=4 eingelesen diff --git a/sd/source/filter/pptin.cxx b/sd/source/filter/pptin.cxx index 6c20fa5e6607..69a3b6b4222b 100644 --- a/sd/source/filter/pptin.cxx +++ b/sd/source/filter/pptin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pptin.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: ka $ $Date: 2000-10-30 12:41:29 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:45:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,9 @@ #include +#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX +#include +#endif #ifndef _SV_WRKWIN_HXX #include #endif @@ -144,10 +147,6 @@ #include #endif -#ifndef _SFX_INIMGR_HXX -#include -#endif - #pragma hdrstop #include "glob.hrc" @@ -1496,10 +1495,10 @@ String SdPPTImport::ReadSound(UINT32 nSoundRef) const for( ULONG n = 0; ( n < pSoundList->Count() ) && !bSoundExists; n++ ) { - INetURLObject aURL; - aURL.SetSmartURL( *(String*)pSoundList->GetObject( n ) ); - String aSoundName( aURL.GetName() ); - if ( aSoundName == aRetval ) + INetURLObject aURL( *(String*)pSoundList->GetObject( n ) ); + String aSoundName( aURL.GetName() ); + + if( aSoundName == aRetval ) { aRetval = *(String*)pSoundList->GetObject( n ); bSoundExists = TRUE; @@ -1517,24 +1516,30 @@ String SdPPTImport::ReadSound(UINT32 nSoundRef) const DffRecordHeader aSoundDataRecHd; if ( SeekToRec( rStCtrl, PPT_PST_SoundData, nStrLen, &aSoundDataRecHd, 0 ) ) { - String aGalleryDir( SFX_INIMANAGER()->Get( SFX_KEY_GALLERY_DIR ) ); - INetURLObject aGalleryUserSound; - aGalleryUserSound.SetSmartURL( aGalleryDir.GetToken( aGalleryDir.GetTokenCount( ';' ) - 1 ) ); + String aGalleryDir( SvtPathOptions().GetGalleryPath() ); + INetURLObject aGalleryUserSound( aGalleryDir.GetToken( aGalleryDir.GetTokenCount( ';' ) - 1 ) ); + aGalleryUserSound.Append( aRetval ); UINT32 nSoundLen = aSoundDataRecHd.nRecLen; UINT8* pBuf = new UINT8[ nSoundLen ]; + rStCtrl.Read( pBuf, nSoundLen ); - SvFileStream aOStm( aGalleryUserSound.PathToFileName(), STREAM_WRITE | STREAM_TRUNC ); - aOStm.Write( pBuf, nSoundLen ); - UINT32 nFileError = aOStm.GetError(); - aOStm.Close(); - delete[] pBuf; - // Hat das Schreiben in die Gallery geklappt? - if ( nFileError == ERRCODE_NONE ) + SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL(), STREAM_WRITE | STREAM_TRUNC ); + + if( pOStm ) { - GalleryExplorer::InsertURL( GALLERY_THEME_USERSOUNDS, aGalleryUserSound.PathToFileName() ); - aRetval = aGalleryUserSound.GetFull(); + pOStm->Write( pBuf, nSoundLen ); + + if( pOStm->GetError() == ERRCODE_NONE ) + { + GalleryExplorer::InsertURL( GALLERY_THEME_USERSOUNDS, aGalleryUserSound.GetMainURL() ); + aRetval = aGalleryUserSound.GetMainURL(); + } + + delete pOStm; } + + delete[] pBuf; } } } diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 4821a524109b..5035d7cc3bc3 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdmod.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2000-09-28 17:59:52 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:45:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,12 @@ * ************************************************************************/ +#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX +#include +#endif +#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX +#include +#endif #ifndef _URLOBJ_HXX #include #endif @@ -357,11 +363,14 @@ SvStorageStreamRef SdModule::GetOptionStream( const String& rOptionName, if( !xOptionStorage.Is() ) { - INetURLObject aURL; + INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); - aURL.SetSmartURL( SFX_APP()->GetAppIniManager()->Get( SFX_KEY_USERCONFIG_PATH ) ); aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "drawing.cfg" ) ) ); - xOptionStorage = new SvStorage( aURL.PathToFileName() ); + + SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL(), STREAM_READWRITE ); + + if( pStm ) + xOptionStorage = new SvStorage( pStm, TRUE ); } if( DOCUMENT_TYPE_DRAW == eType ) diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 4cab1ab2eb79..b20ac0d53878 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdmod1.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: cl $ $Date: 2000-10-11 08:29:45 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:45:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,6 @@ * ************************************************************************/ -#include #include #ifndef _SFXFRAME_HXX //autogen #include @@ -83,9 +82,6 @@ #ifndef _SV_MSGBOX_HXX //autogen #include #endif -#ifndef _SFX_INIMGR_HXX //autogen -#include -#endif #ifndef _SVX_SVXENUM_HXX //autogen #include #endif diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index e29fb2ef07f8..426b444bb0a9 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdmod2.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: pw $ $Date: 2000-10-25 15:44:37 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:45:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,17 +64,13 @@ #endif #define ITEMID_FIELD EE_FEATURE_FIELD + #ifndef _SVX_FLDITEM_HXX //autogen #include #endif - #ifndef _SFX_PRINTER_HXX //autogen #include #endif - -#ifndef _SFX_INIMGR_HXX //autogen -#include -#endif #ifndef _INETHIST_HXX //autogen #include #endif @@ -103,6 +99,7 @@ #include #endif +#include #include #define ITEMID_SPELLCHECK 0 diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index cd5158a003f9..9262a478e7ec 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -2,9 +2,9 @@ * * $RCSfile: animobjs.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: hjs $ $Date: 2000-11-09 12:18:45 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:48:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,6 +103,7 @@ #include "drawdoc.hxx" #include "sdpage.hxx" +#include #include using namespace ::com::sun::star; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 01346f00b8fa..8fce1625ef61 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgass.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2000-09-21 16:11:35 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:48:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1818,10 +1818,10 @@ void AssistentDlgImpl::DeletePassords() BOOL AssistentDlgImpl::IsOwnFormat( const String& rPath ) { - INetURLObject aURL; - aURL.SetSmartURL( rPath ); + INetURLObject aURL( rPath ); + String aExt( aURL.GetFileExtension() ); - String aExt( aURL.GetFileExtension() ); + DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); return !aExt.EqualsIgnoreCaseAscii( "ppt" ); } diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx index 471c38f4d58d..fd5241833476 100644 --- a/sd/source/ui/dlg/dlgassim.cxx +++ b/sd/source/ui/dlg/dlgassim.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgassim.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dl $ $Date: 2000-10-13 11:33:20 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:48:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,14 +59,9 @@ * ************************************************************************/ -#ifndef _SFX_INIMGR_HXX -#include -#endif - #ifndef _SFXDOCFILE_HXX //autogen #include #endif - #ifndef _URLOBJ_HXX //autogen #include #endif @@ -348,16 +343,11 @@ void TemplateCache::Clear() void TemplateCache::Load() { - INetURLObject aURL; - - aURL.SetSmartURL( SFX_APP()->GetAppIniManager()->Get( SFX_KEY_USERCONFIG_PATH ) ); - aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "template.sod" ) ) ); - - SfxMedium aMedium( aURL.GetMainURL(), - STREAM_READ | STREAM_NOCREATE, - TRUE ); // Download - + INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); + aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( "template.sod" ) ) ); + SfxMedium aMedium( aURL.GetMainURL(), STREAM_READ | STREAM_NOCREATE, TRUE ); // Download SvStream* pStream = aMedium.GetInStream(); + if( !pStream ) return; @@ -397,16 +387,11 @@ void TemplateCache::Load() void TemplateCache::Save() { - INetURLObject aURL; - - aURL.SetSmartURL( SFX_APP()->GetAppIniManager()->Get( SFX_KEY_USERCONFIG_PATH ) ); - aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "template.sod" ) ) ); - - SfxMedium aMedium( aURL.GetMainURL(), - STREAM_WRITE | STREAM_TRUNC, - FALSE ); // Download - + INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); + aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( "template.sod" ) ) ); + SfxMedium aMedium( aURL.GetMainURL(), STREAM_WRITE | STREAM_TRUNC, FALSE ); // Download SvStream* pStream = aMedium.GetInStream(); + if( !pStream ) return; @@ -451,11 +436,14 @@ TemplateCacheDirEntry* TemplateCache::GetDirEntry( const String& rPath ) TemplateCacheInfo* TemplateCache::GetFileInfo( const String& rPath ) { - INetURLObject aUrl; aUrl.SetSmartURL( rPath ); + INetURLObject aUrl( rPath ); String aPath( aUrl.GetPath() ); String aName( aUrl.GetName( INetURLObject::DECODE_UNAMBIGUOUS ) ); + DBG_ASSERT( aUrl.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + TemplateCacheDirEntry* pDir = GetDirEntry( aPath ); + if( NULL != pDir ) { for( TemplateCacheInfo* pEntry = pDir->m_aFiles.First(); pEntry; pEntry = pDir->m_aFiles.Next() ) @@ -470,9 +458,11 @@ TemplateCacheInfo* TemplateCache::GetFileInfo( const String& rPath ) TemplateCacheInfo* TemplateCache::AddFileInfo( const String& rPath ) { - INetURLObject aUrl; aUrl.SetSmartURL( rPath ); - String aPath( aUrl.GetPath() ); - String aName( aUrl.GetName( INetURLObject::DECODE_UNAMBIGUOUS ) ); + INetURLObject aUrl( rPath ); + String aPath( aUrl.GetPath() ); + String aName( aUrl.GetName( INetURLObject::DECODE_UNAMBIGUOUS ) ); + + DBG_ASSERT( aUrl.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); TemplateCacheDirEntry* pDir = GetDirEntry( aPath ); TemplateCacheInfo* pEntry = NULL; diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index eee563140355..3daab3dbed9f 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: morphdlg.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:41:01 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:48:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,34 +67,24 @@ #include "morphdlg.hxx" #include "morphdlg.hrc" -#ifndef _SFX_INIMGR_HXX //autogen -#include -#endif - #ifndef _SV_CONFIG_HXX //autogen #include #endif - #ifndef SVX_XFILLIT0_HXX //autogen #include #endif - #ifndef _SVX_XLINEIT0_HXX //autogen #include #endif - #ifndef _XENUM_HXX //autogen #include #endif - #ifndef _SVDOBJ_HXX //autogen #include #endif - #ifndef _SFXITEMSET_HXX //autogen #include #endif - #ifndef _SFXITEMPOOL_HXX //autogen #include #endif diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 709044821900..b87e248ff8a2 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tpaction.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ka $ $Date: 2000-10-30 12:51:38 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:49:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,15 +81,15 @@ #include #include +#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX +#include +#endif #ifndef _SVDPAGV_HXX //autogen #include #endif #ifndef _AEITEM_HXX //autogen #include #endif -#ifndef _SFXINIMGR_HXX //autogen -#include -#endif #ifndef _SVX_COLRITEM_HXX //autogen #include #endif @@ -705,8 +705,7 @@ void SdTPAction::OpenFileDialog() if( bSound ) { - pFileDialog = new SfxSimpleFileDialog ( this, WB_OPEN | WB_3DLOOK | WB_STDMODAL ); - + pFileDialog = new SfxFileDialog ( this, WB_OPEN | WB_3DLOOK | WB_STDMODAL ); pBtnPreview = new PushButton( pFileDialog, SdResId( RID_PREVIEW_BUTTON ) ); pBtnPreview->SetClickHdl( LINK( this, SdTPAnimation, ClickPreviewHdl ) ); pBtnPreview->Show(); @@ -732,9 +731,8 @@ void SdTPAction::OpenFileDialog() #endif if( !aFile.Len() ) - { - aFile = SFX_APP()->GetAppIniManager()->Get( SFX_KEY_GRAPHICS_PATH ); - } + aFile = SvtPathOptions().GetGraphicPath(); + pFileDialog->SetPath( aFile ); if ( pFileDialog->Execute() ) @@ -785,9 +783,7 @@ void SdTPAction::OpenFileDialog() SfxFileDialog* pSfxFileDlg = new SfxFileDialog ( this, WB_OPEN | WB_3DLOOK | WB_STDMODAL ); if (bDocument && !aFile.Len()) - { - aFile = SFX_APP()->GetAppIniManager()->Get( SFX_KEY_WORK_PATH ); - } + aFile = SvtPathOptions().GetWorkPath(); pSfxFileDlg->SetPath( aFile ); diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 80f2c7ac8ab8..91ea83817da2 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: vectdlg.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:48:34 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:49:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,9 +75,6 @@ #include "vectdlg.hxx" #include "vectdlg.hrc" -#ifndef _SFX_INIMGR_HXX //autogen -#include -#endif #ifndef _SV_CONFIG_HXX //autogen #include #endif diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 2f181964a1b6..4d279c9dd24f 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docshel2.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:48:34 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:50:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -152,20 +152,25 @@ void __EXPORT SdDrawDocShell::Draw(OutputDevice* pOut, const JobSetup& rSetup, delete pView; -// Fuer Testzwecke: Bitte nicht entfernen! +// Fuer Testzwecke: Bitte nicht entfernen! // -// GDIMetaFile* pMtf = pOut->GetConnectMetaFile(); +// GDIMetaFile* pMtf = pOut->GetConnectMetaFile(); // -// if (pMtf) -// { -// String aFile("d:\\sd\\winmsci.pro\\bin\\gdi.mtf"); -// SvFileStream aFStream(aFile, STREAM_WRITE); +// if( pMtf ) +// { +// String aURLStr; // -// pMtf->WindStart(); -// aFStream << *pMtf; +// if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( String( RTL_CONSTASCII_USTRINGPARAM( "d:\\gdi.mtf" ) ), aURLStr ) ) +// { +// SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_WRITE | STREAM_TRUNC ); // -// aFStream.Close(); -// } +// if( pOStm ) +// { +// *pOStm << *pMtf; +// delete pOStm; +// } +// } +// } } /************************************************************************* diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index c3d08fce9b1a..bba1160ba5ff 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fuinsert.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:48:35 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:52:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,13 +66,14 @@ #endif #include - #include - #include #include #include #include +#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX +#include +#endif #ifndef _SV_CLIP_HXX //autogen #include #endif @@ -176,23 +177,26 @@ FuInsertGraphic::FuInsertGraphic(SdViewShell* pViewSh, SdWindow* pWin, SdView* p { case RET_OK: { - USHORT nError = 0; - Graphic aGraphic; - Graphic* pGraphic = pDlg->GetGraphic(); - String aPath = pDlg->GetPath(); + USHORT nError = 0; + Graphic aGraphic; + Graphic* pGraphic = pDlg->GetGraphic(); + String aPath( pDlg->GetPath() ); - if (pGraphic) + if( pGraphic ) { aGraphic = *pGraphic; } else { - // Graphik noch nicht ueber Preview vorhanden: also laden GraphicFilter& rFilter = pDlg->GetFilter(); - FilterProgress aFilterProgress(&rFilter, pViewSh->GetDocSh()); - SvFileStream aIStm( aPath, STREAM_READ | STREAM_SHARE_DENYNONE ); + FilterProgress aFilterProgress( &rFilter, pViewSh->GetDocSh() ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aPath, STREAM_READ | STREAM_SHARE_DENYNONE ); - nError = rFilter.ImportGraphic( aGraphic, aPath, aIStm ); + if( pIStm ) + { + nError = rFilter.ImportGraphic( aGraphic, aPath, *pIStm ); + delete pIStm; + } } if ( nError == 0 && pViewSh->ISA(SdDrawViewShell) ) @@ -545,17 +549,16 @@ FuInsertOLE::FuInsertOLE(SdViewShell* pViewSh, SdWindow* pWin, SdView* pView, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ); - INetURLObject* pURL = new INetURLObject(); - pURL->SetSmartProtocol( INET_PROT_FILE ); + INetURLObject aURL( aStrURL ); - if ( pURL->SetURL( aStrURL ) ) + if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) { // create plugin, initialize, etc. SvFactory * pPlugIn = SvFactory::GetDefaultPlugInFactory(); SvStorageRef aStor = new SvStorage( aEmptyStr, STREAM_STD_READWRITE ); SvPlugInObjectRef xObj = &pPlugIn->CreateAndInit( *pPlugIn, aStor ); xObj->SetPlugInMode( (USHORT)PLUGIN_EMBEDED ); - xObj->SetURL( *pURL ); + xObj->SetURL( aURL ); aIPObj = (SvInPlaceObject*)&xObj; } else diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 0cb126a80e1f..9fc9ca74930a 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fusel.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tbe $ $Date: 2000-11-10 16:28:08 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:52:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1326,13 +1326,11 @@ BOOL FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) { // Execute application String aStrApplication = pInfo->aBookmark; - INetURLObject aURLObj( ::URIHelper::SmartRelToAbs( aStrApplication, FALSE, - INetURLObject::WAS_ENCODED, - INetURLObject::DECODE_UNAMBIGUOUS ) ); - aStrApplication = aURLObj.PathToFileName(); - - NAMESPACE_VOS(OProcess) aApp( aStrApplication); - NAMESPACE_VOS(OArgumentList) aParameters; + INetURLObject aURL( ::URIHelper::SmartRelToAbs( aStrApplication, FALSE, + INetURLObject::WAS_ENCODED, + INetURLObject::DECODE_UNAMBIGUOUS ) ); + NAMESPACE_VOS(OProcess) aApp( aURL.GetMainURL() ); + NAMESPACE_VOS(OArgumentList) aParameters; aApp.execute( (NAMESPACE_VOS(OProcess)::TProcessOption) (NAMESPACE_VOS(OProcess)::TOption_SearchPath | diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index c1bc5b0adf94..bdd334a61de0 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drviews9.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2000-09-21 16:12:20 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:53:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -297,18 +297,17 @@ void SdDrawViewShell::ExecGallery(SfxRequest& rReq) // Soll nur ein Link benutzt werden? if( pGrafObj && pGal->IsLinkage() ) { - pGrafObj->SetGraphicLink( pGal->GetURL().PathToFileName(), pGal->GetFilterName() ); + pGrafObj->SetGraphicLink( pGal->GetURL().GetMainURL(), pGal->GetFilterName() ); } } // Sound als OLE-Objekt einfuegen else if (nFormats & SGA_FORMAT_SOUND) { - const String aFile( pGal->GetURL().PathToFileName() ); SvInPlaceObjectRef aIPObj; SvStorageRef aStor = new SvStorage( String(), STREAM_STD_READWRITE ); String aName; - aIPObj = &((SvFactory*)SvInPlaceObject::ClassFactory())->CreateAndInit(aFile, aStor); + aIPObj = &((SvFactory*)SvInPlaceObject::ClassFactory())->CreateAndInit( pGal->GetURL().GetMainURL(), aStor ); if (aIPObj.Is()) { Size aSize(aIPObj->GetVisArea(ASPECT_CONTENT).GetSize()); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index c56026b49308..398aa8fc3669 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdview3.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:50:43 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:53:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,8 +69,9 @@ #ifndef _SV_EXCHANGE_HXX //autogen #include #endif - - +#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX +#include +#endif #ifndef _EDITDATA_HXX #include #endif @@ -120,9 +121,6 @@ #ifndef _SFXAPP_HXX //autogen #include #endif -#ifndef _SFXINIMGR_HXX //autogen -#include -#endif #ifndef _SFXITEMPOOL_HXX //autogen #include #endif @@ -491,8 +489,7 @@ BOOL SdView::InsertData(SvDataObjectRef pDataObject, const Point& rPos, if ( aData.GetData(xStream) ) // Setzt auch die BufferSize { xStream->SetVersion(SOFFICE_FILEFORMAT_NOW); - FmFormModel* pModel = new FmFormModel(SFX_APP()->GetAppIniManager() - ->Get(SFX_KEY_PALETTE_PATH), NULL, pDocSh); + FmFormModel* pModel = new FmFormModel( SvtPathOptions().GetPalettePath(), NULL, pDocSh ); xStream->Seek(0); pModel->SetStreamingSdrModel(TRUE); pModel->GetItemPool().Load(*xStream); diff --git a/sd/source/ui/view/sdview5.cxx b/sd/source/ui/view/sdview5.cxx index b176742acf88..249acf8217eb 100644 --- a/sd/source/ui/view/sdview5.cxx +++ b/sd/source/ui/view/sdview5.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdview5.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:50:43 $ + * last change: $Author: ka $ $Date: 2000-11-10 16:53:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -334,16 +334,16 @@ IMPL_LINK_INLINE_START( SdView, DropInsertFileHdl, Timer*, pTimer ) BOOL bOK = FALSE; const SfxFilter* pFilter = NULL; - SfxMedium aSfxMedium(aDropFile, (STREAM_READ | STREAM_SHARE_DENYNONE), FALSE); + SfxMedium aSfxMedium( aDropFile, STREAM_READ | STREAM_SHARE_DENYNONE, FALSE ); ErrCode nErr = SFX_APP()->GetFilterMatcher(). GuessFilter(aSfxMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE ); if (pFilter && !nErr) { - GraphicFilter* pGraphicFilter = GetGrfFilter(); - String aFilterName = pFilter->GetFilterName(); - USHORT nFormat = pGraphicFilter->GetImportFormatNumber(aFilterName); + GraphicFilter* pGraphicFilter = GetGrfFilter(); + String aFilterName( pFilter->GetFilterName() ); + USHORT nFormat = pGraphicFilter->GetImportFormatNumber(aFilterName); if (aFilterName.EqualsAscii( "Text" ) || aFilterName.EqualsAscii( "Rich Text Format" ) || @@ -365,28 +365,27 @@ IMPL_LINK_INLINE_START( SdView, DropInsertFileHdl, Timer*, pTimer ) pDoc, aReq); delete pFunc; } - else if (nFormat != GRFILTER_FORMAT_DONTKNOW) + else if( nFormat != GRFILTER_FORMAT_DONTKNOW ) { /****************************************************************** * Graphik-Format ******************************************************************/ FilterProgress aFilterProgress(pGraphicFilter, pViewSh->GetDocSh()); - Graphic aGraphic; + Graphic aGraphic; // keine native Tempdatei anlegen (DummyLink setzen) aGraphic.SetLink( GfxLink() ); - SvFileStream aIStm( aDropFile, STREAM_READ | STREAM_SHARE_DENYNONE ); + SvStream* pIStm = aSfxMedium.GetInStream(); - if( !pGraphicFilter->ImportGraphic(aGraphic, aDropFile, aIStm, nFormat ) ) + if( pIStm && !pGraphicFilter->ImportGraphic( aGraphic, aDropFile, *pIStm, nFormat ) ) { bOK = TRUE; + SdrGrafObj* pGrafObj = InsertGraphic(aGraphic, eAction, aDropPos, NULL, NULL); - if (pGrafObj) - { - pGrafObj->SetGraphicLink(aDropFile, aFilterName); - } + if( pGrafObj ) + pGrafObj->SetGraphicLink( aDropFile, aFilterName ); } } }