incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liji...@apache.org
Subject svn commit: r1389716 - in /incubator/ooo/trunk/main/sc/source/filter: excel/xipivot.cxx excel/xlpivot.cxx inc/xipivot.hxx inc/xlpivot.hxx
Date Tue, 25 Sep 2012 05:51:12 GMT
Author: lijiany
Date: Tue Sep 25 05:51:12 2012
New Revision: 1389716

URL: http://svn.apache.org/viewvc?rev=1389716&view=rev
Log:
#121071#: [Regression]Item lists are incorrectly imported into AOO in DataPilot table
Reported by: Terry Yang
Reviewed by: sunying
patched by: Jianyuan Li

Modified:
    incubator/ooo/trunk/main/sc/source/filter/excel/xipivot.cxx
    incubator/ooo/trunk/main/sc/source/filter/excel/xlpivot.cxx
    incubator/ooo/trunk/main/sc/source/filter/inc/xipivot.hxx
    incubator/ooo/trunk/main/sc/source/filter/inc/xlpivot.hxx

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xipivot.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xipivot.cxx?rev=1389716&r1=1389715&r2=1389716&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xipivot.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xipivot.cxx Tue Sep 25 05:51:12 2012
@@ -853,17 +853,20 @@ bool XclImpPivotCache::IsRefreshOnLoad()
 // Pivot table
 // ============================================================================
 
-XclImpPTItem::XclImpPTItem( const XclImpPCField* pCacheField ) :
-    mpCacheField( pCacheField )
+XclImpPTItem::XclImpPTItem( const XclImpPTField& rPTField ) :
+    mrPTField( rPTField )
 {
 }
 
 const String* XclImpPTItem::GetItemName() const
 {
-    if( mpCacheField )
+    if( const XclImpPCField * mpCacheField = mrPTField.GetCacheField() )
+    {
         if( const XclImpPCItem* pCacheItem = mpCacheField->GetItem( maItemInfo.mnCacheIdx
) )
-            //! TODO: use XclImpPCItem::ConvertToText(), if all conversions are available
-            return pCacheItem->IsEmpty() ? &String::EmptyString() : pCacheItem->GetText();
+        {
+            return pCacheItem->GetItemName();
+        }
+    }
     return 0;
 }
 
@@ -948,7 +951,7 @@ void XclImpPTField::ReadSxvdex( XclImpSt
 
 void XclImpPTField::ReadSxvi( XclImpStream& rStrm )
 {
-    XclImpPTItemRef xItem( new XclImpPTItem( GetCacheField() ) );
+    XclImpPTItemRef xItem( new XclImpPTItem( *this ) );
     maItems.push_back( xItem );
     xItem->ReadSxvi( rStrm );
 }

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xlpivot.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xlpivot.cxx?rev=1389716&r1=1389715&r2=1389716&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xlpivot.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xlpivot.cxx Tue Sep 25 05:51:12 2012
@@ -158,6 +158,37 @@ const bool* XclPCItem::GetBool() const
     return (meType == EXC_PCITEM_BOOL) ? &mbValue : 0;
 }
 
+const String* XclPCItem::GetItemName() const
+{
+    //! TODO: use XclImpPCItem::ConvertToText(), if all conversions are available
+    if( EXC_PCITEM_BOOL == this->GetType() )
+    {
+        static String szBool[] = { String::CreateFromAscii("FALSE"), String::CreateFromAscii("TRUE")
};
+
+        if( const bool* pBool = this->GetBool() )
+        {
+            return &(!!*pBool)[szBool];
+        }
+        else
+        {
+            return &0[szBool];
+        }
+    }
+    else
+    {
+        if( this->IsEmpty())
+        {
+            static String aEmptyString( String::EmptyString() );
+            return &aEmptyString;
+        }
+        else
+            return this->GetText();
+    }
+
+    return NULL;
+}
+
+
 // Field settings =============================================================
 
 XclPCFieldInfo::XclPCFieldInfo() :

Modified: incubator/ooo/trunk/main/sc/source/filter/inc/xipivot.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/inc/xipivot.hxx?rev=1389716&r1=1389715&r2=1389716&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/inc/xipivot.hxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/inc/xipivot.hxx Tue Sep 25 05:51:12 2012
@@ -199,13 +199,14 @@ typedef ScfRef< XclImpPivotCache > XclIm
 // ============================================================================
 
 class XclImpPivotTable;
+class XclImpPTField;
 
 // ============================================================================
 
 class XclImpPTItem
 {
 public:
-    explicit            XclImpPTItem( const XclImpPCField* pCacheField );
+    explicit            XclImpPTItem( const XclImpPTField & );
 
     /** Returns the internal name of the item or 0, if no name could be found. */
     const String*       GetItemName() const;
@@ -220,7 +221,8 @@ public:
 
 private:
     XclPTItemInfo       maItemInfo;         /// General data for this item.
-    const XclImpPCField* mpCacheField;      /// Corresponding pivot cache field.
+    //const XclImpPCField* mpCacheField;      /// Corresponding pivot cache field.
+    const XclImpPTField & mrPTField;
 };
 
 typedef ScfRef< XclImpPTItem > XclImpPTItemRef;

Modified: incubator/ooo/trunk/main/sc/source/filter/inc/xlpivot.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/inc/xlpivot.hxx?rev=1389716&r1=1389715&r2=1389716&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/inc/xlpivot.hxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/inc/xlpivot.hxx Tue Sep 25 05:51:12 2012
@@ -447,6 +447,7 @@ public:
     const sal_uInt16*   GetError() const;
     /** Returns pointer to Boolean value, if the item type is 'boolean', otherwise 0. */
     const bool*         GetBool() const;
+    const String *      GetItemName() const;
 
 private:
     XclPCItemType       meType;         /// Type of the item.



Mime
View raw message