forked from amazingfate/loongoffice
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
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user