diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-04 13:04:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-04 13:55:57 +0000 |
commit | d4d4e00a5a449bdf46608ce0cecbfa07c340e555 (patch) | |
tree | 958a0a4df963cb5e0116336fc651ade821c9cde2 /cui | |
parent | 17a3d40e0f41d2769ac9a6ed6331b84736530289 (diff) |
Resolves: tdf#95352 resize the columns when the edits reposition
instead of assuming they are in their final position when the
top level dialog resizes. Cause there's a timer/idle involved
so the final position isn't known yet
Change-Id: I713e938b0e275f181514315cb4ce4531f36191ca
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 29 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 37 |
2 files changed, 36 insertions, 30 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index bf83041a8381..1c4eac679ea5 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -184,21 +184,35 @@ public: class AutoCorrEdit : public Edit { Link<AutoCorrEdit&,bool> aActionLink; - bool bSpaces; + VclPtr<SvTabListBox> m_xReplaceTLB; + sal_Int32 m_nCol; + bool bSpaces; - public: - AutoCorrEdit(vcl::Window* pParent, const ResId& rResId) : - Edit(pParent, rResId), bSpaces(false){} - AutoCorrEdit(vcl::Window* pParent) : - Edit(pParent), bSpaces(false){} +public: + AutoCorrEdit(vcl::Window* pParent, const ResId& rResId) + : Edit(pParent, rResId) + , m_nCol(0) + , bSpaces(false) + { + } + + AutoCorrEdit(vcl::Window* pParent) + : Edit(pParent) + , m_nCol(0) + , bSpaces(false) + { + } void SetActionHdl( const Link<AutoCorrEdit&,bool>& rLink ) { aActionLink = rLink;} + void ConnectColumn(const VclPtr<SvTabListBox>& rTable, sal_Int32 nCol); + void SetSpaces(bool bSet) {bSpaces = bSet;} virtual void KeyInput( const KeyEvent& rKEvent ) override; + virtual void Resize() override; }; // class OfaAutocorrReplacePage ------------------------------------------ @@ -262,7 +276,6 @@ private: LanguageType eOldLanguage, LanguageType eNewLanguage); - void setTabs(); public: OfaAutocorrReplacePage( vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~OfaAutocorrReplacePage(); @@ -274,8 +287,6 @@ public: virtual void Reset( const SfxItemSet* rSet ) override; virtual void ActivatePage( const SfxItemSet& ) override; virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) override; - virtual void Resize() override; - virtual void StateChanged(StateChangedType nStateChange) override; void SetLanguage(LanguageType eSet); void DeleteEntry(const OUString& sShort, const OUString& sLong); diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 72deb491d34c..4d1b049b8e32 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -906,28 +906,9 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( vcl::Window* pParent, m_pReplaceED->SetSpaces(true); m_pShortED->SetSpaces(true); -} - -void OfaAutocorrReplacePage::setTabs() -{ - m_pReplaceTLB->SetTab(0, m_pShortED->GetPosPixel().X(), MAP_PIXEL); - m_pReplaceTLB->SetTab(1, m_pReplaceED->GetPosPixel().X(), MAP_PIXEL); -} - -void OfaAutocorrReplacePage::StateChanged(StateChangedType nStateChange) -{ - SfxTabPage::StateChanged(nStateChange); - - if (nStateChange == StateChangedType::InitShow) - { - setTabs(); - } -} -void OfaAutocorrReplacePage::Resize() -{ - SfxTabPage::Resize(); - setTabs(); + m_pShortED->ConnectColumn(m_pReplaceTLB, 0); + m_pReplaceED->ConnectColumn(m_pReplaceTLB, 1); } OfaAutocorrReplacePage::~OfaAutocorrReplacePage() @@ -1766,6 +1747,12 @@ IMPL_LINK_TYPED(OfaAutocorrExceptPage, ModifyHdl, Edit&, rEdt, void) VCL_BUILDER_FACTORY(AutoCorrEdit) +void AutoCorrEdit::ConnectColumn(const VclPtr<SvTabListBox>& rTable, sal_Int32 nCol) +{ + m_xReplaceTLB = rTable; + m_nCol = nCol; +} + void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt ) { const vcl::KeyCode aKeyCode = rKEvt.GetKeyCode(); @@ -1781,6 +1768,14 @@ void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt ) Edit::KeyInput(rKEvt); } +void AutoCorrEdit::Resize() +{ + Edit::Resize(); + if (!m_xReplaceTLB) + return; + m_xReplaceTLB->SetTab(m_nCol, GetPosPixel().X(), MAP_PIXEL); +} + enum OfaQuoteOptions { ADD_NONBRK_SPACE, |