diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-30 10:41:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-30 12:16:48 +0200 |
commit | fd80650672d5d3a0b585d6d46a1b1b0cd4012faf (patch) | |
tree | ca23283c97c9bb16594ff3d3abd6d97a4c163bb7 /sw/source/uibase/sidebar/PageSizeControl.cxx | |
parent | 1c080b887c1ef28cb2e98173d0121bcae3167075 (diff) |
loplugin:flatten in sw/uibase/sidebar..sw/uibase/uno
Change-Id: Ifc9c838ffc94e89d2049969ef28d66fed853548b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99765
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/sidebar/PageSizeControl.cxx')
-rw-r--r-- | sw/source/uibase/sidebar/PageSizeControl.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 5abdb4788609..00bcfc0a6a3d 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -197,22 +197,22 @@ void PageSizeControl::ExecuteSizeChange( const Paper ePaper ) bool bLandscape = false; const SfxPoolItem *pItem; MapUnit eUnit = lcl_GetUnit(); - if ( SfxViewFrame::Current() ) - { - SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pItem ); - bLandscape = static_cast<const SvxPageItem*>(pItem)->IsLandscape(); + if ( !SfxViewFrame::Current() ) + return; - std::unique_ptr<SvxSizeItem> pPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) ); - Size aPageSize = SvxPaperInfo::GetPaperSize( ePaper, eUnit ); - if ( bLandscape ) - { - Swap( aPageSize ); - } - pPageSizeItem->SetSize( aPageSize ); + SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pItem ); + bLandscape = static_cast<const SvxPageItem*>(pItem)->IsLandscape(); - SfxViewFrame::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, - SfxCallMode::RECORD, { pPageSizeItem.get() }); + std::unique_ptr<SvxSizeItem> pPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) ); + Size aPageSize = SvxPaperInfo::GetPaperSize( ePaper, eUnit ); + if ( bLandscape ) + { + Swap( aPageSize ); } + pPageSizeItem->SetSize( aPageSize ); + + SfxViewFrame::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, + SfxCallMode::RECORD, { pPageSizeItem.get() }); } |