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

sushil_shinde sushil.shinde at synerzip.com
Tue Feb 11 18:37:06 PST 2014


 include/oox/drawingml/chart/chartspacefragment.hxx |    2 ++
 include/oox/drawingml/chart/chartspacemodel.hxx    |    3 ++-
 oox/source/drawingml/chart/chartspaceconverter.cxx |    7 +++++++
 oox/source/drawingml/chart/chartspacefragment.cxx  |    6 +++++-
 4 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 5505cf4f1c7b27662b0e8c0a6db01fd8c52243c3
Author: sushil_shinde <sushil.shinde at synerzip.com>
Date:   Fri Dec 27 14:36:10 2013 +0530

    fdo#72520 : Preserving external data path in chart import.
    
        - Preserved external data path for chart in newly added
          property for external data.
    
    Change-Id: I3c49093c9e71cd126c097500b3951a345e81039e
    Reviewed-on: https://gerrit.libreoffice.org/7214
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/oox/drawingml/chart/chartspacefragment.hxx b/include/oox/drawingml/chart/chartspacefragment.hxx
index 653bbf7..6e927ba 100644
--- a/include/oox/drawingml/chart/chartspacefragment.hxx
+++ b/include/oox/drawingml/chart/chartspacefragment.hxx
@@ -42,6 +42,8 @@ public:
     virtual             ~ChartSpaceFragment();
 
     virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+    ::oox::core::XmlFilterBase& mpFilterBase;
 };
 
 // ============================================================================
diff --git a/include/oox/drawingml/chart/chartspacemodel.hxx b/include/oox/drawingml/chart/chartspacemodel.hxx
index f1a27d8..07f119e 100644
--- a/include/oox/drawingml/chart/chartspacemodel.hxx
+++ b/include/oox/drawingml/chart/chartspacemodel.hxx
@@ -49,7 +49,8 @@ struct ChartSpaceModel
     View3DRef           mxView3D;           /// 3D settings.
     TitleRef            mxTitle;            /// Chart main title.
     LegendRef           mxLegend;           /// Chart legend.
-    OUString     maDrawingPath;      /// Path to drawing fragment with embedded shapes.
+    OUString            maDrawingPath;      /// Path to drawing fragment with embedded shapes.
+    OUString            maSheetPath;        /// Path to embedded charts.
     sal_Int32           mnDispBlanksAs;     /// Mode how to display blank values.
     sal_Int32           mnStyle;            /// Index to default formatting.
     bool                mbAutoTitleDel;     /// True = automatic title deleted manually.
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index db04215..d6b09a4 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -212,6 +212,13 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
         aProps.setProperty( PROP_DisableDataTableDialog , true );
         aProps.setProperty( PROP_DisableComplexChartTypes , true );
     }
+
+    if(!mrModel.maSheetPath.isEmpty() )
+    {
+        Reference< ::com::sun::star::chart::XChartDocument > xChartDoc( getChartDocument(), UNO_QUERY );
+        PropertySet aProps( xChartDoc->getDiagram() );
+        aProps.setProperty( PROP_ExternalData , uno::makeAny(mrModel.maSheetPath) );
+    }
 }
 
 // ============================================================================
diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx
index 2e717a8..03389f0 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -36,7 +36,8 @@ using namespace ::oox::core;
 // ============================================================================
 
 ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
-    FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
+    FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel ),
+    mpFilterBase(rFilter)
 {
 }
 
@@ -74,6 +75,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
                 case C_TOKEN( pivotSource ):
                     mrModel.mbPivotChart = true;
                     return 0;
+                case C_TOKEN (externalData):
+                    mrModel.maSheetPath = getFragmentPathFromRelId(rAttribs.getString(R_TOKEN(id),OUString()));
+                    return 0;
             }
         break;
 


More information about the Libreoffice-commits mailing list