summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-04-03 11:44:28 +0200
committerJan Holesovsky <kendy@suse.cz>2013-04-03 15:23:58 +0200
commitc44a06a122d916a18bbede0126bb1e4614f244dc (patch)
tree283527dbb4fb192a450f214d7f22a7870e5dfdc3
parentca0c54d0fe3812cec64e5c7cc83309d4397f5e0a (diff)
Keep semantics, but improve readibility.
Change-Id: I32c18cb7b080f4847118a2d7e8d77dcd2bbce308
-rw-r--r--sw/source/core/docnode/ndtbl.cxx51
1 files changed, 24 insertions, 27 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 882ff1b36831..4fd72a8d5c2e 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4028,39 +4028,36 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate )
SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE );
- sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True;
- if( bSetNumFmt )
+ sal_Bool bSetNumFmt = IsInsTblFormatNum();
+ sal_Bool bLockModify = sal_True;
+
+ if( bSetNumFmt && !IsInsTblChangeNumFormat() )
{
- if( !IsInsTblChangeNumFormat() )
+ if( !pNumFmtItem )
+ bSetNumFmt = sal_False;
+ else
{
- if( !pNumFmtItem )
- bSetNumFmt = sal_False;
+ sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->GetValue();
+ SvNumberFormatter* pNumFmtr = GetNumberFormatter();
+
+ short nFmtType = pNumFmtr->GetType( nFmtIdx );
+ if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || NUMBERFORMAT_NUMBER == nFmtType )
+ // Current and specified NumFormat match
+ // -> keep old Format
+ nFmtIdx = nOldNumFmt;
else
- {
- sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)->
- GetValue();
- SvNumberFormatter* pNumFmtr = GetNumberFormatter();
-
- short nFmtType = pNumFmtr->GetType( nFmtIdx );
- if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) ||
- NUMBERFORMAT_NUMBER == nFmtType )
- // Current and specified NumFormat match
- // -> keep old Format
- nFmtIdx = nOldNumFmt;
- else
- // Current and specified NumFormat do not match
- // -> insert as Text
- bLockModify = bSetNumFmt = sal_False;
- }
+ // Current and specified NumFormat do not match
+ // -> insert as Text
+ bLockModify = bSetNumFmt = sal_False;
}
+ }
- if( bSetNumFmt )
- {
- pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
+ if( bSetNumFmt )
+ {
+ pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
- aBoxSet.Put( SwTblBoxValue( fNumber ));
- aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
- }
+ aBoxSet.Put( SwTblBoxValue( fNumber ));
+ aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
}
// It's not enough to only reset the Formula.