[Libreoffice-commits] core.git: sw/source
Stephan Bergmann
sbergman at redhat.com
Mon Aug 22 16:24:15 UTC 2016
sw/source/ui/config/optload.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 01c463efa2e2b96eaaa18dfb9d613abb2fbf95b1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Aug 22 18:20:00 2016 +0200
Avoid illegal cast of SwDropDownFieldType to SwSetExpFieldType
...once the loop reaches an SwDropDownFieldType (whose GetName() is empty), and
m_pCategoryBox->GetText() is empty (which it appears is always the case here in
the constructor?), as e.g. happens when opening Writer's "Tools - Options... -
LibreOffice Writer - AutoCaption".
Change-Id: I11128981f32691158e1d5de74117c1b1a9d5fea4
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 41c215a..cde9a8b 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -487,7 +487,8 @@ SwCaptionOptPage::SwCaptionOptPage(vcl::Window* pParent, const SfxItemSet& rSet)
for ( auto i = pMgr->GetFieldTypeCount(); i; )
{
SwFieldType* pFieldType = pMgr->GetFieldType(USHRT_MAX, --i);
- if (pFieldType->GetName().equals(m_pCategoryBox->GetText()))
+ if (!pFieldType->GetName().isEmpty()
+ && pFieldType->GetName().equals(m_pCategoryBox->GetText()))
{
nSelFormat = (sal_uInt16)static_cast<SwSetExpFieldType*>(pFieldType)->GetSeqFormat();
break;
More information about the Libreoffice-commits
mailing list