diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-05-30 15:25:26 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-05-30 17:33:53 +0200 |
commit | 84fb4be390a7a09c27f3aa1f004c022f0cdc192a (patch) | |
tree | 569f66c35ad260da7ab21f20432c2458e02c445e /sw | |
parent | 4d23189aee9adeb87e749a21305f22a43fb3fb17 (diff) |
editeng: rename misleading SvxBoxItem::GetDistance()/SetDistance()
Change-Id: Iea61f2de2b907974bbb05c66abf6cdaeab87b8b2
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentStylePoolManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl1.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/frmsh.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 7 |
14 files changed, 32 insertions, 27 deletions
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 |