include/vcl/seleng.hxx                                   |   12 ++++++------
 sc/source/ui/inc/select.hxx                              |    2 +-
 sc/source/ui/view/select.cxx                             |   12 ++++++------
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   15 +++++++++++++++
 sw/qa/core/accessibilitycheck/data/TOCHyperlinkTest.odt  |binary
 vcl/source/window/seleng.cxx                             |    2 +-
 6 files changed, 29 insertions(+), 14 deletions(-)

New commits:
commit e558cbed9b350f2e6cbe948d648471499e0deffc
Author:     sahil <gautamsahil1...@gmail.com>
AuthorDate: Wed Aug 23 22:03:34 2023 +0530
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Wed Oct 25 11:27:28 2023 +0200

    tdf#114441 - Convert use of sal_uLong to better integer types
    
    nUpdateInterval (sal_uLong --> sal_uInt64) because it is passed as
    argument to Timer::SetTimeout function that takes a sal_uInt64
    
    func CalcUpdateInterval (sal_uLong --> sal_uInt64 return type) because
    this function is only being called once, and in that call, the
    return value is passed to a function which takes sal_uInt64 type
    int. line 412
    
(https://opengrok.libreoffice.org/xref/core/sc/source/ui/view/select.cxx?r=b6b26421#412)
    two lines after which it is passed to a function ...
    
    and the function changed in vcl/source/window/seleng.cxx is the one to
    which the value of nUpdateInterval is being passed as explained in
    the lines above.
    
    Change-Id: I73441c2d3520a222ddb39b8c0c205b4dd61d4751
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156015
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>

diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx
index 580ae74177bf..a0f069e04c1e 100644
--- a/include/vcl/seleng.hxx
+++ b/include/vcl/seleng.hxx
@@ -33,10 +33,10 @@ namespace vcl {
 }
 
 // Timerticks
-#define SELENG_DRAGDROP_TIMEOUT     400
-#define SELENG_AUTOREPEAT_INTERVAL  50
-#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
-#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
+constexpr sal_uInt64 SELENG_DRAGDROP_TIMEOUT = 400;
+constexpr sal_uInt64 SELENG_AUTOREPEAT_INTERVAL =  50;
+constexpr sal_uInt64 SELENG_AUTOREPEAT_INTERVAL_MIN  = 25;
+constexpr sal_uInt64 SELENG_AUTOREPEAT_INTERVAL_MAX  = 300;
 
 class VCL_DLLPUBLIC FunctionSet
 {
@@ -84,7 +84,7 @@ private:
     Timer               aWTimer; // generate fake mouse moves
     MouseEvent          aLastMove;
     SelectionMode       eSelMode;
-    sal_uLong               nUpdateInterval;
+    sal_uInt64               nUpdateInterval;
     sal_uInt16              nLockedMods;
     SelectionEngineFlags    nFlags;
     DECL_DLLPRIVATE_LINK( ImpWatchDog, Timer*, void );
@@ -159,7 +159,7 @@ public:
     bool                HasAnchor() const;
     void                SetAnchor( bool bAnchor );
 
-    void                SetUpdateInterval( sal_uLong nInterval );
+    void                SetUpdateInterval( sal_uInt64 nInterval );
 
     // is switched on in the Ctor
     void                ExpandSelectionOnMouseMove( bool bExpand = true )
diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx
index e1223f91e793..299463afddd2 100644
--- a/sc/source/ui/inc/select.hxx
+++ b/sc/source/ui/inc/select.hxx
@@ -49,7 +49,7 @@ private:
 
     ScSplitPos      GetWhich() const;
 
-    sal_uLong           CalcUpdateInterval( const Size& rWinSize, const Point& 
rEffPos,
+    sal_uInt64           CalcUpdateInterval( const Size& rWinSize, const 
Point& rEffPos,
                                         bool bLeftScroll, bool bTopScroll, 
bool bRightScroll, bool bBottomScroll );
 
 public:
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 961f511131ba..d972c9b4eb8d 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -60,10 +60,10 @@ ScSplitPos ScViewFunctionSet::GetWhich() const
         return m_pViewData->GetActivePart();
 }
 
-sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const 
Point& rEffPos,
+sal_uInt64 ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const 
Point& rEffPos,
                                              bool bLeftScroll, bool 
bTopScroll, bool bRightScroll, bool bBottomScroll )
 {
-    sal_uLong nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
+    sal_uInt64 nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
     vcl::Window* pWin = m_pEngine->GetWindow();
     AbsoluteScreenPixelRectangle aScrRect = pWin->GetDesktopRectPixel();
     AbsoluteScreenPixelPoint aRootPos = 
pWin->OutputToAbsoluteScreenPixel(Point(0,0));
@@ -77,7 +77,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& 
rWinSize, const Poi
         if (nHAccelRate > 1.0)
             nHAccelRate = 1.0;
 
-        nUpdateInterval = 
static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
+        nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate);
     }
 
     if (bLeftScroll)
@@ -104,7 +104,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const 
Size& rWinSize, const Poi
         if (nVAccelRate > 1.0)
             nVAccelRate = 1.0;
 
-        sal_uLong nTmp = 
static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+        sal_uInt64 nTmp = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate);
         if (nUpdateInterval > nTmp)
             nUpdateInterval = nTmp;
     }
@@ -118,7 +118,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const 
Size& rWinSize, const Poi
         if (nVAccelRate > 1.0)
             nVAccelRate = 1.0;
 
-        sal_uLong nTmp = 
static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+        sal_uInt64 nTmp = SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate);
         if (nUpdateInterval > nTmp)
             nUpdateInterval = nTmp;
     }
@@ -409,7 +409,7 @@ void ScViewFunctionSet::SetCursorAtPoint( const Point& 
rPointPixel, bool /* bDon
     if (bScroll)
     {
         // Adjust update interval based on how far the mouse pointer is from 
the edge.
-        sal_uLong nUpdateInterval = CalcUpdateInterval(
+        sal_uInt64 nUpdateInterval = CalcUpdateInterval(
             aWinSize, aEffPos, bLeftScroll, bTopScroll, bRightScroll, 
bBottomScroll);
         m_pEngine->SetUpdateInterval(nUpdateInterval);
     }
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 9cb70cf99d83..a22ecaa7c5dd 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -395,7 +395,7 @@ bool SelectionEngine::Command( const CommandEvent& rCEvt )
     return true;
 }
 
-void SelectionEngine::SetUpdateInterval( sal_uLong nInterval )
+void SelectionEngine::SetUpdateInterval( sal_uInt64 nInterval )
 {
     if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
         // Set a lower threshold.  On Windows, setting this value too low
commit 0c50fe53acbd0ee98e93d52e9967f94543301473
Author:     Yli875 <qq3202390...@gmail.com>
AuthorDate: Tue Oct 24 09:59:46 2023 -0700
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Oct 25 11:27:14 2023 +0200

    tdf#156550 sw: Add a unit test
    
    Change-Id: If0ecfc8f7ebfce330ef0e25b17f48d2a34957299
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158395
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 2b99f49b0cb2..72337e62d6e0 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -202,6 +202,21 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckTabsFormatting)
     CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, 
aIssues[3]->m_eIssueID);
 }
 
+//tdf#156550 - Accessibility sidebar complains about TOC hyperlinks
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTOCHyperlink)
+{
+    createSwDoc("TOCHyperlinkTest.odt");
+    SwDoc* pDoc = getSwDoc();
+    CPPUNIT_ASSERT(pDoc);
+    sw::AccessibilityCheck aCheck(pDoc);
+    aCheck.check();
+    auto& aIssues = aCheck.getIssueCollection().getIssues();
+    // Without the fix in place, this test would have failed with
+    // - Expected: 0 (No Detected HYPERLINK_IS_TEXT Issues)
+    // - Actual  : 4 (Number of TOC Hyperlinks)
+    CPPUNIT_ASSERT_EQUAL(size_t(0), aIssues.size());
+}
+
 namespace
 {
 std::vector<std::shared_ptr<sfx::AccessibilityIssue>>
diff --git a/sw/qa/core/accessibilitycheck/data/TOCHyperlinkTest.odt 
b/sw/qa/core/accessibilitycheck/data/TOCHyperlinkTest.odt
new file mode 100755
index 000000000000..506fc935ac1e
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/TOCHyperlinkTest.odt differ

Reply via email to