diff options
author | Oliver Bolte <obo@openoffice.org> | 2007-07-18 07:53:53 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2007-07-18 07:53:53 +0000 |
commit | 95342901a4708ba2575cd24bb0fd28b08ef9d3e0 (patch) | |
tree | c80be94e945150045bf64ef406651d1e88685774 /svtools | |
parent | cad75211b35f72a8e40c6fbdd995914d960aed7a (diff) |
INTEGRATION: CWS fwk67 (1.5.218); FILE MERGED
2007/06/22 11:08:43 cd 1.5.218.1: #i78471# Cleanup - Remove dead code: Mac OS System 9 and earlier
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/reginfo.cxx | 391 | ||||
-rw-r--r-- | svtools/source/control/taskbar.cxx | 14 |
2 files changed, 7 insertions, 398 deletions
diff --git a/svtools/source/control/reginfo.cxx b/svtools/source/control/reginfo.cxx index 4908c0948961..cd6be4916084 100644 --- a/svtools/source/control/reginfo.cxx +++ b/svtools/source/control/reginfo.cxx @@ -4,9 +4,9 @@ * * $RCSfile: reginfo.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obo $ $Date: 2006-09-17 14:39:43 $ + * last change: $Author: obo $ $Date: 2007-07-18 08:53:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,38 +35,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#ifdef MAC -#include "mac_start.h" - -#ifndef __TYPES__ - #include <Types.h> -#endif - -#ifndef __RESOURCES__ - #include <Resources.h> -#endif - -#ifndef __FILES__ - #include <Files.h> -#endif - -#ifndef __ERRORS__ - #include <Errors.h> -#endif - -#ifndef __FOLDERS__ - #include <Folders.h> -#endif - -#ifndef __SCRIPT__ - #include <script.h> -#endif - -#ifndef __FINDER__ - #include <finder.h> -#endif -#include "mac_end.h" -#endif #include "reginfo.hxx" @@ -80,6 +48,7 @@ #define MAXREGVALUE 200 +// ***************************************************************************** #if defined(WIN) || defined(WNT) #include <tools/svwin.h> @@ -228,6 +197,7 @@ void RegInfo::DeleteKey( const String& rKey ) RegDeleteKey( pImp->aGroupHdl, aBStr.GetBuffer() ); } +// ***************************************************************************** #elif defined(OS2) #define INCL_WINSHELLDATA @@ -353,358 +323,7 @@ void RegInfo::DeleteKey( const String& rKey ) HINI_USERPROFILE, pImp->aCurrentApp, rKey, 0); } -#elif defined(MAC) - -/* Idee: - - In eine Resource SV�� (SV<Apfel><Apfel>) sind die Resource IDs - der Gruppen �ber den Namen der Resource zug�nglich. - - �ber die aktuelle Gruppe sind die Values �ber den Namen der Resource - als Key zug�nglich ... -*/ - -// Wir tuen so, als w�ren es "normale" SV-Resourcen - -#define kAPPInfo 'SV��' - -//**************************************************** - -#pragma options align=mac68k - -typedef struct -{ - OSType nResType; // kAPPInfo + k -} - SVGroupInfo, *SVGroupInfoPtr, **SVGroupInfoHdl; - -//**************************************************** - -typedef struct -{ - USHORT nValueLen; - char aValue[1]; // L�nge wie in nLen -} - SVKeyInfo, *SVKeyInfoPtr, **SVKeyInfoHdl; - -//**************************************************** - -#pragma options align=reset - -//**************************************************** - -struct RegInfo_Impl -{ - short nResFile; - OSType nCurrentGroup; - String aCurrentName; - - SVGroupInfoHdl GetNamedInfo(const String& rName); - - BOOL FindInfoFile( const String& rName, FSSpec *pResult ); -}; - -//**************************************************** - -SVGroupInfoHdl RegInfo_Impl::GetNamedInfo(const String& rName) -{ - String aName(rName); - short nOldRes = CurResFile(); - UseResFile(nResFile); - - SVGroupInfoHdl hResult = (SVGroupInfoHdl) Get1NamedResource(kAPPInfo,rName.GetPascalStr()); - - UseResFile(nOldRes); - - return hResult; -} - -//**************************************************** - -BOOL RegInfo_Impl::FindInfoFile( const String& rName, FSSpec *pResult ) -{ - OSErr nErr; - long nDirID; - short nVRefNum; - BOOL bResult = FALSE; - - nErr = FindFolder( kOnSystemDisk, kPreferencesFolderType, - kCreateFolder, &nVRefNum, &nDirID ); - - if ( nErr == noErr ) - { - nErr = FSMakeFSSpec( nVRefNum, nDirID, rName.GetPascalStr(), pResult ); - if ( nErr == fnfErr ) - { - FSpCreateResFile( pResult, 'SDsv', 'DATA', smRoman ); - nErr = FSMakeFSSpec( nVRefNum, nDirID, rName.GetPascalStr(), pResult ); - } - if ( nErr == noErr ) - { - FInfo aInfo; - nErr = FSpGetFInfo( pResult, &aInfo ); - if ( ( nErr == noErr ) && ! ( aInfo.fdFlags & kIsInvisible ) ) - { - aInfo.fdFlags |= kIsInvisible; - nErr = FSpSetFInfo( pResult, &aInfo ); - } - bResult = TRUE; - } - } - - return bResult; -} - -//**************************************************** - -RegInfo::RegInfo() -{ - FSSpec aFile; - - if ( !pImp->FindInfoFile( "svdbt.dll", &aFile ) ) - { - pImp = NULL; - return; - } - - pImp=new RegInfo_Impl; - - short nOldRes = CurResFile(); - pImp->nResFile = FSpOpenResFile( &aFile, fsRdWrPerm ); - pImp->nCurrentGroup = 0L; - UseResFile( nOldRes ); - - if ( pImp->nResFile < 0 ) - { - delete pImp; - pImp = NULL; - } -} - -//**************************************************** - -RegInfo::~RegInfo() -{ - if (pImp) - { - CloseResFile( pImp->nResFile ); - delete pImp; - } -} - -//**************************************************** - -String RegInfo::GetKeyName( USHORT nKey ) const -{ - String aResult; - - if (!pImp || !pImp -> nCurrentGroup) - return aResult; - - short nOldRes = CurResFile(); - UseResFile(pImp -> nResFile); - - SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1IndResource(pImp -> nCurrentGroup,nKey + 1); - - if (hKeyInfo) - { - Str255 aName; - ResType nType; - short nMacKey; - - GetResInfo((Handle) hKeyInfo,&nMacKey,&nType,aName); - if (ResError() == noErr) - aResult = String((char*) &aName[1], aName[0]); - } - - UseResFile(nOldRes); - return aResult; -} - -//**************************************************** - -USHORT RegInfo::GetKeyCount() const -{ - USHORT nResult = 0; - - if (pImp -> nCurrentGroup) - { - short nOldRes = CurResFile(); - UseResFile(pImp -> nResFile); - - nResult = Count1Resources(pImp -> nCurrentGroup); - UseResFile(nOldRes); - } - return nResult; -} - -//**************************************************** - -void RegInfo::SetAppGroup( const String& rGroup ) -{ - if (!pImp) - return; - - pImp->aCurrentName = rGroup; - SVGroupInfoHdl hGroup = pImp -> GetNamedInfo(rGroup); - if (hGroup) - { - pImp->nCurrentGroup = (*hGroup)-> nResType; - ReleaseResource((Handle) hGroup); - } - else - pImp->nCurrentGroup = 0L; -} - -//**************************************************** - -void RegInfo::DeleteAppGroup( const String &rGroup ) -{ - SVGroupInfoHdl hToDelete = pImp -> GetNamedInfo(rGroup); - if (hToDelete) - { - if ((*hToDelete)-> nResType == pImp->nCurrentGroup) - { - pImp->nCurrentGroup = 0L; - pImp->aCurrentName.Erase(); - } - RemoveResource((Handle) hToDelete); - } -} - -//**************************************************** - -String RegInfo::ReadKey( const String& rKey ) const -{ - String aResult; - - if (!pImp || !pImp -> nCurrentGroup) - return aResult; - - short nOldRes = CurResFile(); - UseResFile(pImp -> nResFile); - - SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp->nCurrentGroup,rKey.GetPascalStr()); - - if (hKeyInfo) - { - HLock((Handle) hKeyInfo); - aResult = String((*hKeyInfo)->aValue, (*hKeyInfo)->nValueLen); - HUnlock((Handle) hKeyInfo); - - ReleaseResource((Handle) hKeyInfo); - } - - UseResFile(nOldRes); - return aResult; -} - -//**************************************************** - -String RegInfo::ReadKey( const String& rKey, const String &rDefault ) const -{ - String aResult = ReadKey(rKey); - if (!aResult.Len()) - return rDefault; - else - return aResult; -} - -//**************************************************** - -void RegInfo::WriteKey( const String& rKey, const String& rValue ) -{ - if (!pImp) - return; - - short nOldRes = CurResFile(); - UseResFile(pImp -> nResFile); - - // Wenn wir noch keine Resource zur aktuellen Gruppe haben ... - if (!pImp -> nCurrentGroup) - { - // ... dann muessen wir hier eine Anlegen - - if (!pImp -> aCurrentName.Len()) - return; // Kein aktueller Name ??? - - short nNewId = Unique1ID(kAPPInfo); - - SVGroupInfoHdl hNewInfo = (SVGroupInfoHdl) NewHandle(sizeof(SVGroupInfo)); - - // Die Neue Resource liegt im Bereich �ber "SV��" - pImp -> nCurrentGroup = kAPPInfo + nNewId; - - (*(hNewInfo))-> nResType = pImp -> nCurrentGroup; - DBG_ASSERT(CurResFile() == pImp -> nResFile,"wrong ResFile"); - AddResource((Handle) hNewInfo ,kAPPInfo, nNewId, pImp -> aCurrentName.GetPascalStr()); - ReleaseResource((Handle) hNewInfo); - } - - SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp -> nCurrentGroup,rKey.GetPascalStr()); - int nNewSize = rValue.Len() + sizeof(USHORT); - - // Haben wir zu diesem Key schon eine Resource ? - if (hKeyInfo) - { - int nSize = GetHandleSize((Handle) hKeyInfo); - OSErr nMemErr = noErr; - if (nSize < nNewSize) - { - SetHandleSize((Handle) hKeyInfo,nNewSize); - nMemErr = MemError(); - } - - if (nMemErr == noErr) - { - (*hKeyInfo)->nValueLen = rValue.Len(); - BlockMoveData(rValue.GetStr(), (*hKeyInfo)->aValue, rValue.Len()); - ChangedResource((Handle) hKeyInfo); - } - else // Handle konnte nicht groesser werden - RemoveResource((Handle) hKeyInfo); - } - else - { - // Resource zu diesemm Key neu anlegen - - hKeyInfo = (SVKeyInfoHdl) NewHandle(nNewSize); - if (hKeyInfo) - { - short nNewId = Unique1ID(pImp -> nCurrentGroup); - - (*hKeyInfo)->nValueLen = rValue.Len(); - BlockMoveData(rValue.GetStr(), (*hKeyInfo)->aValue, rValue.Len()); - - AddResource((Handle) hKeyInfo ,pImp -> nCurrentGroup, nNewId, rKey.GetPascalStr()); - } - } - - UseResFile(nOldRes); -} - -//**************************************************** - -void RegInfo::DeleteKey( const String& rKey ) -{ - // Wenn wir noch keine aktuellen Gruppe haben ... - if (!pImp -> nCurrentGroup) - return; - - String aKey(rKey); - - short nOldRes = CurResFile(); - UseResFile(pImp -> nResFile); - - SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp -> nCurrentGroup,rKey.GetPascalStr()); - - if (hKeyInfo) - RemoveResource((Handle) hKeyInfo); - - UseResFile(nOldRes); -} - -//**************************************************** +// ***************************************************************************** #else diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx index b5aa497ad31d..8a9af6c342a0 100644 --- a/svtools/source/control/taskbar.cxx +++ b/svtools/source/control/taskbar.cxx @@ -4,9 +4,9 @@ * * $RCSfile: taskbar.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obo $ $Date: 2006-09-17 14:41:33 $ + * last change: $Author: obo $ $Date: 2007-07-18 08:53:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -243,11 +243,6 @@ void TaskBar::Tracking( const TrackingEvent& rTEvt ) { Size aSize = GetOutputSizePixel(); -#ifdef MAC - if ( !Application::IsFullScreenMode() ) - aSize.Width() -= 17; -#endif - long nMouseX = rTEvt.GetMouseEvent().GetPosPixel().X()-mnMouseOff; if ( nMouseX < 0 ) nMouseX = 0; @@ -321,11 +316,6 @@ void TaskBar::Resize() long nNewStatusX = -1; long nTaskHeight = aSize.Height() - (TASKBAR_OFFY*2); -#ifdef MAC - if ( !Application::IsFullScreenMode() ) - aSize.Width() -= 17; -#endif - if ( mnWinBits & WB_BORDER ) { nTaskHeight -= TASKBAR_BORDER; |