[ooo-build-commit] .: 3 commits - sc/source

Fridrich Strba fridrich at kemper.freedesktop.org
Wed Sep 15 12:54:19 PDT 2010


 sc/source/core/tool/compiler.cxx    |    2 -
 sc/source/filter/excel/excform8.cxx |    2 -
 sc/source/filter/excel/read.cxx     |    7 ++++-
 sc/source/filter/excel/xechart.cxx  |   45 ++++++++++++++++++++++++++++++++----
 sc/source/filter/inc/xechart.hxx    |    4 ++-
 5 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 5906fdea4c8e93b62f3881995887f60cd63e2f48
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Sep 15 21:47:40 2010 +0200

    calc-xls-disable-adjust-row-height.diff: Don't adjust row height on xls load
    
    Don't adjust row height on xls load for better layout preservation and
    faster file load.

diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 4b28348..5b67513 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -1212,10 +1212,13 @@ FltError ImportExcel8::Read( void )
             GetPivotTableManager().ConvertPivotTables();
 
         pProgress.reset();
-
+#if 0
+        // Excel documents look much better without this call; better in the
+        // sense that the row heights are identical to the original heights in
+        // Excel.
         if (pD->IsAdjustHeightEnabled())
             AdjustRowHeight();
-
+#endif
         PostDocLoad();
 
         pD->CalcAfterLoad();
commit ec9ce165466cb367baa728719e2fd07f23165d03
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Sep 15 21:43:57 2010 +0200

    calc-external-defined-names-enable.diff: Enable external defined names
    
    Enable external defined name import on xls documents.

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index f2d5b99..4293ea7 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2987,7 +2987,7 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol )
      * spec first. Until then don't pretend to support external names that
      * wouldn't survive a save and reload cycle, return false instead. */
 
-#if 0
+#if 1
     if (!pConv)
         return false;
 
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index ab5dc89..e0af01f 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -636,7 +636,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                              * external name reference can be stored in ODF,
                              * which remains to be done for #i3740#. Until then
                              * create a #NAME? token. */
-#if 0
+#if 1
                             sal_uInt16 nFileId;
                             if (!GetExternalFileIdFromXti(nXtiIndex, nFileId) || !pExtName->HasFormulaTokens())
                             {
commit a4a2aaa4c31905cedf36b31087775a0d2aa8b92e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Sep 15 21:38:36 2010 +0200

    chart-subtitle-xls-export.diff: Export chart subtitle
    
    i#92357
    
    Squeeze chart's subtitle into the 2nd line of the main title when exporting
    to xls.

diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 4295aca..badd776 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
 #include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
 #include <com/sun/star/chart/ChartAxisPosition.hpp>
 #include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -1016,6 +1017,13 @@ void XclExpChSourceLink::ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPe
     }
 }
 
+void XclExpChSourceLink::AppendString( const String& rStr )
+{
+    if (!mxString.is())
+        return;
+    XclExpStringHelper::AppendString( *mxString, GetRoot(), rStr );
+}
+
 void XclExpChSourceLink::Save( XclExpStream& rStrm )
 {
     // CHFORMATRUNS record
@@ -1145,7 +1153,7 @@ void XclExpChText::SetRotation( sal_uInt16 nRotation )
     ::insert_value( maData.mnFlags, XclTools::GetXclOrientFromRot( nRotation ), 8, 3 );
 }
 
-void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget )
+void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget, const String* pSubTitle )
 {
     switch( nTarget )
     {
@@ -1167,6 +1175,14 @@ void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget
         // string sequence
         mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
         sal_uInt16 nFontIdx = mxSrcLink->ConvertStringSequence( xTitle->getText() );
+        if (pSubTitle)
+        {
+            // append subtitle as the 2nd line of the title.
+            String aSubTitle = String::CreateFromAscii("\n");
+            aSubTitle.Append(*pSubTitle);
+            mxSrcLink->AppendString(aSubTitle);
+        }
+
         ConvertFontBase( GetChRoot(), nFontIdx );
 
         // rotation
@@ -1375,14 +1391,15 @@ void XclExpChText::WriteBody( XclExpStream& rStrm )
 namespace {
 
 /** Creates and returns an Excel text object from the passed title. */
-XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget )
+XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget,
+                                const String* pSubTitle = NULL )
 {
     Reference< XTitle > xTitle;
     if( xTitled.is() )
         xTitle = xTitled->getTitleObject();
 
     XclExpChTextRef xText( new XclExpChText( rRoot ) );
-    xText->ConvertTitle( xTitle, nTarget );
+    xText->ConvertTitle( xTitle, nTarget, pSubTitle );
     /*  Do not delete the CHTEXT group for the main title. A missing CHTEXT
         will be interpreted as auto-generated title showing the series title in
         charts that contain exactly one data series. */
@@ -3124,6 +3141,23 @@ void XclExpChAxesSet::WriteBody( XclExpStream& rStrm )
 
 // The chart object ===========================================================
 
+static void lcl_getChartSubTitle(const Reference<XChartDocument>& xChartDoc,
+                                 String& rSubTitle)
+{
+    Reference< ::com::sun::star::chart::XChartDocument > xChartDoc1(xChartDoc, UNO_QUERY);
+    if (!xChartDoc1.is())
+        return;
+
+    Reference< XPropertySet > xProp(xChartDoc1->getSubTitle(), UNO_QUERY);
+    if (!xProp.is())
+        return;
+
+    OUString aTitle;
+    Any any = xProp->getPropertyValue( OUString::createFromAscii("String") );
+    if (any >>= aTitle)
+        rSubTitle = aTitle;
+}
+
 XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
         Reference< XChartDocument > xChartDoc, const Rectangle& rChartRect ) :
     XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 )
@@ -3161,7 +3195,10 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
 
         // chart title
         Reference< XTitled > xTitled( xChartDoc, UNO_QUERY );
-        mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE );
+        String aSubTitle;
+        lcl_getChartSubTitle(xChartDoc, aSubTitle);
+        mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE,
+                                  aSubTitle.Len() ? &aSubTitle : NULL );
 
         // diagrams (axes sets)
         sal_uInt16 nFreeGroupIdx = mxPrimAxesSet->Convert( xDiagram, 0 );
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index 2bcdb99..cc391d3 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -418,6 +418,8 @@ public:
     /** Converts the number format from the passed property set. */
     void                ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPercent );
 
+    void                AppendString( const String& rStr );
+
     /** Returns true, if this source link contains explicit string data. */
     inline bool         HasString() const { return mxString.is() && !mxString->IsEmpty(); }
 
@@ -529,7 +531,7 @@ public:
     virtual void        SetRotation( sal_uInt16 nRotation );
 
     /** Converts all text settings of the passed title text object. */
-    void                ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget );
+    void                ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget, const String* pSubTitle = NULL );
     /** Converts all text settings of the passed legend. */
     void                ConvertLegend( const ScfPropertySet& rPropSet );
     /** Converts all settings of the passed data point caption text object. */


More information about the ooo-build-commit mailing list