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