From 6facff4d1199fc4c335a4bf6aa23106878e1cf90 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Nov 2009 11:34:17 +0100 Subject: dba33d: #i104949# show cell value when set field text nodes exits --- sw/source/core/table/swtable.cxx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index caffe6edbf..8d0c21db65 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include #include // fuer RedlineTbl() @@ -101,6 +103,8 @@ SV_IMPL_REF( SwServerObject ) #define COLFUZZY 20 +void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, + BOOL bChgAlign,ULONG nNdPos ); //---------------------------------- class SwTableBox_Impl @@ -2087,11 +2091,16 @@ void SwTable::SetHTMLTableLayout( SwHTMLTableLayout *p ) pHTMLLayout = p; } - void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, BOOL bChgAlign ) { ULONG nNdPos = rBox.IsValidNumTxtNd( TRUE ); + ChgTextToNum( rBox,rTxt,pCol,bChgAlign,nNdPos); +} +void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, + BOOL bChgAlign,ULONG nNdPos ) +{ + if( ULONG_MAX != nNdPos ) { SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc(); @@ -2159,6 +2168,8 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, for( n = 0; n < rOrig.Len() && '\x9' == rOrig.GetChar( n ); ++n ) ; + for( ; n < rOrig.Len() && '\x01' == rOrig.GetChar( n ); ++n ) + ; SwIndex aIdx( pTNd, n ); for( n = rOrig.Len(); n && '\x9' == rOrig.GetChar( --n ); ) ; @@ -2637,6 +2648,14 @@ ULONG SwTableBox::IsValidNumTxtNd( BOOL bCheckAttr ) const *pAttr->GetStart() || *pAttr->GetAnyEnd() < rTxt.Len() ) { + if ( pAttr->Which() == RES_TXTATR_FIELD ) + { + const SwField* pField = pAttr->GetFld().GetFld(); + if ( pField && pField->GetTypeId() == TYP_SETFLD ) + { + continue; + } + } nPos = ULONG_MAX; break; } @@ -2691,7 +2710,7 @@ void SwTableBox::ActualiseValueBox() const String& rTxt = pSttNd->GetNodes()[ nNdPos ]->GetTxtNode()->GetTxt(); if( rTxt != sNewTxt ) - ChgTextToNum( *this, sNewTxt, pCol, FALSE ); + ChgTextToNum( *this, sNewTxt, pCol, FALSE ,nNdPos); } } } -- cgit v1.2.3