Kaydet (Commit) 48bf5e85 authored tarafından Mathias Bauer's avatar Mathias Bauer

Remove tests for INET_PROT_FILE

üst 0785efa9
......@@ -2,9 +2,9 @@
*
* $RCSfile: app.cxx,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -292,7 +292,7 @@ SfxApplication::SfxApplication()
pImp->pSimpleResManager = 0;
pImp->nWarnLevel = 0;
pImp->pAutoSaveTimer = 0;
#ifdef ENABLE_INIMANAGER//MUSTINI
#if SUPD<613
pAppIniMgr = CreateIniManager();
pAppData_Impl = new SfxAppData_Impl( this );
pAppData_Impl->StartListening( *pAppIniMgr );
......@@ -334,7 +334,7 @@ SfxApplication::~SfxApplication()
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
delete pImp;
delete pAppData_Impl;
#ifdef ENABLE_INIMANAGER//MUSTINI
#if SUPD<613
SfxIniManager::Close();
#endif
utl::ConfigManager::RemoveConfigManager();
......@@ -518,7 +518,9 @@ void SfxApplication::UserEvent
sal_Bool IsTemplate_Impl( const String& aPath )
{
INetURLObject aObj( aPath, INET_PROT_FILE );
INetURLObject aObj( aPath );
DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
if ( aObj.getExtension().CompareIgnoreCaseToAscii( "vor" ) == COMPARE_EQUAL )
return sal_True;
......@@ -556,7 +558,9 @@ void SfxApplication::HandleAppEvent( const ApplicationEvent& rAppEvent )
#ifdef APPEVENT_DBG
aStream << "Open: " << (const char *)aFileName.GetValue();
#endif
// Art, Existens und Groesse
// if the filename is a physical name, it is the client file system, not the file system
// of the machine where the office is running ( if this are different machines )
// the file system of the client is addressed through the "file:" protocol
INetURLObject aURL( aFileName.GetValue(), INET_PROT_FILE );
sal_Bool bIsFileURL = INET_PROT_FILE == aURL.GetProtocol();
......@@ -834,11 +838,7 @@ void SfxApplication::SetViewFrame( SfxViewFrame *pFrame )
if ( !pSh )
{
// Wenn es ein Dokument gibt, wird die BaseURL im Activate gesetzt
#if SUPD<613//MUSTINI
INetURLObject aObject( GetIniManager()->Get( SFX_KEY_WORK_PATH ), INET_PROT_FILE );
#else
INetURLObject aObject( SvtPathOptions().GetWorkPath(), INET_PROT_FILE );
#endif
INetURLObject aObject( SvtPathOptions().GetWorkPath() );
aObject.setFinalSlash();
INetURLObject::SetBaseURL( aObject.GetMainURL() );
}
......@@ -1223,94 +1223,8 @@ sal_uInt16 SfxApplication::Exception( sal_uInt16 nError )
SfxNewHdl::Get()->FlushExceptMem();
}
#ifndef TF_UCB
// Flush all CHAOS data.
CntSystem::Flush();
#endif
#if SUPD<613//MUSTINI
INetURLObject aSaveObj( pAppIniMgr->Get( SFX_KEY_BACKUP_PATH ), INET_PROT_FILE );
if ( Application::IsInExecute() )
{
SfxObjectShell *pIter, *pNext;
sal_uInt16 n = 0;
for(pIter = SfxObjectShell::GetFirst(); pIter; pIter = pNext)
{
pNext = SfxObjectShell::GetNext(*pIter);
if( pIter->IsModified() && pIter->GetName().CompareToAscii("BasicIDE") != COMPARE_EQUAL && !pIter->IsLoading() )
{
//try
{
// backup unsaved document
SFX_ITEMSET_ARG( pIter->GetMedium()->GetItemSet(), pPassItem, SfxStringItem, SID_PASSWORD, sal_False );
SfxRequest aReq(SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON, pIter->GetPool());
sal_Bool bHadName = pIter->HasName();
INetURLObject aOldURL = pIter->GetMedium()->GetURLObject();
String aOldName = pIter->GetTitle();
const SfxFilter *pFilter = pIter->GetMedium()->GetFilter();
const SfxFilter *pOrigFilter = pFilter;
if ( !pFilter || ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) || !( pFilter->GetFilterFlags() & SFX_FILTER_EXPORT ) )
// packed files must be saved with default format, but remember original filter !
pFilter = pIter->GetFactory().GetFilter(0);
INetURLObject aSaveObj( SvtPathOptions().GetBackupPath() );
String aSaveName, aSavePath = aSaveObj.GetMainURL();
String aFilterName;
if ( pFilter )
{
aFilterName = pFilter->GetName();
TempFile aTempFile( &aSavePath );
aSaveName = aTempFile.GetName();
}
else
{
String aExt( DEFINE_CONST_UNICODE( ".sav" ) );
TempFile aTempFile( DEFINE_CONST_UNICODE( "exc" ), &aExt, &aSavePath );
aSaveName = aTempFile.GetName();
}
aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aSaveName ) );
aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilterName ) );
if ( pPassItem )
aReq.AppendItem( *pPassItem );
pIter->ExecuteSlot(aReq);
String aEntry( aSaveName );
aEntry += DEFINE_CONST_UNICODE(";");
aEntry += pOrigFilter ? pOrigFilter->GetName() : aFilterName;
aEntry += DEFINE_CONST_UNICODE(";");
if ( bHadName && INET_PROT_FILE == aOldURL.GetProtocol() )
{
aEntry += DEFINE_CONST_UNICODE("url;"),
aEntry += aOldURL.GetMainURL();
}
else
{
aEntry += DEFINE_CONST_UNICODE("title;"),
aEntry += aOldName;
}
pAppIniMgr->Set( aEntry, SFX_GROUP_WORKINGSET_IMPL, DEFINE_CONST_UNICODE("Recover"), n++ );
}
/*catch ( ::Exception & )
{
}*/
}
}
pAppIniMgr->Flush();
if ( ( nError & EXC_MAJORTYPE ) != EXC_DISPLAY && ( nError & EXC_MAJORTYPE ) != EXC_REMOTE )
{
Window *pTopWindow = GetTopWindow(); // GCC needs temporary
WarningBox( pTopWindow, SfxResId(STR_RECOVER_PREPARED) ).Execute();
}
}
else
pAppIniMgr->Flush();
#else//MUSTINI
INetURLObject aSaveObj( SvtPathOptions().GetBackupPath(), INET_PROT_FILE );
// save all modified documents and close all documents
// Do it only, if it's allowed! Ask configuration for right flag.
if(
......@@ -1370,16 +1284,11 @@ sal_uInt16 SfxApplication::Exception( sal_uInt16 nError )
aEntry += pOrigFilter ? pOrigFilter->GetName() : aFilterName;
aEntry += DEFINE_CONST_UNICODE(";");
if ( bHadName && INET_PROT_FILE == aOldURL.GetProtocol() )
if ( bHadName )
{
aEntry += DEFINE_CONST_UNICODE("url;"),
aEntry += aOldURL.GetMainURL();
}
else
{
aEntry += DEFINE_CONST_UNICODE("title;"),
aEntry += aOldName;
}
seqWindowList.realloc(n+1);
seqWindowList[n] = aEntry;
......@@ -1399,7 +1308,6 @@ sal_uInt16 SfxApplication::Exception( sal_uInt16 nError )
WarningBox( pTopWindow, SfxResId(STR_RECOVER_PREPARED) ).Execute();
}
}
#endif//MUSTINI
#if SUPD<613//MUSTINI
/*TODO: We need a new key to save informations for SenCrashMail feature.*/
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: appbas.cxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -532,12 +532,8 @@ sal_uInt16 SfxApplication::SaveBasicManager() const
// Ncht den vom BasicManager, falls inzwischen der Pfad geaendert wurde !?
// So wird natuerlich auch das erste Dir genommen, wenn der BasicManager
// vorher im zweiten gefunden wurde...
/*MUSTINI-----------------------------------------------------------------------------
String aBasicPath( GetIniManager()->Get( SFX_KEY_BASIC_PATH ) );
*/
String aBasicPath( SvtPathOptions().GetBasicPath() );
/*MUSTINI-----------------------------------------------------------------------------*/
INetURLObject aAppBasicObj( aBasicPath.GetToken(0), INET_PROT_FILE );
INetURLObject aAppBasicObj( aBasicPath.GetToken(0) );
aAppBasicObj.insertName( Application::GetAppName() );
aAppBasicObj.setExtension( DEFINE_CONST_UNICODE( "sbl" ) );
String aAppBasicPath( aAppBasicObj.PathToFileName() );
......@@ -625,22 +621,10 @@ BasicManager* SfxApplication::GetBasicManager()
if ( !pImp->pBasicMgr )
{
// Directory bestimmen
#if SUPD<613//MUSTINI
SfxIniManager* pIniMgr = GetIniManager();
String aAppBasicDir( pIniMgr->Get( SFX_KEY_BASIC_PATH ) );
if ( !aAppBasicDir.Len() )
{
aAppBasicDir = pIniMgr->GetProgramPath();
pIniMgr->Set( aAppBasicDir, SFX_KEY_BASIC_PATH );
}
#else
SvtPathOptions aPathCFG;
String aAppBasicDir( aPathCFG.GetBasicPath() );
if ( !aAppBasicDir.Len() )
{
aPathCFG.SetBasicPath( aPathCFG.SubstituteVariable( String::CreateFromAscii("$(insturl)") ) );
}
#endif
aPathCFG.SetBasicPath( String::CreateFromAscii("$(prog)") );
// #58293# soffice.new nur im ::com::sun::star::sdbcx::User-Dir suchen => erstes Verzeichnis
String aAppFirstBasicDir = aAppBasicDir.GetToken(0);
......@@ -648,7 +632,8 @@ BasicManager* SfxApplication::GetBasicManager()
// Basic erzeugen und laden
// MT: #47347# AppBasicDir ist jetzt ein PATH!
INetURLObject aAppBasic( Application::GetAppFileName(), INET_PROT_FILE );
INetURLObject aAppBasic( SvtPathOptions().SubstituteVariable( String::CreateFromAscii("$(progurl)") ) );
aAppBasic.insertName( Application::GetAppName() );
aAppBasic.setExtension( DEFINE_CONST_UNICODE( "sbl" ) );
String aAppBasicFile, aNewBasicFile;
// Direkt nach der Installation gibt es ggf. _nur_ eine SOFFICE.NEW
......@@ -665,9 +650,7 @@ BasicManager* SfxApplication::GetBasicManager()
}
else
aAppBasic = INetURLObject( aAppBasicFile );
SvStorageRef aStor;
if ( SfxContentHelper::Exists( aAppBasic.GetMainURL() ) )
aStor = new SvStorage( aAppBasic.PathToFileName(), STREAM_READ | STREAM_SHARE_DENYWRITE );
SvStorageRef aStor = new SvStorage( aAppBasic.GetMainURL(), STREAM_READ | STREAM_SHARE_DENYWRITE );
if ( aStor.Is() && 0 == aStor->GetError() )
{
SfxErrorContext aErrContext( ERRCTX_SFX_LOADBASIC, Application::GetAppName() );
......@@ -714,7 +697,8 @@ BasicManager* SfxApplication::GetBasicManager()
// Als Destination das erste Dir im Pfad:
String aFileName( aAppBasic.getName() );
aAppBasic = INetURLObject( aAppBasicDir.GetToken(0), INET_PROT_FILE );
aAppBasic = INetURLObject( aAppBasicDir.GetToken(0) );
DBG_ASSERT( aAppBasic.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
aAppBasic.insertName( aFileName );
pImp->pBasicMgr->SetStorageName( aAppBasic.PathToFileName() );
}
......
This diff is collapsed.
......@@ -2,9 +2,9 @@
*
* $RCSfile: appdde.cxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -517,13 +517,9 @@ BOOL SfxApplication::InitializeDde()
pAppData_Impl->pDdeService->AddFormat( FORMAT_RTF );
// Config-Pfad als Topic wegen Mehrfachstart
#if SUPD<613//MUSTINI
INetURLObject aOfficeLockFile( GetIniManager()->Get( SFX_KEY_USERCONFIG_PATH ), INET_PROT_FILE );
#else
INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath(), INET_PROT_FILE );
#endif
INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() );
aOfficeLockFile.insertName( DEFINE_CONST_UNICODE( "soffice.lck" ) );
String aService( SfxDdeServiceName_Impl( aOfficeLockFile.PathToFileName() ) );
String aService( SfxDdeServiceName_Impl( aOfficeLockFile.GetMainURL() ) );
aService.ToUpperAscii();
pAppData_Impl->pDdeService2 = new ImplDdeService( aService );
pAppData_Impl->pTriggerTopic = new SfxDdeTriggerTopic_Impl;
......@@ -624,11 +620,7 @@ BOOL ImplDdeService::MakeTopic( const String& rNm )
if( !bRet )
{
#if SUPD<613//MUSTINI
INetURLObject aWorkPath( SFX_INIMANAGER()->Get( SFX_KEY_WORK_PATH ), INET_PROT_FILE );
#else
INetURLObject aWorkPath( SvtPathOptions().GetWorkPath(), INET_PROT_FILE );
#endif
INetURLObject aWorkPath( SvtPathOptions().GetWorkPath() );
INetURLObject aFile;
if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
SfxContentHelper::IsDocument( aFile.GetMainURL() ) )
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: appmisc.cxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -464,7 +464,7 @@ void SfxApplication::OpenClients()
// Dateiname
#if SUPD<613//MUSTINI
String aName = SFX_INIMANAGER()->ReadKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("StartDocument") );
String aName = pAppIniMgr->ReadKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("StartDocument") );
#else
#ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
DBG_ASSERT(sal_False, "SfxApplication::OpenClients()\nsoffice.ini key \"Common\\StartDocument\" no longer supported ...\n");
......@@ -760,15 +760,17 @@ SfxIniManager* SfxApplication::CreateIniManager()
// If some configurtation files are missing or corrupt
// try to start setup. If starting failed show a errorbox and exit application with an error code.
INetURLObject aSetupObj( Application::GetAppFileName(), INET_PROT_FILE );
String aProgURL = SvtPathOptions().SubstituteVariable( String::CreateFromAscii("$(PROGURL)") );
INetURLObject aSetupObj( aProgURL );
#if defined(UNX)
aSetupObj.setName( DEFINE_CONST_UNICODE("setup") );
aSetupObj.insertName( DEFINE_CONST_UNICODE("setup") );
#endif
#if defined(WIN) || defined(WNT) || defined(OS2)
aSetupObj.setName( DEFINE_CONST_UNICODE("setup.exe") );
aSetupObj.insertName( DEFINE_CONST_UNICODE("setup.exe") );
#endif
#if defined(MAC)
aSetupObj.setName( DEFINE_CONST_UNICODE("Setup") );
aSetupObj.insertName( DEFINE_CONST_UNICODE("Setup") );
#endif
// We must use different messages for fat office and portal.
......@@ -948,11 +950,7 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
if ( !pList )
{
// Gibt es eine Slotdatei ?
#if SUPD<613//MUSTINI
INetURLObject aObj( GetIniManager()->Get( SFX_KEY_CONFIG_DIR ), INET_PROT_FILE );
#else
INetURLObject aObj( SvtPathOptions().GetConfigPath(), INET_PROT_FILE );
#endif
INetURLObject aObj( SvtPathOptions().GetConfigPath() );
aObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) );
SvFileStream aStrm( aObj.GetMainURL(), STREAM_STD_READ );
......@@ -1141,37 +1139,6 @@ ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBind
PopupMenu* SfxAppData_Impl::GetPopupMenu( sal_uInt16 nSID, sal_Bool bBig, sal_Bool bNew )
{
#if SUPD<613//MUSTINI
String aPath;
SfxBmkMenu** ppMenu;
sal_uInt16 nKey;
switch( nSID )
{
case SID_NEWDOCDIRECT:
ppMenu = &pNewMenu;
nKey = SFX_KEY_NEW_DIR;
break;
case SID_AUTOPILOTMENU:
ppMenu = &pAutoPilotMenu;
nKey = SFX_KEY_AUTOPILOT_DIR;
break;
default:
ppMenu = 0;
DBG_ERROR( "Menu ID unknown!" );
break;
}
if( ppMenu && ( !*ppMenu || bNew ) )
{
INetURLObject aObj( SFX_INIMANAGER()->Get( nKey ), INET_PROT_FILE );
String aURL = aObj.GetMainURL();
if ( *ppMenu )
delete *ppMenu;
*ppMenu = new SfxBmkMenu( aURL, aURL );
(*ppMenu)->Initialize();
}
return ppMenu ? *ppMenu : NULL;
#else
String aPath;
SfxBmkMenu** ppMenu;
String sKey;
......@@ -1193,7 +1160,7 @@ PopupMenu* SfxAppData_Impl::GetPopupMenu( sal_uInt16 nSID, sal_Bool bBig, sal_Bo
if( ppMenu && ( !*ppMenu || bNew ) )
{
INetURLObject aObj( sKey, INET_PROT_FILE );
INetURLObject aObj( sKey );
String aURL = aObj.GetMainURL();
if ( *ppMenu )
delete *ppMenu;
......@@ -1201,7 +1168,6 @@ PopupMenu* SfxAppData_Impl::GetPopupMenu( sal_uInt16 nSID, sal_Bool bBig, sal_Bo
(*ppMenu)->Initialize();
}
return ppMenu ? *ppMenu : NULL;
#endif
}
SfxMenuBarManager* SfxApplication::GetMenuBarManager() const
......@@ -1213,4 +1179,90 @@ SfxMenuBarManager* SfxApplication::GetMenuBarManager() const
return 0;
}
#if SUPD<613
SfxIniManager* SfxApplication::GetIniManager() const
/* [Beschreibung]
Diese Methode liefert den Ini-Manager der Dokument-Factory
des aktiven Dokuments, insofern ein Dokument aktiv ist.
Ansonsten liefert sie den Ini-Manager der Applikation.
W"ahrend 'Application:Execute()' ist der R"uckgabewert
immer ein g"ultiger Pointer, ansonsten kann es auch ein
0-Pointer sein.
*/
{
return pAppIniMgr;
}
//--------------------------------------------------------------------
#ifdef WNT
extern String GetUserID();
#endif
SfxIniManager* SfxApplication::CreateIniManager()
{
SfxIniManager *pIniMgr = NULL;
try
{
pIniMgr = SfxIniManager::Get();
if ( pIniMgr )
{
pIniMgr->EnterLock();
// Dialog-Mnemonics/Scaling
LanguageType eLang = Application::GetAppInternational().GetLanguage();
Application::EnableAutoMnemonic( pIniMgr->Get( SFX_KEY_INTERNATIONAL_AUTOMNEMONIC,(sal_uInt16) eLang ).CompareToAscii("1") == COMPARE_EQUAL );
Application::SetDialogScaleX( (short)
pIniMgr->Get( SFX_KEY_INTERNATIONAL_DIALOGSCALEX,
(sal_uInt16) eLang ).ToInt32() );
return pIniMgr;
}
}
catch ( ::com::sun::star::registry::InvalidRegistryException& )
{
pIniMgr = NULL;
}
// If some configurtation files are missing or corrupt
// try to start setup. If starting failed show a errorbox and exit application with an error code.
INetURLObject aSetupObj( Application::GetAppFileName(), INET_PROT_FILE );
#if defined(UNX)
aSetupObj.setName( DEFINE_CONST_UNICODE("setup") );
#endif
#if defined(WIN) || defined(WNT) || defined(OS2)
aSetupObj.setName( DEFINE_CONST_UNICODE("setup.exe") );
#endif
#if defined(MAC)
aSetupObj.setName( DEFINE_CONST_UNICODE("Setup") );
#endif
// We must use different messages for fat office and portal.
// A fat office can be repaired by user himself ...
// but portal problems must fixed by an admin!
String aMsg;
if( Application::IsRemoteServer())
{
aMsg += DEFINE_CONST_UNICODE("Your user account is not configured correctly.\n");
aMsg += DEFINE_CONST_UNICODE("Please contact your StarPortal administator.\n");
}
else
{
aMsg += DEFINE_CONST_UNICODE("Configuration files could not be found.\n");
aMsg += DEFINE_CONST_UNICODE("Can't start neither StarOffice nor Setup.\n");
aMsg += DEFINE_CONST_UNICODE("Please try to start setup by yourself.");
}
String aImageName( aSetupObj.PathToFileName() );
::vos::OProcess aProcess( aImageName.GetBuffer() );
::rtl::OUString aArg = ::rtl::OUString::createFromAscii( "/officemode" );
::vos::OArgumentList aList( 1, &aArg );
if ( 0 != aProcess.execute( ::vos::OProcess::TOption_Detached, aList ) )
Application::Abort( aMsg );
exit(-1);
return 0;
}
#endif
This diff is collapsed.
......@@ -2,9 +2,9 @@
*
* $RCSfile: appserv.cxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -195,6 +195,7 @@ struct ApplicationType
String aDomainName;
};
/*
BOOL SfxApplication::InitOfficeAppType_Impl( USHORT nAppId, ApplicationType& rType, BOOL bEmbed )
{
if ( nAppId < SID_START_BEGIN || nAppId > SID_START_END )
......@@ -225,7 +226,7 @@ BOOL SfxApplication::InitOfficeAppType_Impl( USHORT nAppId, ApplicationType& rTy
rType.aPathName = aFullName;
if ( bEmbed )
rType.aParams = DEFINE_CONST_UNICODE( "/embedding" );
rType.aParams = DEFINE_CONST_UNICODE( "-embedding" );
INetURLObject aObj( aFullName, INET_PROT_FILE );
rType.aDomainName = aObj.getBase();
return TRUE;
......@@ -248,6 +249,7 @@ FASTBOOL SfxApplication::PostOfficeAppEvent( USHORT nAppId, const String& rEvent
SvFactory::DecAliveCount();
return bOk;
}
*/
void SfxApplication::BasicLibExec_Impl( SfxRequest &rReq, BasicManager *pMgr )
{
......@@ -389,11 +391,8 @@ void SfxApplication::BasicLibExec_Impl( SfxRequest &rReq, BasicManager *pMgr )
INetURLObject aOld( aFileName, INET_PROT_FILE );
aDest = aOld.GetName();
}
#if SUPD<613//MUSTINI
INetURLObject aNew( SFX_INIMANAGER()->Get( SFX_KEY_BASIC_PATH ).GetToken( 0, ';' ), INET_PROT_FILE );
#else
INetURLObject aNew( SvtPathOptions().GetBasicPath().GetToken( 0, ';' ), INET_PROT_FILE );
#endif
aNew.SetExtension( aExt );
pMgr->SetLibStorageName( nLib, aNew.GetFull() );
SaveBasicManager();
......@@ -634,15 +633,13 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if ( pStringItem )
{
aCfgName = pStringItem->GetValue();
INetURLObject aObj( pStringItem->GetValue(), INET_PROT_FILE );
INetURLObject aObj( pStringItem->GetValue() );
DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" );
if ( aObj.HasError() )
{
// Wenn relativ, ConfigDir verwenden
#if SUPD<613//MUSTINI
aObj.SetSmartURL( SFX_INIMANAGER()->Get( SFX_KEY_USERCONFIG_PATH) );
#else
aObj.SetSmartURL( SvtPathOptions().GetUserConfigPath() );
#endif
aObj.SetURL( SvtPathOptions().GetUserConfigPath() );
aObj.insertName( pStringItem->GetValue() );
aCfgName = aObj.PathToFileName();
}
......@@ -701,15 +698,12 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if ( pStringItem )
{
aCfgName = pStringItem->GetValue();
INetURLObject aObj( pStringItem->GetValue(), INET_PROT_FILE );
INetURLObject aObj( pStringItem->GetValue() );
DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" );
if ( aObj.HasError() )
{
// Wenn relativ, ConfigDir verwenden
#if SUPD<613//MUSTINI
aObj.SetSmartURL( SFX_INIMANAGER()->Get( SFX_KEY_USERCONFIG_PATH) );
#else
aObj.SetSmartURL( SvtPathOptions().GetUserConfigPath() );
#endif
aObj.SetURL( SvtPathOptions().GetUserConfigPath() );
aObj.insertName( pStringItem->GetValue() );
aCfgName = aObj.PathToFileName();
}
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: sfxhelp.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: as $ $Date: 2000-11-08 14:25:41 $
* last change: $Author: mba $ $Date: 2000-11-16 15:30:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -956,19 +956,12 @@ void SfxHelp_Impl::AssertValidHelpDocInfo()
String SfxHelp_Impl::GetHelpPath()
{
#if SUPD<613//MUSTINI
SfxIniManager* pIni = SFX_INIMANAGER()->Find( SFX_KEY_HELP_DIR );
if ( !pIni )
pIni = SFX_INIMANAGER();
String aHelpDir = pIni->Get( SFX_KEY_HELP_DIR );
#else
String aHelpDir = SvtPathOptions().GetHelpPath();
#endif
if ( aHelpDir.Len() )
{
String aPath;
INetURLObject aHelpRoot( aHelpDir, INET_PROT_FILE );
INetURLObject aHelpRoot( aHelpDir );
DBG_ASSERT( aHelpRoot.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
// Nach Prioritaeten das richtige Language-Dir suchen...
LanguageType eLanguage = Application::GetSettings().GetInternational().GetLanguage();
......@@ -989,31 +982,15 @@ String SfxHelp_Impl::GetHelpPath()
}
else
{
INetURLObject aObj( Application::GetAppFileName(), INET_PROT_FILE );
String aProgURL = SvtPathOptions().SubstituteVariable( String::CreateFromAscii("$(PROGURL)") );
INetURLObject aObj( aProgURL );
return aObj.GetMainURL();
}
}
void SfxHelp_Impl::CreatePIStarterList()
{
// Config:
// [Tips]
// Slot=0/1
DBG_ASSERT( !pPIStarterList, "PIStarterList existiert schon!" );
pPIStarterList = new SortedULONGs;
Config aConfig( GetHelpAgentConfig() );
ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
USHORT nTips = aConfig.GetKeyCount();
for ( USHORT nTip = 0; nTip < nTips; nTip++ )
{
if ( (BOOL)(USHORT)aConfig.ReadKey( nTip ).ToInt32() )
{
ULONG nId = aConfig.GetKeyName( nTip ).ToInt32();
if ( nId )
pPIStarterList->Insert( nId );
}
}
}
void SfxHelp_Impl::StartHelpPI( ULONG nHelpId, BOOL bSlot, BOOL bTip )
......@@ -1061,31 +1038,10 @@ void SfxHelp_Impl::StartHelpPI( ULONG nHelpId, BOOL bSlot, BOOL bTip )
void SfxHelp_Impl::EnableTip( ULONG nTip, BOOL bEnable )
{
Config aConfig( GetHelpAgentConfig() );
ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
aConfig.WriteKey( ByteString::CreateFromInt32( nTip ),
ByteString::CreateFromInt32( (USHORT)bEnable ) );
if ( !bEnable )
{
USHORT nPos;
if ( GetPIStarterList()->Seek_Entry( nTip, &nPos ) )
GetPIStarterList()->Remove( nPos );
}
else
GetPIStarterList()->Insert( nTip );
}
void SfxHelp_Impl::ResetPIStarterList()
{
delete pPIStarterList;
pPIStarterList = 0;
Config aConfig( GetHelpAgentConfig() );
ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
USHORT nTips = aConfig.GetKeyCount();
ByteString aOn = ByteString::CreateFromInt32( 1 );
for ( USHORT nTip = 0; nTip < nTips; nTip++ )
aConfig.WriteKey( aConfig.GetKeyName( nTip ), aOn );
}
String SfxHelp_Impl::GetConfigDir( BOOL bGetSharedConfig )
......@@ -1111,14 +1067,6 @@ String SfxHelp_Impl::GetConfigDir( BOOL bGetSharedConfig )
#endif
}
String SfxHelp_Impl::GetHelpAgentConfig()
{
INetURLObject aObj( GetConfigDir( FALSE ), INET_PROT_FILE );
aObj.insertName( String::CreateFromAscii( zsHelpAgentConfig ) );
return aObj.PathToFileName();
}
void SfxHelp::SetCustomHelpFile( const String& rName )
{
SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
......@@ -1263,24 +1211,6 @@ void SfxHelpTipsWindow::Resize()
IMPL_LINK( SfxHelpTipsWindow, ShowTip, void*, EMPTYARG )
{
ULONG nId = 0;
Config aConfig( SfxHelp_Impl::GetHelpAgentConfig() );
ImplSetLanguageGroup( aConfig, DEFINE_CONST_UNICODE("WelcomeScreen"), TRUE );
USHORT nTips = aConfig.GetKeyCount();
for ( USHORT nTip = 0; nTip < nTips; nTip++ )
{
if ( (BOOL)(USHORT)aConfig.ReadKey( nTip ).ToInt32() )
{
nId = aConfig.GetKeyName( nTip ).ToInt32();
break;
}
}
if ( nId )
{
// at the moment no implementation
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment