diff options
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 1daaf351ad72..b939a19753c7 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -3549,17 +3549,24 @@ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev, nStyle |= DrawTextFlags::Left; } - Color* pColor = nullptr; - OUString aText = GetText(_rxField, xFormatter, &pColor); - if (pColor != nullptr) + try { - Color aOldTextColor( rDev.GetTextColor() ); - rDev.SetTextColor( *pColor ); - rDev.DrawText(rRect, aText, nStyle); - rDev.SetTextColor( aOldTextColor ); + Color* pColor = nullptr; + OUString aText = GetText(_rxField, xFormatter, &pColor); + if (pColor != nullptr) + { + Color aOldTextColor( rDev.GetTextColor() ); + rDev.SetTextColor( *pColor ); + rDev.DrawText(rRect, aText, nStyle); + rDev.SetTextColor( aOldTextColor ); + } + else + rDev.DrawText(rRect, aText, nStyle); + } + catch (const Exception& e) + { + SAL_WARN("svx.form", "PaintFieldToCell: caught an exception: " << e.Message); } - else - rDev.DrawText(rRect, aText, nStyle); } FmXEditCell::FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl ) |