Kaydet (Commit) fed82904 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

flatten indent

Change-Id: Iaec008f2bd9c3184171c3882d694e66d6da876ee
üst c8350654
...@@ -750,36 +750,35 @@ double sw_getValue( SwXCell &rCell ) ...@@ -750,36 +750,35 @@ double sw_getValue( SwXCell &rCell )
/* non UNO function call to set value in SwXCell */ /* non UNO function call to set value in SwXCell */
void sw_setValue( SwXCell &rCell, double nVal ) void sw_setValue( SwXCell &rCell, double nVal )
{ {
if(rCell.IsValid()) if(!rCell.IsValid())
{ return;
// first this text (maybe) needs to be deleted // first this text (maybe) needs to be deleted
sal_uLong nNdPos = rCell.pBox->IsValidNumTxtNd( true ); sal_uLong nNdPos = rCell.pBox->IsValidNumTxtNd( true );
if(ULONG_MAX != nNdPos) if(ULONG_MAX != nNdPos)
sw_setString( rCell, OUString(), true ); // true == keep number format sw_setString( rCell, OUString(), true ); // true == keep number format
SwDoc* pDoc = rCell.GetDoc(); SwDoc* pDoc = rCell.GetDoc();
UnoActionContext aAction(pDoc); UnoActionContext aAction(pDoc);
SwFrmFmt* pBoxFmt = rCell.pBox->ClaimFrmFmt(); SwFrmFmt* pBoxFmt = rCell.pBox->ClaimFrmFmt();
SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE); SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE);
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
//!! do we need to set a new number format? Yes, if //!! do we need to set a new number format? Yes, if
// - there is no current number format // - there is no current number format
// - the current number format is not a number format according to the number formatter, but rather a text format // - the current number format is not a number format according to the number formatter, but rather a text format
// - the current number format is not even a valid number formatter number format, but rather Writer's own 'special' text number format // - the current number format is not even a valid number formatter number format, but rather Writer's own 'special' text number format
if(SfxItemState::SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem) if(SfxItemState::SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem)
|| pDoc->GetNumberFormatter()->IsTextFormat(static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue()) || pDoc->GetNumberFormatter()->IsTextFormat(static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue())
|| static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue() == css::util::NumberFormat::TEXT) || static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue() == css::util::NumberFormat::TEXT)
{ {
aSet.Put(SwTblBoxNumFormat(0)); aSet.Put(SwTblBoxNumFormat(0));
} }
SwTblBoxValue aVal(nVal); SwTblBoxValue aVal(nVal);
aSet.Put(aVal); aSet.Put(aVal);
pDoc->SetTblBoxFormulaAttrs( *rCell.pBox, aSet ); pDoc->SetTblBoxFormulaAttrs( *rCell.pBox, aSet );
// update table // update table
SwTableFmlUpdate aTblUpdate( SwTable::FindTable( rCell.GetFrmFmt() )); SwTableFmlUpdate aTblUpdate( SwTable::FindTable( rCell.GetFrmFmt() ));
pDoc->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); pDoc->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate );
}
} }
TYPEINIT1(SwXCell, SwClient); TYPEINIT1(SwXCell, SwClient);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment