summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-20 13:04:54 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-21 15:57:06 +0000
commitbab808ca04f8c79a98e8133b09ac1a3934c6d339 (patch)
treea3f3c025b3739acf6beda9b792b2ab1c1fbf64e7 /svx
parent8f02c8042d0dd368b31b4245c1179a51c6f0b29f (diff)
Resolves: tdf#100845 exception during vcl painting -> std::terminate
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/27340 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx')
-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 b14cdd18e14a..d2861c013599 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3542,17 +3542,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 )