[Libreoffice-commits] core.git: chart2/source sw/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 14:35:40 UTC 2019


 chart2/source/view/axes/VCartesianAxis.cxx |   15 +++++++++++++++
 sw/qa/extras/layout/data/tdf108021.odt     |binary
 sw/qa/extras/layout/layout.cxx             |    2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 40ffaa4f23fe59f979222facf1688d25c60651b6
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Mon Jan 7 16:17:16 2019 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Tue Jan 22 15:35:15 2019 +0100

    Related: tdf#108021 Fix text break of X axis labels
    
    Recalculate the nLimitedSpaceForText in case of 90
    and 270 degree if the X axis label's text break is true.
    The first part of the fix: https://gerrit.libreoffice.org/65165
    
    Change-Id: I5d78be6ed83dd195bbc34185d5f6b7e44f555d9b
    Reviewed-on: https://gerrit.libreoffice.org/65937
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 42b767ae42a9..e058101524df 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -727,6 +727,21 @@ bool VCartesianAxis::createTextShapes(
                 nReduce = 1;
             nLimitedSpaceForText -= nReduce;
         }
+
+        // recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the text break is true
+        if ( rAxisLabelProperties.fRotationAngleDegree == 90.0 || rAxisLabelProperties.fRotationAngleDegree == 270.0 )
+        {
+            if ( rAxisLabelProperties.m_aFontReferenceSize.Height - rAxisLabelProperties.m_aMaximumSpaceForLabels.Height > 2 * rAxisLabelProperties.m_aMaximumSpaceForLabels.Y )
+            {
+                const sal_Int32 nFullHeight = rAxisLabelProperties.m_aFontReferenceSize.Height;
+                sal_Int32 nMaxLabelsHeight = nFullHeight - ( rAxisLabelProperties.m_aMaximumSpaceForLabels.Height + rAxisLabelProperties.m_aMaximumSpaceForLabels.Y );
+                nLimitedSpaceForText = nMaxLabelsHeight;
+            }
+            else
+            {
+                nLimitedSpaceForText = -1;
+            }
+        }
     }
 
      // Stores an array of text label strings in case of a normal
diff --git a/sw/qa/extras/layout/data/tdf108021.odt b/sw/qa/extras/layout/data/tdf108021.odt
index 39ef6df80d2f..a81fe9c9a40d 100644
Binary files a/sw/qa/extras/layout/data/tdf108021.odt and b/sw/qa/extras/layout/data/tdf108021.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 79b55c80f191..99ca36673c71 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2391,7 +2391,7 @@ void SwLayoutWriter::testTdf108021()
 
     assertXPath(
         pXmlDoc,
-        "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[@length='17']",
+        "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[@length='22']",
         8);
     // This failed, if the textarray length of the first axis label not 17.
 }


More information about the Libreoffice-commits mailing list