desktop/win32/source/loader.cxx |   24 ------------------------
 vcl/win/window/salframe.cxx     |   39 +--------------------------------------
 2 files changed, 1 insertion(+), 62 deletions(-)

New commits:
commit 250f35740d0916845761f54f64c1f37f35420978
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Thu Feb 15 10:54:33 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Mon Sep 30 09:44:34 2024 +0200

    Revert "Fall back to old bootstrap.ini [Win32] section, for backwards 
compatibility"
    
    This reverts commit ebd3f0971b843527ed493a35b2303c8c15b94109.
    Conflicts:
            desktop/win32/source/loader.cxx
            vcl/win/window/salframe.cxx
    
    Reason for revert:  This fallback functionality was documented as 
deprecated at
    
<https://wiki.documentfoundation.org/index.php?title=ReleaseNotes/24.8&oldid=738731>
    "fundamental.override.ini", to "be removed in a later version", which is
    happening now for LO 25.2.
    
    Change-Id: I40a1800f6a05fc7fd7188917083b269ce6a9f1d2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163394
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/desktop/win32/source/loader.cxx b/desktop/win32/source/loader.cxx
index ca74c13ab92d..5374c286aa41 100644
--- a/desktop/win32/source/loader.cxx
+++ b/desktop/win32/source/loader.cxx
@@ -218,8 +218,6 @@ int officeloader_impl(bool bAllowConsole)
     // read limit values from fundamental.override.ini
     unsigned int nMaxMemoryInMB = 0;
     bool bExcludeChildProcesses = true;
-    bool fallbackForMaxMemoryInMB = true;
-    bool fallbackForExcludeChildProcesses = true;
 
     try
     {
@@ -227,34 +225,12 @@ int officeloader_impl(bool bAllowConsole)
         std::ifstream aFile(szIniDirectory + L"\fundamental.override.ini");
         boost::property_tree::ini_parser::read_ini(aFile, pt);
         nMaxMemoryInMB = pt.get("Bootstrap.LimitMaximumMemoryInMB", 
nMaxMemoryInMB);
-        fallbackForMaxMemoryInMB = 
!pt.get_child_optional("Bootstrap.LimitMaximumMemoryInMB");
         bExcludeChildProcesses = 
pt.get("Bootstrap.ExcludeChildProcessesFromLimit", bExcludeChildProcesses);
-        fallbackForExcludeChildProcesses
-            = 
!pt.get_child_optional("Bootstrap.ExcludeChildProcessesFromLimit");
     }
     catch (...)
     {
         nMaxMemoryInMB = 0;
     }
-    // For backwards compatibility, for now also try to read the values from 
bootstrap.ini if
-    // fundamental.override.ini does not provide them:
-    if (fallbackForMaxMemoryInMB || fallbackForExcludeChildProcesses) {
-        try
-        {
-            boost::property_tree::ptree pt;
-            std::ifstream aFile(szIniDirectory + L"\bootstrap.ini");
-            boost::property_tree::ini_parser::read_ini(aFile, pt);
-            if (fallbackForMaxMemoryInMB) {
-                nMaxMemoryInMB = pt.get("Win32.LimitMaximumMemoryInMB", 
nMaxMemoryInMB);
-            }
-            if (fallbackForExcludeChildProcesses) {
-                bExcludeChildProcesses = 
pt.get("Win32.ExcludeChildProcessesFromLimit", bExcludeChildProcesses);
-            }
-        }
-        catch (...)
-        {
-        }
-    }
 
     // create a Windows JobObject with a memory limit
     HANDLE hJobObject = nullptr;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index f1a753f05f82..4c7f6814c6f0 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -32,12 +32,6 @@
 
 #include <comphelper/windowserrorstring.hxx>
 
-#include <fstream>
-#include <boost/property_tree/ptree.hpp>
-#include <boost/property_tree/ini_parser.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-
 #include <rtl/bootstrap.hxx>
 #include <rtl/character.hxx>
 #include <rtl/string.h>
@@ -1958,38 +1952,7 @@ static bool EnableAttachThreadInputHack()
 {
     OUString s("$EnableAttachThreadInputHack");
     rtl::Bootstrap::expandMacros(s);
-    bool bEnabled;
-    if (!s.isEmpty()) {
-        bEnabled = s == "true";
-    } else {
-        // For backwards compatibility, for now also try to read the value 
from a [Win32] section of
-        // bootstrap.ini if it is not set as a bootstrap variable:
-        bEnabled = false;
-        OUString aBootstrapUri;
-        if (osl_getProcessWorkingDir(&aBootstrapUri.pData) == 
osl_Process_E_None) {
-            aBootstrapUri += "/bootstrap.ini";
-
-            OUString aSystemFileName;
-            if (osl::FileBase::getSystemPathFromFileURL(aBootstrapUri, 
aSystemFileName)
-                    == osl::FileBase::E_None
-                && aSystemFileName.getLength() <= MAX_PATH)
-            {
-                // this uses the Boost ini parser, instead of tools::Config, 
as we already use it to
-                // read other values from bootstrap.ini in 
desktop/win32/source/loader.cxx, because
-                // that watchdog process can't access LO libs. This way the 
handling is consistent.
-                try
-                {
-                    boost::property_tree::ptree pt;
-                    std::ifstream aFile(o3tl::toW(aSystemFileName.getStr()));
-                    boost::property_tree::ini_parser::read_ini(aFile, pt);
-                    bEnabled = pt.get("Win32.EnableAttachThreadInputHack", 
false);
-                }
-                catch (...)
-                {
-                }
-            }
-        }
-    }
+    const bool bEnabled = s == "true";
     SAL_WARN_IF(bEnabled, "vcl", "AttachThreadInput hack is enabled. Watch out 
for deadlocks!");
     return bEnabled;
 }

Reply via email to