summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2018-06-14 12:32:48 +0200
committerAron Budea <aron.budea@collabora.com>2018-06-21 04:22:43 +0200
commit5f3c08cf061ae9c6c4cad74e6671c41394f00630 (patch)
treead0b796c19653180d313587f67b461b43a09a563
parent2acaf22274068fbc4181120084aa372254e11686 (diff)
tdf#105720: lok: sc: currency symbol is displayed in the preceding cell
Change-Id: I6175cfeab3d8bc3a757c8522aa9c7a7e49c4bf2b Reviewed-on: https://gerrit.libreoffice.org/55790 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com> (cherry picked from commit 37210da00a9190f7765fa9c1e4a08629d2f4c2c4) Reviewed-on: https://gerrit.libreoffice.org/56214 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--sc/source/ui/view/output2.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 60fa18819e16..9327f6cb856f 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <comphelper/string.hxx>
+#include <comphelper/lok.hxx>
#include <memory>
#include <vector>
@@ -566,13 +567,21 @@ 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) return;
+
+ if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < TWIPS_PER_PIXEL)) return;
+
if (bPixelToLogic)
nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
+
// Are there restrictions on the cell type we should filter out here ?
- long nSpaceToFill = ( nColWidth - aTextSize.Width() );
+ long nTextWidth = aTextSize.Width();
+ if ( bIsTiledRendering )
+ nTextWidth = pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width();
+ long nSpaceToFill = ( nColWidth - nTextWidth );
if ( nSpaceToFill <= nCharWidth )
return;