Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" _ (ByVal hKey As Long, _ ByVal lpSubKey As String, _ ByVal ulOptions As Long, _ ByVal samDesired As Long, _ phkResult As Long) As Long Declare Function RegQueryValueExString Lib "advapi32.dll" Alias "RegQueryValueExA" _ (ByVal hKey As Long, _ ByVal lpValueName As String, _ ByVal lpReserved As Long, _ lpType As Long, _ lpData As String, _ lpcbData As Long) As Long Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias "RegQueryValueExA" _ (ByVal hKey As Long, _ ByVal lpValueName As String, _ ByVal lpReserved As Long, _ lpType As Long, _ lpData As Long, _ lpcbData As Long) As Long Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias "RegQueryValueExA" _ (ByVal hKey As Long, _ ByVal lpValueName As String, _ ByVal lpReserved As Long, _ lpType As Long, _ ByVal lpData As Long, _ lpcbData As Long) As Long Declare Function RegCloseKeyA Lib "advapi32.dll" Alias "RegCloseKey" _ (ByVal hKey As Long) As Long Public Const HKEY_CLASSES_ROOT = &H80000000 Public Const HKEY_CURRENT_USER = &H80000001 Public Const HKEY_LOCAL_MACHINE = &H80000002 Public Const HKEY_USERS = &H80000003 Public Const KEY_ALL_ACCESS = &H3F Public Const REG_OPTION_NON_VOLATILE = 0 Public Const REG_SZ As Long = 1 Public Const REG_DWORD As Long = 4 Public Const ERROR_NONE = 0 Public Const ERROR_BADDB = 1 Public Const ERROR_BADKEY = 2 Public Const ERROR_CANTOPEN = 3 Public Const ERROR_CANTREAD = 4 Public Const ERROR_CANTWRITE = 5 Public Const ERROR_OUTOFMEMORY = 6 Public Const ERROR_INVALID_PARAMETER = 7 Public Const ERROR_ACCESS_DENIED = 8 Public Const ERROR_INVALID_PARAMETERS = 87 Public Const ERROR_NO_MORE_ITEMS = 259 'Public Const KEY_READ = &H20019 Function OpenRegKey(lBaseKey As Long, sKeyName As String) As Variant Dim LocKeyValue Dim hKey as Long Dim lRetValue as Long lRetValue = RegOpenKeyEx(lBaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey) ' lRetValue = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Outlook Express\5.0\Default Settings", "Revocation Checking") If hKey <> 0 Then RegCloseKeyA (hKey) End If OpenRegKey() = lRetValue End Function Function GetDefaultPath(CurOffice as Integer) As String Dim sPath as String Dim Index as Integer Select Case Wizardmode Case SBMICROSOFTMODE Index = Applications(CurOffice,SBAPPLKEY) If GetGUIType = 1 Then ' Windows sPath = QueryValue(HKEY_LOCAL_MACHINE, sKeyName(Index), sValueName(Index)) Else sPath = "" End If If sPath = "" Then sPath = SOWorkPath End If GetDefaultPath = sPath End Select End Function Function GetTemplateDefaultPath(Index as Integer) As String Dim sLocTemplatePath as String Dim sLocProgrampath as String Dim Progstring as String Dim PathList()as String Dim Maxindex as Integer Dim OldsLocTemplatePath Dim sTemplateKeyName as String Dim sTemplateValueName as String On Local Error Goto NOVAlIDSYSTEMPATH Select Case WizardMode Case SBMICROSOFTMODE If GetGUIType = 1 Then ' Windows ' Template directory of Office 97 sTemplateKeyName = "Software\Microsoft\Office\8.0\Common\FileNew\LocalTemplates" sTemplateValueName = "" sLocTemplatePath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName) If sLocTemplatePath = "" Then ' Retrieve the template directory of Office 2000 ' Unfortunately there is no existing note about the template directory in ' the whole registry. ' Programdirectory of Office 2000 sTemplateKeyName = "Software\Microsoft\Office\9.0\Common\InstallRoot" sTemplateValueName = "Path" sLocProgrampath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName) If sLocProgrampath <> "" Then If Right(sLocProgrampath, 1) <> "\" Then sLocProgrampath = sLocProgrampath & "\" End If PathList() = ArrayoutofString(sLocProgrampath,"\",Maxindex) Progstring = "\" & PathList(Maxindex-1) & "\" OldsLocTemplatePath = DeleteStr(sLocProgramPath,Progstring) sLocTemplatePath = OldsLocTemplatePath & "\" & "Templates" ' Does this subdirectory "templates" exist at all If oUcb.Exists(sLocTemplatePath) Then ' If Not the main directory of the office is the base sLocTemplatePath = OldsLocTemplatePath End If Else sLocTemplatePath = SOWorkPath End If End If GetTemplateDefaultPath = ConvertToUrl(sLocTemplatePath) Else GetTemplateDefaultPath = SOWorkPath End If End Select NOVALIDSYSTEMPATH: If Err <> 0 Then GetTemplateDefaultPath() = SOWorkPath Resume ONITGOES ONITGOES: End If End Function Function QueryValueEx(ByVal lhKey, ByVal szValueName As String, vValue As String) As Long Dim cch As Long Dim lrc As Long Dim lType As Long Dim lValue As Long Dim sValue As String Dim Empty On Error GoTo QueryValueExError lrc = RegQueryValueExNULL(lhKey, szValueName, 0&, lType, 0&, cch) If lrc <> ERROR_NONE Then Error 5 Select Case lType Case REG_SZ: sValue = String(cch, 0) lrc = RegQueryValueExString(lhKey, szValueName, 0&, lType, sValue, cch) If lrc = ERROR_NONE Then vValue = Left$(sValue, cch) Else vValue = Empty End If Case REG_DWORD: lrc = RegQueryValueExLong(lhKey, szValueName, 0&, lType, lValue, cch) If lrc = ERROR_NONE Then vValue = lValue End If Case Else lrc = -1 End Select QueryValueExExit: QueryValueEx = lrc Exit Function QueryValueExError: Resume QueryValueExExit End Function Function QueryValue(BaseKey As Long, sKeyName As String, sValueName As String) As Variant Dim lRetVal As Long ' Returnvalue API-Call Dim hKey As Long ' One key handle Dim vValue As String ' Key value lRetVal = RegOpenKeyEx(BaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey) lRetVal = QueryValueEx(hKey, sValueName, vValue) RegCloseKeyA (hKey) QueryValue = vValue End Function alue='distro/mimo/mimo-7-0'>distro/mimo/mimo-7-0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/svtools/source/control/toolbarmenuimp.hxx
AgeCommit message (Expand)Author
2017-01-26Remove dynamic exception specificationsStephan Bergmann
2017-01-19New loplugin:dynexcspec: Add @throws documentation, svtoolsStephan Bergmann
2016-11-01style fixes for cppcheck noExplicitConstructorJochen Nitschke
2016-10-27loplugin:expandablemethods in svtoolsNoel Grandin
2016-10-05Split some stuff from ToolbarMenu to a base classMaxim Monastirsky
2016-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
2016-07-04comphelper::OBaseMutex -> cppu::BaseMutexNoel Grandin
2016-05-12use unique_ptrDavid Tardon
2016-03-09loplugin:constantparam in svtoolsNoel Grandin
2016-02-09Remove excess newlinesChris Sherlock
2016-02-09Formatting changes across all modulesChris Sherlock
2015-10-30com::sun::star->css in svtoolsNoel Grandin
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-09-20convert Link<> to typedNoel Grandin
2015-09-15convert Link<> to typedNoel Grandin
2015-09-07svtools: tdf#88206 replace cppu::WeakImplHelper* etc.Takeshi Abe
2015-07-14loplugin:unusedmethods svtoolsNoel Grandin
2015-06-02cppcheck: noExplicitConstructorCaolán McNamara
2015-04-30Gradually typed LinkStephan Bergmann
2015-04-28Merge remote-tracking branch 'origin/feature/vclptr'Michael Meeks
2015-04-21No more need for PartialWeakComponentImplHelper hereStephan Bergmann
2015-04-15remove unnecessary use of void in function declarationsNoel Grandin
2015-04-10vclwidget: change all vcl::window fields to be wrapped in VclPtrNoel Grandin
2015-01-29callcatcher: large newly detected unused methods post de-virtualizationCaolán McNamara
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin
2014-11-01fdo#84938: replace MIB_ constants with enumNoel Grandin
2014-06-29Typo: beeing->beingJulien Nabet
2014-06-01fdo#68849: Add header guards to all include filesJens Carl
2014-05-08svtools: sal_Bool->boolNoel Grandin
2014-04-01Explicitly mark overriding destructors as "virtual"Stephan Bergmann
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
2014-02-25Remove visual noise from svtoolsAlexander Wilms
2013-09-17fdo#63926: remove extra include paths in svtools/ and sfx2/Marcos Paulo de Souza
2013-08-22convert svtools/source/control/toolbarmenuimp.hxx from String to OUStringNoel Grandin
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák