summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/tabpagemodel.cxx
diff options
context:
space:
mode:
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& ) {}