diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-02-17 23:08:53 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-03-19 17:57:18 +0100 |
commit | c0c2e9ed18b29c109ef1194e9b7b4fb48fa5f787 (patch) | |
tree | 5054fe59eba170eb4cb64a5506499e19e841d96a /editeng/source/rtf/rtfitem.cxx | |
parent | 2001821bc9cf0ab285662a2beff279a7346594ba (diff) |
Fixed RTF import/export of new border lines
Diffstat (limited to 'editeng/source/rtf/rtfitem.cxx')
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 259 |
1 files changed, 0 insertions, 259 deletions
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index a782d556648c..bfc5b6c00ebc 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1549,265 +1549,6 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, // TODO unhandled ATM break; -#if 0 - case RTF_BOX: - case RTF_BRDRT: - case RTF_BRDRB: - case RTF_BRDRL: - case RTF_BRDRR: - nBorderTyp = nToken; - goto SETBORDER; - - case RTF_CLBRDRT: - if( !bTableDef ) - break; - nBorderTyp = RTF_BRDRT; - goto SETBORDER; - case RTF_CLBRDRB: - if( !bTableDef ) - break; - nBorderTyp = RTF_BRDRB; - goto SETBORDER; - case RTF_CLBRDRL: - if( !bTableDef ) - break; - nBorderTyp = RTF_BRDRL; - goto SETBORDER; - case RTF_CLBRDRR: - if( !bTableDef ) - break; - nBorderTyp = RTF_BRDRR; - goto SETBORDER; - -SETBORDER: - { - // Define the default values - aBrd.SetLinesWidths( SOLID, 0, 0, DEF_LINE_WIDTH_0 ); - aBrd.SetColor( Color( COL_BLACK ) ); - } - break; - - -// yet to be evaluated - case RTF_BRSP: - { - switch( nBorderTyp ) - { - case RTF_BRDRB: - aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_BOTTOM ); - break; - - case RTF_BRDRT: - aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_TOP ); - break; - - case RTF_BRDRL: - aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_LEFT ); - break; - - case RTF_BRDRR: - aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_RIGHT ); - break; - - case RTF_BOX: - aAttr.SetDistance( (sal_uInt16)nTokenValue ); - break; - } - } - break; - - case RTF_BRDRBTW: - case RTF_BRDRBAR: - break; - - - case RTF_BRDRCF: - { - aBrd.SetColor( GetColor( sal_uInt16(nTokenValue) ) ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - } - break; - - case RTF_BRDRTH: - aBrd.SetLinesWidths( SOLID, 0, 0, DEF_LINE_WIDTH_1 ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - - case RTF_BRDRDB: - aBrd.SetLinesWidths( SOLID, DEF_DOUBLE_LINE0_IN, - DEF_DOUBLE_LINE0_OUT, - DEF_DOUBLE_LINE0_DIST ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - - case RTF_BRDRSH: - // shaded box - { - rSet.Put( SvxShadowItem( PARDID->nShadow, (Color*) 0, 60 /*3pt*/, - SVX_SHADOW_BOTTOMRIGHT ) ); - } - break; - - case RTF_BRDRW: - if( -1 != nTokenValue ) - { - // It should be a "thick" line? - if( DEF_LINE_WIDTH_0 != aBrd.GetOutWidth() ) - nTokenValue *= 2; - - // a double line? - if( aBrd.GetInWidth() ) - { - // WinWord - adapt values to StarOffice - if( nTokenValue < DEF_LINE_WIDTH_1 - (DEF_LINE_WIDTH_1/10)) - { - aBrd.SetLinesWidths( SOLID, DEF_DOUBLE_LINE0_IN, - DEF_DOUBLE_LINE0_OUT, - DEF_DOUBLE_LINE0_DIST ); - } - else - if( nTokenValue < DEF_LINE_WIDTH_2 - (DEF_LINE_WIDTH_2/10)) - { - aBrd.SetLinesWidths( SOLID, DEF_DOUBLE_LINE1_IN, - DEF_DOUBLE_LINE1_OUT, - DEF_DOUBLE_LINE1_DIST ); - } - else - { - aBrd.SetLinesWidths( SOLID, DEF_DOUBLE_LINE2_IN, - DEF_DOUBLE_LINE2_OUT, - DEF_DOUBLE_LINE2_DIST ); - } - } - else - { - // WinWord - adapt values to StarOffice - if( nTokenValue < DEF_LINE_WIDTH_1 - (DEF_LINE_WIDTH_1/10)) - aBrd.SetOutWidth( DEF_LINE_WIDTH_0 ); - else - if( nTokenValue < DEF_LINE_WIDTH_2 - (DEF_LINE_WIDTH_2/10)) - aBrd.SetOutWidth( DEF_LINE_WIDTH_1 ); - else - if( nTokenValue < DEF_LINE_WIDTH_3 - (DEF_LINE_WIDTH_3/10)) - aBrd.SetOutWidth( DEF_LINE_WIDTH_2 ); - else - if( nTokenValue < DEF_LINE_WIDTH_4 ) - aBrd.SetOutWidth( DEF_LINE_WIDTH_3 ); - else - aBrd.SetOutWidth( DEF_LINE_WIDTH_4 ); - } - } - SetBorderLine( nBorderTyp, aAttr, aBrd ); - - case RTF_BRDRDOT: - aBrd.SetStyle( DOTTED ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - break; - case RTF_BRDRDASH: - aBrd.SetStyle( DASHED ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - break; - case RTF_BRDRS: - case RTF_BRDRHAIR: - aBrd.SetStyle( SOLID ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - break; -#endif - case BRACELEFT: - { - short nSkip = 0; - if( RTF_IGNOREFLAG != GetNextToken() ) - nSkip = -1; - else - { - int bSwgControl = sal_True, bFirstToken = sal_True; - nToken = GetNextToken(); - do { - switch( nToken ) - { - case RTF_BRDBOX: - aAttr.SetDistance( sal_uInt16(nTokenValue) ); - break; - - case RTF_BRDRT: - case RTF_BRDRB: - case RTF_BRDRR: - case RTF_BRDRL: - { - nBorderTyp = nToken; - bFirstToken = sal_False; - - sal_uInt16 nInWidth = 0; - sal_uInt16 nOutWidth = 0; - sal_uInt16 nDistWidth = 0; - - if( RTF_BRDLINE_COL != GetNextToken() ) - { - bSwgControl = sal_False; - break; - } - aBrd.SetColor( GetColor( sal_uInt16(nTokenValue) )); - - if( RTF_BRDLINE_IN != GetNextToken() ) - { - bSwgControl = sal_False; - break; - } - nInWidth = sal_uInt16( nTokenValue ); - - if( RTF_BRDLINE_OUT != GetNextToken() ) - { - bSwgControl = sal_False; - break; - } - nOutWidth = sal_uInt16( nTokenValue ); - - if( RTF_BRDLINE_DIST != GetNextToken() ) - { - bSwgControl = sal_False; - break; - } - nDistWidth = sal_uInt16( nTokenValue ); - - aBrd.GuessLinesWidths( NO_STYLE, nOutWidth, - nInWidth, nDistWidth ); - SetBorderLine( nBorderTyp, aAttr, aBrd ); - break; - } - - default: - bSwgControl = sal_False; - break; - } - - if( bSwgControl ) - { - nToken = GetNextToken(); - bFirstToken = sal_False; - } - } while( bSwgControl ); - - // End of the Swg-Group - // -> still read the closing parenthesis - if( BRACERIGHT == nToken ) - ; - else if( !bFirstToken ) - { - // It is a parser error, jump to the end of the group - SkipGroup(); - // Disregard closing BRACERIGHT - GetNextToken(); - } - else - nSkip = -2; - } - - if( nSkip ) - { - SkipToken( nSkip ); // Ignore back again - bWeiter = sal_False; - } - } - break; - default: bWeiter = (nToken & ~(0xff| RTF_SWGDEFS)) == RTF_BRDRDEF; } |