summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-06-21 13:00:51 +0100
committerEike Rathke <erack@redhat.com>2013-06-21 13:29:28 +0000
commit874dad99efd531abcad486a6b1abc21c13194bb0 (patch)
treec8760e2ddd11b9c5b00cfc57b1d8061f51291004 /vcl
parent140da2c862b60a885dd35b86e197e919c28c9e6a (diff)
Resolves: fdo#65635 don't include border gap in height for borderless edits
Change-Id: If778fdeb5bdbd5a5cac33f57ef8d598ddc1408f2 (cherry picked from commit 0a5c151b62a7abc3fc4abaadb0b50c3047eb5f26) Reviewed-on: https://gerrit.libreoffice.org/4428 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/edit.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 10b25dc94c6c..20323b35ffa2 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1048,10 +1048,10 @@ void Edit::ImplSetText( const OUString& rText, const Selection* pNewSelection )
// -----------------------------------------------------------------------
-int Edit::ImplGetNativeControlType()
+int Edit::ImplGetNativeControlType() const
{
int nCtrl = 0;
- Window *pControl = mbIsSubEdit ? GetParent() : this;
+ const Window *pControl = mbIsSubEdit ? GetParent() : this;
switch( pControl->GetType() )
{
@@ -2877,6 +2877,8 @@ void Edit::SetSubEdit( Edit* pEdit )
Size Edit::CalcMinimumSizeForText(const OUString &rString) const
{
+ int eCtrlType = ImplGetNativeControlType();
+
Size aSize;
if (mnWidthInChars != -1)
{
@@ -2893,8 +2895,12 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const
if (aSize.Width() < aMinSize.Width())
aSize.Width() = aMinSize.Width();
}
- // add some space between text entry and border
- aSize.Height() += 4;
+
+ if (eCtrlType != CTRL_EDITBOX_NOBORDER)
+ {
+ // add some space between text entry and border
+ aSize.Height() += 4;
+ }
aSize = CalcWindowSize( aSize );
@@ -2903,7 +2909,7 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const
Rectangle aRect( Point( 0, 0 ), aSize );
Rectangle aContent, aBound;
if( const_cast<Edit*>(this)->GetNativeControlRegion(
- CTRL_EDITBOX, PART_ENTIRE_CONTROL,
+ eCtrlType, PART_ENTIRE_CONTROL,
aRect, 0, aControlValue, OUString(), aBound, aContent) )
{
if( aBound.GetHeight() > aSize.Height() )