summaryrefslogtreecommitdiff
path: root/svx/source/dialog/dlgname.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-12-21 15:18:50 +0000
committerOliver Bolte <obo@openoffice.org>2005-12-21 15:18:50 +0000
commitea14782e79b8e06ec334a15e4f474f3ea547ae48 (patch)
treea4d0b510eaaaecd5fb3dbedffc438aee96eeff48 /svx/source/dialog/dlgname.cxx
parent929605847981c33bf6a6c485fcc992d280b49aa1 (diff)
INTEGRATION: CWS fwk27 (1.6.184); FILE MERGED
2005/12/09 06:30:41 pb 1.6.184.1: fix: #i52740# dynamic height of the description field
Diffstat (limited to 'svx/source/dialog/dlgname.cxx')
-rw-r--r--svx/source/dialog/dlgname.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/svx/source/dialog/dlgname.cxx b/svx/source/dialog/dlgname.cxx
index 3c83ae89dd6a..7c62e9f3f9ce 100644
--- a/svx/source/dialog/dlgname.cxx
+++ b/svx/source/dialog/dlgname.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: dlgname.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 20:59:33 $
+ * last change: $Author: obo $ $Date: 2005-12-21 16:18:50 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -58,6 +58,8 @@
#include "dlgname.hrc"
#include "dialmgr.hxx"
+#define MAX_DESCRIPTION_LINES ((long)5)
+
/*************************************************************************
|*
|* Dialog zum Editieren eines Namens
@@ -79,7 +81,22 @@ SvxNameDialog::SvxNameDialog( Window* pWindow, const String& rName, const String
aEdtName.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
ModifyHdl(&aEdtName);
aEdtName.SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
+
+ // dynamic height of the description field
+ Size aSize = aFtDescription.GetSizePixel();
+ long nTxtWidth = aFtDescription.GetCtrlTextWidth( rDesc );
+ if ( nTxtWidth > aSize.Width() )
+ {
+ long nLines = Min( ( nTxtWidth / aSize.Width() + 1 ), MAX_DESCRIPTION_LINES );
+ long nHeight = aSize.Height();
+ aSize.Height() = nHeight * nLines;
+ aFtDescription.SetSizePixel( aSize );
+ Point aPnt = aEdtName.GetPosPixel();
+ aPnt.Y() += ( aSize.Height() - nHeight );
+ aEdtName.SetPosPixel( aPnt );
+ }
}
+
/* -----------------------------27.02.2002 15:22------------------------------
---------------------------------------------------------------------------*/