ooo-build r15591 - in trunk: . patches/dev300



Author: jannieuw
Date: Fri Mar 20 12:48:20 2009
New Revision: 15591
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15591&view=rev

Log:
2009-03-20  Jan Nieuwenhuizen  <janneke gnu org>

	* patches/dev300/oox-import-chart-externalref.diff: New file.  Use
	printFormulaTokens instead of extractCellRangeList to get a range
	representation.  Fixes calc ooxml chart import with external
	references, n#480868.  Thanks, Kohei.


Added:
   trunk/patches/dev300/oox-import-chart-externalref.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri Mar 20 12:48:20 2009
@@ -2017,6 +2017,7 @@
 
 oox-fix-placeholder-layout.diff, n#485316, n#480223, rodo
 oox-fix-list-style-apply.diff, n#485417, rodo
+oox-import-chart-externalref.diff, n#480868, jannieuw
 
 [ CalcFixes  <= dev300-m42 <= ooo310-m1]
 # Support PHONETIC function to display asian phonetic guide.

Added: trunk/patches/dev300/oox-import-chart-externalref.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/oox-import-chart-externalref.diff	Fri Mar 20 12:48:20 2009
@@ -0,0 +1,95 @@
+diff --git oox/inc/oox/xls/formulaparser.hxx oox/inc/oox/xls/formulaparser.hxx
+index fa3b86e..6bf27a2 100644
+--- oox/inc/oox/xls/formulaparser.hxx
++++ oox/inc/oox/xls/formulaparser.hxx
+@@ -86,6 +86,8 @@ public:
+                             const ::rtl::OUString& rUrl,
+                             double fValue ) const;
+ 
++    ::rtl::OUString     printFormulaTokens( ApiTokenSequence const& rTokens );
++
+ private:
+     ::std::auto_ptr< FormulaParserImpl > mxImpl;
+ };
+diff --git oox/source/xls/excelchartconverter.cxx oox/source/xls/excelchartconverter.cxx
+index cf9f986..a1ce829 100644
+--- oox/source/xls/excelchartconverter.cxx
++++ oox/source/xls/excelchartconverter.cxx
+@@ -93,10 +93,8 @@ Reference< XDataSequence > ExcelChartConverter::createDataSequence(
+             aContext.setBaseAddress( CellAddress( getCurrentSheetIndex(), 0, 0 ) );
+             rParser.importFormula( aContext, rDataSeq.maFormula );
+ 
+-            // create a range list from the token sequence
+-            ApiCellRangeList aRanges;
+-            rParser.extractCellRangeList( aRanges, aContext.getTokens() );
+-            aRangeRep = rParser.generateApiRangeListString( aRanges );
++            // create a range representation string from the token sequence.
++            aRangeRep = rParser.printFormulaTokens( aContext.getTokens() );
+         }
+         else if( !rDataSeq.maData.empty() )
+         {
+diff --git oox/source/xls/formulaparser.cxx oox/source/xls/formulaparser.cxx
+index 161802b..12d610b 100644
+--- oox/source/xls/formulaparser.cxx
++++ oox/source/xls/formulaparser.cxx
+@@ -73,6 +73,8 @@ class FormulaParserImpl : public OpCodeProvider
+ public:
+     explicit            FormulaParserImpl( const OpCodeProvider& rOpCodeProv );
+ 
++    virtual ::rtl::OUString printFormulaTokens( ApiTokenSequence const& rTokens );
++
+     /** Converts an XML formula string. */
+     virtual void        importOoxFormula(
+                             FormulaContext& rContext,
+@@ -248,6 +250,12 @@ FormulaParserImpl::FormulaParserImpl( const OpCodeProvider& rOpCodeProv ) :
+     maClosingSpaces.reserve( 256 );
+ }
+ 
++OUString FormulaParserImpl::printFormulaTokens( ApiTokenSequence const& )
++{
++    // not implemented...
++    return OUString();
++}
++
+ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& )
+ {
+     OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" );
+@@ -1214,6 +1222,8 @@ public:
+                             FormulaContext& rContext,
+                             RecordInputStream& rStrm );
+ 
++    virtual OUString    printFormulaTokens( ApiTokenSequence const& rTokens );
++
+ private:
+     // import token contents and create API formula token ---------------------
+ 
+@@ -1393,6 +1403,17 @@ void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInp
+         rStrm.seek( nAddDataEndPos );
+ }
+ 
++OUString OoxFormulaParserImpl::printFormulaTokens( ApiTokenSequence const& rTokens )
++{
++    sal_Int16 saveFC;
++    OUString const FormulaConvention = CREATE_OUSTRING( "FormulaConvention" );
++    maParserProps.getProperty( saveFC, FormulaConvention );
++    maParserProps.setProperty( FormulaConvention, ::com::sun::star::sheet::AddressConvention::OOO );
++    OUString oooTokens = mxParser->printFormula( rTokens );
++    maParserProps.setProperty( FormulaConvention, saveFC );
++    return oooTokens;
++}
++
+ // import token contents and create API formula token -------------------------
+ 
+ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
+@@ -2785,6 +2806,11 @@ void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OU
+     }
+ }
+ 
++OUString FormulaParser::printFormulaTokens( ApiTokenSequence const& rTokens )
++{
++    return mxImpl->printFormulaTokens( rTokens );
++}
++
+ // ============================================================================
+ 
+ } // namespace xls



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]