[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 2 commits - oox/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Mon Feb 24 06:48:50 PST 2014


 oox/source/drawingml/chart/datasourceconverter.cxx |   28 +++++++++++++++++++++
 oox/source/drawingml/chart/objectformatter.cxx     |    5 +++
 2 files changed, 33 insertions(+)

New commits:
commit 404689ba178d4282b5b685dced393fdd3f0e3ff8
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 22 05:49:39 2014 +0100

    we only support simple labels in the InternalDataProvider, bnc#864396
    
    Change-Id: Ie31c5c73bb5185125fd4493c4e476997e2e9bc63

diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx
index 6be4710..ea22348 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -50,6 +50,34 @@ Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUSt
     Reference< XDataSequence > xDataSeq;
     if( getChartConverter() )
     {
+        // the internal data table does not support complex labels
+        // this is only supported in Calc!!!
+        // merge the labels into a single one
+        if(rRole == "label")
+        {
+            mrModel.mnPointCount = std::min<sal_Int32>(mrModel.mnPointCount, 1);
+            OUStringBuffer aTitle;
+            bool bFirst = true;
+            for(DataSequenceModel::AnyMap::const_iterator itr = mrModel.maData.begin(),
+                    itrEnd = mrModel.maData.end(); itr != itrEnd; ++itr)
+            {
+                Any aAny = itr->second;
+                if(aAny.has<OUString>())
+                {
+                    if(!bFirst)
+                        aTitle.append(" ");
+
+                    aTitle.append(aAny.get<OUString>());
+                    bFirst = false;
+                }
+            }
+
+            if(!bFirst)
+            {
+                mrModel.maData.clear();
+                mrModel.maData.insert(std::make_pair<sal_Int32, Any>(1, Any(aTitle.makeStringAndClear())));
+            }
+        }
         xDataSeq = getChartConverter()->createDataSequence( getChartDocument()->getDataProvider(), mrModel );
 
         // set sequen   ce role
commit 45cc86bf89cee298037bef9693a2ea22c3238673
Author: Andras Timar <andras.timar at collabora.com>
Date:   Mon Feb 24 14:55:05 2014 +0100

    OOXML chart import: ignore rot values outside the valid range
    
    Change-Id: I506a78a024d761d1d263a7bb1dcbf09a4bbcf4ef

diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 8c36959..dada09a 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1105,6 +1105,11 @@ void ObjectFormatter::convertTextRotation( PropertySet& rPropSet, const ModelRef
         /*  Chart2 expects rotation angle as double value in range of [0,360).
             OOXML counts clockwise, Chart2 counts counterclockwise. */
         double fAngle = static_cast< double >( bStacked ? 0 : rxTextProp->getTextProperties().moRotation.get( 0 ) );
+        // MS Office UI allows values only in range of [-90,90].
+        if ( fAngle <= -5400000.0 || fAngle >= 5400000.0 )
+        {
+            fAngle = 0.0;
+        }
         fAngle = getDoubleIntervalValue< double >( -fAngle / 60000.0, 0.0, 360.0 );
         rPropSet.setProperty( PROP_TextRotation, fAngle );
     }


More information about the Libreoffice-commits mailing list