summaryrefslogtreecommitdiff
path: root/sw/source/uibase/sidebar
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:41:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 12:16:48 +0200
commitfd80650672d5d3a0b585d6d46a1b1b0cd4012faf (patch)
treeca23283c97c9bb16594ff3d3abd6d97a4c163bb7 /sw/source/uibase/sidebar
parent1c080b887c1ef28cb2e98173d0121bcae3167075 (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')
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx34
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.cxx26
2 files changed, 30 insertions, 30 deletions
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 258b5996d052..065588eda318 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -397,26 +397,26 @@ IMPL_LINK( PageMarginControl, SelectMarginHdl, weld::Button&, rControl, void )
}
}
- if ( bApplyNewPageMargins )
- {
- const css::uno::Reference< css::document::XUndoManager > xUndoManager( getUndoManager( SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) );
- if ( xUndoManager.is() )
- xUndoManager->enterUndoContext( "" );
-
- ExecuteMarginLRChange( m_nPageLeftMargin, m_nPageRightMargin );
- ExecuteMarginULChange( m_nPageTopMargin, m_nPageBottomMargin );
- if ( m_bMirrored != bMirrored )
- {
- m_bMirrored = bMirrored;
- ExecutePageLayoutChange( m_bMirrored );
- }
+ if ( !bApplyNewPageMargins )
+ return;
- if ( xUndoManager.is() )
- xUndoManager->leaveUndoContext();
+ const css::uno::Reference< css::document::XUndoManager > xUndoManager( getUndoManager( SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) );
+ if ( xUndoManager.is() )
+ xUndoManager->enterUndoContext( "" );
- m_bCustomValuesUsed = false;
- m_xControl->EndPopupMode();
+ ExecuteMarginLRChange( m_nPageLeftMargin, m_nPageRightMargin );
+ ExecuteMarginULChange( m_nPageTopMargin, m_nPageBottomMargin );
+ if ( m_bMirrored != bMirrored )
+ {
+ m_bMirrored = bMirrored;
+ ExecutePageLayoutChange( m_bMirrored );
}
+
+ if ( xUndoManager.is() )
+ xUndoManager->leaveUndoContext();
+
+ m_bCustomValuesUsed = false;
+ m_xControl->EndPopupMode();
}
void PageMarginControl::ExecuteMarginLRChange(
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() });
}