From 735f3a94b92ac93d11f66c3a86edc42e1915b337 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 10 Nov 2014 11:31:58 +0000 Subject: 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 --- .../source/xsltdialog/xmlfiltersettingsdialog.cxx | 39 +++++++++++++++----- .../source/xsltdialog/xmlfiltersettingsdialog.hxx | 12 +++---- sc/uiconfig/scalc/ui/consolidatedialog.ui | 42 +++++++++++++++++++--- sc/uiconfig/scalc/ui/insertsheet.ui | 23 ++++++++++-- sw/source/ui/table/tautofmt.cxx | 14 +++++--- sw/uiconfig/swriter/ui/autoformattable.ui | 2 +- 6 files changed, 104 insertions(+), 28 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 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 ); diff --git a/sc/uiconfig/scalc/ui/consolidatedialog.ui b/sc/uiconfig/scalc/ui/consolidatedialog.ui index 920edb860b88..deec922eaf27 100644 --- a/sc/uiconfig/scalc/ui/consolidatedialog.ui +++ b/sc/uiconfig/scalc/ui/consolidatedialog.ui @@ -1,8 +1,8 @@ - + - + False 6 @@ -95,6 +95,8 @@ 0 0 + 1 + 1 @@ -105,11 +107,13 @@ 0 _Consolidation ranges: True - consareas + consareas:border 0 2 + 1 + 1 @@ -134,10 +138,12 @@ 0 1 + 1 + 1 - + True True True @@ -151,6 +157,8 @@ 0 3 + 1 + 1 @@ -181,6 +189,8 @@ 0 0 + 1 + 1 @@ -194,6 +204,8 @@ 1 0 + 1 + 1 @@ -208,12 +220,16 @@ 2 0 + 1 + 1 0 1 + 1 + 1 @@ -232,6 +248,8 @@ 0 0 + 1 + 1 @@ -245,6 +263,8 @@ 1 0 + 1 + 1 @@ -259,12 +279,16 @@ 2 0 + 1 + 1 0 3 + 1 + 1 @@ -308,6 +332,8 @@ 0 4 + 1 + 1 @@ -322,6 +348,8 @@ 0 0 + 1 + 1 @@ -336,6 +364,8 @@ 0 2 + 1 + 1 @@ -396,6 +426,8 @@ 0 0 + 1 + 1 @@ -412,6 +444,8 @@ 0 1 + 1 + 1 diff --git a/sc/uiconfig/scalc/ui/insertsheet.ui b/sc/uiconfig/scalc/ui/insertsheet.ui index a156e9ef1475..453cd579c27e 100644 --- a/sc/uiconfig/scalc/ui/insertsheet.ui +++ b/sc/uiconfig/scalc/ui/insertsheet.ui @@ -1,5 +1,5 @@ - + @@ -231,6 +231,8 @@ 0 0 + 1 + 1 @@ -245,6 +247,8 @@ 0 1 + 1 + 1 @@ -258,6 +262,8 @@ 1 0 + 1 + 1 @@ -272,6 +278,8 @@ 1 1 + 1 + 1 @@ -338,6 +346,7 @@ 0 1 2 + 1 @@ -348,7 +357,7 @@ True in - + True True True @@ -359,7 +368,7 @@ - + Tables in file @@ -369,6 +378,8 @@ 0 0 + 1 + 1 @@ -387,6 +398,8 @@ 0 0 + 1 + 1 @@ -404,12 +417,16 @@ 0 1 + 1 + 1 1 0 + 1 + 1 diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index fc85c65822b4..0c1a1a1d17bf 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -47,7 +47,7 @@ using namespace com::sun::star; class AutoFmtPreview : public vcl::Window { public: - AutoFmtPreview(vcl::Window* pParent); + AutoFmtPreview(vcl::Window* pParent, WinBits nStyle); virtual ~AutoFmtPreview(); void NotifyChange( const SwTableAutoFmt& rNewData ); @@ -486,8 +486,8 @@ IMPL_LINK_NOARG_INLINE_START(SwAutoFormatDlg, OkHdl) } IMPL_LINK_NOARG_INLINE_END(SwAutoFormatDlg, OkHdl) -AutoFmtPreview::AutoFmtPreview(vcl::Window* pParent) : - Window ( pParent ), +AutoFmtPreview::AutoFmtPreview(vcl::Window* pParent, WinBits nStyle) : + Window ( pParent, nStyle ), aCurData ( OUString() ), aVD ( *this ), aScriptedText ( aVD ), @@ -508,9 +508,13 @@ AutoFmtPreview::AutoFmtPreview(vcl::Window* pParent) : Init(); } -extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeAutoFmtPreview(vcl::Window *pParent, VclBuilder::stringmap &) +extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeAutoFmtPreview(vcl::Window *pParent, VclBuilder::stringmap &rMap) { - return new AutoFmtPreview(pParent); + WinBits nWinStyle = 0; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new AutoFmtPreview(pParent, nWinStyle); } void AutoFmtPreview::Resize() diff --git a/sw/uiconfig/swriter/ui/autoformattable.ui b/sw/uiconfig/swriter/ui/autoformattable.ui index dcfc1bd6cbbe..9855f081e9be 100644 --- a/sw/uiconfig/swriter/ui/autoformattable.ui +++ b/sw/uiconfig/swriter/ui/autoformattable.ui @@ -158,7 +158,7 @@ True in - + True True True -- cgit