Kaydet (Commit) f92fcff0 authored tarafından Jean-Baptiste FAURE's avatar Jean-Baptiste FAURE Kaydeden (comit) Arnaud Versini

The label size is computed from the length of the string it contains

Change-Id: I586a31a5d563ea8a11282836ca1d54b0c8be1bf4
Signed-off-by: 's avatarArnaud Versini <arnaud.versini@gmail.com>
üst 1cd0f1bd
......@@ -48,16 +48,23 @@ ScTpDefaultsOptions::ScTpDefaultsOptions(Window *pParent, const SfxItemSet &rCor
{
FreeResource();
long nTxtW = aFtNSheets.GetCtrlTextWidth( aFtNSheets.GetText() );
long nCtrlW = aFtNSheets.GetSizePixel().Width();
if ( nTxtW >= nCtrlW )
// the following computation must be modified accordingly if a third line is added to this dialog
long nTxtW1 = aFtNSheets.GetCtrlTextWidth( aFtNSheets.GetText() );
long nCtrlW1 = aFtNSheets.GetSizePixel().Width();
long nTxtW2 = aFtSheetPrefix.GetCtrlTextWidth(aFtSheetPrefix.GetText() );
long nCtrlW2 = aFtSheetPrefix.GetSizePixel().Width();
if ( nTxtW1 >= nCtrlW1 || nTxtW2 >= nCtrlW2)
{
long nTxtW = std::max(nTxtW1,nTxtW2);
Size aNewSize = aFtNSheets.GetSizePixel();
aNewSize.Width() += ( nTxtW - nCtrlW );
aNewSize.Width() = nTxtW;
aFtNSheets.SetSizePixel( aNewSize );
aFtSheetPrefix.SetSizePixel( aNewSize );
Point aNewPoint = aEdNSheets.GetPosPixel();
aNewPoint.X() += ( nTxtW - nCtrlW );
aNewPoint.X() += (nTxtW - nCtrlW1);
aEdNSheets.SetPosPixel( aNewPoint );
aNewPoint.Y() = aEdSheetPrefix.GetPosPixel().Y();
aEdSheetPrefix.SetPosPixel( aNewPoint );
}
aEdNSheets.SetModifyHdl( LINK(this, ScTpDefaultsOptions, NumModifiedHdl) );
aEdSheetPrefix.SetModifyHdl( LINK(this, ScTpDefaultsOptions, PrefixModifiedHdl) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment