summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/reg4msdoc
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source/win32/customactions/reg4msdoc')
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/constants.hxx14
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx10
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/register.cxx116
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/register.hxx6
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrar.cxx234
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrar.hxx44
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx22
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx68
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registry.cxx34
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registry.hxx64
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx12
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx20
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx16
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx24
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx6
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx32
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx36
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx8
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx4
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx30
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx24
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx8
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx10
26 files changed, 538 insertions, 538 deletions
diff --git a/setup_native/source/win32/customactions/reg4msdoc/constants.hxx b/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
index 21b576b97dda..4caab9211f78 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,18 +25,18 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _CONSTANTS_HXX_
#define _CONSTANTS_HXX_
-
+
extern const int MSWORD;
extern const int MSEXCEL;
-extern const int MSPOWERPOINT;
-extern const int DEFAULT_HTML_EDITOR_FOR_IE;
-extern const int HTML_EDITOR;
+extern const int MSPOWERPOINT;
+extern const int DEFAULT_HTML_EDITOR_FOR_IE;
+extern const int HTML_EDITOR;
extern const int DEFAULT_SHELL_HTML_EDITOR;
#endif
-
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
index 648d4f33fdd3..f1f2f59822df 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
@@ -17,7 +17,7 @@ bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value)
MsiGetProperty(handle, name, buff, &sz);
value = buff;
return true;
- }
+ }
return false;
}
@@ -47,7 +47,7 @@ bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name)
bool IsAllUserInstallation(MSIHANDLE handle)
{
- return IsSetMsiProp(handle, TEXT("ALLUSERS"));
+ return IsSetMsiProp(handle, TEXT("ALLUSERS"));
}
std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
@@ -58,7 +58,7 @@ std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
}
std::wstring GetOfficeExecutablePath(MSIHANDLE handle)
-{
+{
std::wstring exepath = GetOfficeInstallationPath(handle);
exepath += TEXT("program\\soffice.exe");
return exepath;
@@ -68,7 +68,7 @@ std::wstring GetProductName(MSIHANDLE handle)
{
std::wstring prodname;
GetMsiProp(handle, TEXT("ProductName"), prodname);
- return prodname;
+ return prodname;
}
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name)
@@ -92,7 +92,7 @@ bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name)
INSTALLSTATE current_state;
INSTALLSTATE future_state;
MsiGetFeatureState(handle, name, &current_state, &future_state);
- return ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_ABSENT));
+ return ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_ABSENT));
}
bool IsCompleteDeinstallation(MSIHANDLE handle)
diff --git a/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx b/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
index 483a66986859..2ff1a880f12e 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
@@ -15,43 +15,43 @@
#include <string>
/**
- Get the value of the named property
-
+ Get the value of the named property
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the property.
-
+
@param value
[out] receives thes value of the property.
-
- @returns
+
+ @returns
<TRUE/>if the property was found.
*/
bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value);
/**
- Set the value of a binary property which can only
+ Set the value of a binary property which can only
have the values "0" or "1" to "1".
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
- [in] the name of the property.
+ [in] the name of the property.
*/
void SetMsiProp(MSIHANDLE handle, LPCTSTR name);
/**
- Set the value of a binary property which can only
+ Set the value of a binary property which can only
have the values "0" or "1" to "0".
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
- [in] the name of the property.
+ [in] the name of the property.
*/
void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
@@ -59,7 +59,7 @@ void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
Returns whether a certain property is set meaning
its value is "1". This method should be used for
binary properties whose value can be "0" or "1".
-
+
@returns
<TRUE/>if the value of the specified property is
"1" else if the property is not defined or its
@@ -71,7 +71,7 @@ bool IsSetMsiProp(MSIHANDLE handle, LPCTSTR name);
Returns whether a certain property is set meaning
its value is not empty. This method should be used for
properties, that can have different values.
-
+
@returns
<TRUE/>if the value of the specified property is
not empty. If it is empty <FALSE/> will be returned.
@@ -80,10 +80,10 @@ bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name);
/**
Query if this is an installation for all user or not.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
<TRUE/>if this is an all user installation
*/
@@ -92,10 +92,10 @@ bool IsAllUserInstallation(MSIHANDLE handle);
/**
Returns the destination folder of the office installation
as system path. The returned path contains a final '\'.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
the destination path of the office installation finalized
with a '\'.
@@ -105,10 +105,10 @@ std::wstring GetOfficeInstallationPath(MSIHANDLE handle);
/**
Returns the absolute path of the office executable that
will be installed as system path.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
the absolute system path of the office executable (e.g.
(C:\Program Files\StarOffice 8\program\soffice.exe").
@@ -118,25 +118,25 @@ std::wstring GetOfficeExecutablePath(MSIHANDLE handle);
/**
Get the name of the office that will be installed
(e.g. StarOffice 8, StarSuite 8, ...).
-
+
@param handle
[in] a valid msi handle.
-
- @returns
+
+ @returns
the name of the office product that will be installed.
*/
std::wstring GetProductName(MSIHANDLE handle);
/**
Determine if the specified module is installed locally.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
- @returns
+
+ @returns
<TRUE/>if the specified module is installed locally.
*/
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
@@ -144,39 +144,39 @@ bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
/**
Determine if the specified module is selected to be installed
locally.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
+
@returns
- <TRUE/>if the specified module is about to be installed locally.
+ <TRUE/>if the specified module is about to be installed locally.
*/
bool IsModuleSelectedForInstallation(MSIHANDLE handle, LPCTSTR name);
/**
Determine if the specified module which is locally installed is
selected for deinstallation.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
- @returns
+
+ @returns
<TRUE/>if the specified module is about to be deinstalled.
*/
bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name);
/**
Determine whether this is a complete uninstallation or not.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
<TRUE/>if this is a complete deinstallation.
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
index e3f930ccfcbd..538f45339851 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -29,7 +29,7 @@
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
-#define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <msiquery.h>
#ifdef _MSC_VER
@@ -62,29 +62,29 @@ void DeterminePowerPointPreselectionState(MSIHANDLE handle)
}
extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
-{
+{
//MessageBox(NULL, TEXT("InstallUiSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Wrt_Bin")))
{
DetermineWordPreselectionState(handle);
}
- else if (IsModuleInstalled(handle, TEXT("gm_p_Wrt_Bin")) &&
- !IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")) &&
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Wrt_Bin")) &&
+ !IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")) &&
IsRegisteredFor(handle, MSWORD))
- {
+ {
SetMsiProp(handle, TEXT("SELECT_WORD"));
- }
+ }
else
{
UnsetMsiProp(handle, TEXT("SELECT_WORD"));
}
-
- if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Calc_Bin")))
+
+ if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Calc_Bin")))
{
- DetermineExcelPreselectionState(handle);
- }
- else if (IsModuleInstalled(handle, TEXT("gm_p_Calc_Bin")) &&
+ DetermineExcelPreselectionState(handle);
+ }
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Calc_Bin")) &&
!IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Calc_Bin")) &&
IsRegisteredFor(handle, MSEXCEL))
{
@@ -94,21 +94,21 @@ extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
{
UnsetMsiProp(handle, TEXT("SELECT_EXCEL"));
}
-
- if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Impress_Bin")))
+
+ if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Impress_Bin")))
{
DeterminePowerPointPreselectionState(handle);
- }
- else if (IsModuleInstalled(handle, TEXT("gm_p_Impress_Bin")) &&
+ }
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Impress_Bin")) &&
!IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Impress_Bin")) &&
IsRegisteredFor(handle, MSPOWERPOINT))
{
- SetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
- }
+ SetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
+ }
else
{
UnsetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
- }
+ }
SetMsiProp(handle, TEXT("UI_SEQUENCE_EXECUTED"));
@@ -118,17 +118,17 @@ extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE handle)
{
//MessageBox(NULL, TEXT("InstallExecSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
// Do nothing in repair mode.
// Then UI_SEQUENCE_EXECUTED is not set and Installed is set!
// In silent installation UI_SEQUENCE_EXECUTED is also not set, but Installed is not set.
if ((!IsSetMsiProp(handle, TEXT("UI_SEQUENCE_EXECUTED"))) && (IsMsiPropNotEmpty(handle, TEXT("Installed")))) { return ERROR_SUCCESS; }
-
+
int reg4 = 0;
int unreg4 = 0;
-
- // we always register as html editor for Internet Explorer
- // if writer is installed because there's no harm if we do so
+
+ // we always register as html editor for Internet Explorer
+ // if writer is installed because there's no harm if we do so
if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Wrt_Bin")))
reg4 |= HTML_EDITOR;
@@ -136,54 +136,54 @@ extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE handle)
reg4 |= MSWORD;
else if (!IsSetMsiProp(handle, TEXT("SELECT_WORD")) && IsRegisteredFor(handle, MSWORD))
unreg4 |= MSWORD;
-
+
if (IsSetMsiProp(handle, TEXT("SELECT_EXCEL")) && !IsRegisteredFor(handle, MSEXCEL))
reg4 |= MSEXCEL;
else if (!IsSetMsiProp(handle, TEXT("SELECT_EXCEL")) && IsRegisteredFor(handle, MSEXCEL))
unreg4 |= MSEXCEL;
-
+
if (IsSetMsiProp(handle, TEXT("SELECT_POWERPOINT")) && !IsRegisteredFor(handle, MSPOWERPOINT))
reg4 |= MSPOWERPOINT;
else if (!IsSetMsiProp(handle, TEXT("SELECT_POWERPOINT")) && IsRegisteredFor(handle, MSPOWERPOINT))
unreg4 |= MSPOWERPOINT;
-
+
if (reg4)
- {
+ {
Register4MsDoc(handle, reg4);
}
-
+
if (unreg4)
- {
+ {
Unregister4MsDoc(handle, unreg4);
- }
+ }
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE handle)
-{
+{
//MessageBox(NULL, TEXT("DeinstallExecSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
if (IsCompleteDeinstallation(handle))
{
- Unregister4MsDocAll(handle);
+ Unregister4MsDocAll(handle);
return ERROR_SUCCESS;
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")))
{
Unregister4MsDoc(handle, MSWORD | HTML_EDITOR);
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Calc_Bin")))
{
Unregister4MsDoc(handle, MSEXCEL);
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Impress_Bin")))
{
Unregister4MsDoc(handle, MSPOWERPOINT);
}
-
+
return ERROR_SUCCESS;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.cxx b/setup_native/source/win32/customactions/reg4msdoc/register.cxx
index a23d0ea67934..21d6d7e8f822 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/register.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/register.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,25 +56,25 @@ namespace /* private */
RegistrarPtr CreateRegistrar(bool InstallForAllUser, const RegistrationContextInformation& RegCtx)
{
RegistrarPtr RegPtr;
-
+
if (InstallForAllUser)
RegPtr = RegistrarPtr(new Registrar(RegCtx));
else
RegPtr = RegistrarPtr(new UserRegistrar(RegCtx));
-
+
return RegPtr;
}
} // namespace private
bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Register)
-{
+{
bool preselect = false;
-
+
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if (Register & MSWORD)
preselect = CurrentRegistrar->QueryPreselectMsWordRegistration();
else if (Register & MSEXCEL)
@@ -85,9 +85,9 @@ bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Regis
catch(RegistryException&)
{
assert(false);
- }
+ }
return preselect;
-}
+}
//-----------------------------------------
// registers StarOffice for MS document
@@ -96,24 +96,24 @@ bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Regis
//-----------------------------------------
void Register4MsDoc(MSIHANDLE handle, int Register)
-{
+{
try
- {
+ {
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if ((Register & MSWORD))
- CurrentRegistrar->RegisterForMsWord();
-
+ CurrentRegistrar->RegisterForMsWord();
+
if ((Register & MSEXCEL))
CurrentRegistrar->RegisterForMsExcel();
-
+
if ((Register & MSPOWERPOINT))
CurrentRegistrar->RegisterForMsPowerPoint();
-
+
if ((Register & HTML_EDITOR))
CurrentRegistrar->RegisterAsHtmlEditorForInternetExplorer();
-
+
if ((Register & DEFAULT_SHELL_HTML_EDITOR))
{
CurrentRegistrar->RegisterAsDefaultHtmlEditorForInternetExplorer();
@@ -124,33 +124,33 @@ void Register4MsDoc(MSIHANDLE handle, int Register)
{
assert(false);
}
-
+
if (Register)
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
}
void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if ((Unregister & MSWORD) && CurrentRegistrar->IsRegisteredFor(MSWORD))
CurrentRegistrar->UnregisterForMsWord();
-
+
if ((Unregister & HTML_EDITOR) && CurrentRegistrar->IsRegisteredFor(HTML_EDITOR))
CurrentRegistrar->UnregisterAsHtmlEditorForInternetExplorer();
-
+
if ((Unregister & MSEXCEL) && CurrentRegistrar->IsRegisteredFor(MSEXCEL))
CurrentRegistrar->UnregisterForMsExcel();
-
+
if ((Unregister & MSPOWERPOINT) && CurrentRegistrar->IsRegisteredFor(MSPOWERPOINT))
CurrentRegistrar->UnregisterForMsPowerPoint();
-
+
if ((Unregister & DEFAULT_HTML_EDITOR_FOR_IE) && CurrentRegistrar->IsRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE))
CurrentRegistrar->UnregisterAsDefaultHtmlEditorForInternetExplorer();
-
+
if ((Unregister & DEFAULT_SHELL_HTML_EDITOR) && CurrentRegistrar->IsRegisteredFor(DEFAULT_SHELL_HTML_EDITOR))
CurrentRegistrar->UnregisterAsDefaultShellHtmlEditor();
}
@@ -158,9 +158,9 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
{
assert(false);
}
-
+
if (Unregister)
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
}
//-----------------------------------------
@@ -168,14 +168,14 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
// registry entries
// Algorithm:
//
-// 1.
+// 1.
// Target key exist (e.g. '.doc')
// Default value == soffice.?
// Backup key != empty
// Action: Replace Default value with backup
// key
//
-// 2.
+// 2.
// Target key exist
// Default value == soffice.?
// Backup key == empty
@@ -188,16 +188,16 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
//
// 4.
// Target key does not exist
-// Action: nop
+// Action: nop
//-----------------------------------------
void Unregister4MsDocAll(MSIHANDLE handle)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
CurrentRegistrar->UnregisterAllAndCleanUpRegistry();
}
catch(RegistryException&)
@@ -212,12 +212,12 @@ void Unregister4MsDocAll(MSIHANDLE handle)
//-----------------------------------------
void RepairRegister4MsDocSettings(MSIHANDLE handle)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
CurrentRegistrar->RepairRegistrationState();
}
catch(RegistryException&)
@@ -227,14 +227,14 @@ void RepairRegister4MsDocSettings(MSIHANDLE handle)
}
bool IsRegisteredFor(MSIHANDLE handle, int State)
-{
+{
bool Registered = false;
-
+
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
Registered = CurrentRegistrar->IsRegisteredFor(State);
}
catch(RegistryException&)
@@ -255,24 +255,24 @@ int FixReturnRegistrationState(MSIHANDLE handle)
try
{
- WindowsRegistry registry;
+ WindowsRegistry registry;
RegistryValue rv_regmsdocstate = RegistryValue(
new RegistryValueImpl(REGMSDOCSTATE, 0));
-
+
RegistryKey so_bak_key;
if (IsAllUserInstallation(handle))
{
RegistryKey hkcr_key = registry.GetClassesRootKey();
-
+
if (hkcr_key->HasSubKey(SO_BACKUP_KEY))
so_bak_key = hkcr_key->OpenSubKey(SO_BACKUP_KEY);
else
- so_bak_key = hkcr_key->CreateSubKey(SO_BACKUP_KEY);
+ so_bak_key = hkcr_key->CreateSubKey(SO_BACKUP_KEY);
if (!so_bak_key->HasValue(REGMSDOCSTATE))
- {
+ {
// set a defined value
so_bak_key->SetValue(rv_regmsdocstate);
@@ -280,37 +280,37 @@ int FixReturnRegistrationState(MSIHANDLE handle)
if (hklm_key->HasSubKey(SO60_UNINSTALL_KEY))
{
- RegistryKey so_uninst_key =
+ RegistryKey so_uninst_key =
hklm_key->OpenSubKey(SO60_UNINSTALL_KEY);
if (so_uninst_key->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
- }
- }
+ so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
+ }
+ }
}
- else
+ else
{
- RegistryKey hkcu_classes_key =
+ RegistryKey hkcu_classes_key =
registry.GetCurrentUserKey()->OpenSubKey(SOFTWARE_CLASSES);
-
+
so_bak_key = hkcu_classes_key->CreateSubKey(SO_BACKUP_KEY);
-
+
if (!so_bak_key->HasValue(REGMSDOCSTATE))
{
// set a defined value
so_bak_key->SetValue(rv_regmsdocstate);
- RegistryKey hklm_sftw_classes =
+ RegistryKey hklm_sftw_classes =
registry.GetLocalMachineKey()->OpenSubKey(SOFTWARE_CLASSES, false);
-
+
RegistryKey so_bak_key_old;
if (hklm_sftw_classes->HasSubKey(SO_BACKUP_KEY))
{
so_bak_key_old = hklm_sftw_classes->OpenSubKey(SO_BACKUP_KEY, false);
-
+
if (so_bak_key_old->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_bak_key_old, REGMSDOCSTATE);
+ so_bak_key->CopyValue(so_bak_key_old, REGMSDOCSTATE);
}
else // try the uninstall key
{
@@ -318,16 +318,16 @@ int FixReturnRegistrationState(MSIHANDLE handle)
if (hklm_key->HasSubKey(SO60_UNINSTALL_KEY))
{
- RegistryKey so_uninst_key =
+ RegistryKey so_uninst_key =
hklm_key->OpenSubKey(SO60_UNINSTALL_KEY);
if (so_uninst_key->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
+ so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
}
}
}
- }
-
+ }
+
rv_regmsdocstate = so_bak_key->GetValue(REGMSDOCSTATE);
registration_state = rv_regmsdocstate->GetDataAsInt();
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.hxx b/setup_native/source/win32/customactions/reg4msdoc/register.hxx
index 964c4be894df..10d600776e97 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/register.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/register.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTER_HXX_
#define _REGISTER_HXX_
@@ -71,7 +71,7 @@ bool IsRegisteredFor(MSIHANDLE handle, int State);
application type or not */
bool query_preselect_registration_for_ms_application(
MSIHANDLE handle, int Register);
-
+
// StarOffice 6.0 saved the registration
// state in HKEY_LOCAL_MACHINE\Software\
// Microsoft\Windows\CurrentVersion\Uninstall\
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
index 45fbed4819d2..12316bc9adf6 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
@@ -35,9 +35,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
const int MSWORD = 0x1;
const int MSEXCEL = 0x2;
-const int MSPOWERPOINT = 0x4;
-const int DEFAULT_HTML_EDITOR_FOR_IE = 0x8;
-const int HTML_EDITOR = 0x10;
+const int MSPOWERPOINT = 0x4;
+const int DEFAULT_HTML_EDITOR_FOR_IE = 0x8;
+const int HTML_EDITOR = 0x10;
const int DEFAULT_SHELL_HTML_EDITOR = 0x20;
namespace /* private */
@@ -53,7 +53,7 @@ namespace /* private */
const std::wstring MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD = L"Software\\Microsoft\\Internet Explorer\\Default HTML Editor\\shell\\edit\\command";
}
-Registrar::Registrar(const RegistrationContextInformation& RegContext) :
+Registrar::Registrar(const RegistrationContextInformation& RegContext) :
m_ContextInformation(RegContext),
FORWARD_KEY_PREFIX(L"OpenOffice.org"),//FORWARD_KEY_PREFIX(L"soffice6"),
DEFAULT_VALUE_NAME(L""),
@@ -69,9 +69,9 @@ Registrar::~Registrar()
}
void Registrar::RegisterForMsWord() const
-{
+{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetWordDocumentFileExtension(),
m_ContextInformation.GetWordDocumentDisplayName(),
@@ -79,15 +79,15 @@ void Registrar::RegisterForMsWord() const
m_ContextInformation.GetWordDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Writer);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetWordTemplateFileExtension(),
m_ContextInformation.GetWordTemplateDisplayName(),
m_ContextInformation.GetWordTemplateDefaultIconEntry(),
m_ContextInformation.GetWordTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
- RegistrationContextInformation::Writer);
-
+ RegistrationContextInformation::Writer);
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetRtfDocumentFileExtension(),
m_ContextInformation.GetRtfDocumentDisplayName(),
@@ -95,7 +95,7 @@ void Registrar::RegisterForMsWord() const
m_ContextInformation.GetRtfDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Writer);
-
+
SaveRegisteredFor(MSWORD);
}
@@ -114,7 +114,7 @@ void Registrar::UnregisterForMsWord() const
try
{
UnregisterForMsOfficeApplication(
- m_ContextInformation.GetWordTemplateFileExtension());
+ m_ContextInformation.GetWordTemplateFileExtension());
}
catch(RegistryKeyNotFoundException&)
{}
@@ -138,7 +138,7 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
// MS Office applications already exist if we are about to
// register in HKCU\Software\Classes
RegistryKey root_key = WindowsRegistry().GetClassesRootKey();
-
+
if (!root_key->HasSubKey(file_extension))
{
preselect = true;
@@ -147,7 +147,7 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
else
{
RegistryKey RegKey = root_key->OpenSubKey(file_extension, false);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
@@ -169,12 +169,12 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
preselect = true;
OutputDebugStringFormat( TEXT("QueryPreselect: No default found for SubKey (%s), preselected!\n"), file_extension.c_str() );
}
- }
+ }
return preselect;
}
bool Registrar::QueryPreselectMsWordRegistration() const
-{
+{
return QueryPreselectForMsApplication(
m_ContextInformation.GetWordDocumentFileExtension());
}
@@ -182,7 +182,7 @@ bool Registrar::QueryPreselectMsWordRegistration() const
void Registrar::RegisterForMsExcel() const
{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetExcelSheetFileExtension(),
m_ContextInformation.GetExcelSheetDisplayName(),
@@ -198,14 +198,14 @@ void Registrar::RegisterForMsExcel() const
m_ContextInformation.GetExcelTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Calc);
-
+
SaveRegisteredFor(MSEXCEL);
}
void Registrar::UnregisterForMsExcel() const
{
assert(m_RootKey.get());
-
+
try
{
UnregisterForMsOfficeApplication(
@@ -234,7 +234,7 @@ bool Registrar::QueryPreselectMsExcelRegistration() const
void Registrar::RegisterForMsPowerPoint() const
{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointDocumentFileExtension(),
m_ContextInformation.GetPowerPointDocumentDisplayName(),
@@ -242,7 +242,7 @@ void Registrar::RegisterForMsPowerPoint() const
m_ContextInformation.GetPowerPointDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Impress);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointShowFileExtension(),
m_ContextInformation.GetPowerPointShowDisplayName(),
@@ -250,22 +250,22 @@ void Registrar::RegisterForMsPowerPoint() const
m_ContextInformation.GetPowerPointShowDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Impress);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointTemplateFileExtension(),
m_ContextInformation.GetPowerPointTemplateDisplayName(),
m_ContextInformation.GetPowerPointTemplateDefaultIconEntry(),
m_ContextInformation.GetPowerPointTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
- RegistrationContextInformation::Impress);
-
+ RegistrationContextInformation::Impress);
+
SaveRegisteredFor(MSPOWERPOINT);
}
void Registrar::UnregisterForMsPowerPoint() const
{
assert(m_RootKey.get());
-
+
try
{
UnregisterForMsOfficeApplication(
@@ -307,46 +307,46 @@ bool Registrar::QueryPreselectMsPowerPointRegistration() const
make the following entries to register
a html editor for the Internet Explorer
HKCR\.htm\OpenWithList\App Friendly Name\shell\edit\command
- But the reality shows that this works only
- with Internet Explorer 5.x
- Internet Explorer 6.0 wants the follwoing
+ But the reality shows that this works only
+ with Internet Explorer 5.x
+ Internet Explorer 6.0 wants the follwoing
entries:
HKCR\.htm\OpenWithList\App.exe
- HKCR\Applications\App.ex\shell\edit\command
+ HKCR\Applications\App.ex\shell\edit\command
*/
void Registrar::RegisterAsHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
std::wstring OOFriendlyAppName = m_ContextInformation.GetOpenOfficeFriendlyAppName();
-
+
std::wstring RegKeyName = HTM_OPENWITHLIST + std::wstring(L"\\") + OOFriendlyAppName;
RegistryKey RegKey = m_RootKey->CreateSubKey(RegKeyName);
-
+
RegKey = RegKey->CreateSubKey(SHELL_EDIT_COMMAND);
-
+
RegistryValue RegVal(
new RegistryValueImpl(
- DEFAULT_VALUE_NAME,
+ DEFAULT_VALUE_NAME,
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer)));
-
+
RegKey->SetValue(RegVal);
-
+
RegKeyName = APPLICATIONS + std::wstring(L"\\") + OOFriendlyAppName;
RegKey = m_RootKey->CreateSubKey(RegKeyName);
-
+
RegVal->SetName(L"FriendlyAppName");
RegVal->SetValue(OOFriendlyAppName);
RegKey->SetValue(RegVal);
-
+
RegKey = RegKey->CreateSubKey(SHELL_EDIT_COMMAND);
RegVal->SetName(DEFAULT_VALUE_NAME);
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
- RegistrationContextInformation::Writer));
+ RegistrationContextInformation::Writer));
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(HTML_EDITOR);
}
@@ -375,75 +375,75 @@ void Registrar::UnregisterAsHtmlEditorForInternetExplorer() const
void Registrar::RegisterAsDefaultHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegistrationRootKey = GetRootKeyForDefHtmlEditorForIERegistration();
-
+
RegistryKey RegKey = RegistrationRootKey->CreateSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
-
+
RegistryValue RegVal = RegistryValue(new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos == CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + DEFAULT_HTML_EDITOR);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
- BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME);
-
+ BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME);
+
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
if (RegKey->HasValue(L"Description"))
BackupRegKey->CopyValue(RegKey, L"Description");
}
}
-
+
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer));
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
RegKey->SetValue(RegVal);
-
+
RegVal->SetName(L"Description");
RegVal->SetValue(m_ContextInformation.GetOpenOfficeFriendlyAppName());
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE);
}
void Registrar::UnregisterAsDefaultHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegistrationRootKey = GetRootKeyForDefHtmlEditorForIERegistration();
-
+
RegistryKey RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos != CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->OpenSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
if (BackupRegKey->HasSubKey(DEFAULT_HTML_EDITOR))
{
BackupRegKey = BackupRegKey->OpenSubKey(DEFAULT_HTML_EDITOR);
-
+
if (BackupRegKey->HasValue(DEFAULT_VALUE_NAME))
RegKey->CopyValue(BackupRegKey, DEFAULT_VALUE_NAME);
else
RegKey->DeleteValue(DEFAULT_VALUE_NAME);
- RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
-
+ RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
+
if (BackupRegKey->HasValue(L"Description"))
RegKey->CopyValue(BackupRegKey, L"Description");
else
@@ -451,91 +451,91 @@ void Registrar::UnregisterAsDefaultHtmlEditorForInternetExplorer() const
}
else
{
- RegKey->DeleteValue(DEFAULT_VALUE_NAME);
+ RegKey->DeleteValue(DEFAULT_VALUE_NAME);
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
RegKey->DeleteValue(L"Description");
- }
+ }
}
}
-
+
SaveNotRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE);
}
void Registrar::RegisterAsDefaultShellHtmlEditor() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(L".htm");
-
+
RegistryValue RegVal = RegistryValue(
new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
- std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
+
+ std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
if (0 == HtmFwdKey.length() || !m_RootKey->HasSubKey(HtmFwdKey))
HtmFwdKey = L".htm";
-
+
RegKey = m_RootKey->CreateSubKey(HtmFwdKey + L"\\" + SHELL_EDIT_COMMAND);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
// backup old values if we are not in place
if (std::wstring::npos == CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + HTML_EDIT);
BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME, SHELL_EDIT_COMMAND_BACKUP);
- }
+ }
}
-
+
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer));
-
+
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(DEFAULT_SHELL_HTML_EDITOR);
}
void Registrar::UnregisterAsDefaultShellHtmlEditor() const
{
assert(m_RootKey.get());
-
+
try
{
RegistryKey RegKey = m_RootKey->OpenSubKey(L".htm");
-
+
RegistryValue RegVal = RegistryValue(
new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
-
+
if (0 == HtmFwdKey.length() || !m_RootKey->HasSubKey(HtmFwdKey))
HtmFwdKey = L".htm";
-
+
RegKey = m_RootKey->OpenSubKey(HtmFwdKey + L"\\" + SHELL_EDIT_COMMAND);
-
+
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos != CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + HTML_EDIT);
-
+
if (BackupRegKey->HasValue(SHELL_EDIT_COMMAND_BACKUP))
RegKey->CopyValue(BackupRegKey, SHELL_EDIT_COMMAND_BACKUP, DEFAULT_VALUE_NAME);
else
RegKey->DeleteValue(DEFAULT_VALUE_NAME);
- }
+ }
}
catch(RegistryKeyNotFoundException&)
{
@@ -547,7 +547,7 @@ void Registrar::UnregisterAsDefaultShellHtmlEditor() const
void Registrar::SaveRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
int NewState = GetRegisterState();
NewState |= State;
SetRegisterState(NewState);
@@ -556,7 +556,7 @@ void Registrar::SaveRegisteredFor(int State) const
void Registrar::SaveNotRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
int NewState = GetRegisterState();
NewState &= ~State;
SetRegisterState(NewState);
@@ -565,16 +565,16 @@ void Registrar::SaveNotRegisteredFor(int State) const
int Registrar::GetRegisterState() const
{
int State = 0;
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
if (RegKey->HasValue(REGISTRATION_STATE))
{
RegistryValue RegVal = RegKey->GetValue(REGISTRATION_STATE);
if (REG_DWORD == RegVal->GetType())
State = RegVal->GetDataAsInt();
}
-
+
return State;
}
@@ -584,22 +584,22 @@ void Registrar::SetRegisterState(int NewState) const
RegistryValue RegVal = RegistryValue(new RegistryValueImpl(REGISTRATION_STATE, NewState));
RegKey->SetValue(RegVal);
}
-
+
bool Registrar::IsRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
int SavedState = 0;
-
+
if (RegKey->HasValue(REGISTRATION_STATE))
{
RegistryValue RegVal = RegKey->GetValue(REGISTRATION_STATE);
if (REG_DWORD == RegVal->GetType())
- SavedState = RegVal->GetDataAsInt();
+ SavedState = RegVal->GetDataAsInt();
}
-
+
return ((SavedState & State) == State);
}
@@ -631,7 +631,7 @@ void Registrar::RepairRegistrationState() const
/** Unregisters all and delete all Registry keys we have written */
void Registrar::UnregisterAllAndCleanUpRegistry() const
-{
+{
assert(m_RootKey.get());
if (IsRegisteredFor(MSWORD))
@@ -651,7 +651,7 @@ void Registrar::UnregisterAllAndCleanUpRegistry() const
if (IsRegisteredFor(DEFAULT_SHELL_HTML_EDITOR))
UnregisterAsDefaultShellHtmlEditor();
-
+
if (m_RootKey->HasSubKey(PRIVATE_BACKUP_KEY_NAME))
m_RootKey->DeleteSubKeyTree(PRIVATE_BACKUP_KEY_NAME);
}
@@ -665,7 +665,7 @@ void Registrar::RegisterForMsOfficeApplication(
const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const
{
assert(m_RootKey.get());
-
+
std::wstring ForwardKeyName = FORWARD_KEY_PREFIX + FileExtension;
RegistryKey ForwardKey = m_RootKey->CreateSubKey(ForwardKeyName);
@@ -702,39 +702,39 @@ void Registrar::RegisterForMsOfficeApplication(
// set the new forward key under the appropriate extension
RegKey = m_RootKey->CreateSubKey(FileExtension);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
if (REG_SZ == RegVal->GetType())
{
std::wstring str = RegVal->GetDataAsUniString();
- if (!IsOpenOfficeRegisteredForMsApplication(str))
+ if (!IsOpenOfficeRegisteredForMsApplication(str))
ForwardKey->CopyValue(RegKey, DEFAULT_VALUE_NAME, BACKUP_VALUE_NAME);
}
}
-
+
RegVal->SetValue(ForwardKeyName);
- RegKey->SetValue(RegVal);
+ RegKey->SetValue(RegVal);
}
void Registrar::UnregisterForMsOfficeApplication(const std::wstring& FileExtension) const
{
std::wstring FwdRegKeyName = FORWARD_KEY_PREFIX + FileExtension;
-
+
if (m_RootKey->HasSubKey(FileExtension))
{
RegistryKey RegKey = m_RootKey->OpenSubKey(FileExtension);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
- if (REG_SZ == RegVal->GetType() &&
+ if (REG_SZ == RegVal->GetType() &&
IsOpenOfficeRegisteredForMsApplication(RegVal->GetDataAsUniString()))
- {
+ {
RegistryKey FwdRegKey = m_RootKey->CreateSubKey(FwdRegKeyName);
-
+
if (FwdRegKey->HasValue(BACKUP_VALUE_NAME))
RegKey->CopyValue(FwdRegKey, BACKUP_VALUE_NAME, DEFAULT_VALUE_NAME);
else
@@ -742,11 +742,11 @@ void Registrar::UnregisterForMsOfficeApplication(const std::wstring& FileExtensi
}
}
}
-
+
if (m_RootKey->HasSubKey(FwdRegKeyName))
m_RootKey->DeleteSubKeyTree(FwdRegKeyName);
}
-
+
RegistryKey Registrar::GetRootKeyForDefHtmlEditorForIERegistration() const
{
return WindowsRegistry().GetLocalMachineKey();
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
index 851b12f8daf7..e0bf8f1ee799 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
@@ -11,28 +11,28 @@
#include "constants.hxx"
-class Registrar
+class Registrar
{
public:
-
+
Registrar(const RegistrationContextInformation& RegContext);
virtual ~Registrar();
bool IsRegisteredFor(int State) const;
-
+
virtual void RegisterForMsWord() const;
virtual void UnregisterForMsWord() const;
virtual bool QueryPreselectMsWordRegistration() const;
-
+
virtual void RegisterForMsExcel() const;
virtual void UnregisterForMsExcel() const;
virtual bool QueryPreselectMsExcelRegistration() const;
-
+
virtual void RegisterForMsPowerPoint() const;
virtual void UnregisterForMsPowerPoint() const;
virtual bool QueryPreselectMsPowerPointRegistration() const;
-
+
virtual void RegisterAsHtmlEditorForInternetExplorer() const;
virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
@@ -50,9 +50,9 @@ public:
/** Unregisters all and delete all Registry keys we have written
*/
virtual void UnregisterAllAndCleanUpRegistry() const;
-
+
protected:
-
+
virtual void RegisterForMsOfficeApplication(
const std::wstring& FileExtension,
const std::wstring& DocumentDisplayName,
@@ -60,45 +60,45 @@ protected:
const std::wstring& DefaultShellCommand,
const std::wstring& ShellNewCommandDisplayName,
const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const;
-
+
virtual void UnregisterForMsOfficeApplication(
const std::wstring& FileExtension) const;
-
+
virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
-
+
void SaveRegisteredFor(int State) const;
void SaveNotRegisteredFor(int State) const;
-
+
int GetRegisterState() const;
void SetRegisterState(int NewState) const;
-
+
virtual bool QueryPreselectForMsApplication(const std::wstring& file_extension) const;
-
+
/** A helper function (for readability) returns true if OpenOffice is already
registered for a MS application
-
+
@param DocumentExtensionDefValue
The default value of the appropriate document extension Registry key
*/
bool IsOpenOfficeRegisteredForMsApplication(const std::wstring& DocumentExtensionDefValue) const;
-
-protected:
- const RegistrationContextInformation& m_ContextInformation;
+
+protected:
+ const RegistrationContextInformation& m_ContextInformation;
const std::wstring FORWARD_KEY_PREFIX;
const std::wstring DEFAULT_VALUE_NAME;
const std::wstring BACKUP_VALUE_NAME;
const std::wstring PRIVATE_BACKUP_KEY_NAME;
const std::wstring REGISTRATION_STATE;
-
- RegistryKey m_RootKey;
-
+
+ RegistryKey m_RootKey;
+
// prevent copy/assignment
private:
Registrar(const Registrar&);
Registrar& operator=(const Registrar&);
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
index 189b7e3074ae..307e3ff469e9 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
@@ -31,7 +31,7 @@ RegistrationContextInformation::RegistrationContextInformation(MSIHANDLE hMsi, c
}
std::wstring RegistrationContextInformation::GetWordDocumentDisplayName() const
-{
+{
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_MS_WORD_DOCUMENT"), str);
if (m_IsWin9x && !IsConvertableToAnsi(str))
@@ -79,7 +79,7 @@ std::wstring RegistrationContextInformation::GetWordTemplateDefaultShellCommand(
}
std::wstring RegistrationContextInformation::GetRtfDocumentDisplayName() const
-{
+{
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_RTF_DOCUMENT"), str);
if (m_IsWin9x && !IsConvertableToAnsi(str))
@@ -221,7 +221,7 @@ std::wstring RegistrationContextInformation::GetPowerPointShowDefaultShellComman
{
return std::wstring(TEXT("open"));
}
-
+
//----------------------------------------------
/** The string for the "New" command that should appear
in the Explorer context menu when someone right
@@ -232,13 +232,13 @@ std::wstring RegistrationContextInformation::ShellNewCommandDisplayName() const
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_NEW_DISPLAY_NAME"), str);
std::wstring::size_type idx = str.find(TEXT("~"));
-
+
if(std::wstring::npos != idx)
str.replace(idx, 1, TEXT("&"));
-
+
if (m_IsWin9x && !IsConvertableToAnsi(str))
str = TEXT("&New");
-
+
return str;
}
@@ -251,7 +251,7 @@ std::wstring RegistrationContextInformation::ShellEditCommandDisplayName() const
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_EDIT"), str);
std::wstring::size_type idx = str.find(TEXT("~"));
-
+
if(std::wstring::npos != idx)
str.replace(idx, 1, TEXT("&"));
@@ -264,7 +264,7 @@ std::wstring RegistrationContextInformation::ShellEditCommandDisplayName() const
std::wstring RegistrationContextInformation::GetOpenOfficeFriendlyAppName() const
{
std::wstring str;
- GetMsiProp(msihandle_, TEXT("ProductName"), str);
+ GetMsiProp(msihandle_, TEXT("ProductName"), str);
return str;
}
@@ -302,7 +302,7 @@ std::wstring RegistrationContextInformation::GetOpenOfficeCommandline(SHELL_COMM
break;
case Office: // default to std command line
break;
- // default: no default to find new added enums at compile time
+ // default: no default to find new added enums at compile time
}
switch(ShellCommand)
{
@@ -318,7 +318,7 @@ std::wstring RegistrationContextInformation::GetOpenOfficeCommandline(SHELL_COMM
case Printto:
cmd_line += std::wstring(TEXT(" -pt \"%2\" \"%1\""));
break;
- // default: no default to find new added enums at compile time
+ // default: no default to find new added enums at compile time
}
return cmd_line;
}
@@ -338,7 +338,7 @@ bool RegistrationContextInformation::IsConvertableToAnsi(const std::wstring& Str
buff,
sizeof(buff),
NULL,
- &bUsedDefChar);
+ &bUsedDefChar);
}
return !bUsedDefChar;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
index 91a42e6b58d7..1e52a710e81d 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
@@ -21,25 +21,25 @@
/** A simple implementation class that returns the
appropriate display names for the Microsoft
Office document types.
- Under Windows 9x this class checks if the
+ Under Windows 9x this class checks if the
document display name is convertable to an ANSI
string and if not returns an english default.
So we avoid garbage if soemone for instance
installs an japanese StarOffice/OpenOffice
under a German Windows 98 for instance.
*/
-class RegistrationContextInformation
+class RegistrationContextInformation
{
public:
-
+
enum SHELL_COMMAND {New, Open, Print, Printto};
enum OFFICE_APPLICATION {Office, Writer, Calc, Impress};
-
+
RegistrationContextInformation(MSIHANDLE hMsi, const std::wstring& OpenOfficeExecutablePath);
-
- /** Word document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+
+ /** Word document information
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
word document files
*/
std::wstring GetWordDocumentDisplayName() const;
@@ -48,8 +48,8 @@ public:
std::wstring GetWordDocumentDefaultShellCommand() const;
/** Word template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
word template files
*/
std::wstring GetWordTemplateDisplayName() const;
@@ -57,9 +57,9 @@ public:
std::wstring GetWordTemplateDefaultIconEntry() const;
std::wstring GetWordTemplateDefaultShellCommand() const;
- /** Rtf document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ /** Rtf document information
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
rtf document files
*/
std::wstring GetRtfDocumentDisplayName() const;
@@ -68,18 +68,18 @@ public:
std::wstring GetRtfDocumentDefaultShellCommand() const;
/** Excel sheet information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
Excel sheets
*/
- std::wstring GetExcelSheetDisplayName() const;
+ std::wstring GetExcelSheetDisplayName() const;
std::wstring GetExcelSheetFileExtension() const;
std::wstring GetExcelSheetDefaultIconEntry() const;
std::wstring GetExcelSheetDefaultShellCommand() const;
/** Excel template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
Excel template files
*/
std::wstring GetExcelTemplateDisplayName() const;
@@ -88,18 +88,18 @@ public:
std::wstring GetExcelTemplateDefaultShellCommand() const;
/** PowerPoint document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
PowerPoint document files
*/
std::wstring GetPowerPointDocumentDisplayName() const;
- std::wstring GetPowerPointDocumentFileExtension() const;
+ std::wstring GetPowerPointDocumentFileExtension() const;
std::wstring GetPowerPointDocumentDefaultIconEntry() const;
std::wstring GetPowerPointDocumentDefaultShellCommand() const;
/** PowerPoint template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
PowerPoint template files
*/
std::wstring GetPowerPointTemplateDisplayName() const;
@@ -110,17 +110,17 @@ public:
/** PowerPoint Show information
*/
std::wstring GetPowerPointShowDisplayName() const;
- std::wstring GetPowerPointShowFileExtension() const;
+ std::wstring GetPowerPointShowFileExtension() const;
std::wstring GetPowerPointShowDefaultIconEntry() const;
std::wstring GetPowerPointShowDefaultShellCommand() const;
-
- /** The string for the "New" command that should appear
- in the Explorer context menu when someone right
- clicks a Microsoft document
+
+ /** The string for the "New" command that should appear
+ in the Explorer context menu when someone right
+ clicks a Microsoft document
*/
std::wstring ShellNewCommandDisplayName() const;
- /** The string for the "Edit" command that should
+ /** The string for the "Edit" command that should
appear in the Explorer context menu when someone
right clicks a document
*/
@@ -130,7 +130,7 @@ public:
*/
std::wstring GetOpenOfficeFriendlyAppName() const;
- /** The path to the StarOffice/OpenOffice executable
+ /** The path to the StarOffice/OpenOffice executable
*/
std::wstring GetOpenOfficeExecutablePath() const;
@@ -143,19 +143,19 @@ public:
*/
std::wstring GetOpenOfficeCommandline(SHELL_COMMAND ShellCommand,
OFFICE_APPLICATION OfficeApp) const;
-
+
private:
bool IsConvertableToAnsi(const std::wstring& String) const;
void ExtractOpenOfficeExecNameFromPath();
private:
- MSIHANDLE msihandle_;
- bool m_IsWin9x;
+ MSIHANDLE msihandle_;
+ bool m_IsWin9x;
std::wstring m_OOExecPath;
std::wstring m_OOExecName;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
index bc277997b92b..d2201e076943 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -102,7 +102,7 @@ std::wstring RegistryKeyImpl::GetName() const
}
//-----------------------------------------------------
-/**
+/**
*/
bool RegistryKeyImpl::IsOpen() const
{
@@ -130,7 +130,7 @@ bool RegistryKeyImpl::IsWriteable() const
//-----------------------------------------------------
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
value
@precond IsOpen = true
@@ -152,18 +152,18 @@ struct CompareNamesCaseInsensitive
CompareNamesCaseInsensitive(const std::wstring& Name) :
name_(Name)
{}
-
+
bool operator() (const std::wstring& value)
{
return (0 == StrCmpI(value.c_str(), name_.c_str()));
}
-
+
std::wstring name_;
};
//-----------------------------------------------------
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
sub-key
@precond IsOpen = true
@@ -188,14 +188,14 @@ void RegistryKeyImpl::Close()
if (RegCloseKey(m_hSubKey) != ERROR_SUCCESS) {
assert(false);
}
-
+
m_hSubKey = 0;
m_IsWriteable = false;
}
//-----------------------------------------------------
-/** Copies the specified value from RegistryKey to
- the registry key at hand, if a value with this
+/** Copies the specified value from RegistryKey to
+ the registry key at hand, if a value with this
name already exist under the registry key at hand
it will be overwritten
@@ -208,18 +208,18 @@ void RegistryKeyImpl::Close()
RegistryValueNotFoundException
*/
void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name)
-{
- assert(RegistryKey->HasValue(Name));
+{
+ assert(RegistryKey->HasValue(Name));
#ifdef __MINGW32__
- SetValue((const RegistryValue&)(RegistryKey->GetValue(Name)));
+ SetValue((const RegistryValue&)(RegistryKey->GetValue(Name)));
#else
- SetValue(RegistryKey->GetValue(Name));
+ SetValue(RegistryKey->GetValue(Name));
#endif
assert(HasValue(Name));
}
-/** Copies the specified value from RegistryKey to
- the registry key at hand under a new name,
+/** Copies the specified value from RegistryKey to
+ the registry key at hand under a new name,
if a value with this name already exist there
it will be overwritten
@@ -234,11 +234,11 @@ void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstri
void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name, const std::wstring& NewName)
{
assert(RegistryKey->HasValue(Name));
-
+
RegistryValue RegVal = RegistryKey->GetValue(Name);
RegVal->SetName(NewName);
SetValue(RegVal);
-
+
assert(HasValue(NewName));
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registry.hxx b/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
index fe0014b6a191..4d251b8eea5f 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -53,18 +53,18 @@ class RegistryKeyImpl;
// typedefs
//---------------------------------------
-typedef std::auto_ptr<RegistryKeyImpl> RegistryKey;
-typedef std::vector<std::wstring> StringList;
-typedef std::auto_ptr<StringList> StringListPtr;
+typedef std::auto_ptr<RegistryKeyImpl> RegistryKey;
+typedef std::vector<std::wstring> StringList;
+typedef std::auto_ptr<StringList> StringListPtr;
//---------------------------------------
-//
+//
//---------------------------------------
class RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Destruction
//############################################
@@ -83,10 +83,10 @@ public:
std::wstring GetName() const;
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const = 0;
@@ -97,7 +97,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const = 0;
-
+
bool IsOpen() const;
/** Do we have write access on the key at hand
@@ -136,9 +136,9 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const = 0;
-
+
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
value
@precond IsOpen = true
@@ -148,7 +148,7 @@ public:
bool HasValue(const std::wstring& Name) const;
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
sub-key
@precond IsOpen = true
@@ -163,9 +163,9 @@ public:
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -177,12 +177,12 @@ public:
using it without re-opening may cause
RegistryIOExceptions to be thrown
- This is a template method that calls
- ImplClose which has to be overwritten
+ This is a template method that calls
+ ImplClose which has to be overwritten
by sub-classes
*/
void Close();
-
+
/** Open the specified sub-key of the registry key
at hand
@@ -233,7 +233,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -250,8 +250,8 @@ public:
virtual void SetValue(const RegistryValue& Value) = 0;
- /** Copies the specified value from RegistryKey to
- the registry key at hand, if a value with this
+ /** Copies the specified value from RegistryKey to
+ the registry key at hand, if a value with this
name already exist under the registry key at hand
it will be overwritten
@@ -265,8 +265,8 @@ public:
*/
virtual void CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name);
- /** Copies the specified value from RegistryKey to
- the registry key at hand under a new name,
+ /** Copies the specified value from RegistryKey to
+ the registry key at hand under a new name,
if a value with this name already exist there
it will be overwritten
@@ -281,8 +281,8 @@ public:
virtual void CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name, const std::wstring& NewName);
//############################################
- // Creation
- // only possible through WindowsRegistry class
+ // Creation
+ // only possible through WindowsRegistry class
//############################################
@@ -296,7 +296,7 @@ protected:
RegistryKeyImpl(HKEY RootKey, const std::wstring& KeyName);
/** Create instance of the specified Registry key.
- RootKey should only one of the predefined
+ RootKey should only one of the predefined
keys HKEY_CLASSES_ROOT, HKEY_CURRENT_USER,
HKEY_LOCAL_MACHINE, HKEY_USERS
@@ -305,7 +305,7 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImpl(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
@@ -318,11 +318,11 @@ protected:
*/
bool IsRootKey() const;
-protected:
- HKEY m_hRootKey;
- HKEY m_hSubKey;
- std::wstring m_KeyName;
- bool m_IsWriteable;
+protected:
+ HKEY m_hRootKey;
+ HKEY m_hSubKey;
+ std::wstring m_KeyName;
+ bool m_IsWriteable;
// prevent copy and assignment
private:
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
index cebbe67c6798..5de0c04e42a7 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
@@ -35,9 +35,9 @@ RegistryException::~RegistryException() throw()
*/
const char* RegistryException::what() const throw()
{
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
m_ErrorCode,
@@ -45,7 +45,7 @@ const char* RegistryException::what() const throw()
(LPTSTR) &m_ErrorMsg,
0,
NULL);
-
+
return reinterpret_cast<char*>(m_ErrorMsg);
}
@@ -61,13 +61,13 @@ long RegistryException::GetErrorCode() const
// that is closed
//#######################################
-RegistryIOException::RegistryIOException(long ErrorCode) :
+RegistryIOException::RegistryIOException(long ErrorCode) :
RegistryException(ErrorCode)
{
};
//#######################################
-//
+//
//#######################################
RegistryNoWriteAccessException::RegistryNoWriteAccessException(long ErrorCode) :
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
index 4ea3a2098853..96ce6036746a 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
@@ -17,23 +17,23 @@ class RegistryException : public std::exception
public:
RegistryException(long ErrorCode);
-
+
virtual ~RegistryException() throw();
-
+
/**
- @descr Returns a string that describes the error if
+ @descr Returns a string that describes the error if
available, else NULL will be returned. The
returned string is only temporary so the caller
has to copy it if he needs the string further.
*/
virtual const char* what() const throw();
-
+
/**
- @descr Returns the error code.
+ @descr Returns the error code.
*/
-
+
long GetErrorCode() const;
-
+
private:
long m_ErrorCode;
void* m_ErrorMsg;
@@ -51,7 +51,7 @@ public:
};
//#######################################
-// Thrown when trying to write to a readonly registry key
+// Thrown when trying to write to a readonly registry key
//#######################################
class RegistryNoWriteAccessException : public RegistryException
@@ -61,7 +61,7 @@ public:
};
//#######################################
-// Thrown when trying to access an registry key, with improper
+// Thrown when trying to access an registry key, with improper
// access rights
//#######################################
@@ -102,6 +102,6 @@ public:
RegistryInvalidOperationException(long ErrorCode);
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
index d9012fcd087d..71501a8a6ce9 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
@@ -48,7 +48,7 @@ RegistryValueImpl::RegistryValueImpl(const std::wstring& Name, const std::wstrin
*/
RegistryValueImpl::RegistryValueImpl(const std::wstring& Name, const std::string& Value) :
m_Name(Name),
- m_Type(REG_SZ),
+ m_Type(REG_SZ),
m_IntData(0)
{
m_StringData = AnsiToUnicodeString(Value);
@@ -118,7 +118,7 @@ const void* RegistryValueImpl::GetDataBuffer() const
*/
std::wstring RegistryValueImpl::GetDataAsUniString() const
{
- assert(REG_SZ == m_Type);
+ assert(REG_SZ == m_Type);
return m_StringData;
}
@@ -130,13 +130,13 @@ std::string RegistryValueImpl::GetDataAsAnsiString() const
assert(REG_SZ == m_Type);
return UnicodeToAnsiString(m_StringData);
}
-
+
//--------------------------------------------
-/** Returns the data as number
+/** Returns the data as number
*/
int RegistryValueImpl::GetDataAsInt() const
{
- assert(REG_DWORD == m_Type);
+ assert(REG_DWORD == m_Type);
return m_IntData;
}
@@ -155,7 +155,7 @@ int RegistryValueImpl::GetType() const
//--------------------------------------------
-/** Set a new name
+/** Set a new name
*/
void RegistryValueImpl::SetName(const std::wstring& NewName)
{
@@ -163,7 +163,7 @@ void RegistryValueImpl::SetName(const std::wstring& NewName)
}
//--------------------------------------------
-/**
+/**
*/
void RegistryValueImpl::SetValue(const std::wstring& NewValue)
{
@@ -172,7 +172,7 @@ void RegistryValueImpl::SetValue(const std::wstring& NewValue)
}
//--------------------------------------------
-/**
+/**
*/
void RegistryValueImpl::SetValue(const std::string& NewValue)
{
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
index 1f4df3353359..48bfcea9b605 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
@@ -9,7 +9,7 @@
#include <memory>
#include <string>
-class RegistryValueImpl
+class RegistryValueImpl
{
public:
@@ -22,7 +22,7 @@ public:
RegistryValueImpl(const std::wstring& Name, const std::wstring& Value);
RegistryValueImpl(const std::wstring& Name, const std::string& Value);
-
+
#if (_MSC_VER >= 1300)
RegistryValueImpl::RegistryValueImpl(const RegistryValueImpl& s);
#endif
@@ -53,7 +53,7 @@ public:
@precond GetType = STRING
*/
std::wstring GetDataAsUniString() const;
-
+
/** Returns the data as ansi string
@precond GetType = STRING
@@ -61,7 +61,7 @@ public:
std::string GetDataAsAnsiString() const;
/** Returns the data as number
-
+
@precond GetType = NUMBER
*/
int GetDataAsInt() const;
@@ -73,13 +73,13 @@ public:
//#################################
// Command
//#################################
+
-
- /** Set a new name
+ /** Set a new name
*/
void SetName(const std::wstring& NewName);
- /**
+ /**
*/
void SetValue(const std::wstring& NewValue);
@@ -96,16 +96,16 @@ public:
//#################################
private:
- std::wstring m_Name;
- int m_Type;
- std::wstring m_StringData;
- int m_IntData;
+ std::wstring m_Name;
+ int m_Type;
+ std::wstring m_StringData;
+ int m_IntData;
};
typedef std::auto_ptr<RegistryValueImpl> RegistryValue;
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
index 47cc8ce70ec5..4b14c0d1d907 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -446,7 +446,7 @@ void RegistryKeyImplWin9x::DeleteSubKey(const std::wstring& Name)
else if (ERROR_ACCESS_DENIED == rc)
throw RegistryAccessDeniedException(rc);
else if (ERROR_SUCCESS != rc)
- throw RegistryException(rc);
+ throw RegistryException(rc);
}
//-----------------------------------------------------
@@ -478,7 +478,7 @@ void RegistryKeyImplWin9x::DeleteSubKeyTree(const std::wstring& Name)
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
index 46c25cb898cf..5f6ce614981d 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTRYW9X_HXX_
#define _REGISTRYW9X_HXX_
@@ -38,17 +38,17 @@
class RegistryKeyImplWin9x : public RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Queries
//############################################
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const;
@@ -59,7 +59,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const;
-
+
virtual StringListPtr GetSubKeyNames() const;
virtual StringListPtr GetSubValueNames() const;
@@ -76,14 +76,14 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const;
-
+
//############################################
// Commands
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -141,7 +141,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -158,9 +158,9 @@ public:
virtual void SetValue(const RegistryValue& Value);
//############################################
- // Creation
+ // Creation
//
- // only possible through WindowsRegistry class
+ // only possible through WindowsRegistry class
//############################################
protected:
@@ -179,17 +179,17 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImplWin9x(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
RegistryKeyImplWin9x(HKEY RootKey, HKEY SubKey, const std::wstring& KeyName, bool Writeable = true);
-
+
// prevent copy/assignment
private:
RegistryKeyImplWin9x(const RegistryKeyImplWin9x&);
RegistryKeyImplWin9x& operator=(const RegistryKeyImplWin9x&);
-
+
//######################################
// Friend declarations
//######################################
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
index 4f60d0cae32a..cd3507b7d696 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,7 +27,7 @@
************************************************************************/
//---------------------------------------
-//
+//
//---------------------------------------
#ifdef _MSC_VER
@@ -50,22 +50,22 @@
#endif
//---------------------------------------
-//
+//
//---------------------------------------
const size_t MAX_TMP_BUFF_SIZE = 1024 * sizeof(wchar_t);
//############################################
-// Creation
-// only possible through WindowsRegistry class
+// Creation
+// only possible through WindowsRegistry class
//############################################
//-----------------------------------------------------
/** Create instance and open the specified Registry key
*/
-RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& KeyName) :
+RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& KeyName) :
RegistryKeyImpl(RootKey, KeyName)
{
}
@@ -73,7 +73,7 @@ RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& Key
//-----------------------------------------------------
/** Create instance and open the specified Registry key
*/
-RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey) :
+RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey) :
RegistryKeyImpl(RootKey)
{
}
@@ -95,10 +95,10 @@ RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, HKEY SubKey, const std:
//-----------------------------------------------------
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
size_t RegistryKeyImplWinNT::GetSubValueCount() const
{
@@ -147,37 +147,37 @@ size_t RegistryKeyImplWinNT::GetSubKeyCount() const
/**
*/
StringListPtr RegistryKeyImplWinNT::GetSubKeyNames() const
-{
+{
assert(IsOpen());
wchar_t buff[1024];
- DWORD buff_size = sizeof(buff);
+ DWORD buff_size = sizeof(buff);
FILETIME ftime;
-
+
StringList* key_names = new StringList();
-
+
LONG rc = ERROR_SUCCESS;
for (DWORD i = 0; /* left empty */; i++)
- {
+ {
rc = RegEnumKeyExW(
m_hSubKey, i, buff, &buff_size,
0, 0, 0, &ftime);
-
- if (ERROR_SUCCESS != rc &&
+
+ if (ERROR_SUCCESS != rc &&
ERROR_MORE_DATA != rc)
break;
-
+
buff_size = sizeof(buff);
- key_names->push_back(buff);
+ key_names->push_back(buff);
}
-
+
if (ERROR_INVALID_HANDLE == rc)
throw RegistryIOException(rc);
else if (ERROR_NO_MORE_ITEMS != rc && ERROR_SUCCESS != rc)
throw RegistryException(rc);
-
+
#if (_MSC_VER < 1300) && !defined(__MINGW32__)
return key_names;
#else
@@ -193,7 +193,7 @@ StringListPtr RegistryKeyImplWinNT::GetSubValueNames() const
assert(IsOpen());
wchar_t buff[1024];
- DWORD buff_size = sizeof(buff);
+ DWORD buff_size = sizeof(buff);
StringList* value_names = new StringList();
@@ -204,16 +204,16 @@ StringListPtr RegistryKeyImplWinNT::GetSubValueNames() const
rc = RegEnumValueW(
m_hSubKey, i, buff, &buff_size,
0, 0, 0, 0);
-
- if (ERROR_SUCCESS != rc &&
+
+ if (ERROR_SUCCESS != rc &&
ERROR_MORE_DATA != rc)
break;
buff_size = sizeof(buff);
- value_names->push_back(buff);
+ value_names->push_back(buff);
}
-
+
if (ERROR_INVALID_HANDLE == rc)
throw RegistryIOException(rc);
else if (ERROR_NO_MORE_ITEMS != rc && ERROR_SUCCESS != rc)
@@ -271,7 +271,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name) const
{
assert(false);
}
-
+
return regval;
}
@@ -324,7 +324,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name, const Reg
return regval;
}
-
+
//############################################
// Commands
@@ -332,7 +332,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name, const Reg
//-----------------------------------------------------
-/** Open the registry key, has no effect if
+/** Open the registry key, has no effect if
the key is already open
@precond IsOpen = false
@@ -365,7 +365,7 @@ void RegistryKeyImplWinNT::Open(bool Writeable)
throw RegistryException(rc);
m_IsWriteable = Writeable;
-
+
assert(IsOpen());
}
@@ -405,7 +405,7 @@ RegistryKey RegistryKeyImplWinNT::CreateSubKey(const std::wstring& Name)
HKEY hRoot = IsRootKey() ? m_hRootKey : m_hSubKey;
HKEY hKey;
-
+
LONG rc = RegCreateKeyExW(
hRoot,
Name.c_str(),
@@ -442,16 +442,16 @@ void RegistryKeyImplWinNT::DeleteSubKey(const std::wstring& Name)
assert(IsOpen());
assert(IsWriteable());
assert(HasSubKey(Name));
-
+
RegistryKey SubKey = OpenSubKey(Name);
size_t nSubKeyCount = SubKey->GetSubKeyCount();
-
+
assert(0 == nSubKeyCount);
-
+
if (nSubKeyCount)
throw RegistryInvalidOperationException(ERROR_NOT_SUPPORTED);
-
+
LONG rc = RegDeleteKeyW(m_hSubKey, Name.c_str());
if (ERROR_INVALID_HANDLE == rc)
@@ -499,9 +499,9 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
0,
KEY_READ | DELETE,
&hKey);
-
+
if (ERROR_SUCCESS == rc)
- {
+ {
wchar_t* lpSubKey;
DWORD nMaxSubKeyLen;
@@ -509,7 +509,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
hKey, 0, 0, 0, 0,
&nMaxSubKeyLen,
0, 0, 0, 0, 0, 0);
-
+
nMaxSubKeyLen++; // space for trailing '\0'
lpSubKey = reinterpret_cast<wchar_t*>(
@@ -538,7 +538,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
} // while
- RegCloseKey(hKey);
+ RegCloseKey(hKey);
} // if
@@ -561,7 +561,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
index 517327f34582..ac93df4f02da 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTRYWNT_HXX_
#define _REGISTRYWNT_HXX_
@@ -37,17 +37,17 @@
class RegistryKeyImplWinNT : public RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Queries
//############################################
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const;
@@ -58,7 +58,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const;
-
+
virtual StringListPtr GetSubKeyNames() const;
virtual StringListPtr GetSubValueNames() const;
@@ -75,14 +75,14 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const;
-
+
//############################################
// Commands
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -140,7 +140,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -157,9 +157,9 @@ public:
virtual void SetValue(const RegistryValue& Value);
//############################################
- // Creation
+ // Creation
//
- // only possible through WindowsRegistry class
+ // only possible through WindowsRegistry class
//############################################
protected:
@@ -178,21 +178,21 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImplWinNT(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
RegistryKeyImplWinNT(HKEY RootKey, HKEY SubKey, const std::wstring& KeyName, bool Writeable = true);
-
+
private:
-
+
LONG ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring& Name);
-
+
//prevent copy and assignment
private:
RegistryKeyImplWinNT(const RegistryKeyImplWinNT&);
RegistryKeyImplWinNT& operator=(const RegistryKeyImplWinNT&);
-
+
//######################################
// Friend declarations
//######################################
diff --git a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
index db38d568e877..84d45532d218 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "stringconverter.hxx"
#ifdef _MSC_VER
@@ -44,7 +44,7 @@ std::string UnicodeToAnsiString(const std::wstring& UniString)
{
int len = WideCharToMultiByte(
CP_ACP, 0, UniString.c_str(), -1, 0, 0, 0, 0);
-
+
char* buff = reinterpret_cast<char*>(_alloca(len));
WideCharToMultiByte(
@@ -59,7 +59,7 @@ std::wstring AnsiToUnicodeString(const std::string& AnsiString)
{
int len = MultiByteToWideChar(
CP_ACP, 0, AnsiString.c_str(), -1, 0, 0);
-
+
wchar_t* buff = reinterpret_cast<wchar_t*>(_alloca(len * sizeof(wchar_t)));
MultiByteToWideChar(
diff --git a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
index c8fcbd56f627..6a23c0e9b7cc 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _STRINGCONVERTER_HXX_
#define _STRINGCONVERTER_HXX_
diff --git a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
index 986bf0d28cb6..03a19523d171 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
@@ -23,7 +23,7 @@ UserRegistrar::UserRegistrar(const RegistrationContextInformation& RegContext) :
}
//###################################
-// Command
+// Command
//###################################
//--------------------------------------
@@ -32,9 +32,9 @@ UserRegistrar::UserRegistrar(const RegistrationContextInformation& RegContext) :
void UserRegistrar::UnregisterAsHtmlEditorForInternetExplorer() const
{
Registrar::UnregisterAsHtmlEditorForInternetExplorer();
-
+
DeleteHtmFileAssociationKeys();
-
+
try
{
RegistryKey RegKey = m_RootKey->OpenSubKey(L"Applications");
@@ -55,30 +55,30 @@ void UserRegistrar::UnregisterAsHtmlEditorForInternetExplorer() const
void UserRegistrar::RegisterAsDefaultShellHtmlEditor() const
{
RegistryKey LocalHtmKey = m_RootKey->CreateSubKey(L".htm");
-
+
if (!LocalHtmKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryKey HKCRKey = WindowsRegistry().GetClassesRootKey();
-
+
if (HKCRKey->HasSubKey(L".htm"))
{
RegistryKey RootHtmKey = HKCRKey->OpenSubKey(L".htm", false);
-
+
if (RootHtmKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RootHtmKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring RootHtmFwdKey = RegVal->GetDataAsUniString();
-
+
if (HKCRKey->HasSubKey(RootHtmFwdKey))
- {
+ {
m_RootKey->CreateSubKey(RootHtmFwdKey);
LocalHtmKey->CopyValue(RootHtmKey, DEFAULT_VALUE_NAME);
}
}
}
}
-
+
// calling base class method
Registrar::RegisterAsDefaultShellHtmlEditor();
}
@@ -92,7 +92,7 @@ void UserRegistrar::UnregisterAsDefaultShellHtmlEditor() const
Registrar::UnregisterAsDefaultShellHtmlEditor();
DeleteHtmFileAssociationKeys();
}
-
+
//--------------------------------------
/**
*/
@@ -101,11 +101,11 @@ void UserRegistrar::UnregisterForMsOfficeApplication(
{
/// calling base class method
Registrar::UnregisterForMsOfficeApplication(FileExtension);
-
+
if (m_RootKey->HasSubKey(FileExtension))
{
RegistryKey RegKey = m_RootKey->OpenSubKey(FileExtension);
-
+
if ((0 == RegKey->GetSubKeyCount()) && (0 == RegKey->GetSubValueCount()))
{
RegKey->Close();
@@ -123,14 +123,14 @@ RegistryKey UserRegistrar::GetRootKeyForDefHtmlEditorForIERegistration() const
}
//--------------------------------------
-/**
+/**
*/
void UserRegistrar::DeleteHtmFileAssociationKeys() const
{
// Later delete the created keys if they are empty and have not changed meanwhile.
// Remeber: if we create a new registry key in the user part of the
// registry, changes to that key via the merged key HKEY_CLASSES_ROOT
- // go into the user branch HKEY_CURRENT_USER and are not visible for other users.
+ // go into the user branch HKEY_CURRENT_USER and are not visible for other users.
// so we must carefully detect if the keys have not changed in order to prevent accidentally
// deleting a key and so destroying existing associations
// See MSDN: "Merged View of HKEY_CLASSES_ROOT"
diff --git a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
index f4b674a717e7..653a4790edda 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
@@ -8,10 +8,10 @@
#include "registrar.hxx"
-class UserRegistrar : public Registrar
+class UserRegistrar : public Registrar
{
public:
-
+
//###################################
// Creation
//###################################
@@ -19,28 +19,28 @@ public:
UserRegistrar(const RegistrationContextInformation& RegContext);
//###################################
- // Command
+ // Command
//###################################
-
+
virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
-
+
virtual void RegisterAsDefaultShellHtmlEditor() const;
virtual void UnregisterAsDefaultShellHtmlEditor() const;
-
+
protected:
virtual void UnregisterForMsOfficeApplication(
const std::wstring& FileExtension) const;
-
+
virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
-
+
private:
-
- /** Delete the privately created file associations
- for htm files if the keys are empty
+
+ /** Delete the privately created file associations
+ for htm files if the keys are empty
*/
void DeleteHtmFileAssociationKeys() const;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
index 1e97f779bc39..49a3fdd34892 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
@@ -15,7 +15,7 @@
//
//------------------------------
-WindowsRegistry::WindowsRegistry()
+WindowsRegistry::WindowsRegistry()
{
OSVERSIONINFOA osverinfo;
ZeroMemory(&osverinfo, sizeof(osverinfo));
@@ -37,7 +37,7 @@ RegistryKey WindowsRegistry::GetClassesRootKey(bool Writeable) const
//------------------------------
//
//------------------------------
-
+
RegistryKey WindowsRegistry::GetCurrentUserKey(bool Writeable) const
{
return GetRegistryKey(HKEY_CURRENT_USER, Writeable);
@@ -68,14 +68,14 @@ RegistryKey WindowsRegistry::GetUserKey(bool Writeable) const
RegistryKey WindowsRegistry::GetRegistryKey(HKEY RootKey, bool Writeable) const
{
RegistryKey regkey;
-
+
if (m_IsWinNT)
regkey = RegistryKey(new RegistryKeyImplWinNT(RootKey));
else
regkey = RegistryKey(new RegistryKeyImplWin9x(RootKey));
regkey->Open(Writeable);
-
+
return regkey;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
index 1b1cb5e2829e..5b2f94047f5e 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
@@ -16,15 +16,15 @@
#include "Registry.hxx"
-/** Basically a factory class
+/** Basically a factory class
*/
-class WindowsRegistry
+class WindowsRegistry
{
public:
WindowsRegistry();
-
+
RegistryKey GetClassesRootKey(bool Writeable = true) const;
-
+
RegistryKey GetCurrentUserKey(bool Writeable = true) const;
RegistryKey GetLocalMachineKey(bool Writeable = true) const;
@@ -38,6 +38,6 @@ private:
bool m_IsWinNT;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */