summaryrefslogtreecommitdiff
path: root/basctl/source/dlged/dlgedobj.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 13:01:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 19:50:47 +0100
commitbddd6c77811e0489a5632437116f5eec356cc397 (patch)
tree761111e37f065d040a6d63ef1098de2afce16eae /basctl/source/dlged/dlgedobj.cxx
parenteb5563e7e636a9856d4f1cc23d00a21193b9d0cc (diff)
Revert "loplugin:changetoolsgen in avmedia..basic" and reapply plugin
because I (a) forgot to insert parentheses which changes the meaning of some expressions and (b) I now use the AdjustFoo calls when changing unary operations, which reads much better This reverts commit 1adb1a320a7e9832a41545bde13fd59d27ce7954. Change-Id: I52924b35008c8e4b44c8a6b6657cc3a1ac513886 Reviewed-on: https://gerrit.libreoffice.org/49848 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/dlged/dlgedobj.cxx')
-rw-r--r--basctl/source/dlged/dlgedobj.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index d14f49fcdc9f..6eecc246a849 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -140,8 +140,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) );
// subtract form position
- aPos.setWidth( aPos.Width() - aFormPos.Width() );
- aPos.setHeight( aPos.Height() - aFormPos.Height() );
+ aPos.AdjustWidth( -(aFormPos.Width()) );
+ aPos.AdjustHeight( -(aFormPos.Height()) );
// take window borders into account
Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
@@ -153,8 +153,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aPos.setWidth( aPos.Width() - aDeviceInfo.LeftInset );
- aPos.setHeight( aPos.Height() - aDeviceInfo.TopInset );
+ aPos.AdjustWidth( -(aDeviceInfo.LeftInset) );
+ aPos.AdjustHeight( -(aDeviceInfo.TopInset) );
}
// convert pixel to logic units
@@ -201,8 +201,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aSize.setWidth( aSize.Width() - aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
- aSize.setHeight( aSize.Height() - aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
+ aSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
+ aSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
}
// convert pixel to logic units
aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont));
@@ -251,8 +251,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont));
// add form position
- aPos.setWidth( aPos.Width() + aFormPos.Width() );
- aPos.setHeight( aPos.Height() + aFormPos.Height() );
+ aPos.AdjustWidth(aFormPos.Width() );
+ aPos.AdjustHeight(aFormPos.Height() );
// take window borders into account
bool bDecoration = true;
@@ -260,8 +260,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aPos.setWidth( aPos.Width() + aDeviceInfo.LeftInset );
- aPos.setHeight( aPos.Height() + aDeviceInfo.TopInset );
+ aPos.AdjustWidth(aDeviceInfo.LeftInset );
+ aPos.AdjustHeight(aDeviceInfo.TopInset );
}
// convert pixel to 100th_mm
@@ -309,8 +309,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aSize.setWidth( aSize.Width() + aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
- aSize.setHeight( aSize.Height() + aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
+ aSize.AdjustWidth(aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
+ aSize.AdjustHeight(aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
}
// convert pixel to 100th_mm