summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/output2.cxx
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:43:33 +0200
commitecd02b76fe2c134abf7fc32572436e1374d9c79b (patch)
treeaa82d57e359de8a1ec52c412967a196a971bad03 /sc/source/ui/view/output2.cxx
parent740e204b481a3d742ef7c240e081a9ddc45a11a2 (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/56213 Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc/source/ui/view/output2.cxx')
-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 5575a26bc70b..bb9dc4f97118 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 )