summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-22 16:06:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-22 21:59:03 +0200
commitfc37b184eeaecee2f4d1d5cc7d6d032e59802cae (patch)
tree37d9bfccf67b6551503f045ee6489a08dd5d197f /editeng
parent13366d4951bd4ed92cdeed3c8fdeb1ab0543a3db (diff)
tdf#158556 make SvxBoxItem hashable
Change-Id: I33557df66341ec0d201b66f97ed33c1c61155d7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172262 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/frmitems.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index d2a788370e77..ee8c84888c45 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2377,6 +2377,15 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) const
CompareBorderLine(mpRightBorderLine, rBoxItem.GetRight()));
}
+size_t SvxBoxItem::hashCode() const
+{
+ std::size_t seed(0);
+ o3tl::hash_combine(seed, mnTopDistance);
+ o3tl::hash_combine(seed, mnBottomDistance);
+ o3tl::hash_combine(seed, mnLeftDistance);
+ o3tl::hash_combine(seed, mnRightDistance);
+ return seed;
+}
table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, bool bConvert)
{
@@ -2617,6 +2626,7 @@ lcl_setLine(const uno::Any& rAny, Item& rItem, Line nLine, const bool bConvert)
bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
SvxBoxItemLine nLine = SvxBoxItemLine::TOP;
bool bDistMember = false;
@@ -3009,6 +3019,7 @@ bool SvxBoxItem::GetPresentation
void SvxBoxItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
if (mpTopBorderLine)
mpTopBorderLine->ScaleMetrics( nMult, nDiv );
if (mpBottomBorderLine)
@@ -3060,6 +3071,7 @@ const SvxBorderLine *SvxBoxItem::GetLine( SvxBoxItemLine nLine ) const
void SvxBoxItem::SetLine( const SvxBorderLine* pNew, SvxBoxItemLine nLine )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
std::unique_ptr<SvxBorderLine> pTmp( pNew ? new SvxBorderLine( *pNew ) : nullptr );
switch ( nLine )
@@ -3128,6 +3140,7 @@ sal_Int16 SvxBoxItem::GetDistance( SvxBoxItemLine nLine, bool bAllowNegative ) c
void SvxBoxItem::SetDistance( sal_Int16 nNew, SvxBoxItemLine nLine )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
switch ( nLine )
{
case SvxBoxItemLine::TOP:
@@ -3218,6 +3231,7 @@ sal_Int16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine nLine, bool bEvenIfNoLine, b
void SvxBoxItem::tryMigrateComplexColor(SvxBoxItemLine eLine)
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
if (!GetLine(eLine))
return;