summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-17 12:15:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-21 10:20:07 +0200
commitca5b322fd47f527c559f8806162b84eec7158615 (patch)
tree1fad433983b75bade6b6d92aa83143275a53f5ac /vcl/source
parent2e0a32b51681fb356699b4a722f461f55a46b890 (diff)
don't add maUserItemSize to text width, just use it as-is
which means we don't need the reverse calculation in the style dropdown to force that result Change-Id: I3c8421e964af4339abfacb455b75db5ad75456fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92446 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/imp_listbox.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 3fe90de21906..ad33bb85a3a7 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -667,16 +667,18 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, aMetrics.nEntryHeight );
}
- if ( IsUserDrawEnabled() || aMetrics.bImage )
+
+ bool bIsUserDrawEnabled = IsUserDrawEnabled();
+ if (bIsUserDrawEnabled || aMetrics.bImage)
{
aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() );
- if ( aMetrics.bText )
+ if (!bIsUserDrawEnabled && aMetrics.bText)
aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE;
aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2,
aMetrics.nEntryHeight );
}
- if ( !aMetrics.bText && !aMetrics.bImage && !IsUserDrawEnabled() )
+ if (!aMetrics.bText && !aMetrics.bImage && !bIsUserDrawEnabled)
{
// entries which have no (aka an empty) text, and no image,
// and are not user-drawn, should be shown nonetheless