diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-08 09:56:33 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-12-13 16:01:05 +0100 |
commit | 7717ec3e5cba51cd1a2c52c66054a35c0a0488ef (patch) | |
tree | 44214d53de83ce00183682f6e86f95d80a9cc191 /filter | |
parent | 68f3ce851c4bd10be2f828c01d6ff99098d7a55d (diff) |
Resolves: rhbz#1164614 xslt dialog crashes if there are no entries
Change-Id: Id7d967389cbc9f8ae120749bbe1c79bbbe46b212
Reviewed-on: https://gerrit.libreoffice.org/13370
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 15 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 8d85688af27f..e6986883bd1c 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1355,6 +1355,16 @@ SvxPathControl::SvxPathControl(Window* pParent) #define ITEMID_NAME 1 #define ITEMID_TYPE 2 +Size SvxPathControl::GetOptimalSize() const +{ + Size aDefSize(LogicToPixel(Size(150, 0), MapMode(MAP_APPFONT))); + Size aOptSize(VclVBox::GetOptimalSize()); + long nRowHeight(GetTextHeight()); + aOptSize.Height() = nRowHeight * 10; + aOptSize.Width() = std::max(aDefSize.Width(), aOptSize.Width()); + return aOptSize; +} + void SvxPathControl::setAllocation(const Size &rAllocation) { VclVBox::setAllocation(rAllocation); @@ -1366,6 +1376,11 @@ void SvxPathControl::setAllocation(const Size &rAllocation) { std::vector<long> aWidths; m_pFocusCtrl->getPreferredDimensions(aWidths); + if (aWidths.empty()) + { + bHasBeenShown = false; + return; + } long nFirstColumnWidth = aWidths[1]; m_pHeaderBar->SetItemSize(ITEMID_NAME, nFirstColumnWidth); m_pHeaderBar->SetItemSize(ITEMID_TYPE, 0xFFFF); diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index 7fbd3622f0e7..86828af20dd4 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -44,6 +44,7 @@ private: HeaderBar* m_pHeaderBar; XMLFilterListBox* m_pFocusCtrl; protected: + virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE; public: SvxPathControl(Window* pParent); |