[Libreoffice-commits] core.git: 4 commits - oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Apr 30 12:23:23 PDT 2013


 oox/source/export/chartexport.cxx |   56 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 2 deletions(-)

New commits:
commit d54aa149bd6e07c646383b761901aa047a3d3ea2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 30 21:12:51 2013 +0200

    better to use no overlay for now
    
    We have no way to determine whether the lengend touches the chart area
    so let us use no overlay for now. That should be much more in line of
    the most use cases.
    
    Change-Id: Idecb0113e47a3f7c925ff8c45238152406ce8954

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 3a806b8..660455d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -890,6 +890,9 @@ void ChartExport::exportLegend( Reference< ::com::sun::star::chart::XChartDocume
             pFS->singleElement( FSNS( XML_c, XML_legendPos ),
                 XML_val, strPos,
                 FSEND );
+            pFS->singleElement( FSNS( XML_c, XML_overlay ),
+                    XML_val, "0",
+                    FSEND );
         }
 
         // shape properties
commit 0c58dc8655017523be8c610ebea2200e472fdd8f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 30 20:16:06 2013 +0200

    only export c:SymbolSize if attribute is there
    
    Change-Id: I4f167d1ec6998b27025450e9339d14d94c06e3c1

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index cab8536..3a806b8 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2464,7 +2464,6 @@ void ChartExport::exportMarker()
     pFS->startElement( FSNS( XML_c, XML_marker ),
             FSEND );
     Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
-    awt::Size aSymbolSize;
     sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
     if( GetProperty( xPropSet, "SymbolType" ) )
         mAny >>= nSymbolType;
@@ -2511,15 +2510,18 @@ void ChartExport::exportMarker()
     }
     if( nSymbolType != cssc::ChartSymbolType::NONE )
     {
+        awt::Size aSymbolSize;
         if( GetProperty( xPropSet, "SymbolSize" ) )
+        {
             mAny >>= aSymbolSize;;
-        sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
+            sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
 
-        nSize = nSize/250.0*7.0; // just guessed based on some test cases
-        nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
-        pFS->singleElement( FSNS( XML_c, XML_size),
-                XML_val, I32S(nSize),
-                FSEND );
+            nSize = nSize/250.0*7.0; // just guessed based on some test cases
+            nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
+            pFS->singleElement( FSNS( XML_c, XML_size),
+                    XML_val, I32S(nSize),
+                    FSEND );
+        }
     }
     pFS->endElement( FSNS( XML_c, XML_marker ) );
 }
commit bb7dec2fa080b9d0ee89ff780db65bc1f97e0d61
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 30 20:14:13 2013 +0200

    also export point size
    
    The current formula size/250*7 is just a guess based on some test docs.
    If someone has an idea how to translate them please tell me.
    
    Change-Id: Ibdd27d52d545ac96882c128485c48a3116eb4467

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 68880cd..cab8536 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2464,9 +2464,11 @@ void ChartExport::exportMarker()
     pFS->startElement( FSNS( XML_c, XML_marker ),
             FSEND );
     Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
+    awt::Size aSymbolSize;
     sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
     if( GetProperty( xPropSet, "SymbolType" ) )
         mAny >>= nSymbolType;
+
     // TODO: more properties support for marker
     const char* pSymbolType = NULL;
     switch( nSymbolType )
@@ -2500,12 +2502,25 @@ void ChartExport::exportMarker()
         default:
             SAL_WARN("oox", "unknown data series symbol");
     }
+
     if( pSymbolType )
     {
         pFS->singleElement( FSNS( XML_c, XML_symbol ),
             XML_val, pSymbolType,
             FSEND );
     }
+    if( nSymbolType != cssc::ChartSymbolType::NONE )
+    {
+        if( GetProperty( xPropSet, "SymbolSize" ) )
+            mAny >>= aSymbolSize;;
+        sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
+
+        nSize = nSize/250.0*7.0; // just guessed based on some test cases
+        nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
+        pFS->singleElement( FSNS( XML_c, XML_size),
+                XML_val, I32S(nSize),
+                FSEND );
+    }
     pFS->endElement( FSNS( XML_c, XML_marker ) );
 }
 
commit 2af36506592908e19b02bdfe00359dfe71eb3322
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 30 18:04:52 2013 +0200

    export markers to OOXML
    
    Change-Id: I0c2cabc8636b0988bdd779f002c1e7dc1e34b65b

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 48e2e60..68880cd 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2468,10 +2468,42 @@ void ChartExport::exportMarker()
     if( GetProperty( xPropSet, "SymbolType" ) )
         mAny >>= nSymbolType;
     // TODO: more properties support for marker
-    if( nSymbolType == ::com::sun::star::chart::ChartSymbolType::NONE )
+    const char* pSymbolType = NULL;
+    switch( nSymbolType )
+    {
+        case cssc::ChartSymbolType::NONE:
+            pSymbolType = "none";
+            break;
+        case cssc::ChartSymbolType::SYMBOL0:
+            pSymbolType = "square";
+            break;
+        case cssc::ChartSymbolType::SYMBOL1:
+            pSymbolType = "diamond";
+            break;
+        // map all triangle variants to the OOXML version
+        case cssc::ChartSymbolType::SYMBOL2:
+        case cssc::ChartSymbolType::SYMBOL3:
+        case cssc::ChartSymbolType::SYMBOL4:
+        case cssc::ChartSymbolType::SYMBOL5:
+            pSymbolType = "triangle";
+            break;
+        case cssc::ChartSymbolType::SYMBOL6:
+            pSymbolType = "plus";
+            break;
+        case cssc::ChartSymbolType::SYMBOL7:
+            pSymbolType = "plus";
+            break;
+        case cssc::ChartSymbolType::AUTO:
+            break;
+        case cssc::ChartSymbolType::BITMAPURL:
+            break;
+        default:
+            SAL_WARN("oox", "unknown data series symbol");
+    }
+    if( pSymbolType )
     {
         pFS->singleElement( FSNS( XML_c, XML_symbol ),
-            XML_val, "none",
+            XML_val, pSymbolType,
             FSEND );
     }
     pFS->endElement( FSNS( XML_c, XML_marker ) );


More information about the Libreoffice-commits mailing list