diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-12-24 10:00:15 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-03-19 17:56:23 +0100 |
commit | 89d3e8a8424ce44404a554812e5136452bb8cb60 (patch) | |
tree | f6aa43366754ff0efa23d68cdecad94d2771a262 /sc | |
parent | e881f7d231cccb7b74ce69394e0644088ded9c2b (diff) |
Switching the order of the SetLinesWidth arguments
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/dpoutput.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/scdpoutputimpl.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 36 | ||||
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/lotus/lotattr.cxx | 23 | ||||
-rw-r--r-- | sc/source/filter/starcalc/scflt.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh8.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 8 |
12 files changed, 65 insertions, 81 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index ed3a8498d07a..0c2f267b47b6 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -586,9 +586,8 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* if ((dest)) \ { \ SvxBorderLine* pCast = (SvxBorderLine*)(dest); \ - pCast->SetOutWidth((src)->GetOutWidth()); \ - pCast->SetInWidth( (src)->GetInWidth() ); \ - pCast->SetDistance((src)->GetDistance()); \ + pCast->SetStyle( (src)->GetStyle( ) ); \ + pCast->SetWidth( (src)->GetWidth( ) ); \ } void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index f91b403f8986..5e17fc64ff38 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -157,8 +157,7 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nWidth ) { - SvxBorderLine aLine; - aLine.SetOutWidth(nWidth); + SvxBorderLine aLine( NULL, nWidth, SOLID ); SvxBoxItem aBox( ATTR_BORDER ); aBox.SetLine(&aLine, BOX_LINE_LEFT); aBox.SetLine(&aLine, BOX_LINE_TOP); diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx index 1f533e034d32..b33821e92c47 100644 --- a/sc/source/core/data/scdpoutputimpl.cxx +++ b/sc/source/core/data/scdpoutputimpl.cxx @@ -138,12 +138,9 @@ sal_Bool OutputImpl::AddCol( SCCOL nCol ) void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori ) { - - SvxBorderLine aLine, aOutLine; - aLine.SetColor( SC_DP_FRAME_COLOR ); - aLine.SetOutWidth( SC_DP_FRAME_INNER_BOLD ); - aOutLine.SetColor( SC_DP_FRAME_COLOR ); - aOutLine.SetOutWidth( SC_DP_FRAME_OUTER_BOLD ); + Color color = SC_DP_FRAME_COLOR; + SvxBorderLine aLine( &color, SC_DP_FRAME_INNER_BOLD ); + SvxBorderLine aOutLine( &color, SC_DP_FRAME_OUTER_BOLD ); SvxBoxItem aBox( ATTR_BORDER ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 290ce0eebdcf..bac3fe6d6eb3 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -913,21 +913,21 @@ bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette, { static const sal_uInt16 ppnLineParam[][ 4 ] = { - // outer width, inner width, distance type - { 0, 0, 0, SOLID }, // 0 = none - { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 1 = thin - { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // 2 = medium - { XLS_LINE_WIDTH_THIN, 0, 0, DASHED }, // 3 = dashed - { XLS_LINE_WIDTH_THIN, 0, 0, DOTTED }, // 4 = dotted - { XLS_LINE_WIDTH_THICK, 0, 0, SOLID }, // 5 = thick - { XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, SOLID }, // 6 = double - { XLS_LINE_WIDTH_HAIR, 0, 0, SOLID }, // 7 = hair - { XLS_LINE_WIDTH_MEDIUM, 0, 0, DASHED }, // 8 = med dash - { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 9 = thin dashdot - { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // A = med dashdot - { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // B = thin dashdotdot - { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // C = med dashdotdot - { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID } // D = med slant dashdot + // outer width, type + { 0, SOLID }, // 0 = none + { XLS_LINE_WIDTH_THIN, SOLID }, // 1 = thin + { XLS_LINE_WIDTH_MEDIUM, SOLID }, // 2 = medium + { XLS_LINE_WIDTH_THIN, DASHED }, // 3 = dashed + { XLS_LINE_WIDTH_THIN, DOTTED }, // 4 = dotted + { XLS_LINE_WIDTH_THICK, SOLID }, // 5 = thick + { XLS_LINE_WIDTH_THIN, DOUBLE }, // 6 = double + { XLS_LINE_WIDTH_HAIR, SOLID }, // 7 = hair + { XLS_LINE_WIDTH_MEDIUM, DASHED }, // 8 = med dash + { XLS_LINE_WIDTH_THIN, SOLID }, // 9 = thin dashdot + { XLS_LINE_WIDTH_MEDIUM, SOLID }, // A = med dashdot + { XLS_LINE_WIDTH_THIN, SOLID }, // B = thin dashdotdot + { XLS_LINE_WIDTH_MEDIUM, SOLID }, // C = med dashdotdot + { XLS_LINE_WIDTH_MEDIUM, SOLID } // D = med slant dashdot }; if( nXclLine == EXC_LINE_NONE ) @@ -936,10 +936,8 @@ bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette, nXclLine = EXC_LINE_THIN; rLine.SetColor( rPalette.GetColor( nXclColor ) ); - rLine.SetOutWidth( ppnLineParam[ nXclLine ][ 0 ] ); - rLine.SetInWidth( ppnLineParam[ nXclLine ][ 1 ] ); - rLine.SetDistance( ppnLineParam[ nXclLine ][ 2 ] ); - rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 3 ] ); + rLine.SetWidth( ppnLineParam[ nXclLine ][ 0 ] ); + rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 1 ] ); return true; } diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c1f6cacd7eb6..05d71399c4c4 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -2190,13 +2190,10 @@ void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos { const SCCOL nLastCol = maSize.mnCols - 1; const SCROW nLastRow = maSize.mnRows - 1; - const sal_uInt16 nOuterLine = DEF_LINE_WIDTH_2; - const sal_uInt16 nInnerLine = DEF_LINE_WIDTH_0; - SvxBorderLine aOuterLine, aInnerLine; - aOuterLine.SetColor( Color( COL_BLACK ) ); - aOuterLine.SetOutWidth( nOuterLine ); - aInnerLine.SetColor( Color( COL_BLACK ) ); - aInnerLine.SetOutWidth( nInnerLine ); + const long nOuterLine = DEF_LINE_WIDTH_2; + const long nInnerLine = DEF_LINE_WIDTH_0; + SvxBorderLine aOuterLine( NULL, nOuterLine, SOLID ); + SvxBorderLine aInnerLine( NULL, nInnerLine, SOLID ); SvxBoxItem aBorderItem( ATTR_BORDER ); for( SCCOL nCol = 0; nCol <= nLastCol; ++nCol ) diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx index 5a8bb17623c3..24e9d2509a8e 100644 --- a/sc/source/filter/lotus/lotattr.cxx +++ b/sc/source/filter/lotus/lotattr.cxx @@ -170,21 +170,20 @@ const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr ) void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, SvxBorderLine& aBL ) { - static const sal_uInt16 pPara[ 4 ][ 3 ] = - { - { 0,0,0 }, - { DEF_LINE_WIDTH_1, 0, 0 }, - { DEF_LINE_WIDTH_2, 0, 0 }, - { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1 } - }; - nLine &= 0x03; - if( nLine ) + switch ( nLine ) { - aBL.SetOutWidth( pPara[ nLine ][ 0 ] ); - aBL.SetInWidth( pPara[ nLine ][ 1 ] ); - aBL.SetDistance( pPara[ nLine ][ 2 ] ); + default: + case 0: aBL.SetStyle( NO_STYLE ); break; + case 1: aBL.SetWidth( DEF_LINE_WIDTH_1 ); break; + case 2: aBL.SetWidth( DEF_LINE_WIDTH_2 ); break; + case 3: + { + aBL.SetStyle( DOUBLE ); + aBL.SetWidth( DEF_LINE_WIDTH_1 ); + } + break; } } diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index 755d232dc71e..4cb52f9fe694 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -834,16 +834,16 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc ) lcl_ChangeColor(cBottom, ColorBottom); SvxBorderLine aLine; SvxBoxItem aBox( ATTR_BORDER ); - aLine.SetOutWidth(nLeft); + aLine.SetWidth(nLeft); aLine.SetColor(ColorLeft); aBox.SetLine(&aLine, BOX_LINE_LEFT); - aLine.SetOutWidth(nTop); + aLine.SetWidth(nTop); aLine.SetColor(ColorTop); aBox.SetLine(&aLine, BOX_LINE_TOP); - aLine.SetOutWidth(nRight); + aLine.SetWidth(nRight); aLine.SetColor(ColorRight); aBox.SetLine(&aLine, BOX_LINE_RIGHT); - aLine.SetOutWidth(nBottom); + aLine.SetWidth(nBottom); aLine.SetColor(ColorBottom); aBox.SetLine(&aLine, BOX_LINE_BOTTOM); @@ -1271,16 +1271,16 @@ void Sc10Import::LoadPatternCollection() SvxBorderLine aLine; SvxBoxItem aBox( ATTR_BORDER ); - aLine.SetOutWidth( nLeft ); + aLine.SetWidth( nLeft ); aLine.SetColor( ColorLeft ); aBox.SetLine( &aLine, BOX_LINE_LEFT ); - aLine.SetOutWidth( nTop ); + aLine.SetWidth( nTop ); aLine.SetColor( ColorTop ); aBox.SetLine( &aLine, BOX_LINE_TOP ); - aLine.SetOutWidth( nRight ); + aLine.SetWidth( nRight ); aLine.SetColor( ColorRight ); aBox.SetLine( &aLine, BOX_LINE_RIGHT ); - aLine.SetOutWidth( nBottom ); + aLine.SetWidth( nBottom ); aLine.SetColor( ColorBottom ); aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); rItemSet.Put( aBox ); @@ -1924,19 +1924,19 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) SvxBorderLine aLine; SvxBoxItem aBox( ATTR_BORDER ); - aLine.SetOutWidth( nLeft ); + aLine.SetWidth( nLeft ); aLine.SetColor( ColorLeft ); aBox.SetLine( &aLine, BOX_LINE_LEFT ); - aLine.SetOutWidth( nTop ); + aLine.SetWidth( nTop ); aLine.SetColor( ColorTop ); aBox.SetLine( &aLine, BOX_LINE_TOP ); - aLine.SetOutWidth( nRight ); + aLine.SetWidth( nRight ); aLine.SetColor( ColorRight ); aBox.SetLine( &aLine, BOX_LINE_RIGHT ); - aLine.SetOutWidth( nBottom ); + aLine.SetWidth( nBottom ); aLine.SetColor( ColorBottom ); aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 56ce6fe932b9..0e1795fdff6f 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -951,11 +951,13 @@ ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary ) const SvxBorderLine* ScHelperFunctions::GetBorderLine( SvxBorderLine& rLine, const table::BorderLine& rStruct ) { - // Calc braucht Twips, im Uno-Struct sind 1/100mm - - rLine.SetOutWidth( (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ) ); - rLine.SetInWidth( (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ) ); - rLine.SetDistance( (sal_uInt16)HMMToTwips( rStruct.LineDistance ) ); + // Calc needs Twips, and there are 1/100mm in the Uno structure + const table::BorderLine2& rBorder2 = static_cast< const table::BorderLine2& >( rStruct ); + rLine.SetStyle( SvxBorderStyle( rBorder2.LineStyle ) ); + rLine.GuessLinesWidths( rLine.GetStyle(), + (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ), + (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ), + (sal_uInt16)HMMToTwips( rStruct.LineDistance ) ); rLine.SetColor( ColorData( rStruct.Color ) ); if ( rLine.GetOutWidth() || rLine.GetInWidth() || rLine.GetDistance() ) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index d9557eb44578..6f787a5e6928 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1511,10 +1511,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) if ( pDefLine ) { - pDefLine->SetOutWidth( pLine->GetOutWidth() ); - pDefLine->SetInWidth ( pLine->GetInWidth() ); - pDefLine->SetDistance( pLine->GetDistance() ); pDefLine->SetStyle( pLine->GetStyle( ) ); + pDefLine->SetWidth( pLine->GetWidth( ) ); pTabViewShell->SetSelectionFrameLines( pDefLine, false ); } else @@ -1527,7 +1525,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) else { Color aColorBlack( COL_BLACK ); - SvxBorderLine aDefLine( &aColorBlack, 20, 0, 0 ); + SvxBorderLine aDefLine( &aColorBlack, 20, SOLID ); pTabViewShell->SetDefaultFrameLine( &aDefLine ); pTabViewShell->SetSelectionFrameLines( NULL, false ); } @@ -1549,7 +1547,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) } else { - SvxBorderLine aDefLine( &rColor, 20, 0, 0 ); + SvxBorderLine aDefLine( &rColor, 20, SOLID ); pTabViewShell->SetDefaultFrameLine( &aDefLine ); pTabViewShell->SetSelectionFrameLines( &aDefLine, false ); } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index af5ae9e563d9..8910c12bdaec 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1505,7 +1505,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode ) SetPool( &SC_MOD()->GetPool() ); SetWindow( GetActiveWin() ); - pCurFrameLine = new SvxBorderLine( &aColBlack, 20, 0, 0 ); + pCurFrameLine = new SvxBorderLine( &aColBlack, 20, SOLID ); pPivotSource = new ScArea; StartListening(*GetViewData()->GetDocShell(),sal_True); StartListening(*GetViewFrame(),sal_True); diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx index 75ce2b1d6832..d230a3ab3483 100644 --- a/sc/source/ui/view/tabvwsh8.cxx +++ b/sc/source/ui/view/tabvwsh8.cxx @@ -48,9 +48,8 @@ void ScTabViewShell::SetDefaultFrameLine( const SvxBorderLine* pLine ) { delete pCurFrameLine; pCurFrameLine = new SvxBorderLine( &pLine->GetColor(), - pLine->GetOutWidth(), - pLine->GetInWidth(), - pLine->GetDistance() ); + pLine->GetWidth(), + pLine->GetStyle() ); } else if ( pCurFrameLine ) { diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 8b3f7657ef99..953b7dffcb71 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2920,18 +2920,14 @@ void ScViewFunc::UpdateLineAttrs( SvxBorderLine& rLine, if ( bColor ) { rLine.SetColor ( pSrcLine->GetColor() ); - rLine.SetOutWidth ( pDestLine->GetOutWidth() ); - rLine.SetInWidth ( pDestLine->GetInWidth() ); - rLine.SetDistance ( pDestLine->GetDistance() ); rLine.SetStyle ( pDestLine->GetStyle() ); + rLine.SetWidth ( pDestLine->GetWidth() ); } else { rLine.SetColor ( pDestLine->GetColor() ); - rLine.SetOutWidth ( pSrcLine->GetOutWidth() ); - rLine.SetInWidth ( pSrcLine->GetInWidth() ); - rLine.SetDistance ( pSrcLine->GetDistance() ); rLine.SetStyle ( pSrcLine->GetStyle() ); + rLine.SetWidth ( pSrcLine->GetWidth() ); } } } |