sc/source/ui/inc/gridwin.hxx            |    8 ++++----
 sc/source/ui/view/gridwin4.cxx          |   14 +++++++-------
 sd/source/filter/eppt/epptbase.hxx      |    1 -
 sd/source/filter/eppt/pptx-epptbase.cxx |    8 ++++----
 4 files changed, 15 insertions(+), 16 deletions(-)

New commits:
commit 8c4871201ee73d3f0dd59afab6f000b266907047
Author:     Noel Grandin <[email protected]>
AuthorDate: Sun Mar 22 16:52:29 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Mar 24 05:34:20 2026 +0100

    Fraction->double in LOKCursorEntry
    
    Change-Id: I88148de920ff6ed50290b566f9e3e755fbc8119d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202398
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 65f5eafc7e40..76d4e7ae813d 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -151,8 +151,8 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public 
vcl::DocWindow, public DropTarget
 
     struct LOKCursorEntry
     {
-        Fraction aScaleX;
-        Fraction aScaleY;
+        double mfScaleX;
+        double mfScaleY;
         tools::Rectangle aRect;
     };
 
@@ -326,9 +326,9 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public 
vcl::DocWindow, public DropTarget
     void            UpdateKitSelection(const std::vector<tools::Rectangle>& 
rRectangles,
                                        std::vector<tools::Rectangle>* 
pLogicRects = nullptr);
     bool            NeedLOKCursorInvalidation(const tools::Rectangle& 
rCursorRect,
-                                              const Fraction aScaleX, const 
Fraction aScaleY);
+                                              double fScaleX, double fScaleY);
     void            InvalidateLOKViewCursor(const tools::Rectangle& 
rCursorRect,
-                                            const Fraction aScaleX, const 
Fraction aScaleY);
+                                            double fScaleX, double fScaleY);
 
     void            SetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab);
     DECL_DLLPRIVATE_LINK(InitiatePageBreaksTimer, Timer*, void);
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 1bddc7aee900..e45db253589a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -312,13 +312,13 @@ void ScGridWindow::PrePaint(vcl::RenderContext& 
/*rRenderContext*/)
 }
 
 bool ScGridWindow::NeedLOKCursorInvalidation(const tools::Rectangle& 
rCursorRect,
-        const Fraction aScaleX, const Fraction aScaleY)
+        double fScaleX, double fScaleY)
 {
     // Don't see the need for a map as there will be only a few zoom levels
     // and as of now X and Y zooms in online are the same.
     for (auto& rEntry : maLOKLastCursor)
     {
-        if (aScaleX == rEntry.aScaleX && aScaleY == rEntry.aScaleY)
+        if (fScaleX == rEntry.mfScaleX && fScaleY == rEntry.mfScaleY)
         {
             if (rCursorRect == rEntry.aRect)
                 return false; // No change
@@ -329,14 +329,14 @@ bool ScGridWindow::NeedLOKCursorInvalidation(const 
tools::Rectangle& rCursorRect
         }
     }
 
-    maLOKLastCursor.push_back(LOKCursorEntry{aScaleX, aScaleY, rCursorRect});
+    maLOKLastCursor.push_back(LOKCursorEntry{fScaleX, fScaleY, rCursorRect});
     return true;
 }
 
 void ScGridWindow::InvalidateLOKViewCursor(const tools::Rectangle& rCursorRect,
-        const Fraction aScaleX, const Fraction aScaleY)
+        double fScaleX, double fScaleY)
 {
-    if (!NeedLOKCursorInvalidation(rCursorRect, aScaleX, aScaleY))
+    if (!NeedLOKCursorInvalidation(rCursorRect, fScaleX, fScaleY))
         return;
 
     ScTabViewShell* pThisViewShell = mrViewData.GetViewShell();
@@ -352,7 +352,7 @@ void ScGridWindow::InvalidateLOKViewCursor(const 
tools::Rectangle& rCursorRect,
                 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
                 double fZoomX = rOtherViewData.GetZoomX();
                 double fZoomY = rOtherViewData.GetZoomY();
-                if (Fraction(fZoomX) == aScaleX && Fraction(fZoomY) == aScaleY)
+                if (fZoomX == fScaleX && fZoomY == fScaleY)
                 {
                     SfxLokHelper::notifyOtherView(*pThisViewShell, 
pOtherViewShell,
                             LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", 
rCursorRect.toString());
@@ -1298,7 +1298,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
                     aCursorRect.setWidth(0);
                     aCursorRect.Move(aCursPos.getX(), 0);
                     // Sends view cursor position to views of all matching 
zooms if needed (avoids duplicates).
-                    InvalidateLOKViewCursor(aCursorRect, aMM.GetScaleX(), 
aMM.GetScaleY());
+                    InvalidateLOKViewCursor(aCursorRect, 
double(aMM.GetScaleX()), double(aMM.GetScaleY()));
                 }
 
                 // Rollback the mapmode and 'output area'.
commit e9698991ec939f0bcdf1ee0840d3a439110090d6
Author:     Noel Grandin <[email protected]>
AuthorDate: Sun Mar 22 15:12:45 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Mar 24 05:34:06 2026 +0100

    maFraction in PPTWriterBase is static data
    
    it is never modified
    
    Change-Id: I329e3bcbad1981dfe57f47b31dadea0a17ee81d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202376
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sd/source/filter/eppt/epptbase.hxx 
b/sd/source/filter/eppt/epptbase.hxx
index a932e233e9d3..c012180f32ce 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -347,7 +347,6 @@ protected:
     sal_uInt32          mnMasterPages;
     sal_uInt32          mnCanvasMasterIndex;
 
-    Fraction           maFraction;
     MapMode            maMapModeSrc;
     MapMode            maMapModeDest;
     css::awt::Size     maDestPageSize;
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx 
b/sd/source/filter/eppt/pptx-epptbase.cxx
index 5dd0f374d485..a3528f765ee8 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -103,6 +103,8 @@ PHLayout const pPHLayout[] =
     { EppLayout::TWOCOLUMNSANDTITLE,    { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 
0x00, 0x00 }, 0x16, 0x0d, 0x12, true, true, false }
 };
 
+const Fraction gPPTFraction(1,576);
+
 PPTWriterBase::PPTWriterBase()
     : mbStatusIndicator(false)
     , mbPresObj(false)
@@ -113,9 +115,8 @@ PPTWriterBase::PPTWriterBase()
     , mnPages(0)
     , mnMasterPages(0)
     , mnCanvasMasterIndex(SAL_MAX_UINT32)
-    , maFraction(1, 576)
     , maMapModeSrc(MapUnit::Map100thMM)
-    , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction)
+    , maMapModeDest(MapUnit::MapInch, Point(), gPPTFraction, gPPTFraction)
     , meLatestPageType(NORMAL)
     , mpStyleSheet(nullptr)
 {
@@ -135,9 +136,8 @@ PPTWriterBase::PPTWriterBase( const rtl::Reference< 
SdXImpressDocument > & rXMod
     , mnPages(0)
     , mnMasterPages(0)
     , mnCanvasMasterIndex(SAL_MAX_UINT32)
-    , maFraction(1, 576)
     , maMapModeSrc(MapUnit::Map100thMM)
-    , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction)
+    , maMapModeDest(MapUnit::MapInch, Point(), gPPTFraction, gPPTFraction)
     , meLatestPageType (NORMAL)
     , mpStyleSheet(nullptr)
 {

Reply via email to