summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2018-06-20 17:52:13 +0200
committerJan Holesovsky <kendy@collabora.com>2018-06-21 08:44:28 +0200
commitb86a8857e6488bac1224a9eed471bcf930994399 (patch)
treed6886074175e17bde909af5d0fc4aa8e2370600f
parent5f3c08cf061ae9c6c4cad74e6671c41394f00630 (diff)
tdf#66089 tdf#105720: only rely on bPixelToLogic
Left-aligned currency symbols were put in preceding cells sometimes, because fill width was calculated incorrectly. Commit 37210da00a9190f7765fa9c1e4a08629d2f4c2c4 fixed the issue for LOK, but the bug was still reproducible in Calc if setting "Use printer metrics for text formatting" was enabled. Change-Id: I6cf90493cbf98c5020acd5faf1d0f3cf2def5c25 Reviewed-on: https://gerrit.libreoffice.org/56172 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 93e9a3e2b545c853f53ffe28d2795f55ad29f304) Reviewed-on: https://gerrit.libreoffice.org/56215
-rw-r--r--sc/source/ui/view/output2.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 9327f6cb856f..49bfb0670dc4 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -75,7 +75,6 @@
#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <comphelper/string.hxx>
-#include <comphelper/lok.hxx>
#include <memory>
#include <vector>
@@ -567,19 +566,18 @@ void ScDrawStringsVars::RepeatToFill( long nColWidth )
if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() )
return;
- const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
-
long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
- if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < TWIPS_PER_PIXEL)) return;
-
- if (bPixelToLogic)
- nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
+ if ( nCharWidth < 1 || (bPixelToLogic && nCharWidth < pOutput->mpRefDevice->PixelToLogic(Size(1,0)).Width()) )
+ return;
// Are there restrictions on the cell type we should filter out here ?
long nTextWidth = aTextSize.Width();
- if ( bIsTiledRendering )
+ if ( bPixelToLogic )
+ {
+ nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
nTextWidth = pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width();
+ }
long nSpaceToFill = ( nColWidth - nTextWidth );
if ( nSpaceToFill <= nCharWidth )