filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 15 +++++++++++++++ filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 1 + 2 files changed, 16 insertions(+)
New commits: commit 90452b4eb40086b98ad21a19b154c404251c08e6 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Dec 8 09:56:33 2014 +0000 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.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 8d85688..e698688 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 7fbd362..86828af 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);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits