summaryrefslogtreecommitdiff
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
commitb56fdd4316dbdcf1f49e0ab0e06f400d604311a0 (patch)
treeae85061534fafdfb33310e348fed565cda0e93a6
parentf2e26401ab829e0e9b2f0bdd0067bcff0a5dacb3 (diff)
Fixes for ODT filter related to new borders
-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 889902f6a3a2..7c9a53541485 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 1ba6bd85cb59..a6e2d9ba5c90 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 );
}