summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx102
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx25
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx13
-rw-r--r--sd/source/ui/func/fuolbull.cxx2
-rw-r--r--sd/source/ui/inc/OutlineBulletDlg.hxx25
5 files changed, 79 insertions, 88 deletions
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index d169853c9ac1..bbbc3fb24968 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -46,26 +46,22 @@ namespace sd {
/**
* Constructor of tab dialog: append pages to the dialog
*/
-OutlineBulletDlg::OutlineBulletDlg(
- vcl::Window* pParent,
- const SfxItemSet* pAttr,
- ::sd::View* pView )
- : SfxTabDialog( pParent, "BulletsAndNumberingDialog",
- "modules/sdraw/ui/bulletsandnumbering.ui")
- , aInputSet( *pAttr )
- , bTitle(false)
- , pSdView(pView)
+OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
+ : SfxTabDialogController(pParent, "modules/sdraw/ui/bulletsandnumbering.ui", "BulletsAndNumberingDialog")
+ , m_aInputSet(*pAttr)
+ , m_bTitle(false)
+ , m_pSdView(pView)
{
- aInputSet.MergeRange( SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL );
- aInputSet.Put( *pAttr );
+ m_aInputSet.MergeRange(SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL);
+ m_aInputSet.Put(*pAttr);
- pOutputSet.reset( new SfxItemSet( *pAttr ) );
- pOutputSet->ClearItem();
+ m_xOutputSet.reset( new SfxItemSet( *pAttr ) );
+ m_xOutputSet->ClearItem();
bool bOutliner = false;
// special treatment if a title object is selected
- if( pView )
+ if (pView)
{
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
const size_t nCount = rMarkList.GetMarkCount();
@@ -78,7 +74,7 @@ OutlineBulletDlg::OutlineBulletDlg(
switch(pObj->GetObjIdentifier())
{
case OBJ_TITLETEXT:
- bTitle = true;
+ m_bTitle = true;
break;
case OBJ_OUTLINETEXT:
bOutliner = true;
@@ -88,7 +84,7 @@ OutlineBulletDlg::OutlineBulletDlg(
}
}
- if( SfxItemState::SET != aInputSet.GetItemState(EE_PARA_NUMBULLET))
+ if( SfxItemState::SET != m_aInputSet.GetItemState(EE_PARA_NUMBULLET))
{
const SvxNumBulletItem *pItem = nullptr;
if(bOutliner)
@@ -100,17 +96,17 @@ OutlineBulletDlg::OutlineBulletDlg(
}
if( pItem == nullptr )
- pItem = aInputSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET);
+ pItem = m_aInputSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET);
DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in Pool! [CL]" );
std::unique_ptr<SfxPoolItem> pNewItem(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
- aInputSet.Put(*pNewItem);
+ m_aInputSet.Put(*pNewItem);
}
- if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
+ if (m_bTitle && m_aInputSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
{
- const SvxNumBulletItem* pItem = aInputSet.GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET);
+ const SvxNumBulletItem* pItem = m_aInputSet.GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET);
SvxNumRule* pRule = pItem->GetNumRule();
if(pRule)
{
@@ -118,80 +114,68 @@ OutlineBulletDlg::OutlineBulletDlg(
aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS );
SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
- aInputSet.Put(aNewItem);
+ m_aInputSet.Put(aNewItem);
}
}
- SetInputSet( &aInputSet );
+ SetInputSet(&m_aInputSet);
- if(!bTitle)
+ if (!m_bTitle)
AddTabPage("singlenum", RID_SVXPAGE_PICK_SINGLE_NUM);
else
RemoveTabPage("singlenum");
AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET);
AddTabPage("graphics", RID_SVXPAGE_PICK_BMP);
- m_nOptionsId = AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS);
- m_nPositionId = AddTabPage("position", RID_SVXPAGE_NUM_POSITION);
+ AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS);
+ AddTabPage("position", RID_SVXPAGE_NUM_POSITION);
}
OutlineBulletDlg::~OutlineBulletDlg()
{
- disposeOnce();
}
-void OutlineBulletDlg::dispose()
+void OutlineBulletDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
{
- pOutputSet.reset();
- SfxTabDialog::dispose();
-}
-
-void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
-{
- if (nId == m_nOptionsId)
+ if (!m_pSdView)
+ return;
+ if (rId == "customize")
{
- if( pSdView )
- {
- FieldUnit eMetric = pSdView->GetDoc().GetUIUnit();
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
- rPage.PageCreated(aSet);
- }
+ FieldUnit eMetric = m_pSdView->GetDoc().GetUIUnit();
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+ aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
+ rPage.PageCreated(aSet);
}
- else if (nId == m_nPositionId)
+ else if (rId == "position")
{
- if( pSdView )
- {
- FieldUnit eMetric = pSdView->GetDoc().GetUIUnit();
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
- rPage.PageCreated(aSet);
- }
+ FieldUnit eMetric = m_pSdView->GetDoc().GetUIUnit();
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+ aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
+ rPage.PageCreated(aSet);
}
}
-const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const
+const SfxItemSet* OutlineBulletDlg::GetBulletOutputItemSet() const
{
- SfxItemSet aSet( *SfxTabDialog::GetOutputItemSet() );
- pOutputSet->Put( aSet );
+ SfxItemSet aSet(*GetOutputItemSet());
+ m_xOutputSet->Put(aSet);
const SfxPoolItem *pItem = nullptr;
- if( SfxItemState::SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), false, &pItem ))
+ if( SfxItemState::SET == m_xOutputSet->GetItemState(m_xOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), false, &pItem ))
{
- SdBulletMapper::MapFontsInNumRule( *static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule(), *pOutputSet );
-
-// #i35937 - removed EE_PARA_BULLETSTATE setting
+ SdBulletMapper::MapFontsInNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule(), *m_xOutputSet);
+ // #i35937 - removed EE_PARA_BULLETSTATE setting
}
- if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
+ if (m_bTitle && m_xOutputSet->GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET)
{
- const SvxNumBulletItem* pBulletItem = pOutputSet->GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET);
+ const SvxNumBulletItem* pBulletItem = m_xOutputSet->GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET);
SvxNumRule* pRule = pBulletItem->GetNumRule();
if(pRule)
pRule->SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, false );
}
- return pOutputSet.get();
+ return m_xOutputSet.get();
}
} // end of namespace sd
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 2070defa11b7..6c43e082bdef 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -104,7 +104,16 @@ short AbstractSdVectorizeDlg_Impl::Execute()
IMPL_ABSTDLG_BASE(AbstractSdPublishingDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractBulletDialog_Impl);
+
+short AbstractBulletDialog_Impl::Execute()
+{
+ return m_xDlg->execute();
+}
+
+bool AbstractBulletDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
+{
+ return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
AbstractBreakDlg_Impl::AbstractBreakDlg_Impl(std::unique_ptr<::sd::BreakDlg> pDlg)
: m_xDlg(std::move(pDlg))
@@ -205,27 +214,27 @@ void SdAbstractTabController_Impl::SetText( const OUString& rStr )
void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( rName );
+ m_xDlg->SetCurPageId( rName );
}
const SfxItemSet* AbstractBulletDialog_Impl::GetOutputItemSet() const
{
- return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetOutputItemSet();
+ return static_cast< ::sd::OutlineBulletDlg*>(m_xDlg.get())->GetBulletOutputItemSet();
}
const sal_uInt16* AbstractBulletDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
{
- return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetInputRanges( pItem );
+ return m_xDlg->GetInputRanges(pItem);
}
void AbstractBulletDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetInputSet( pInSet );
+ m_xDlg->SetInputSet(pInSet);
}
void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetText( rStr );
+ m_xDlg->set_title(rStr);
}
void SdPresLayoutTemplateDlg_Impl::SetCurPageId( const OString& rName )
@@ -422,9 +431,9 @@ VclPtr<AbstractMorphDlg> SdAbstractDialogFactory_Impl::CreateMorphDlg(weld::Wind
return VclPtr<AbstractMorphDlg_Impl>::Create(o3tl::make_unique<::sd::MorphDlg>(pParent, pObj1, pObj2));
}
-VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
+VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
{
- return VclPtr<AbstractBulletDialog_Impl>::Create( VclPtr<::sd::OutlineBulletDlg>::Create( pParent, pAttr, pView ) );
+ return VclPtr<AbstractBulletDialog_Impl>::Create(o3tl::make_unique<::sd::OutlineBulletDlg>(pParent, pAttr, pView));
}
VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg(weld::Window* pParent, const SfxItemSet* pAttr )
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 9f83019cc2ff..4571aa29248c 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -154,10 +154,17 @@ public:
virtual void SetText( const OUString& rStr ) override;
};
-
class AbstractBulletDialog_Impl : public SfxAbstractTabDialog
{
- DECL_ABSTDLG_BASE( AbstractBulletDialog_Impl,SfxTabDialog )
+protected:
+ std::shared_ptr<SfxTabDialogController> m_xDlg;
+public:
+ explicit AbstractBulletDialog_Impl(std::unique_ptr<SfxTabDialogController> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual bool StartExecuteAsync(AsyncContext &rCtx) override;
virtual void SetCurPageId( const OString& rName ) override;
virtual const SfxItemSet* GetOutputItemSet() const override;
virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override;
@@ -324,7 +331,7 @@ public:
virtual VclPtr<AbstractSdInsertLayerDlg> CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr) override;
virtual VclPtr<AbstractSdInsertPagesObjsDlg> CreateSdInsertPagesObjsDlg(vcl::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName ) override;
virtual VclPtr<AbstractMorphDlg> CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) override;
- virtual VclPtr<SfxAbstractTabDialog> CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSdOutlineBulletTabDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdParagraphTabDlg(weld::Window* pParent, const SfxItemSet* pAttr) override;
virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) override;
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 9215ef607e53..38de3444595b 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -82,7 +82,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
// create and execute dialog
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetActiveWindow(), &aNewAttr, mpView) );
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetFrameWeld(), &aNewAttr, mpView) );
if ( pPageItem )
pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) );
sal_uInt16 nResult = pDlg->Execute();
diff --git a/sd/source/ui/inc/OutlineBulletDlg.hxx b/sd/source/ui/inc/OutlineBulletDlg.hxx
index 2b747ab885cc..8542e79d7ac5 100644
--- a/sd/source/ui/inc/OutlineBulletDlg.hxx
+++ b/sd/source/ui/inc/OutlineBulletDlg.hxx
@@ -29,31 +29,22 @@ class View;
/**
* Bullet-Tab-Dialog
*/
-class OutlineBulletDlg
- : public SfxTabDialog
+class OutlineBulletDlg : public SfxTabDialogController
{
public:
- OutlineBulletDlg (
- vcl::Window* pParent,
- const SfxItemSet* pAttr,
- ::sd::View* pView );
+ OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView);
virtual ~OutlineBulletDlg () override;
- virtual void dispose() override;
- const SfxItemSet* GetOutputItemSet() const;
+ const SfxItemSet* GetBulletOutputItemSet() const;
protected:
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
private:
- using SfxTabDialog::GetOutputItemSet;
-
- SfxItemSet aInputSet;
- std::unique_ptr<SfxItemSet> pOutputSet;
- sal_uInt16 m_nOptionsId;
- sal_uInt16 m_nPositionId;
- bool bTitle;
- ::sd::View *pSdView;
+ SfxItemSet m_aInputSet;
+ std::unique_ptr<SfxItemSet> m_xOutputSet;
+ bool m_bTitle;
+ ::sd::View *m_pSdView;
};
} // end of namespace sd