diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-02-01 16:48:28 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2021-02-09 13:27:09 +0100 |
commit | 68892230ddcde135e9951047a3621438eb7987d0 (patch) | |
tree | 1978101f8ef72589d73862cced4f1f3987b9cb87 /sc | |
parent | 852315fa15fdd1ad1f75820e39f5fc298a552b1b (diff) |
autofilter: scale dropdown button according to zoom level
Change-Id: I4f8a16e196bc33ea5b29fda0edc1f773a24e28db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110259
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/cctrl/dpcontrol.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 2ca413055000..f178074ae577 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -146,6 +146,13 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const long nW = std::min(maSize.getWidth() / 2, nMaxSize); long nH = std::min(maSize.getHeight(), nMaxSize); + double fZoom = static_cast<double>(maZoomY) > 1.0 ? static_cast<double>(maZoomY) : 1.0; + if (fZoom > 1.0) + { + nW = fZoom * (nW - 1); + nH = fZoom * (nH - 1); + } + // #i114944# AutoFilter button is left-aligned in RTL. // DataPilot button is always right-aligned for now, so text output isn't affected. if (mbPopupLeft) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 41a9760cc450..9e301615a107 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1336,8 +1336,10 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY ( rPattern.GetItem(ATTR_MERGE_FLAG).GetValue() & (ScMF::Auto|ScMF::Button|ScMF::ButtonPopup) ) && ( !bBreak || mpRefDevice == pFmtDevice ) ) { - // filter drop-down width is now independent from row height - const long nFilter = DROPDOWN_BITMAP_SIZE; + // filter drop-down width depends on row height + double fZoom = mpRefDevice ? static_cast<double>(mpRefDevice->GetMapMode().GetScaleY()) : 1.0; + fZoom = fZoom > 1.0 ? fZoom : 1.0; + const long nFilter = fZoom * DROPDOWN_BITMAP_SIZE; bool bFit = ( nNeeded + nFilter <= nMergeSizeX ); if ( bFit || bCellIsValue ) { @@ -4906,11 +4908,13 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) eOrient!=SvxCellOrientation::Stacked && pInfo->bAutoFilter) { - // filter drop-down width is now independent from row height + // filter drop-down width depends on row height + double fZoom = mpRefDevice ? static_cast<double>(mpRefDevice->GetMapMode().GetScaleY()) : 1.0; + fZoom = fZoom > 1.0 ? fZoom : 1.0; if (bPixelToLogic) - nAvailWidth -= mpRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height(); + nAvailWidth -= mpRefDevice->PixelToLogic(Size(0,fZoom * DROPDOWN_BITMAP_SIZE)).Height(); else - nAvailWidth -= DROPDOWN_BITMAP_SIZE; + nAvailWidth -= fZoom * DROPDOWN_BITMAP_SIZE; long nComp = nEngineWidth; if (nAvailWidth<nComp) nAvailWidth=nComp; } |