[Libreoffice-commits] core.git: svl/source svx/source

2023-11-21 Thread Armin Le Grand (allotropia) (via logerrit)
 svl/source/items/itempool.cxx|2 
 svx/source/dialog/framelinkarray.cxx |  206 +--
 2 files changed, 103 insertions(+), 105 deletions(-)

New commits:
commit f7df46c917533d3ce3528d52f49629fe9f51e67b
Author: Armin Le Grand (allotropia) 
AuthorDate: Tue Nov 21 19:57:25 2023 +0100
Commit: Noel Grandin 
CommitDate: Wed Nov 22 07:41:15 2023 +0100

Work with what we have in ArrayImpl: pointers

That allows to not create a local copy on the heap before
being able to check if a change is really necessary

Also added mfOrientation to Cell::operator==, it was missing. Maybe
with C++20 we should more use the default generated op== (or op<=>)
that may turn out to be more safe. For class Cell at least all members
(and sub-members of Style) are simple and simple comparable.

Change-Id: Idea2ef2abe68c4bb14aa776a8393ba5da92abd5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159798
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index f119bc85304f..c2c37c1200fb 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -40,8 +40,6 @@ static size_t nRemainingDirectlyPooledSfxPoolItemCount(0);
 size_t getAllDirectlyPooledSfxPoolItemCount() { return 
nAllDirectlyPooledSfxPoolItemCount; }
 size_t getRemainingDirectlyPooledSfxPoolItemCount() { return 
nRemainingDirectlyPooledSfxPoolItemCount; }
 #endif
-// NOTE: Only needed for one Item in SC, see note in itemset.cxx
-static bool g_bItemClassicMode(getenv("ITEM_CLASSIC_MODE"));
 
 // WhichIDs that need to set _bNeedsPoolRegistration in SfxItemInfo
 // to true to allow a register of all items of that type/with that WhichID
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index afe6a2d7dd51..65e8c8342dfe 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -226,6 +226,7 @@ bool Cell::operator==(const Cell& rOther) const
 && mnAddTop == rOther.mnAddTop
 && mnAddBottom == rOther.mnAddBottom
 && meRotMode == rOther.meRotMode
+&& mfOrientation == rOther.mfOrientation
 && mbOverlapX == rOther.mbOverlapX
 && mbOverlapY == rOther.mbOverlapY;
 }
@@ -280,7 +281,7 @@ struct ArrayImpl
 sal_Int32   GetIndex( sal_Int32 nCol, sal_Int32 nRow ) const
 { return nRow * mnWidth + nCol; }
 
-const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
+const Cell* GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
 voidPutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell& );
 
 sal_Int32  GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) 
const;
@@ -288,8 +289,8 @@ struct ArrayImpl
 sal_Int32  GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 sal_Int32  GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
-const Cell& GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
-const Cell& GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
+const Cell* GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
+const Cell* GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
 boolIsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow 
) const;
 boolIsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 
nRow ) const;
@@ -367,9 +368,9 @@ Cell* ArrayImpl::createOrFind(const Cell& rCell)
 return pRetval;
 }
 
-const Cell& ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const
+const Cell* ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const
 {
-return IsValidPos( nCol, nRow ) ? *maCells[ GetIndex( nCol, nRow ) ] : 
OBJ_CELL_NONE;
+return IsValidPos( nCol, nRow ) ? maCells[ GetIndex( nCol, nRow ) ] : 
_CELL_NONE;
 }
 
 void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell & rCell )
@@ -381,61 +382,61 @@ void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, 
const Cell & rCell )
 sal_Int32 ArrayImpl::GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nFirstCol = nCol;
-while( (nFirstCol > 0) && GetCell( nFirstCol, nRow ).mbOverlapX ) 
--nFirstCol;
+while( (nFirstCol > 0) && GetCell( nFirstCol, nRow )->mbOverlapX ) 
--nFirstCol;
 return nFirstCol;
 }
 
 sal_Int32 ArrayImpl::GetMergedFirstRow( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nFirstRow = nRow;
-while( (nFirstRow > 0) && GetCell( nCol, nFirstRow ).mbOverlapY ) 
--nFirstRow;
+while( (nFirstRow > 0) && GetCell( nCol, nFirstRow )->mbOverlapY ) 
--nFirstRow;
 return nFirstRow;
 }
 
 sal_Int32 ArrayImpl::GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nLastCol = nCol + 1;
-while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow 

[Libreoffice-commits] core.git: svl/source svx/source

2015-07-02 Thread Caolán McNamara
 svl/source/inc/passwordcontainer.hxx   |2 +-
 svl/source/passwordcontainer/passwordcontainer.cxx |2 +-
 svx/source/svdraw/svdobj.cxx   |1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a9ad8444b8e1c47a47dc4ef6367335e3ccad59ea
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jul 2 08:23:17 2015 +0100

coverity#1309051 Uncaught exception

Change-Id: Ia1ae16d9560c1eac294e29445e71dcee49ed16ce

diff --git a/svl/source/inc/passwordcontainer.hxx 
b/svl/source/inc/passwordcontainer.hxx
index df421b5..ba8e72f 100644
--- a/svl/source/inc/passwordcontainer.hxx
+++ b/svl/source/inc/passwordcontainer.hxx
@@ -248,7 +248,7 @@ private:
 ::com::sun::star::uno::Sequence ::com::sun::star::task::UserRecord  
CopyToUserRecordSequence(
 const ::std::list NamePassRecord  
original,
 const 
::com::sun::star::uno::Reference ::com::sun::star::task::XInteractionHandler 
 Handler )
-
throw(::com::sun::star::uno::RuntimeException);
+
throw(css::uno::RuntimeException, std::exception);
 
 ::com::sun::star::task::UserRecord CopyToUserRecord(
 const NamePassRecord aRecord,
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx 
b/svl/source/passwordcontainer/passwordcontainer.cxx
index 6b8fa7f..5b807cd 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -623,7 +623,7 @@ UserRecord PasswordContainer::CopyToUserRecord( const 
NamePassRecord aRecord, b
 }
 
 
-Sequence UserRecord  PasswordContainer::CopyToUserRecordSequence( const 
list NamePassRecord  original, const Reference XInteractionHandler  
aHandler ) throw(RuntimeException)
+Sequence UserRecord  PasswordContainer::CopyToUserRecordSequence( const 
list NamePassRecord  original, const Reference XInteractionHandler  
aHandler ) throw(RuntimeException, std::exception)
 {
 Sequence UserRecord  aResult( original.size() );
 sal_uInt32 nInd = 0;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 9bf94f7..51b5e0d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1620,6 +1620,7 @@ void SdrObject::ImpSetAnchorPos(const Point rPnt)
 
 void SdrObject::NbcSetAnchorPos(const Point rPnt)
 {
+fprintf(stderr, NbcSetAnchorPos %ld %ld\n, rPnt.X(), rPnt.Y());
 Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
 aAnchor=rPnt;
 NbcMove(aSiz); // This also calls SetRectsDirty()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits