[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - writerfilter/source

Miklos Vajna vmiklos at suse.cz
Thu May 16 09:07:24 PDT 2013


 writerfilter/source/dmapper/SdtHelper.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 3ac737503d44d16a2519342893ef40cbc18acf23
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu May 16 17:27:49 2013 +0200

    bnc#779630 DOCX import: improve w:sdt size guessing
    
    The problem was that when border was enabled (and the importer leaves it
    unchanged, and it's on by default), there was not enough space for the
    text.
    
    Change-Id: I3ce770eb523389bcf7c5e83d4e76155e2c45de6d
    (cherry picked from commit d0edc4e4c3709a3d0300e0b2b035e10493f583f9)

diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index 41c6181..e773ff9 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -53,8 +53,13 @@ awt::Size lcl_getOptimalWidth(StyleSheetTablePtr pStyleSheet, rtl::OUString& rDe
     sal_Int32 nWidth = pOut->GetTextWidth(aLongest);
 
     pOut->Pop();
+
+    // Border: see PDFWriterImpl::drawFieldBorder(), border size is font height / 4,
+    // so additional width / height needed is height / 2.
+    sal_Int32 nBorder = nHeight / 2;
+
     // Width: space for the text + the square having the dropdown arrow.
-    return awt::Size(nWidth + nHeight, nHeight);
+    return awt::Size(nWidth + nBorder + nHeight, nHeight + nBorder);
 }
 
 SdtHelper::SdtHelper(DomainMapper_Impl& rDM_Impl):


More information about the Libreoffice-commits mailing list