Hi, I have submitted a patch for review:
https://gerrit.libreoffice.org/3186 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/86/3186/1 Keep semantics, but improve readibility. Change-Id: I32c18cb7b080f4847118a2d7e8d77dcd2bbce308 --- M sw/source/core/docnode/ndtbl.cxx 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 252ac7f..08b710a 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -4022,39 +4022,36 @@ SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt(); SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True; + sal_Bool bSetNumFmt = IsInsTblFormatNum(); + sal_Bool bLockModify = sal_True; + + if( bSetNumFmt && !IsInsTblChangeNumFormat() ) + { + if( !pNumFmtItem ) + bSetNumFmt = sal_False; + 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; + } + } + if( bSetNumFmt ) { - if( !IsInsTblChangeNumFormat() ) - { - if( !pNumFmtItem ) - bSetNumFmt = sal_False; - else - { - sal_uLong nOldNumFmt = ((SwTblBoxNumFormat*)pNumFmtItem)-> - GetValue(); - SvNumberFormatter* pNumFmtr = GetNumberFormatter(); + pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt(); - 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; - } - } - - 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. -- To view, visit https://gerrit.libreoffice.org/3186 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32c18cb7b080f4847118a2d7e8d77dcd2bbce308 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: libreoffice-4-0 Gerrit-Owner: Jan Holesovsky <ke...@suse.cz> _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice