diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-10 11:31:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-10 16:16:11 +0000 |
commit | 735f3a94b92ac93d11f66c3a86edc42e1915b337 (patch) | |
tree | 32f255b658d2785d8c1edc4c67f38aea86a762fa /filter | |
parent | 7546afda22e2af40e45b533f17bd8aeaacaa100a (diff) |
Related: fdo#85111 put a box around xml filter settings control
and writer->insert->table->autoformat
and calc->data->consolidate
and calc->insert->sheet
Change-Id: I7c89d9f01747a00b906afe3c762b747df6872869
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 39 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 12 |
2 files changed, 36 insertions, 15 deletions
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 4c715e589b33..e3deef39b010 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1337,23 +1337,36 @@ OUString getApplicationUIName( const OUString& rServiceName ) } SvxPathControl::SvxPathControl(vcl::Window* pParent) - : VclVBox(pParent) + : Window(pParent, WB_HIDE | WB_CLIPCHILDREN | WB_TABSTOP | WB_DIALOGCONTROL | WB_BORDER) , bHasBeenShown(false) { - m_pHeaderBar = new HeaderBar(this, WB_BOTTOMBORDER); + m_pVBox = new VclVBox(this); + + m_pHeaderBar = new HeaderBar(m_pVBox, WB_BOTTOMBORDER); m_pHeaderBar->set_height_request(GetTextHeight() + 6); - m_pFocusCtrl = new XMLFilterListBox(this); + m_pFocusCtrl = new XMLFilterListBox(m_pVBox, this); m_pFocusCtrl->set_fill(true); m_pFocusCtrl->set_expand(true); + + m_pVBox->set_hexpand(true); + m_pVBox->set_vexpand(true); + m_pVBox->set_expand(true); + m_pVBox->set_fill(true); + m_pVBox->Show(); } #define ITEMID_NAME 1 #define ITEMID_TYPE 2 -void SvxPathControl::setAllocation(const Size &rAllocation) +void SvxPathControl::Resize() { - VclVBox::setAllocation(rAllocation); + Window::Resize(); + + if (!m_pVBox) + return; + + m_pVBox->SetSizePixel(GetSizePixel()); if (!bHasBeenShown) bHasBeenShown = IsReallyShown(); @@ -1362,6 +1375,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); @@ -1370,6 +1388,11 @@ void SvxPathControl::setAllocation(const Size &rAllocation) } } +Size SvxPathControl::GetOptimalSize() const +{ + return m_pVBox->GetOptimalSize(); +} + SvxPathControl::~SvxPathControl() { delete m_pFocusCtrl; @@ -1383,7 +1406,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxPathControl(vcl::Wi bool SvxPathControl::Notify(NotifyEvent& rNEvt) { - bool nRet = VclVBox::Notify(rNEvt); + bool nRet = Window::Notify(rNEvt); if ( m_pFocusCtrl && rNEvt.GetWindow() != m_pFocusCtrl && rNEvt.GetType() == EVENT_GETFOCUS ) m_pFocusCtrl->GrabFocus(); @@ -1391,10 +1414,10 @@ bool SvxPathControl::Notify(NotifyEvent& rNEvt) return nRet; } -XMLFilterListBox::XMLFilterListBox(SvxPathControl* pParent) +XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl) : SvTabListBox(pParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP) , mbFirstPaint(true) - , m_pHeaderBar(pParent->getHeaderBar()) + , m_pHeaderBar(pPathControl->getHeaderBar()) { Size aBoxSize( pParent->GetOutputSizePixel() ); diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index 6ed617fd40de..cfa47e8d0671 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -32,19 +32,19 @@ #include "xmlfiltercommon.hxx" - - class HeaderBar; class XMLFilterListBox; -class SvxPathControl : public VclVBox +class SvxPathControl : public vcl::Window { private: bool bHasBeenShown; + VclVBox* m_pVBox; HeaderBar* m_pHeaderBar; XMLFilterListBox* m_pFocusCtrl; protected: - virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE; + virtual void Resize() SAL_OVERRIDE; + virtual Size GetOptimalSize() const SAL_OVERRIDE; public: SvxPathControl(vcl::Window* pParent); HeaderBar* getHeaderBar() { return m_pHeaderBar; } @@ -54,8 +54,6 @@ public: virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; }; - - class HeaderBar; class XMLFilterListBox : public SvTabListBox @@ -70,7 +68,7 @@ private: OUString getEntryString( const filter_info_impl* pInfo ) const; public: - XMLFilterListBox(SvxPathControl* pParent); + XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl); /** adds a new filter info entry to the ui filter list */ void addFilterEntry( const filter_info_impl* pInfo ); |