--- sw/source/ui/frmdlg/frmpage.cxx.old 2007-04-01 17:38:09.000000000 +0200 +++ sw/source/ui/frmdlg/frmpage.cxx 2007-04-01 19:16:12.000000000 +0200 @@ -2120,17 +2120,32 @@ SwTwips nHeight = aHeightED.Denormalize(aHeightED.GetValue(FUNIT_TWIP)); if ( aFixedRatioCB.IsChecked() ) { - BOOL bWidthRelative = aRelWidthCB.IsChecked(); - BOOL bHeightRelative = aRelHeightCB.IsChecked(); if ( pEdit == &aWidthED ) { nHeight = SwTwips((double)nWidth / fWidthHeightRatio); + SwTwips height_before = aHeightED.GetValue(); aHeightED.SetPrcntValue(aHeightED.Normalize(nHeight), FUNIT_TWIP); + // update failed, we have to reverse width field + if ( nHeight != aHeightED.Denormalize(aHeightED.GetValue(FUNIT_TWIP)) ) + { + nHeight = aHeightED.Denormalize(aHeightED.GetValue(FUNIT_TWIP)); + nWidth = SwTwips((double)nHeight * fWidthHeightRatio); + aWidthED.SetPrcntValue(aWidthED.Normalize(nWidth), FUNIT_TWIP); + } } - else if(pEdit == &aHeightED) + if ( pEdit == &aHeightED ) { nWidth = SwTwips((double)nHeight * fWidthHeightRatio); + SwTwips width_before = aWidthED.GetValue(); aWidthED.SetPrcntValue(aWidthED.Normalize(nWidth), FUNIT_TWIP); + // update failed, we have to reverse height field + if ( nWidth != aWidthED.Denormalize(aWidthED.GetValue(FUNIT_TWIP)) ) + { + nWidth = aWidthED.Denormalize(aWidthED.GetValue(FUNIT_TWIP)); + nHeight = SwTwips((double)nWidth / fWidthHeightRatio); + aHeightED.SetPrcntValue(aHeightED.Normalize(nHeight), FUNIT_TWIP); + } + } } fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;