core.git: sw/source

2024-04-13 Thread Aaron Bourdeaux (via logerrit)
 sw/source/core/access/acccell.cxx |4 +---
 sw/source/core/access/accembedded.cxx |4 +---
 sw/source/core/access/accfootnote.cxx |9 ++---
 3 files changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 734a84f33d3f08e31086c2dbd629715608a178d5
Author: Aaron Bourdeaux 
AuthorDate: Fri Apr 5 19:38:00 2024 -0400
Commit: Ilmari Lauhakangas 
CommitDate: Sat Apr 13 20:31:00 2024 +0200

tdf#158067 Replace OUStringLiteral with _ustr

Change-Id: I3a58469c52055121e8726cee2d3e42ecd23cdf96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165826
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index 8b15fa095545..0cffe02d1e04 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -48,8 +48,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 using namespace sw::access;
 
-constexpr OUStringLiteral sImplementationName = 
u"com.sun.star.comp.Writer.SwAccessibleCellView";
-
 bool SwAccessibleCell::IsSelected()
 {
 bool bRet = false;
@@ -240,7 +238,7 @@ OUString SAL_CALL 
SwAccessibleCell::getAccessibleDescription()
 
 OUString SAL_CALL SwAccessibleCell::getImplementationName()
 {
-return sImplementationName;
+return u"com.sun.star.comp.Writer.SwAccessibleCellView"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& 
sTestServiceName)
diff --git a/sw/source/core/access/accembedded.cxx 
b/sw/source/core/access/accembedded.cxx
index 1eb54cf25878..7d4a5415bdcf 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -31,8 +31,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
-constexpr OUStringLiteral sImplementationName = 
u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
-
 SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
 std::shared_ptr const& pInitMap,
 const SwFlyFrame* pFlyFrame  ) :
@@ -71,7 +69,7 @@ void SAL_CALL
 
 OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
 {
-return sImplementationName;
+return u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& 
sTestServiceName)
diff --git a/sw/source/core/access/accfootnote.cxx 
b/sw/source/core/access/accfootnote.cxx
index 6fb7ebca864c..9fc265c53bc1 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -33,11 +33,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
-constexpr OUStringLiteral sImplementationNameFootnote
-= u"com.sun.star.comp.Writer.SwAccessibleFootnoteView";
-constexpr OUStringLiteral sImplementationNameEndnote
-= u"com.sun.star.comp.Writer.SwAccessibleEndnoteView";
-
 SwAccessibleFootnote::SwAccessibleFootnote(
 std::shared_ptr const& pInitMap,
 bool bIsEndnote,
@@ -90,9 +85,9 @@ OUString SAL_CALL 
SwAccessibleFootnote::getAccessibleDescription()
 OUString SAL_CALL SwAccessibleFootnote::getImplementationName()
 {
 if( AccessibleRole::END_NOTE == GetRole() )
-return sImplementationNameEndnote;
+return u"com.sun.star.comp.Writer.SwAccessibleEndnoteView"_ustr;
 else
-return sImplementationNameFootnote;
+return u"com.sun.star.comp.Writer.SwAccessibleFootnoteView"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& 
sTestServiceName)


core.git: svx/source

2024-04-05 Thread Aaron Bourdeaux (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx |4 +---
 svx/source/sdr/overlay/overlaybitmapex.cxx |2 +-
 svx/source/sdr/overlay/overlaytools.cxx|6 +++---
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit ee9a21da6aa0872855f78a4464d6952e11a9aa54
Author: Aaron Bourdeaux 
AuthorDate: Fri Mar 29 19:12:59 2024 -0400
Commit: Ilmari Lauhakangas 
CommitDate: Fri Apr 5 13:15:46 2024 +0200

tdf#160084 Simplify comparison for basegfx::fTools

Change-Id: I61bcc0054c71273945d3004839be92a25a26d261
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165563
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index e6386e7c0a92..0c206f6edb07 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -99,9 +99,7 @@ void 
ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(drawinglay
 const double fWidth(aChartContentRange.getWidth());
 const double fHeight(aChartContentRange.getHeight());
 
-if(!aChartSequence.empty()
-&& basegfx::fTools::more(fWidth, 0.0)
-&& basegfx::fTools::more(fHeight, 0.0))
+if(!aChartSequence.empty() && fWidth > 0.0 && fHeight > 0.0)
 {
 // create embedding transformation
 basegfx::B2DHomMatrix aEmbed(
diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx 
b/svx/source/sdr/overlay/overlaybitmapex.cxx
index 3ffba9e05747..6dc31ff8eb2c 100644
--- a/svx/source/sdr/overlay/overlaybitmapex.cxx
+++ b/svx/source/sdr/overlay/overlaybitmapex.cxx
@@ -35,7 +35,7 @@ namespace sdr::overlay
 mfShearX,
 mfRotation));
 
-if(basegfx::fTools::more(mfAlpha, 0.0))
+if(mfAlpha > 0.0)
 {
 drawinglayer::primitive2d::Primitive2DContainer 
aNewTransPrimitiveVector { aReference };
 aReference = new 
drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aNewTransPrimitiveVector),
 mfAlpha);
diff --git a/svx/source/sdr/overlay/overlaytools.cxx 
b/svx/source/sdr/overlay/overlaytools.cxx
index 8b857ad53ee8..2755b7fa3030 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -62,7 +62,7 @@ Primitive2DReference 
OverlayStaticRectanglePrimitive::create2DDecomposition(cons
 maPosition.getX() - fHalfWidth, maPosition.getY() - fHalfHeight,
 maPosition.getX() + fHalfWidth, maPosition.getY() + fHalfHeight);
 
-if (!basegfx::fTools::more(getDiscreteUnit(), 0.0) || mfTransparence > 1.0)
+if (getDiscreteUnit() <= 0.0 || mfTransparence > 1.0)
 return nullptr;
 
 basegfx::B2DPolygon aPolygon(
@@ -138,7 +138,7 @@ sal_uInt32 
OverlayStaticRectanglePrimitive::getPrimitive2DID() const
 {
 const Size aBitmapSize(getBitmapEx().GetSizePixel());
 
-if(!aBitmapSize.Width() || !aBitmapSize.Height() || 
!basegfx::fTools::more(getDiscreteUnit(), 0.0))
+if(!aBitmapSize.Width() || !aBitmapSize.Height() || 
getDiscreteUnit() <= 0.0)
 return nullptr;
 
 // calculate back from internal bitmap's extreme coordinates (the 
edges)
@@ -287,7 +287,7 @@ sal_uInt32 
OverlayStaticRectanglePrimitive::getPrimitive2DID() const
 Primitive2DReference aRetval;
 basegfx::B2DRange aInnerRange(getObjectRange());
 
-if(aInnerRange.isEmpty() || 
!basegfx::fTools::more(getDiscreteUnit(), 0.0) || getTransparence() > 1.0)
+if(aInnerRange.isEmpty() || getDiscreteUnit() <= 0.0 || 
getTransparence() > 1.0)
 return nullptr;
 
 if 
(!Application::GetSettings().GetStyleSettings().GetHighContrastMode())


core.git: oox/source

2024-03-29 Thread Aaron Bourdeaux (via logerrit)
 oox/source/drawingml/customshapeproperties.cxx |2 +-
 oox/source/helper/propertymap.cxx  |2 +-
 oox/source/shape/WpsContext.cxx|8 
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 6c358c28c5cc2d1d8d8bb9d1238e3546a9bf3ce8
Author: Aaron Bourdeaux 
AuthorDate: Thu Mar 28 14:32:45 2024 -0400
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Fri Mar 29 14:58:23 2024 +0100

tdf#158237 Use C++20 contains() instead of find() and end()

Change-Id: I529096d97991a89bdc68ec7f5d490ec21744fc6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165499
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index 862ffd8624a3..a3e2dd5e10bb 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -111,7 +111,7 @@ void CustomShapeProperties::pushToPropSet(
 PropertyMap aPropertyMap;
 PropertySet aPropSet( xPropSet );
 
-if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end())
+if (maPresetDataMap.contains(mnShapePresetType))
 {
 SAL_INFO(
 "oox.drawingml",
diff --git a/oox/source/helper/propertymap.cxx 
b/oox/source/helper/propertymap.cxx
index d5a89e6f2388..d93fb41209bf 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -171,7 +171,7 @@ Property SAL_CALL GenericPropertySet::getPropertyByName( 
const OUString& rProper
 
 sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& 
rPropertyName )
 {
-return maPropMap.find( rPropertyName ) != maPropMap.end();
+return maPropMap.contains(rPropertyName);
 }
 
 } // namespace
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 6d7b3d117fc4..37c58d25029e 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -203,7 +203,7 @@ void lcl_getFillDetailsFromPropSeq(const 
uno::Sequence& rT
 if (!rTextFillSeq.hasElements())
 return;
 comphelper::SequenceAsHashMap aTextFillMap(rTextFillSeq);
-if (aTextFillMap.find(u"noFill"_ustr) != aTextFillMap.end())
+if (aTextFillMap.contains(u"noFill"_ustr))
 {
 rFillProperties.moFillType = oox::XML_noFill;
 return;
@@ -308,11 +308,11 @@ void lcl_getLineDetailsFromPropSeq(const 
uno::Sequence& rT
 
 // LineJoint
 comphelper::SequenceAsHashMap aTextOutlineMap(rTextOutlineSeq);
-if (aTextOutlineMap.find(u"bevel"_ustr) != aTextOutlineMap.end())
+if (aTextOutlineMap.contains(u"bevel"_ustr))
 rLineProperties.moLineJoint = oox::XML_bevel;
-else if (aTextOutlineMap.find(u"round"_ustr) != aTextOutlineMap.end())
+else if (aTextOutlineMap.contains(u"round"_ustr))
 rLineProperties.moLineJoint = oox::XML_round;
-else if (aTextOutlineMap.find(u"miter"_ustr) != aTextOutlineMap.end())
+else if (aTextOutlineMap.contains(u"miter"_ustr))
 {
 // LineProperties has no member to store a miter limit. Therefore some 
heuristic is
 // added here. 0 is default for attribute "lim" in MS Office. It is 
rendered same as bevel.