summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-01-20 15:25:03 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-19 15:33:12 +0100
commitd2b8ddf30bc133caea6af8bbb9b91213f319c1f1 (patch)
treee65fd5535d16b813f7cb825dae9b8bc22e597de1 /sw/source
parentc43a3eb7d66cbeb23bd1a165fb99d72db5124101 (diff)
Fixes for ODT filter related to new borders
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx12
-rw-r--r--sw/source/filter/xml/xmlithlp.cxx29
2 files changed, 7 insertions, 34 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index adaaba004c..72f2e8dbc3 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -505,25 +505,19 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nInWidth, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nInWidth, aToken ) )
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nDistance, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nDistance, aToken ) )
return sal_False;
if( !aTokenEnum.getNextToken( aToken ) )
return sal_False;
- if( !rUnitConverter.convertMeasure( nOutWidth, aToken,
- DEF_LINE_WIDTH_0,
- DEF_LINE_WIDTH_4 ) )
+ if( !rUnitConverter.convertMeasure( nOutWidth, aToken ) )
return sal_False;
// #i61946: accept line style even it's not part of our "normal" set of line styles
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 2e10f85ef0..6af9cfca63 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -159,25 +159,6 @@ void lcl_frmitems_setXMLBorderStyle( SvxBorderLine& rLine, sal_uInt16 nStyle )
rLine.SetStyle( eStyle );
}
-void lcl_frmitems_setXMLBorderWidth( SvxBorderLine& rLine,
- sal_uInt16 nWidth, sal_Bool bDouble )
-{
- const sal_uInt16 *aWidths;
- sal_uInt16 nSize;
-
- sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4;
- while( i>0 &&
- nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) )
- {
- DBG_ASSERT( aWidths[i] >= aWidths[i-4], "line widths are unordered!" );
- i -= 4;
- }
-
- if ( bDouble )
- rLine.SetStyle( DOUBLE );
- rLine.SetWidth( aBorderWidths[i] );
-}
-
sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
sal_Bool bHasStyle, sal_uInt16 nStyle,
sal_Bool bHasWidth, sal_uInt16 nWidth,
@@ -208,12 +189,10 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
if( ( bHasWidth &&
- (USHRT_MAX != nNamedWidth || (nWidth != rpLine->GetOutWidth() +
- rpLine->GetInWidth() +
- rpLine->GetDistance()) ) ) ||
+ (USHRT_MAX != nNamedWidth || (nWidth != rpLine->GetWidth() ) ) ) ||
( bHasStyle &&
((SVX_XML_BORDER_STYLE_SOLID == nStyle && rpLine->GetDistance()) ||
- (SVX_XML_BORDER_STYLE_DOUBLE == nStyle && !rpLine->GetDistance())) ))
+ (SVX_XML_BORDER_STYLE_DOUBLE == nStyle && !rpLine->GetDistance())) ) )
{
sal_Bool bDouble = (bHasWidth && SVX_XML_BORDER_STYLE_DOUBLE == nStyle ) ||
rpLine->GetDistance();
@@ -231,7 +210,7 @@ sal_Bool lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
nWidth = rpLine->GetInWidth() + rpLine->GetDistance() +
rpLine->GetOutWidth();
- lcl_frmitems_setXMLBorderWidth( *rpLine, nWidth, bDouble );
+ rpLine->SetWidth( nWidth );
}
lcl_frmitems_setXMLBorderStyle( *rpLine, nStyle );
}
@@ -251,7 +230,7 @@ void lcl_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
rpLine = new SvxBorderLine;
if( nWidth > 0 )
- lcl_frmitems_setXMLBorderWidth( *rpLine, nWidth, sal_True );
+ rpLine->SetWidth( nWidth );
else
rpLine->GuessLinesWidths( DOUBLE, nOutWidth, nInWidth, nDistance );
}