diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-08-02 16:47:47 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-08-02 16:47:47 +0000 |
commit | b0e7675f0ed6ab6a1fb750a88abed6812616dbd1 (patch) | |
tree | 6123ef62fdd87565fea7e503b04cb9670aca1532 /svx | |
parent | 56ce215d39efdb96703a53b7b51c9c5a0d61c9f1 (diff) |
INTEGRATION: CWS dr14 (1.29.334); FILE MERGED
2004/07/20 13:29:43 dr 1.29.334.8: #i23675# SvxLineItem::(Put|Query)Value with member ID returns css::table::BorderLine
2004/07/12 19:41:35 dr 1.29.334.7: RESYNC: (1.33-1.34); FILE MERGED
2004/05/19 15:25:06 dr 1.29.334.6: RESYNC: (1.31-1.33); FILE MERGED
2004/04/20 15:42:00 sab 1.29.334.5: #i23675#: the SvxLineItem should support table::BorderLine
2004/03/15 18:22:21 dr 1.29.334.4: RESYNC: (1.30-1.31); FILE MERGED
2004/03/12 17:11:58 dr 1.29.334.3: #i23675# SvxLineItem::Store was broken for ages (but never used)
2004/02/13 12:49:09 dr 1.29.334.2: RESYNC: (1.29-1.30); FILE MERGED
2004/02/13 08:51:09 dr 1.29.334.1: #i23675# diagonal borders step 1: new svx::FrameSelector, new svx::frmlnk::* functions
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/items/frmitems.cxx | 106 |
1 files changed, 33 insertions, 73 deletions
diff --git a/svx/source/items/frmitems.cxx b/svx/source/items/frmitems.cxx index 85a264e30580..b2ef7f8ded61 100644 --- a/svx/source/items/frmitems.cxx +++ b/svx/source/items/frmitems.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frmitems.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: obo $ $Date: 2004-07-06 13:16:48 $ + * last change: $Author: hr $ $Date: 2004-08-02 17:47:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2609,28 +2609,26 @@ sal_uInt16 SvxBoxItem::CalcLineSpace( sal_uInt16 nLine, sal_Bool bIgnoreLine ) c // class SvxBoxInfoItem -------------------------------------------------- SvxBoxInfoItem::SvxBoxInfoItem( const sal_uInt16 nId ) : - SfxPoolItem( nId ), - pHori ( 0 ), pVert ( 0 ), - nDefDist( 0 ) - + nDefDist( 0 ), + mbEnableHor( false ), + mbEnableVer( false ) { - bTable = bDist = bMinDist = sal_False; + bDist = bMinDist = sal_False; ResetFlags(); } // ----------------------------------------------------------------------- SvxBoxInfoItem::SvxBoxInfoItem( const SvxBoxInfoItem& rCpy ) : - - SfxPoolItem( rCpy ) - + SfxPoolItem( rCpy ), + mbEnableHor( rCpy.mbEnableHor ), + mbEnableVer( rCpy.mbEnableVer ) { pHori = rCpy.GetHori() ? new SvxBorderLine( *rCpy.GetHori() ) : 0; pVert = rCpy.GetVert() ? new SvxBorderLine( *rCpy.GetVert() ) : 0; - bTable = rCpy.IsTable(); bDist = rCpy.IsDist(); bMinDist = rCpy.IsMinDist(); nValidFlags = rCpy.nValidFlags; @@ -2653,7 +2651,8 @@ SvxBoxInfoItem &SvxBoxInfoItem::operator=( const SvxBoxInfoItem& rCpy ) delete pVert; pHori = rCpy.GetHori() ? new SvxBorderLine( *rCpy.GetHori() ) : 0; pVert = rCpy.GetVert() ? new SvxBorderLine( *rCpy.GetVert() ) : 0; - bTable = rCpy.IsTable(); + mbEnableHor = rCpy.mbEnableHor; + mbEnableVer = rCpy.mbEnableVer; bDist = rCpy.IsDist(); bMinDist = rCpy.IsMinDist(); nValidFlags = rCpy.nValidFlags; @@ -2669,7 +2668,8 @@ int SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( bTable == rBoxInfo.IsTable() + return ( mbEnableHor == rBoxInfo.mbEnableHor + && mbEnableVer == rBoxInfo.mbEnableVer && bDist == rBoxInfo.IsDist() && bMinDist == rBoxInfo.IsMinDist() && nValidFlags == rBoxInfo.nValidFlags @@ -3334,44 +3334,25 @@ sal_Bool SvxLineItem::QueryValue( uno::Any& rVal, BYTE nMemId ) const { sal_Bool bConvert = 0!=(nMemId&CONVERT_TWIPS); nMemId &= ~CONVERT_TWIPS; - sal_Int32 nVal = 0; if ( nMemId == 0 ) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq( 4 ); - if( pLine ) - { - aSeq[0] = ::com::sun::star::uno::makeAny( sal_Int32( pLine->GetColor().GetColor() )); - aSeq[1] = ::com::sun::star::uno::makeAny( sal_Int32( pLine->GetOutWidth() )); - aSeq[2] = ::com::sun::star::uno::makeAny( sal_Int32( pLine->GetInWidth( ) )); - aSeq[3] = ::com::sun::star::uno::makeAny( sal_Int32( pLine->GetDistance() )); - rVal = ::com::sun::star::uno::makeAny( aSeq ); - } - else - { - // Special case: We have to recognize the empty case which is different to the one - // where all members are 0 (means default!). For this special purpose we send an - // empty sequence! - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq; - rVal = ::com::sun::star::uno::makeAny( aSeq ); - } - + rVal <<= uno::makeAny( lcl_SvxLineToLine(pLine, bConvert) ); return sal_True; } else if ( pLine ) { switch ( nMemId ) { - case MID_FG_COLOR: nVal = pLine->GetColor().GetColor(); break; - case MID_OUTER_WIDTH: nVal = pLine->GetOutWidth(); break; - case MID_INNER_WIDTH: nVal = pLine->GetInWidth( ); break; - case MID_DISTANCE: nVal = pLine->GetDistance(); break; + case MID_FG_COLOR: rVal <<= sal_Int32(pLine->GetColor().GetColor()); break; + case MID_OUTER_WIDTH: rVal <<= sal_Int32(pLine->GetOutWidth()); break; + case MID_INNER_WIDTH: rVal <<= sal_Int32(pLine->GetInWidth( )); break; + case MID_DISTANCE: rVal <<= sal_Int32(pLine->GetDistance()); break; default: DBG_ERROR( "Wrong MemberId" ); return sal_False; } } - rVal <<= nVal; return TRUE; } @@ -3384,42 +3365,16 @@ sal_Bool SvxLineItem::PutValue( const uno::Any& rVal, BYTE nMemId ) sal_Int32 nVal; if ( nMemId == 0 ) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq; - if ( rVal >>= aSeq ) + table::BorderLine aLine; + if ( rVal >>= aLine ) { - if ( aSeq.getLength() == 4 ) - { - if ( !pLine ) - pLine = new SvxBorderLine; - - if ( aSeq[0] >>= nVal ) - pLine->SetColor( Color(nVal) ); - else - return sal_False; - if ( aSeq[1] >>= nVal ) - pLine->SetOutWidth( USHORT( nVal )); - else - return sal_False; - if ( aSeq[2] >>= nVal ) - pLine->SetInWidth( USHORT( nVal )); - else - return sal_False; - if ( aSeq[3] >>= nVal ) - pLine->SetDistance( USHORT( nVal )); - else - return sal_False; - - return sal_True; - } - else if ( aSeq.getLength() == 0 ) - { - // Special case: No line at all! See PutValue - SetLine( 0 ); - return sal_True; - } + if ( !pLine ) + pLine = new SvxBorderLine; + if( !lcl_LineToSvxLine(aLine, *pLine, bConvert) ) + DELETEZ( pLine ); + return sal_True; } - else - return sal_False; + return sal_False; } else if ( rVal >>= nVal ) { @@ -3484,6 +3439,8 @@ SvStream& SvxLineItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const << (short)pLine->GetInWidth() << (short)pLine->GetDistance(); } + else + rStrm << Color() << (short)0 << (short)0 << (short)0; return rStrm; } @@ -3511,8 +3468,11 @@ SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const Color aColor; rStrm >> aColor >> nOutline >> nInline >> nDistance; - SvxBorderLine aLine( &aColor, nOutline, nInline, nDistance ); - pLine->SetLine( &aLine ); + if( nOutline ) + { + SvxBorderLine aLine( &aColor, nOutline, nInline, nDistance ); + pLine->SetLine( &aLine ); + } return pLine; } |