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 <kendy@suse.cz>
Context
- [PATCH libreoffice-4-0] Keep semantics, but improve readibility. · Jan Holesovsky (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.