sc/source/filter/excel/xlroot.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 20b54a228b2844ad66d80d930d4a9eb39ce8c336
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Dec 7 15:22:24 2016 +0100

    stab at the sick "units in character width of the standard font", tdf#101363
    
    Which gave problems in the unit test on tinderbox build machines, apparently
    because they don't have not even the resulting fallback font installed.
    
    Specifically here digit '1' was slightly wider (123) than digit '0' (122),
    which the import accounts for but the export didn't, so widths were divided 
by
    122 instead of 123 hence resulted in 24.23 instead of 24, for example.
    
    Change-Id: If8a04383632de674ae2a15a79608661e434aeb54

diff --git a/sc/source/filter/excel/xlroot.cxx 
b/sc/source/filter/excel/xlroot.cxx
index 97ece71..cef5e38 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -205,7 +205,11 @@ void XclRoot::SetCharWidth( const XclFontData& rFontData )
         aFont.SetCharSet( rFontData.GetFontEncoding() );
         aFont.SetWeight( rFontData.GetScWeight() );
         pPrinter->SetFont( aFont );
-        mrData.mnCharWidth = pPrinter->GetTextWidth( OUString('0') );
+        // Usually digits have the same width, but in some fonts they don't ...
+        // Match the import in sc/source/filter/oox/unitconverter.cxx
+        // UnitConverter::finalizeImport()
+        for (sal_Unicode cChar = '0'; cChar <= '9'; ++cChar)
+            mrData.mnCharWidth = std::max( pPrinter->GetTextWidth( 
OUString(cChar)), mrData.mnCharWidth);
     }
     if( mrData.mnCharWidth <= 0 )
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to