Kaydet (Commit) b12823aa authored tarafından qarkai's avatar qarkai Kaydeden (comit) Michael Stahl

tdf#39593 move duplicate code to separate method

Change-Id: I89c809a220efc006d3b5b0675c050ff07cb2dbfe
Reviewed-on: https://gerrit.libreoffice.org/33380Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst ebe83479
......@@ -235,31 +235,11 @@ IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, ListBox&, rBox, void)
{
ObjectHdl(&rBox);
}
void SwColumnDlg::ObjectHdl(ListBox* pBox)
{
SfxItemSet* pSet = nullptr;
switch(nOldSelection)
{
case LISTBOX_SELECTION :
pSet = pSelectionSet;
break;
case LISTBOX_SECTION :
pSet = pSectionSet;
bSectionChanged = true;
break;
case LISTBOX_SECTIONS :
pSet = pSectionSet;
bSelSectionChanged = true;
break;
case LISTBOX_PAGE :
pSet = pPageSet;
bPageChanged = true;
break;
case LISTBOX_FRAME:
pSet = pFrameSet;
bFrameChanged = true;
break;
}
SfxItemSet* pSet = EvalCurrentSelection();
if(pBox)
{
pTabPage->FillItemSet(pSet);
......@@ -300,29 +280,7 @@ void SwColumnDlg::ObjectHdl(ListBox* pBox)
IMPL_LINK_NOARG(SwColumnDlg, OkHdl, Button*, void)
{
// evaluate current selection
SfxItemSet* pSet = nullptr;
switch(nOldSelection)
{
case LISTBOX_SELECTION :
pSet = pSelectionSet;
break;
case LISTBOX_SECTION :
pSet = pSectionSet;
bSectionChanged = true;
break;
case LISTBOX_SECTIONS :
pSet = pSectionSet;
bSelSectionChanged = true;
break;
case LISTBOX_PAGE :
pSet = pPageSet;
bPageChanged = true;
break;
case LISTBOX_FRAME:
pSet = pFrameSet;
bFrameChanged = true;
break;
}
SfxItemSet* pSet = EvalCurrentSelection();
pTabPage->FillItemSet(pSet);
if(pSelectionSet && SfxItemState::SET == pSelectionSet->GetItemState(RES_COL))
......@@ -377,6 +335,36 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl, Button*, void)
EndDialog(RET_OK);
}
SfxItemSet* SwColumnDlg::EvalCurrentSelection(void)
{
SfxItemSet* pSet = nullptr;
switch(nOldSelection)
{
case LISTBOX_SELECTION :
pSet = pSelectionSet;
break;
case LISTBOX_SECTION :
pSet = pSectionSet;
bSectionChanged = true;
break;
case LISTBOX_SECTIONS :
pSet = pSectionSet;
bSelSectionChanged = true;
break;
case LISTBOX_PAGE :
pSet = pPageSet;
bPageChanged = true;
break;
case LISTBOX_FRAME:
pSet = pFrameSet;
bFrameChanged = true;
break;
}
return pSet;
}
#if OSL_DEBUG_LEVEL < 2
inline
#endif
......
......@@ -64,6 +64,7 @@ class SwColumnDlg : public SfxModalDialog
DECL_LINK(ObjectListBoxHdl, ListBox&, void);
DECL_LINK(OkHdl, Button*, void);
void ObjectHdl(ListBox*);
SfxItemSet* EvalCurrentSelection(void);
public:
SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment