summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/tabpagemodel.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-17 11:18:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-18 07:41:51 +0100
commit5e69b3619d3a2b05930c5b8b8521d7f2938c709d (patch)
tree2bcfb4244223b7fe570e9b0bcee2f7dd3928e226 /toolkit/source/controls/tabpagemodel.cxx
parent1d097883541b9d244e50ced7fe49a4d7a0f65cfd (diff)
loplugin:flatten in toolkit..writerfilter
Change-Id: I4da2a768b6b55869c3a3d6f8a8d50dc018709acd Reviewed-on: https://gerrit.libreoffice.org/44865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/controls/tabpagemodel.cxx')
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx96
1 files changed, 49 insertions, 47 deletions
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index c45c8daad700..90f22675da0f 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -235,62 +235,64 @@ void SAL_CALL UnoControlTabPage::windowResized( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
- if ( pOutDev && !mbSizeModified )
- {
- // Currentley we are simply using MapUnit::MapAppFont
- ::Size aAppFontSize( e.Width, e.Height );
+ if ( !pOutDev || mbSizeModified )
+ return;
- Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
- Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
- OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
- if ( xDialogDevice.is() )
- {
- DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
- aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
- aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
- }
+ // Currentley we are simply using MapUnit::MapAppFont
+ ::Size aAppFontSize( e.Width, e.Height );
- aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
-
- // Remember that changes have been done by listener. No need to
- // update the position because of property change event.
- mbSizeModified = true;
- Sequence< OUString > aProps( 2 );
- Sequence< Any > aValues( 2 );
- // Properties in a sequence must be sorted!
- aProps[0] = "Height";
- aProps[1] = "Width";
- aValues[0] <<= aAppFontSize.Height();
- aValues[1] <<= aAppFontSize.Width();
-
- ImplSetPropertyValues( aProps, aValues, true );
- mbSizeModified = false;
+ Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
+ Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
+ OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
+ if ( xDialogDevice.is() )
+ {
+ DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
+ aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
+ aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
+
+ aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbSizeModified = true;
+ Sequence< OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ // Properties in a sequence must be sorted!
+ aProps[0] = "Height";
+ aProps[1] = "Width";
+ aValues[0] <<= aAppFontSize.Height();
+ aValues[1] <<= aAppFontSize.Width();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbSizeModified = false;
+
}
void SAL_CALL UnoControlTabPage::windowMoved( const css::awt::WindowEvent& e )
{
OutputDevice*pOutDev = Application::GetDefaultDevice();
DBG_ASSERT( pOutDev, "Missing Default Device!" );
- if ( pOutDev && !mbPosModified )
- {
- // Currentley we are simply using MapUnit::MapAppFont
- ::Size aTmp( e.X, e.Y );
- aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
-
- // Remember that changes have been done by listener. No need to
- // update the position because of property change event.
- mbPosModified = true;
- Sequence< OUString > aProps( 2 );
- Sequence< Any > aValues( 2 );
- aProps[0] = "PositionX";
- aProps[1] = "PositionY";
- aValues[0] <<= aTmp.Width();
- aValues[1] <<= aTmp.Height();
-
- ImplSetPropertyValues( aProps, aValues, true );
- mbPosModified = false;
- }
+ if ( !pOutDev || mbPosModified )
+ return;
+
+ // Currentley we are simply using MapUnit::MapAppFont
+ ::Size aTmp( e.X, e.Y );
+ aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbPosModified = true;
+ Sequence< OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ aProps[0] = "PositionX";
+ aProps[1] = "PositionY";
+ aValues[0] <<= aTmp.Width();
+ aValues[1] <<= aTmp.Height();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbPosModified = false;
+
}
void SAL_CALL UnoControlTabPage::windowShown( const css::lang::EventObject& ) {}