[Libreoffice-commits] core.git: include/tools starmath/source tools/source

2021-08-17 Thread Mike Kaganski (via logerrit)
 include/tools/gen.hxx   |4 ++--
 starmath/source/mathml/import.cxx   |4 ++--
 starmath/source/mathml/mathmlimport.cxx |4 ++--
 tools/source/generic/gen.cxx|4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 6fd0d2af5069ec23b25b7e7e2e024df9e3319a0a
Author: Mike Kaganski 
AuthorDate: Tue Aug 17 10:46:27 2021 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 17 13:15:54 2021 +0200

Rename SaturatingSet[XY] to SaturatingSetPos[XY]

... to align with commit 4639ca2f878b04ffc50d9c20d92e90464d2d67a7

Change-Id: Ibec7a451a61ca7f2d141a9624369a6f9656ed468
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120562
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 5cc23bf83654..a9cf170952e6 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -591,8 +591,8 @@ public:
  * Sanitizing variants for handling data from the outside
  */
 voidSaturatingSetSize(const Size& rSize);
-voidSaturatingSetX(tools::Long x);
-voidSaturatingSetY(tools::Long y);
+voidSaturatingSetPosX(tools::Long x);
+voidSaturatingSetPosY(tools::Long y);
 
 private:
 tools::Long nLeft = 0;
diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index e9e94b0f3cc6..39b81b9aaed9 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -1267,12 +1267,12 @@ void SmMLImport::SetViewSettings(const 
Sequence& aViewProps)
 if (rValue.Name == "ViewAreaTop")
 {
 rValue.Value >>= nTmp;
-aRect.SaturatingSetY(nTmp);
+aRect.SaturatingSetPosY(nTmp);
 }
 else if (rValue.Name == "ViewAreaLeft")
 {
 rValue.Value >>= nTmp;
-aRect.SaturatingSetX(nTmp);
+aRect.SaturatingSetPosX(nTmp);
 }
 else if (rValue.Name == "ViewAreaWidth")
 {
diff --git a/starmath/source/mathml/mathmlimport.cxx 
b/starmath/source/mathml/mathmlimport.cxx
index 270e6911281c..131eda86bb9f 100644
--- a/starmath/source/mathml/mathmlimport.cxx
+++ b/starmath/source/mathml/mathmlimport.cxx
@@ -2599,12 +2599,12 @@ void SmXMLImport::SetViewSettings(const 
Sequence& aViewProps)
 if (rValue.Name == "ViewAreaTop")
 {
 rValue.Value >>= nTmp;
-aRect.SaturatingSetY(nTmp);
+aRect.SaturatingSetPosY(nTmp);
 }
 else if (rValue.Name == "ViewAreaLeft")
 {
 rValue.Value >>= nTmp;
-aRect.SaturatingSetX(nTmp);
+aRect.SaturatingSetPosX(nTmp);
 }
 else if (rValue.Name == "ViewAreaWidth")
 {
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 027c7b9356b1..29e7da9b98fa 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -69,14 +69,14 @@ void tools::Rectangle::SaturatingSetSize(const Size& rSize)
 SetHeightEmpty();
 }
 
-void tools::Rectangle::SaturatingSetX(tools::Long x)
+void tools::Rectangle::SaturatingSetPosX(tools::Long x)
 {
 if (!IsWidthEmpty())
 nRight = o3tl::saturating_add(nRight, x - nLeft);
 nLeft = x;
 }
 
-void tools::Rectangle::SaturatingSetY(tools::Long y)
+void tools::Rectangle::SaturatingSetPosY(tools::Long y)
 {
 if (!IsHeightEmpty())
 nBottom = o3tl::saturating_add(nBottom, y - nTop);


[Libreoffice-commits] core.git: include/tools starmath/source tools/source

2018-03-13 Thread Caolán McNamara
 include/tools/gen.hxx|3 +++
 starmath/source/mathmlimport.cxx |4 ++--
 tools/source/generic/gen.cxx |   12 
 3 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit fc6a8994055db18b9ba2dce1e26d2b1ea9ea41f3
Author: Caolán McNamara 
Date:   Mon Mar 12 21:26:31 2018 +

ofz#6843 Integer-overflow

Change-Id: I3984253ac3e5eaf0be7b10c8ba95d50e6bd9ce5d
Reviewed-on: https://gerrit.libreoffice.org/51175
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 53f7fb716e3c..90486536c401 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -472,6 +472,9 @@ public:
  * Sanitizing variants for handling data from the outside
  */
 voidSaturatingSetSize(const Size& rSize);
+voidSaturatingSetX(long x);
+voidSaturatingSetY(long y);
+
 private:
 longnLeft;
 longnTop;
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index ed207aaa0f0b..59b42570a2d0 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -3067,12 +3067,12 @@ void SmXMLImport::SetViewSettings(const 
Sequence& aViewProps)
 if (pValue->Name == "ViewAreaTop" )
 {
 pValue->Value >>= nTmp;
-aRect.setY( nTmp );
+aRect.SaturatingSetY(nTmp);
 }
 else if (pValue->Name == "ViewAreaLeft" )
 {
 pValue->Value >>= nTmp;
-aRect.setX( nTmp );
+aRect.SaturatingSetX(nTmp);
 }
 else if (pValue->Name == "ViewAreaWidth" )
 {
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 5fe6eeeaa3d6..ea855f98e9f0 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -85,6 +85,18 @@ void tools::Rectangle::SaturatingSetSize(const Size& rSize)
 nBottom = RECT_EMPTY;
 }
 
+void tools::Rectangle::SaturatingSetX(long x)
+{
+nRight = o3tl::saturating_add(nRight, x - nLeft);
+nLeft = x;
+}
+
+void tools::Rectangle::SaturatingSetY(long y)
+{
+nBottom = o3tl::saturating_add(nBottom, y - nTop);
+nTop = y;
+}
+
 tools::Rectangle& tools::Rectangle::Union( const tools::Rectangle& rRect )
 {
 if ( rRect.IsEmpty() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits