sw/source/uibase/uiview/pview.cxx |   30 +++++--------
 vcl/source/app/settings.cxx       |   87 --------------------------------------
 vcl/win/app/salinst.cxx           |    2 
 3 files changed, 14 insertions(+), 105 deletions(-)

New commits:
commit 59b7de0e8ffc3a4cfe5ac6873778fb2e8bafa74d
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Oct 23 14:07:02 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Oct 24 09:07:56 2024 +0200

    sw a11y: Don't prevent zooming into print preview when AT active
    
    In Writer's print preview ("File" -> "Print Preview"),
    allow zooming in or out using Ctrl + mouse wheel
    regardless of whether assistive technology is enabled
    (on Windows) or not.
    
    I see no reason to prevent this when AT is active.
    
    This was originally introduced in
    
        commit 70de0c38fd177b3c95837118c5fb35e380c87e90
        Author: Jens-Heiner Rechtien <h...@openoffice.org>
        Date:   Thu Mar 27 14:45:43 2003 +0000
    
            MWS_SRX644: migrate branch mws_srx644 -> HEAD
    
    with a
    
        //#106746# zoom has to be disabled if Accessibility support is switched 
on
    
    comment, but that unfortunately only refers to a ticket
    in the StarDivision internal issue tracker, so the
    reasoning from back then remains unclear.
    
    (`git show --ignore-space-change` to see the "actual
    change" more clearly)
    
    Change-Id: Iccec17a334dbe19de14cf7889d7f70f0051f152e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175502
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index 25694534a179..96789b67e33e 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1779,25 +1779,21 @@ bool SwPagePreview::HandleWheelCommands( const 
CommandEvent& rCEvt )
     const CommandWheelData* pWData = rCEvt.GetWheelData();
     if( pWData && CommandWheelMode::ZOOM == pWData->GetMode() )
     {
-        //only the Preference shouldn't control the Zoom, it is better to 
detect AT tools running. So the bridge can be used here
-        if 
(!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
+        sal_uInt16 nFactor = GetViewShell()->GetViewOptions()->GetZoom();
+        const sal_uInt16 nOffset = 10;
+        if( 0L > pWData->GetDelta() )
         {
-            sal_uInt16 nFactor = GetViewShell()->GetViewOptions()->GetZoom();
-            const sal_uInt16 nOffset = 10;
-            if( 0L > pWData->GetDelta() )
-            {
-                nFactor -= nOffset;
-                if(nFactor < MIN_PREVIEW_ZOOM)
-                    nFactor = MIN_PREVIEW_ZOOM;
-            }
-            else
-            {
-                nFactor += nOffset;
-                if(nFactor > MAX_PREVIEW_ZOOM)
-                    nFactor = MAX_PREVIEW_ZOOM;
-            }
-            SetZoom(SvxZoomType::PERCENT, nFactor);
+            nFactor -= nOffset;
+            if(nFactor < MIN_PREVIEW_ZOOM)
+                nFactor = MIN_PREVIEW_ZOOM;
+        }
+        else
+        {
+            nFactor += nOffset;
+            if(nFactor > MAX_PREVIEW_ZOOM)
+                nFactor = MAX_PREVIEW_ZOOM;
         }
+        SetZoom(SvxZoomType::PERCENT, nFactor);
         bOk = true;
     }
     else
commit 77e1c0bfa2e643f017b829cd775d08c5a40d9b6b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Oct 23 12:17:02 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Oct 24 09:07:48 2024 +0200

    win a11y: No longer read/write registry key
    
    No longer attempt to write a registry
    "SupportAssistiveTechnology" in
    "HKEY_CURRENT_USER\Software\LibreOffice\Accessibility\AtToolSupport"
    when assistive technology support gets enabled (e.g. because a
    screen reader is running) and no longer try to read that registry
    key to determine whether or not AT tool support is requested.
    
    While the comment
    
        // Check in the Windows registry if an AT tool wants Accessibility 
support to
        // be activated ..
    
    seems to suggest that this is something requested by an assistive
    technology, it looks more like a way to persist whether the a11y
    bridge was ever used in LO, as LO itself writes that value.
    
    I don't really see the point, but think it makes much more
    sense to enable the a11y bridge if an AT is active
    *at the moment*.
    
    In addition, in my Windows 10 setup with LO 24.8 installed, there's no
    "HKEY_CURRENT_USER\Software\LibreOffice" in the registry, only a
    "HKEY_CURRENT_USER\Software\The Document Foundation\LibreOffice 24.8",
    so the code wouldn't have any effect in practice anyway.
    
    Maybe this was necessary at some point in the past
    when the Java Access Bridge was still in place, instead
    of supporting the platform API via today's MSAA/IAccessible2
    bridge
    
    Note that before
    
        commit bfbaeb8192447265bdd78d1be4990947d135eb6e
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Oct 18 17:01:43 2024 +0100
    
            tdf#160982 wina11y: Drop extra screen reader check to enable a11y 
bridge
    
    , the presence or absence of the SPI_GETSCREENREADER param
    or a SAL_FORCE_IACCESSIBLE2 environment variable would
    additionally have played a role.
    
    Change-Id: I4dddb599eedb4b29c9709fbb41093ef615e60b8f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175501
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 2372a380937c..3f2160420806 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2710,55 +2710,6 @@ bool MiscSettings::GetDisablePrinting() const
 
 bool MiscSettings::GetEnableATToolSupport() const
 {
-
-#ifdef _WIN32
-    if( mxData->mnEnableATT == TRISTATE_INDET )
-    {
-        // Check in the Windows registry if an AT tool wants Accessibility 
support to
-        // be activated ..
-        HKEY hkey;
-
-        if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
-            L"Software\LibreOffice\Accessibility\AtToolSupport",
-            &hkey) )
-        {
-            DWORD dwType;
-            wchar_t Data[6]; // possible values: "true", "false", "1", "0", 
DWORD
-            DWORD cbData = sizeof(Data);
-
-            if( ERROR_SUCCESS == RegQueryValueExW(hkey, 
L"SupportAssistiveTechnology",
-                nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
-            {
-                switch (dwType)
-                {
-                    case REG_SZ:
-                        mxData->mnEnableATT = ((0 == wcsicmp(Data, L"1")) || 
(0 == wcsicmp(Data, L"true"))) ? TRISTATE_TRUE : TRISTATE_FALSE;
-                        break;
-                    case REG_DWORD:
-                        switch (reinterpret_cast<DWORD *>(Data)[0]) {
-                        case 0:
-                            mxData->mnEnableATT = TRISTATE_FALSE;
-                            break;
-                        case 1:
-                            mxData->mnEnableATT = TRISTATE_TRUE;
-                            break;
-                        default:
-                            mxData->mnEnableATT = TRISTATE_INDET;
-                                //TODO: or TRISTATE_TRUE?
-                            break;
-                        }
-                        break;
-                    default:
-                        // Unsupported registry type
-                        break;
-                }
-            }
-
-            RegCloseKey(hkey);
-        }
-    }
-#endif
-
     if( mxData->mnEnableATT == TRISTATE_INDET )
     {
         static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
@@ -2790,43 +2741,7 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable )
         mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
 
         if (o3tl::IsRunningUnitTest())
-            return; // No registry changing; no SettingsConfigItem modification
-
-        HKEY hkey;
-
-        // If the accessibility key in the Windows registry exists, change it 
synchronously
-        if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
-            L"Software\LibreOffice\Accessibility\AtToolSupport",
-            &hkey) )
-        {
-            DWORD dwType;
-            wchar_t Data[6]; // possible values: "true", "false", 1, 0
-            DWORD cbData = sizeof(Data);
-
-            if( ERROR_SUCCESS == RegQueryValueExW(hkey, 
L"SupportAssistiveTechnology",
-                nullptr,   &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
-            {
-                switch (dwType)
-                {
-                    case REG_SZ:
-                        RegSetValueExW(hkey, L"SupportAssistiveTechnology",
-                            0, dwType,
-                            reinterpret_cast<const BYTE*>(bEnable ? L"true" : 
L"false"),
-                            bEnable ? sizeof(L"true") : sizeof(L"false"));
-                        break;
-                    case REG_DWORD:
-                        reinterpret_cast<DWORD *>(Data)[0] = bEnable ? 1 : 0;
-                        RegSetValueExW(hkey, L"SupportAssistiveTechnology",
-                            0, dwType, reinterpret_cast<const BYTE*>(Data), 
sizeof(DWORD));
-                        break;
-                    default:
-                        // Unsupported registry type
-                        break;
-                }
-            }
-
-            RegCloseKey(hkey);
-        }
+            return; // no SettingsConfigItem modification
 
         vcl::SettingsConfigItem::get()->
             setValue( "Accessibility",
commit fe9ebbefb5f94d7d002b84c8732c1812d029775f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Oct 23 10:56:38 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Oct 24 09:07:41 2024 +0200

    win: Drop local var assigned to but never read
    
    Change-Id: I302e014134d5f91a4d454d3b137743af3c455997
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175473
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index bcb3041225b6..8dbe2428b7e4 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -1123,7 +1123,6 @@ OUString WinSalInstance::getOSVersion()
         }
         // Now use RtlGetVersion (which is not subject to deprecation for 
GetVersion(Ex) API)
         // to get build number and SP info
-        bool bHaveVerFromRtlGetVersion = false;
         DWORD nBuildNumber = 0;
         if (HMODULE h_ntdll = GetModuleHandleW(L"ntdll.dll"))
         {
@@ -1138,7 +1137,6 @@ OUString WinSalInstance::getOSVersion()
                         aNtVersion = (OUString::number(vi2.dwMajorVersion) + 
"."
                                       + OUString::number(vi2.dwMinorVersion));
                     nBuildNumber = vi2.dwBuildNumber;
-                    bHaveVerFromRtlGetVersion = true;
                 }
             }
         }

Reply via email to