summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-05-30 15:25:26 +0200
committerMichael Stahl <mstahl@redhat.com>2016-05-30 17:33:53 +0200
commit84fb4be390a7a09c27f3aa1f004c022f0cdc192a (patch)
tree569f66c35ad260da7ab21f20432c2458e02c445e
parent4d23189aee9adeb87e749a21305f22a43fb3fb17 (diff)
editeng: rename misleading SvxBoxItem::GetDistance()/SetDistance()
Change-Id: Iea61f2de2b907974bbb05c66abf6cdaeab87b8b2
-rw-r--r--cui/source/tabpages/border.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx14
-rw-r--r--editeng/source/rtf/rtfitem.cxx2
-rw-r--r--include/editeng/boxitem.hxx6
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/stlpool.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx4
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/table/cell.cxx4
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx2
-rw-r--r--sw/source/core/doc/tblafmt.cxx4
-rw-r--r--sw/source/core/docnode/ndtbl.cxx3
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx2
-rw-r--r--sw/source/core/edit/autofmt.cxx2
-rw-r--r--sw/source/core/unocore/unotbl.cxx6
-rw-r--r--sw/source/filter/html/htmlcss1.cxx4
-rw-r--r--sw/source/filter/html/htmltab.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx10
-rw-r--r--sw/source/uibase/shells/frmsh.cxx5
-rw-r--r--sw/source/uibase/shells/tabsh.cxx4
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx7
23 files changed, 51 insertions, 46 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index c999db8486c3..5ea3bdcae8f0 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -496,7 +496,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
nDefDist != nRightDist ||
nDefDist != nTopDist ||
nDefDist != nBottomDist);
- if((pBoxItem->GetDistance() ||
+ if ((pBoxItem->GetSmallestDistance() ||
bIsAnyBorderVisible) && bDiffDist )
{
m_pLeftMF->SetModifyFlag();
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index f9766975bc11..58a118c892eb 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1669,7 +1669,7 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
aSeq[1] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetRight(), bConvert) );
aSeq[2] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetBottom(), bConvert) );
aSeq[3] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetTop(), bConvert) );
- aSeq[4] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( GetDistance()) : GetDistance()));
+ aSeq[4] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( GetSmallestDistance()) : GetSmallestDistance()));
aSeq[5] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nTopDist ) : nTopDist ));
aSeq[6] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nBottomDist ) : nBottomDist ));
aSeq[7] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nLeftDist ) : nLeftDist ));
@@ -1694,7 +1694,7 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
aRetLine = SvxBoxItem::SvxLineToLine(GetTop(), bConvert);
break;
case BORDER_DISTANCE:
- nDist = GetDistance();
+ nDist = GetSmallestDistance();
bDistMember = true;
break;
case TOP_BORDER_DISTANCE:
@@ -1852,7 +1852,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if( bConvert )
nDist = convertMm100ToTwip(nDist);
if ( n == 4 )
- SetDistance( sal_uInt16( nDist ));
+ SetAllDistances(sal_uInt16(nDist));
else
SetDistance( sal_uInt16( nDist ), nLines[n-5] );
}
@@ -1951,7 +1951,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if( bConvert )
nDist = convertMm100ToTwip(nDist);
if( nMemberId == BORDER_DISTANCE )
- SetDistance( sal_uInt16( nDist ));
+ SetAllDistances(sal_uInt16(nDist));
else
SetDistance( sal_uInt16( nDist ), nLine );
}
@@ -2164,7 +2164,7 @@ bool SvxBoxItem::GetPresentation
SvStream& SvxBoxItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
{
- rStrm.WriteUInt16( GetDistance() );
+ rStrm.WriteUInt16( GetSmallestDistance() );
const SvxBorderLine* pLine[ 4 ]; // top, left, right, bottom
pLine[ 0 ] = GetTop();
pLine[ 1 ] = GetLeft();
@@ -2265,7 +2265,7 @@ SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, sal_uInt16 nIVersion ) const
}
else
{
- pAttr->SetDistance( nDistance );
+ pAttr->SetAllDistances(nDistance);
}
return pAttr;
@@ -2328,7 +2328,7 @@ void SvxBoxItem::SetLine( const SvxBorderLine* pNew, SvxBoxItemLine nLine )
}
-sal_uInt16 SvxBoxItem::GetDistance() const
+sal_uInt16 SvxBoxItem::GetSmallestDistance() const
{
// The smallest distance that is not 0 will be returned.
sal_uInt16 nDist = nTopDist;
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 94aab744b878..f6e0691facbe 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1538,7 +1538,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet,
break;
case RTF_BOX:
- aAttr.SetDistance( (sal_uInt16)nTokenValue );
+ aAttr.SetAllDistances( (sal_uInt16)nTokenValue );
break;
}
}
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
index 58ccb21ac086..cb23578be18b 100644
--- a/include/editeng/boxitem.hxx
+++ b/include/editeng/boxitem.hxx
@@ -99,12 +99,12 @@ public:
void SetLine( const editeng::SvxBorderLine* pNew, SvxBoxItemLine nLine );
sal_uInt16 GetDistance( SvxBoxItemLine nLine ) const;
- sal_uInt16 GetDistance() const;
+ sal_uInt16 GetSmallestDistance() const;
bool IsRemoveAdjacentCellBorder() const { return bRemoveAdjCellBorder; }
void SetDistance( sal_uInt16 nNew, SvxBoxItemLine nLine );
- inline void SetDistance( sal_uInt16 nNew );
+ inline void SetAllDistances( sal_uInt16 nNew );
void SetRemoveAdjacentCellBorder( bool bSet = true ) { bRemoveAdjCellBorder = bSet; }
@@ -116,7 +116,7 @@ public:
static bool LineToSvxLine(const css::table::BorderLine2& rLine, editeng::SvxBorderLine& rSvxLine, bool bConvert);
};
-inline void SvxBoxItem::SetDistance( sal_uInt16 nNew )
+inline void SvxBoxItem::SetAllDistances(sal_uInt16 const nNew)
{
nTopDist = nBottomDist = nLeftDist = nRightDist = nNew;
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index f5ad18c25d6f..68b1f8f52a7d 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4956,7 +4956,7 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark,
rLineOuter.SetLine(nullptr, SvxBoxItemLine::BOTTOM);
rLineOuter.SetLine(nullptr, SvxBoxItemLine::LEFT);
rLineOuter.SetLine(nullptr, SvxBoxItemLine::RIGHT);
- rLineOuter.SetDistance(0);
+ rLineOuter.SetAllDistances(0);
rLineInner.SetLine(nullptr, SvxBoxInfoItemLine::HORI);
rLineInner.SetLine(nullptr, SvxBoxInfoItemLine::VERT);
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index ec06c0887308..9b2a5ce56488 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -374,7 +374,7 @@ void ScStyleSheetPool::CreateStandardStyles()
aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::BOTTOM );
aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::LEFT );
aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::RIGHT );
- aBoxItem.SetDistance( 10 ); // 0.2mm
+ aBoxItem.SetAllDistances( 10 ); // 0.2mm
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::TOP );
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::BOTTOM );
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::LEFT );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 944c56d13cc2..238da0d112e3 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -962,7 +962,7 @@ template<typename TableBorderType>
void lcl_fillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const TableBorderType& rBorder )
{
::editeng::SvxBorderLine aLine;
- rOuter.SetDistance( static_cast<sal_uInt16>(HMMToTwips( rBorder.Distance )) );
+ rOuter.SetAllDistances(static_cast<sal_uInt16>(HMMToTwips(rBorder.Distance)));
rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.TopLine ), SvxBoxItemLine::TOP );
rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.BottomLine ), SvxBoxItemLine::BOTTOM );
rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.LeftLine ), SvxBoxItemLine::LEFT );
@@ -1014,7 +1014,7 @@ void lcl_fillTableBorder( TableBorderItem& rBorder, const SvxBoxItem& rOuter, co
ScHelperFunctions::FillBorderLine( rBorder.HorizontalLine, rInner.GetHori() );
ScHelperFunctions::FillBorderLine( rBorder.VerticalLine, rInner.GetVert() );
- rBorder.Distance = rOuter.GetDistance();
+ rBorder.Distance = rOuter.GetSmallestDistance();
rBorder.IsTopLineValid = rInner.IsValid(SvxBoxInfoItemValidFlags::TOP);
rBorder.IsBottomLineValid = rInner.IsValid(SvxBoxInfoItemValidFlags::BOTTOM);
rBorder.IsLeftLineValid = rInner.IsValid(SvxBoxInfoItemValidFlags::LEFT);
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 5a0570c93832..65b1b124b49d 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -307,7 +307,7 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
- pboxItem->SetDistance( 100 );
+ pboxItem->SetAllDistances( 100 );
mppLocalPoolDefaults[ SDRATTR_TABLE_BORDER - SDRATTR_START ] = pboxItem;
SvxBoxInfoItem* pBoxInfoItem = new SvxBoxInfoItem( SDRATTR_TABLE_BORDER_INNER );
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index f4d11deaeca4..fc270351059c 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1046,7 +1046,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
aBoxInfo.SetLine(bSet ? &aLine : nullptr, SvxBoxInfoItemLine::VERT);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, pBorder->IsVerticalLineValid);
- aBox.SetDistance(pBorder->Distance); //TODO
+ aBox.SetAllDistances(pBorder->Distance); //TODO
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::DISTANCE, pBorder->IsDistanceValid);
mpProperties->SetObjectItem(aBox);
@@ -1162,7 +1162,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) throw(Unknow
aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::HORI);
aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), false);
aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::VERT);
- aTableBorder.Distance = rBox.GetDistance();
+ aTableBorder.Distance = rBox.GetSmallestDistance();
aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
return Any( aTableBorder );
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index b3ced5d3825c..aab39ce47583 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1289,7 +1289,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
- aBox.SetDistance( 85 );
+ aBox.SetAllDistances( 85 );
aSet.Put( aBox );
aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 6c55d0b8304f..ebad1b030680 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -305,7 +305,7 @@ SwBoxAutoFormat::SwBoxAutoFormat()
m_aRotateMode( SVX_ROTATE_MODE_STANDARD, 0 )
{
m_eSysLanguage = m_eNumFormatLanguage = ::GetAppLanguage();
- m_aBox.SetDistance( 55 );
+ m_aBox.SetAllDistances(55);
}
SwBoxAutoFormat::SwBoxAutoFormat( const SwBoxAutoFormat& rNew )
@@ -1118,7 +1118,7 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
pNew->SetBoxFormat( aNew, i );
SvxBoxItem aBox( RES_BOX );
- aBox.SetDistance( 55 );
+ aBox.SetAllDistances(55);
SvxBorderLine aLn( &aColor, DEF_LINE_WIDTH_0 );
aBox.SetLine( &aLn, SvxBoxItemLine::LEFT );
aBox.SetLine( &aLn, SvxBoxItemLine::BOTTOM );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index c01455adf983..2b92de276c45 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -125,7 +125,8 @@ static void lcl_SetDfltBoxAttr( SwFrameFormat& rFormat, sal_uInt8 nId )
aLine.SetBorderLineStyle(table::BorderLineStyle::DOUBLE);
aLine.SetWidth( DEF_LINE_WIDTH_0 );
}
- SvxBoxItem aBox(RES_BOX); aBox.SetDistance( 55 );
+ SvxBoxItem aBox(RES_BOX);
+ aBox.SetAllDistances(55);
if ( bTop )
aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
if ( bBottom )
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 2a77eaa683e3..03735e8f869c 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -1099,7 +1099,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet )
rBox.GetDistance( k ) )
{
aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISTANCE, false );
- aSetBox.SetDistance( 0 );
+ aSetBox.SetAllDistances(0);
break;
}
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 816e08172d12..c85e25c204c7 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -584,7 +584,7 @@ bool SwAutoFormat::DoUnderline()
aSet.Put( SwParaConnectBorderItem( false ) );
SvxBoxItem aBox( RES_BOX );
aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
- aBox.SetDistance( 42 ); // ~0,75 mm
+ aBox.SetAllDistances(42); // ~0,75 mm
aSet.Put(aBox);
m_pDoc->getIDocumentContentOperations().InsertItemSet( m_aDelPam, aSet );
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index ba58c94ca6de..eb1de8f06725 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2708,7 +2708,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An
aBoxInfo.SetLine(aVertLine.isEmpty() ? nullptr : &aVertLine, SvxBoxInfoItemLine::VERT);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, aBorder.IsVerticalLineValid);
- aBox.SetDistance((sal_uInt16)convertMm100ToTwip(aBorder.Distance));
+ aBox.SetAllDistances(static_cast<sal_uInt16>(convertMm100ToTwip(aBorder.Distance)));
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::DISTANCE, aBorder.IsDistanceValid);
aSet.Put(aBox);
@@ -2898,7 +2898,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName)
aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::HORI);
aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), true);
aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::VERT);
- aTableBorder.Distance = convertTwipToMm100( rBox.GetDistance() );
+ aTableBorder.Distance = convertTwipToMm100(rBox.GetSmallestDistance());
aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
aRet <<= aTableBorder;
}
@@ -2917,7 +2917,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName)
aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::HORI);
aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), true);
aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::VERT);
- aTableBorder.Distance = convertTwipToMm100( rBox.GetDistance() );
+ aTableBorder.Distance = convertTwipToMm100(rBox.GetSmallestDistance());
aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
aRet <<= aTableBorder;
}
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index f78711bea863..f2ccc8c8839a 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2095,8 +2095,8 @@ void SwHTMLParser::SetFrameFormatAttrs( SfxItemSet &rItemSet,
if( (nFlags & HTML_FF_PADDING) == 0 )
{
SvxBoxItem aBoxItem( *static_cast<const SvxBoxItem *>(pItem) );
- // Alle 4 Seiten gleichzeitig auf 0 setzen
- aBoxItem.SetDistance( 0 );
+ // reset all 4 sides to 0
+ aBoxItem.SetAllDistances(0);
rFrameItemSet.Put( aBoxItem );
}
else
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index fc407fd7ec7b..96504ffc8bc9 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -1425,10 +1425,10 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
(2*nCellPadding <= nInnerFrameWidth) ? nCellPadding
: (nInnerFrameWidth / 2) );
// wir setzen das Item nur, wenn es eine Umrandung gibt
- // oder eine sheet::Border-Distanz vorgegeben ist. Fehlt letztere,
+ // oder eine Border-Distanz vorgegeben ist. Fehlt letztere,
// dann gibt es eine Umrandung, und wir muessen die Distanz
// setzen
- aBoxItem.SetDistance( nBDist ? nBDist : MIN_BORDER_DIST );
+ aBoxItem.SetAllDistances((nBDist) ? nBDist : MIN_BORDER_DIST);
pFrameFormat->SetFormatAttr( aBoxItem );
}
else
@@ -1528,7 +1528,7 @@ void HTMLTable::FixFillerFrameFormat( SwTableBox *pBox, bool bRight ) const
aBoxItem.SetLine( &aInhLeftBorderLine, SvxBoxItemLine::LEFT );
if( bRight && bInhRightBorder )
aBoxItem.SetLine( &aInhRightBorderLine, SvxBoxItemLine::RIGHT );
- aBoxItem.SetDistance( MIN_BORDER_DIST );
+ aBoxItem.SetAllDistances(MIN_BORDER_DIST);
pFrameFormat->SetFormatAttr( aBoxItem );
}
else
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 59d375ec6407..417fead07261 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4002,7 +4002,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt)
const SvxBoxItem& rBoxItem = static_cast< const SvxBoxItem& >(rHt);
bMustWrite = rBoxItem.GetTop() || rBoxItem.GetLeft() ||
rBoxItem.GetBottom() || rBoxItem.GetRight() ||
- rBoxItem.GetDistance();
+ rBoxItem.GetSmallestDistance();
}
break;
case RES_CHRATR_HIGHLIGHT:
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 59b6bb5abc54..8bdadc5215a2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3254,7 +3254,7 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)
OOO_STRING_SVTOOLS_RTF_BRDRT, OOO_STRING_SVTOOLS_RTF_BRDRL, OOO_STRING_SVTOOLS_RTF_BRDRB, OOO_STRING_SVTOOLS_RTF_BRDRR
};
- sal_uInt16 nDist = rBox.GetDistance();
+ sal_uInt16 const nDist = rBox.GetSmallestDistance();
if (m_rExport.m_bRTFFlySyntax)
{
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 6a55d0fb1b66..ebed2f3fe5ee 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -154,7 +154,7 @@ SwColumnDlg::SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh)
const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)rFormat.GetLRSpace();
const SvxBoxItem& rBox = (const SvxBoxItem&) rFormat.GetBox();
- nPageWidth -= rLRSpace.GetLeft() + rLRSpace.GetRight() + rBox.GetDistance();
+ nPageWidth -= rLRSpace.GetLeft() + rLRSpace.GetRight() + rBox.GetSmallestDistance();
pPageSet->Put(rFormat.GetCol());
pPageSet->Put(rFormat.GetLRSpace());
@@ -636,7 +636,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet)
{
const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(rSet->Get(RES_FRM_SIZE));
const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rSet->Get(RES_BOX));
- pColMgr->SetActualWidth((sal_uInt16)rSize.GetSize().Width() - rBox.GetDistance());
+ pColMgr->SetActualWidth((sal_uInt16)rSize.GetSize().Width() - rBox.GetSmallestDistance());
}
}
if(m_pBalanceColsCB->IsVisible())
@@ -1251,7 +1251,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
RES_LR_SPACE ));
const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>( rSet.Get(RES_BOX));
nActWidth = rSize.GetSize().Width()
- - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetDistance();
+ - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetSmallestDistance();
}
else
{
@@ -1259,7 +1259,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
RES_UL_SPACE ));
const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>( rSet.Get(RES_BOX));
nActWidth = rSize.GetSize().Height()
- - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetDistance();
+ - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetSmallestDistance();
}
@@ -1289,7 +1289,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
nTotalWish = FRAME_FORMAT_WIDTH;
else
{
- long nDistance = rBox.GetDistance();
+ long const nDistance = rBox.GetSmallestDistance();
nTotalWish = (!bVertical ? rSize.GetWidth() : rSize.GetHeight()) - 2 * nDistance;
}
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 95f31c96f8e8..a78df35033f0 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1009,7 +1009,8 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
if(!StarBASIC::IsRunning())
#endif
{
- aNewBox.SetDistance( rBoxItem.GetDistance() );
+ // TODO: should this copy 4 individual Dist instead?
+ aNewBox.SetAllDistances(rBoxItem.GetSmallestDistance());
}
aBoxItem = aNewBox;
@@ -1115,7 +1116,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
if (bDefault && (aBoxItem.GetTop() || aBoxItem.GetBottom() ||
aBoxItem.GetLeft() || aBoxItem.GetRight()))
{
- aBoxItem.SetDistance(MIN_BORDER_DIST);
+ aBoxItem.SetAllDistances(MIN_BORDER_DIST);
}
aFrameSet.Put( aBoxItem );
// Template AutoUpdate
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index c8b9afde9501..4681b22897a7 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -491,9 +491,11 @@ void SwTableShell::Execute(SfxRequest &rReq)
sal_uInt16 nDefValue = MIN_BORDER_DIST;
if ( !rReq.IsAPI() )
nDefValue = 55;
- if ( !rReq.IsAPI() || aBox.GetDistance() < MIN_BORDER_DIST )
+ if (!rReq.IsAPI() || aBox.GetSmallestDistance() < MIN_BORDER_DIST)
+ {
for( SvxBoxItemLine k : o3tl::enumrange<SvxBoxItemLine>() )
aBox.SetDistance( std::max(rCoreBox.GetDistance(k), nDefValue) , k );
+ }
}
else
OSL_ENSURE( false, "where is BoxItem?" );
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 7ab973dc82e2..f5df065a1ffe 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1650,7 +1650,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxColumnItem aColItem(nNum);
const SwRect aPrtRect = rSh.GetAnyCurRect(RECT_PAGE_PRT, pPt);
const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetFormatAttr(RES_BOX));
- long nDist = rBox.GetDistance();
+ long nDist = rBox.GetSmallestDistance();
lcl_FillSvxColumn(
aCol,
@@ -1946,8 +1946,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
const SwFormatCol* pCols = pFormat ? &pFormat->GetCol():
&rDesc.GetMaster().GetCol();
const SwColumns& rCols = pCols->GetColumns();
- const sal_uInt16 nBorder = pFormat ? pFormat->GetBox().GetDistance() :
- rDesc.GetMaster().GetBox().GetDistance();
+ const sal_uInt16 nBorder = (pFormat)
+ ? pFormat->GetBox().GetSmallestDistance()
+ : rDesc.GetMaster().GetBox().GetSmallestDistance();
// RECT_FLY_PRT_EMBEDDED returns the relative position to RECT_FLY_EMBEDDED
// the absolute position must be added here