diff options
Diffstat (limited to 'sw/source/core/table/swtable.cxx')
-rw-r--r-- | sw/source/core/table/swtable.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index fdc1633e7c73..c6a527abdb36 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2326,6 +2326,7 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew // format contents with the new value assigned and write to paragraph Color* pCol = nullptr; OUString sNewText; + bool bChangeFormat = true; if( DBL_MAX == fVal ) { sNewText = SwViewShell::GetShellRes()->aCalc_Error; @@ -2350,6 +2351,14 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew #else sNewText = aOrigText; #endif + // Remove the newly assigned numbering format as well if text actually exists. + // Exception: assume user-defined formats are always intentional. + if (bChgText && pNumFormatr->IsTextFormat(nOldFormat) + && !pNumFormatr->IsUserDefinedAndNotOverloaded(nNewFormat)) + { + pBox->GetFrameFormat()->ResetFormatAttr(RES_BOXATR_FORMAT); + bChangeFormat = false; + } } if( !bChgText ) @@ -2359,9 +2368,11 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew } // across all boxes - ChgTextToNum( *pBox, sNewText, pCol, + if (bChangeFormat) + { + ChgTextToNum( *pBox, sNewText, pCol, GetDoc()->IsInsTableAlignNum() ); - + } } else if( bNewIsTextFormat && nOldFormat != nNewFormat ) { |