summaryrefslogtreecommitdiff
path: root/svtools/source/dialogs
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:26:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:54:12 +0100
commit1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 (patch)
tree9461c0532919f4fe61f3e0e3fa8556e954244fbd /svtools/source/dialogs
parent04bb9549e0a0ee567f3bd48a7707286c5abd631a (diff)
loplugin:flatten in svtools
almost completely automatically rewritten, only had to tweak the indentation on a couple of lines. Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646 Reviewed-on: https://gerrit.libreoffice.org/45072 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/dialogs')
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx40
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx24
-rw-r--r--svtools/source/dialogs/wizdlg.cxx80
3 files changed, 72 insertions, 72 deletions
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 0a7ac213d5e7..e1318d1aa5dc 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -223,34 +223,34 @@ void PlaceEditDialog::InitDetails( )
IMPL_LINK( PlaceEditDialog, OKHdl, Button*, /*pBtn*/, void)
{
- if ( m_xCurrentDetails.get() )
- {
- OUString sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset );
+ if ( !m_xCurrentDetails.get() )
+ return;
- if ( sUrl.startsWith( GDRIVE_BASE_URL )
- || sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL )
- || sUrl.startsWith( ONEDRIVE_BASE_URL ) )
- {
- m_pBTRepoRefresh->Click();
+ OUString sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset );
- sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset );
- INetURLObject aHostUrl( sUrl );
- OUString sRepoId = aHostUrl.GetMark();
+ if ( sUrl.startsWith( GDRIVE_BASE_URL )
+ || sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL )
+ || sUrl.startsWith( ONEDRIVE_BASE_URL ) )
+ {
+ m_pBTRepoRefresh->Click();
- if ( !sRepoId.isEmpty() )
- {
- EndDialog( RET_OK );
- }
- else
- {
- // TODO: repository id missing. Auth error?
- }
+ sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset );
+ INetURLObject aHostUrl( sUrl );
+ OUString sRepoId = aHostUrl.GetMark();
+
+ if ( !sRepoId.isEmpty() )
+ {
+ EndDialog( RET_OK );
}
else
{
- EndDialog( RET_OK );
+ // TODO: repository id missing. Auth error?
}
}
+ else
+ {
+ EndDialog( RET_OK );
+ }
}
IMPL_LINK( PlaceEditDialog, DelHdl, Button*, /*pButton*/, void)
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 58f4c7c542f3..fd1c4a548285 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -627,21 +627,21 @@ void AssignmentPersistentData::ImplCommit()
// so the dialog will at least show up before we do the loading of the
// configuration data and the (maybe time consuming) analysis of the data source/table to select
- if ( !m_pImpl->bWorkingPersistent )
- {
- StyleSettings aSystemStyle = GetSettings().GetStyleSettings();
- const ::Color& rNewColor = aSystemStyle.GetDialogColor();
+ if ( m_pImpl->bWorkingPersistent )
+ return;
- m_pDatasource->SetReadOnly();
- m_pDatasource->SetBackground( Wallpaper( rNewColor ) );
- m_pDatasource->SetControlBackground( rNewColor );
+ StyleSettings aSystemStyle = GetSettings().GetStyleSettings();
+ const ::Color& rNewColor = aSystemStyle.GetDialogColor();
- m_pTable->SetReadOnly();
- m_pTable->SetBackground( Wallpaper( rNewColor ) );
- m_pTable->SetControlBackground( rNewColor );
+ m_pDatasource->SetReadOnly();
+ m_pDatasource->SetBackground( Wallpaper( rNewColor ) );
+ m_pDatasource->SetControlBackground( rNewColor );
- m_pAdministrateDatasources->Hide( );
- }
+ m_pTable->SetReadOnly();
+ m_pTable->SetBackground( Wallpaper( rNewColor ) );
+ m_pTable->SetControlBackground( rNewColor );
+
+ m_pAdministrateDatasources->Hide( );
}
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index 7694f7f6add6..a24522bcaf56 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -177,55 +177,55 @@ void WizardDialog::ImplPosCtrls()
nOffY -= WIZARDDIALOG_BUTTON_OFFSET_Y;
}
- if ( mpViewWindow && mpViewWindow->IsVisible() )
+ if ( !(mpViewWindow && mpViewWindow->IsVisible()) )
+ return;
+
+ long nViewOffX = 0;
+ long nViewOffY = 0;
+ long nViewWidth = 0;
+ long nViewHeight = 0;
+ long nDlgHeight = nOffY;
+ PosSizeFlags nViewPosFlags = PosSizeFlags::Pos;
+ if ( meViewAlign == WindowAlign::Top )
{
- long nViewOffX = 0;
- long nViewOffY = 0;
- long nViewWidth = 0;
- long nViewHeight = 0;
- long nDlgHeight = nOffY;
- PosSizeFlags nViewPosFlags = PosSizeFlags::Pos;
- if ( meViewAlign == WindowAlign::Top )
- {
- nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
- nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
- nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
- nViewPosFlags |= PosSizeFlags::Width;
- }
- else if ( meViewAlign == WindowAlign::Left )
+ nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
+ nViewPosFlags |= PosSizeFlags::Width;
+ }
+ else if ( meViewAlign == WindowAlign::Left )
+ {
+ if ( mbEmptyViewMargin )
{
- if ( mbEmptyViewMargin )
- {
- nViewOffX = 0;
- nViewOffY = 0;
- nViewHeight = nDlgHeight;
- }
- else
- {
- nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
- nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
- nViewHeight = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
- }
- nViewPosFlags |= PosSizeFlags::Height;
+ nViewOffX = 0;
+ nViewOffY = 0;
+ nViewHeight = nDlgHeight;
}
- else if ( meViewAlign == WindowAlign::Bottom )
+ else
{
nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
- nViewOffY = nDlgHeight-mpViewWindow->GetSizePixel().Height()-WIZARDDIALOG_VIEW_DLGOFFSET_Y;
- nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
- nViewPosFlags |= PosSizeFlags::Width;
- }
- else if ( meViewAlign == WindowAlign::Right )
- {
- nViewOffX = aDlgSize.Width()-mpViewWindow->GetSizePixel().Width()-WIZARDDIALOG_VIEW_DLGOFFSET_X;
nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
nViewHeight = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
- nViewPosFlags |= PosSizeFlags::Height;
}
- mpViewWindow->setPosSizePixel( nViewOffX, nViewOffY,
- nViewWidth, nViewHeight,
- nViewPosFlags );
+ nViewPosFlags |= PosSizeFlags::Height;
+ }
+ else if ( meViewAlign == WindowAlign::Bottom )
+ {
+ nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = nDlgHeight-mpViewWindow->GetSizePixel().Height()-WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
+ nViewPosFlags |= PosSizeFlags::Width;
+ }
+ else if ( meViewAlign == WindowAlign::Right )
+ {
+ nViewOffX = aDlgSize.Width()-mpViewWindow->GetSizePixel().Width()-WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewHeight = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
+ nViewPosFlags |= PosSizeFlags::Height;
}
+ mpViewWindow->setPosSizePixel( nViewOffX, nViewOffY,
+ nViewWidth, nViewHeight,
+ nViewPosFlags );
}