[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - oox/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Jul 21 21:29:38 UTC 2018


 oox/source/drawingml/chart/titleconverter.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit bfbf276c9e1b7da55b613fade763fad56a1cd6fe
Author:     Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Fri Jul 20 20:59:01 2018 +0200
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Sat Jul 21 23:29:25 2018 +0200

    tdf#118150 Fix displaying of chart where Legend is set manually
    
    By default Legend's position is automatic and it is located
    at the right side of the chart.
    Unfortunately even if layout with manualLayout is set:
    http://www.datypic.com/sc/ooxml/e-draw-chart_manualLayout-1.html
    the empty space for the automatic legend on the right side of the chart,
    was left.
    This is issue with opening of the OOXML charts by LibreOffice,
    as MS Word is opening the same document properly.
    
    This patch fixes issue with wrong chart displaying, when manual position
    of the legend is set.
    
    Change-Id: Id5363d48b049c469b6761b43cecfbb56514bf7d8
    Reviewed-on: https://gerrit.libreoffice.org/57788
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins

diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index 690858e290de..daa1f2d8cb57 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -213,14 +213,13 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
             case XML_r:
                 eLegendPos = cssc2::LegendPosition_LINE_END;
                 eLegendExpand = cssc::ChartLegendExpansion_HIGH;
-                break;
+            break;
             case XML_tr:    // top-right not supported
                 eLegendPos = LegendPosition_CUSTOM;
                 eRelPos.Primary = 1;
                 eRelPos.Secondary =0;
                 eRelPos.Anchor = Alignment_TOP_RIGHT;
                 bTopRight=true;
-
             break;
             case XML_t:
                 eLegendPos = cssc2::LegendPosition_PAGE_START;
@@ -236,9 +235,12 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
         if( mrModel.mxLayout.get() )
         {
             LayoutConverter aLayoutConv( *this, *mrModel.mxLayout );
-            // manual size needs ChartLegendExpansion_CUSTOM
+            // manual size needs ChartLegendExpansion_CUSTOM and LegendPosition_CUSTOM (tdf#118150)
             if( aLayoutConv.convertFromModel( aPropSet ) )
+            {
+                eLegendPos = cssc2::LegendPosition_CUSTOM;
                 eLegendExpand = cssc::ChartLegendExpansion_CUSTOM;
+            }
             bManualLayout = !aLayoutConv.getAutoLayout();
         }
 


More information about the Libreoffice-commits mailing list