summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-05-26 14:59:53 -0400
committerMichael Meeks <michael.meeks@collabora.com>2020-05-16 19:21:53 +0100
commit2f32e19a6aca8e3361a05a4c333c39225775ef9e (patch)
treef329529f5c1f7f5301ebc543d00adc6fca8255a4 /svx
parent08bf8101717ea293a1340b442c710de6a5dfc6dd (diff)
svx: LOK: convert background child-dialogs to async
(cherry picked from commit 625a8c33bd95b4068838caef19af28c5404c59ce) Reviewed-on: https://gerrit.libreoffice.org/83633 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 46a1c0a733f1e664823dcb483796dbcc8a743f4a) Change-Id: I682ab039ce3732aa973e0fe371c191f1ca1b9ef7 Reviewed-on: https://gerrit.libreoffice.org/85677 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/hdft.cxx79
1 files changed, 42 insertions, 37 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index c936e91ee740..b92dc46e8deb 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -624,54 +624,59 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void)
*pBBSet,
mbEnableDrawingLayerFillStyles));
- if(RET_OK == pDlg->Execute() && pDlg->GetOutputItemSet())
- {
- SfxItemIter aIter(*pDlg->GetOutputItemSet());
-
- for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
+ pDlg->StartExecuteAsync([&](sal_Int32 nResult) {
+ if (nResult == RET_OK && pDlg->GetOutputItemSet())
{
- if(!IsInvalidItem(pItem))
- {
- pBBSet->Put(*pItem);
- }
- }
+ SfxItemIter aIter(*pDlg->GetOutputItemSet());
- {
- drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
-
- if(mbEnableDrawingLayerFillStyles)
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
{
- // create FillAttributes directly from DrawingLayer FillStyle entries
- aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(*pBBSet));
+ if(!IsInvalidItem(pItem))
+ {
+ pBBSet->Put(*pItem);
+ }
}
- else
+
{
- const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH);
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
- if(pBBSet->GetItemState(nWhich) == SfxItemState::SET)
+ if (mbEnableDrawingLayerFillStyles)
{
- // create FillAttributes from SvxBrushItem
- const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(pBBSet->Get(nWhich));
- SfxItemSet aTempSet(*pBBSet->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
-
- setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
- aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ // create FillAttributes directly from DrawingLayer FillStyle entries
+ aFillAttributes.reset(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(*pBBSet));
+ }
+ else
+ {
+ const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH);
+
+ if (pBBSet->GetItemState(nWhich) == SfxItemState::SET)
+ {
+ // create FillAttributes from SvxBrushItem
+ const SvxBrushItem& rItem
+ = static_cast<const SvxBrushItem&>(pBBSet->Get(nWhich));
+ SfxItemSet aTempSet(*pBBSet->GetPool(),
+ svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
+
+ setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
+ aFillAttributes.reset(
+ new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ }
}
- }
- if(SID_ATTR_PAGE_HEADERSET == nId)
- {
- //m_aBspWin.SetHdColor(rItem.GetColor());
- m_aBspWin.setHeaderFillAttributes(aFillAttributes);
- }
- else
- {
- //m_aBspWin.SetFtColor(rItem.GetColor());
- m_aBspWin.setFooterFillAttributes(aFillAttributes);
+ if (SID_ATTR_PAGE_HEADERSET == nId)
+ {
+ //m_aBspWin.SetHdColor(rItem.GetColor());
+ m_aBspWin.setHeaderFillAttributes(aFillAttributes);
+ }
+ else
+ {
+ //m_aBspWin.SetFtColor(rItem.GetColor());
+ m_aBspWin.setFooterFillAttributes(aFillAttributes);
+ }
}
}
-
- }
+ });
UpdateExample();
}