You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2021/08/11 18:44:50 UTC
[openoffice] branch AOO42X updated: Removed whitespace, fixed typos
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 102561b Removed whitespace, fixed typos
102561b is described below
commit 102561b74e875fe164ad1488217f4cde2d8c23b8
Author: mseidel <ms...@apache.org>
AuthorDate: Wed Aug 11 20:42:55 2021 +0200
Removed whitespace, fixed typos
(cherry picked from commit 392035504ed53862d932c374eb62904f0fb1ee81)
---
.../win32/customactions/reg4msdoc/msihelper.cxx | 20 ++--
.../win32/customactions/reg4msdoc/msihelper.hxx | 95 ++++++++--------
.../win32/customactions/reg4msdoc/register.cxx | 124 ++++++++++-----------
.../win32/customactions/reg4msdoc/register.hxx | 14 +--
4 files changed, 128 insertions(+), 125 deletions(-)
diff --git a/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx b/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
index fd2ec6c..d509277 100644
--- a/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
+++ b/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,18 +7,20 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
+
+
#include "msihelper.hxx"
#include <malloc.h>
@@ -37,7 +39,7 @@ bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value)
MsiGetProperty(handle, name, buff, &sz);
value = buff;
return true;
- }
+ }
return false;
}
@@ -67,7 +69,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)
@@ -78,7 +80,7 @@ std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
}
std::wstring GetOfficeExecutablePath(MSIHANDLE handle)
-{
+{
std::wstring exepath = GetOfficeInstallationPath(handle);
exepath += TEXT("program\\soffice.exe");
return exepath;
@@ -88,7 +90,7 @@ std::wstring GetProductName(MSIHANDLE handle)
{
std::wstring prodname;
GetMsiProp(handle, TEXT("ProductName"), prodname);
- return prodname;
+ return prodname;
}
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name)
@@ -112,7 +114,7 @@ bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name)
INSTALLSTATE current_state;
INSTALLSTATE future_state;
MsiGetFeatureState(handle, name, ¤t_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/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx b/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
index d72f315..1107204 100644
--- a/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
+++ b/main/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,18 +7,20 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
+
+
#ifndef INCLUDED_MSIHELPER_HXX
#define INCLUDED_MSIHELPER_HXX
@@ -35,43 +37,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
+ [out] receives this value of the property.
+
+ @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);
@@ -79,7 +81,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
@@ -91,7 +93,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.
@@ -100,10 +102,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
*/
@@ -112,10 +114,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 '\'.
@@ -125,38 +127,37 @@ 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").
+ "C:\Program Files (x86)\OpenOffice 4\program\soffice.exe").
*/
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);
@@ -164,39 +165,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.
-
+ Determine whether this is a complete deinstallation or not.
+
@param handle
[in] a valid msi handle.
-
+
@returns
<TRUE/>if this is a complete deinstallation.
*/
diff --git a/main/setup_native/source/win32/customactions/reg4msdoc/register.cxx b/main/setup_native/source/win32/customactions/reg4msdoc/register.cxx
index 598f7db..ead35b9 100644
--- a/main/setup_native/source/win32/customactions/reg4msdoc/register.cxx
+++ b/main/setup_native/source/win32/customactions/reg4msdoc/register.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -51,25 +51,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)
@@ -80,35 +80,35 @@ bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Regis
catch(RegistryException&)
{
assert(false);
- }
+ }
return preselect;
-}
+}
//-----------------------------------------
-// registers StarOffice for MS document
+// registers OpenOffice for MS document
// types and as default HTML editor if
// specified
//-----------------------------------------
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();
@@ -119,33 +119,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();
}
@@ -153,9 +153,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);
}
//-----------------------------------------
@@ -163,14 +163,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
@@ -183,16 +183,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&)
@@ -207,12 +207,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&)
@@ -222,14 +222,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&)
@@ -250,24 +250,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);
@@ -275,37 +275,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
{
@@ -313,16 +313,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/main/setup_native/source/win32/customactions/reg4msdoc/register.hxx b/main/setup_native/source/win32/customactions/reg4msdoc/register.hxx
index 37352a3..67f2775 100644
--- a/main/setup_native/source/win32/customactions/reg4msdoc/register.hxx
+++ b/main/setup_native/source/win32/customactions/reg4msdoc/register.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,20 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
+
#ifndef _REGISTER_HXX_
#define _REGISTER_HXX_
@@ -45,7 +45,7 @@ const int MOD_CALC = 0x2;
const int MOD_IMPRESS = 0x4;
const int MOD_ACTIVEX = 0x40;
-/* registers StarOffice for MS document
+/* registers OpenOffice for MS document
types and as default HTML editor if
specified */
void Register4MsDoc(MSIHANDLE handle, int Register);
@@ -68,7 +68,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\