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-20 21:43:46 +0200
commit93e9a3e2b545c853f53ffe28d2795f55ad29f304 (patch)
tree2a1612c79e09494cee67ad863091dff72209ab29
parent1b4c09401053ff6df8de9e839299ac26efa28b37 (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>
-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 bf10567aa2eb..ab6f0065d71c 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 )