diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-08 09:56:33 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-12-09 03:34:39 +0000 |
commit | 90452b4eb40086b98ad21a19b154c404251c08e6 (patch) | |
tree | 84d8dc663c4052993ccff307b66ca6f624eec273 /filter | |
parent | dcc914ab55feb844d5d71e6568801fa1ffd47f6c (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); |