summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-20 13:04:54 +0100
committerAndras Timar <andras.timar@collabora.com>2016-07-22 15:00:14 +0200
commite81a237a6309c4ca147175770c6c4089b03d53e1 (patch)
treed0998e946788d7278cfc7d9b6f066e675356fa63
parent16bf1b6da85a59383a7d88fc062cac1d93f6f06e (diff)
Resolves: tdf#100845 exception during vcl painting -> std::terminatecp-5.1-2
GetText throws under the circumstances described in the bug where the record is missing Change-Id: I03b0ce9a19d93a7eb8842831b433b80a20628541 (cherry picked from commit d8e225304b7c8465f5e7f038ec02270445e1b600) Reviewed-on: https://gerrit.libreoffice.org/27341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 90a26f7501b3829eba28e61f5dbae6ce6927b1f1)
-rw-r--r--svx/source/fmcomp/gridcell.cxx25
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 )