[Libreoffice-commits] core.git: Branch 'feature/inherited-number-format-removal' - 9 commits - sc/inc sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri May 24 13:49:39 PDT 2013


 sc/inc/column.hxx                   |    3 +
 sc/inc/formulacell.hxx              |    4 +-
 sc/source/core/data/column.cxx      |   20 +++++++---
 sc/source/core/data/column2.cxx     |    9 ++++
 sc/source/core/data/column3.cxx     |   13 +++++-
 sc/source/core/data/formulacell.cxx |   24 ++++++++----
 sc/source/filter/excel/xestream.cxx |   22 +++++------
 sc/source/filter/excel/xetable.cxx  |   70 ++++++++----------------------------
 sc/source/filter/inc/xetable.hxx    |    3 -
 sc/source/filter/xml/xmlcelli.cxx   |    2 +
 sc/source/ui/view/output2.cxx       |    8 ++--
 11 files changed, 88 insertions(+), 90 deletions(-)

New commits:
commit 7c0489cacd5bb86c6b268cf8dbea1cf6f84a7a38
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri May 24 22:41:44 2013 +0200

    remove inherited number formats, related fdo#60215
    
    Change-Id: I23d5e1b3baeb1499ada1fba1665027bdbe3fbb87

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index e73a79c..49941f9 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -83,6 +83,7 @@ private:
     bool            bInChangeTrack : 1; // Cell is in ChangeTrack
     bool            bTableOpDirty  : 1; // Dirty flag for TableOp
     bool            bNeedListening : 1; // Listeners need to be re-established after UpdateReference
+    bool            mbNeedsNumberFormat : 1; // set the calculated number format as hard number format
 
                     enum ScInterpretTailParameter
                     {
@@ -145,6 +146,7 @@ public:
     void            ResetDirty() { bDirty = false; }
     bool            NeedsListening() const { return bNeedListening; }
     void            SetNeedsListening( bool bVar ) { bNeedListening = bVar; }
+    void            SetNeedNumberFormat( bool bVal ) { mbNeedsNumberFormat = bVal; }
     void            Compile(const OUString& rFormula,
                             bool bNoListening = false,
                             const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 92b03ca..76f8fc6 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2319,7 +2319,14 @@ void ScColumn::CompileXML( ScProgress& rProgress )
             if ( pCell->GetCellType() == CELLTYPE_FORMULA )
             {
                 SCROW nRow = maItems[i].nRow;
-                static_cast<ScFormulaCell*>(pCell)->CompileXML( rProgress );
+                ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+                sal_uInt32 nCellFormat = GetNumberFormat( nRow );
+                if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+                    pFCell->SetNeedNumberFormat(false);
+                else
+                    pFCell->SetDirty(true);
+
+                pFCell->CompileXML( rProgress );
                 if ( nRow != maItems[i].nRow )
                     Search( nRow, i );      // Listener deleted/inserted?
             }
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index c93e043..9e489ac 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1507,6 +1507,15 @@ void ScColumn::CopyScriptTypesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDe
 
 void ScColumn::SetCell(SCROW nRow, ScBaseCell* pNewCell)
 {
+    if(pNewCell->GetCellType() == CELLTYPE_FORMULA)
+    {
+        ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pNewCell);
+        sal_uInt32 nCellFormat = GetNumberFormat( nRow );
+        if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+            pFCell->SetNeedNumberFormat(true);
+
+    }
+
     bool bIsAppended = false;
     if ( !maItems.empty() )
     {
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 63b3a5f..0b3c64f 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1457,13 +1457,22 @@ void ScColumn::SetEditText( SCROW nRow, const EditTextObject& rEditText, const S
 void ScColumn::SetFormula( SCROW nRow, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGram )
 {
     ScAddress aPos(nCol, nRow, nTab);
-    Insert(nRow, new ScFormulaCell(pDocument, aPos, &rArray, eGram));
+    ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, &rArray, eGram);
+    sal_uInt32 nCellFormat = GetNumberFormat( nRow );
+    if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+        pCell->SetNeedNumberFormat(true);
+    Insert(nRow, pCell);
 }
 
 void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::FormulaGrammar::Grammar eGram )
 {
     ScAddress aPos(nCol, nRow, nTab);
-    Insert(nRow, new ScFormulaCell(pDocument, aPos, rFormula, eGram));
+    ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, rFormula, eGram);
+
+    sal_uInt32 nCellFormat = GetNumberFormat( nRow );
+    if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+        pCell->SetNeedNumberFormat(true);
+    Insert(nRow, pCell);
 }
 
 void ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell )
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 80305c2..446c89d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -413,6 +413,7 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
     bInChangeTrack( false ),
     bTableOpDirty( false ),
     bNeedListening( false ),
+    mbNeedsNumberFormat( false ),
     aPos( rPos )
 {
     Compile( rFormula, true, eGrammar );    // bNoListening, Insert does that
@@ -447,6 +448,7 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
     bInChangeTrack( false ),
     bTableOpDirty( false ),
     bNeedListening( false ),
+    mbNeedsNumberFormat( false ),
     aPos( rPos )
 {
     // UPN-Array generation
@@ -491,6 +493,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
     bInChangeTrack( false ),
     bTableOpDirty( false ),
     bNeedListening( false ),
+    mbNeedsNumberFormat( false ),
     aPos( rPos )
 {
     pCode = rCell.pCode->Clone();
@@ -1289,16 +1292,21 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
             if ( aResult.GetCellResultType() != svUnknown )
                 bContentChanged = true;
         }
-        // Different number format?
-        if( nFormatType != p->GetRetFormatType() )
-        {
-            nFormatType = p->GetRetFormatType();
-            bChanged = true;
-        }
-        if( nFormatIndex != p->GetRetFormatIndex() )
+
+        if( mbNeedsNumberFormat )
         {
-            nFormatIndex = p->GetRetFormatIndex();
+            sal_uInt16 nFormatType = p->GetRetFormatType();
+            sal_Int32 nFormatIndex = p->GetRetFormatIndex();
+
+            if((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+                nFormatIndex = ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
+                        nFormatIndex, nFormatType);
+
+            // set number format explicitly
+            pDocument->SetNumberFormat( aPos, nFormatIndex );
+
             bChanged = true;
+            mbNeedsNumberFormat = false;
         }
 
         // In case of changes just obtain the result, no temporary and
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 556f27b..56d6121 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1116,6 +1116,7 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos )
         {
             ScFormulaCell* pFCell = rXMLImport.GetDocument()->GetFormulaCell(rCurrentPos);
             SetFormulaCell(pFCell);
+            pFCell->SetNeedNumberFormat( true );
         }
     }
     else  //regular value cell
@@ -1348,6 +1349,7 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos )
             ScFormulaCell* pNewCell = new ScFormulaCell(pDoc, rCellPos, pCode.get(), eGrammar, MM_NONE);
             SetFormulaCell(pNewCell);
             pDoc->SetFormulaCell(rCellPos, pNewCell);
+            pNewCell->SetNeedNumberFormat( true );
         }
         else if ( aText[0] == '\'' && aText.getLength() > 1 )
         {
commit 967f147cc577aee8c6f0039a18c4791151310b7a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri May 24 02:07:16 2013 +0200

    make ScColumn::Append private
    
    This method should never be called outside of ScColumn anyway.
    
    Change-Id: I11443ae2001e440c92b6ee45c6400e9e2af2fa02

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index e0773aa..122988f 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -176,7 +176,6 @@ public:
     ScRefCellValue GetCellValue( SCROW nRow ) const;
     void        Insert( SCROW nRow, ScBaseCell* pCell );
     void        Insert( SCROW nRow, sal_uInt32 nFormatIndex, ScBaseCell* pCell );
-    void        Append( SCROW nRow, ScBaseCell* pCell );
     void        Delete( SCROW nRow );
     void        DeleteAtIndex( SCSIZE nIndex );
     void        FreeAll();
@@ -487,6 +486,8 @@ private:
     void CopyScriptTypesToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol) const;
 
     void SetCell(SCROW nRow, ScBaseCell* pNewCell);
+
+    void        Append( SCROW nRow, ScBaseCell* pCell );
 };
 
 
commit 5b2e4f7ec59d8d0d6842cbf5e93110420db7b8dd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 23 23:17:49 2013 +0200

    use static_cast instead of c style cast
    
    Change-Id: I9194d5fb9fc42247cf43bfcd0327472eeca7c297

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 2933e9f..92b03ca 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2267,13 +2267,13 @@ void ScColumn::CalcAll()
             ScBaseCell* pCell = maItems[i].pCell;
             if (pCell->GetCellType() == CELLTYPE_FORMULA)
             {
+                ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
 #if OSL_DEBUG_LEVEL > 1
                 // after F9 ctrl-F9: check the calculation for each FormulaTree
-                ScFormulaCell* pFCell = (ScFormulaCell*)pCell;
                 double nOldVal, nNewVal;
                 nOldVal = pFCell->GetValue();
 #endif
-                ((ScFormulaCell*)pCell)->Interpret();
+                pFCell->Interpret();
 #if OSL_DEBUG_LEVEL > 1
                 if ( pFCell->GetCode()->IsRecalcModeNormal() )
                     nNewVal = pFCell->GetValue();
@@ -2298,9 +2298,10 @@ void ScColumn::CompileAll()
                 SCROW nRow = maItems[i].nRow;
                 // for unconditional compilation
                 // bCompile=true and pCode->nError=0
-                ((ScFormulaCell*)pCell)->GetCode()->SetCodeError( 0 );
-                ((ScFormulaCell*)pCell)->SetCompile( true );
-                ((ScFormulaCell*)pCell)->CompileTokenArray();
+                ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+                pFCell->GetCode()->SetCodeError( 0 );
+                pFCell->SetCompile( true );
+                pFCell->CompileTokenArray();
                 if ( nRow != maItems[i].nRow )
                     Search( nRow, i );      // Listener deleted/inserted?
             }
@@ -2318,7 +2319,7 @@ void ScColumn::CompileXML( ScProgress& rProgress )
             if ( pCell->GetCellType() == CELLTYPE_FORMULA )
             {
                 SCROW nRow = maItems[i].nRow;
-                ((ScFormulaCell*)pCell)->CompileXML( rProgress );
+                static_cast<ScFormulaCell*>(pCell)->CompileXML( rProgress );
                 if ( nRow != maItems[i].nRow )
                     Search( nRow, i );      // Listener deleted/inserted?
             }
commit 25b093c73f9266d6dff4d443392e0c0cd422c136
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 21 20:26:04 2013 +0200

    this method is unused now
    
    We are down to two number format methods in ScFormulaCell now
    
    Change-Id: If8bf13dfdd9803872bc1425909c31a5bb0ee1598

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 4152450..e73a79c 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -93,8 +93,6 @@ private:
     void            InterpretTail( ScInterpretTailParameter );
 
     ScFormulaCell( const ScFormulaCell& );
-    sal_uLong GetFormatIndex() const { return nFormatIndex; }
-
 public:
 
     enum CompareState { NotEqual = 0, EqualInvariant, EqualRelativeRef };
commit 815458802168834778c76bd2855a58e5abff0d00
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 21 20:25:21 2013 +0200

    String to OUString
    
    Change-Id: I4ca8254fea9e2ec78cb1d542cc8c0c2cd12e6e89

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 1ce9da4..9c3ebcd 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -910,8 +910,8 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
 
         case NUMBERFORMAT_TEXT:
         {
-            String aResult = mrScFmlaCell.GetString();
-            if( aResult.Len() || (rStrm.GetRoot().GetBiff() <= EXC_BIFF5) )
+            OUString aResult = mrScFmlaCell.GetString();
+            if( !aResult.isEmpty() || (rStrm.GetRoot().GetBiff() <= EXC_BIFF5) )
             {
                 rStrm << EXC_FORMULA_RES_STRING;
                 mxStringRec.reset( new XclExpStringRec( rStrm.GetRoot(), aResult ) );
commit 447b9ff6db7948d4229a14293933ed3b918e008f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 7 03:05:07 2013 +0200

    bail out early for error cells
    
    Change-Id: Ice38b42cdd01b8dbb472752d2c8e1679181f8422

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index d2dccc0..1ce9da4 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -887,20 +887,24 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
 
 void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
 {
+    sal_uInt16 nScErrCode = mrScFmlaCell.GetErrCode();
+    if( nScErrCode )
+    {
+        rStrm << EXC_FORMULA_RES_ERROR << sal_uInt8( 0 )
+            << XclTools::GetXclErrorCode( nScErrCode )
+            << sal_uInt8( 0 ) << sal_uInt16( 0 )
+            << sal_uInt16( 0xFFFF );
+
+        return;
+    }
+
     // result of the formula
     switch( mrScFmlaCell.GetFormatType() )
     {
         case NUMBERFORMAT_NUMBER:
         {
             // either value or error code
-            sal_uInt16 nScErrCode = mrScFmlaCell.GetErrCode();
-            if( nScErrCode )
-                rStrm << EXC_FORMULA_RES_ERROR << sal_uInt8( 0 )
-                      << XclTools::GetXclErrorCode( nScErrCode )
-                      << sal_uInt8( 0 ) << sal_uInt16( 0 )
-                      << sal_uInt16( 0xFFFF );
-            else
-                rStrm << mrScFmlaCell.GetValue();
+            rStrm << mrScFmlaCell.GetValue();
         }
         break;
 
commit 7179c8e6d569d32ad00ee50b58201ed9382e5709
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 7 02:10:12 2013 +0200

    bail out for error cells early
    
    Change-Id: I36581f3b735008dbba6eea5808da654eb8b279e3

diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 02632ed..bf9c1d8 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -675,22 +675,22 @@ static const char* lcl_GetErrorString( sal_uInt16 nScErrCode )
 
 void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& rsType, OUString& rsValue )
 {
+    sal_uInt16 nScErrCode = rCell.GetErrCode();
+    if( nScErrCode )
+    {
+        rsType = "e";
+        rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) );
+
+        return;
+    }
+
     switch( rCell.GetFormatType() )
     {
         case NUMBERFORMAT_NUMBER:
         {
             // either value or error code
-            sal_uInt16 nScErrCode = rCell.GetErrCode();
-            if( nScErrCode )
-            {
-                rsType = "e";
-                rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) );
-            }
-            else
-            {
-                rsType = "n";
-                rsValue = OUString::valueOf( rCell.GetValue() );
-            }
+            rsType = "n";
+            rsValue = OUString::valueOf( rCell.GetValue() );
         }
         break;
 
commit 07e267e6d9367f3fe45209aa90d811b02068a7b5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 7 02:03:54 2013 +0200

    fix warning
    
    Change-Id: I7a226a7411ff2bab7d373c5720541071aabd573b

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 2cdb205..6ec5017 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -154,7 +154,7 @@ public:
     const Size&             GetTextSize() const     { return aTextSize; }
     long                    GetOriginalWidth() const { return nOriginalWidth; }
 
-    sal_uLong GetResultValueFormat( const ScRefCellValue& rCell ) const;
+    sal_uLong GetResultValueFormat() const;
 
     sal_uLong   GetValueFormat() const                  { return nValueFormat; }
     sal_Bool    GetLineBreak() const                    { return bLineBreak; }
@@ -597,7 +597,7 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScRefCellValue& rCell, long nWidth
             return;
     }
 
-    sal_uLong nFormat = GetResultValueFormat(rCell);
+    sal_uLong nFormat = GetResultValueFormat();
     if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
     {
         // Not 'General' number format.  Set hash text and bail out.
@@ -783,7 +783,7 @@ sal_Bool ScDrawStringsVars::HasEditCharacters() const
     return aString.SearchChar( pChars ) != STRING_NOTFOUND;
 }
 
-sal_uLong ScDrawStringsVars::GetResultValueFormat( const ScRefCellValue& rCell ) const
+sal_uLong ScDrawStringsVars::GetResultValueFormat() const
 {
     // Get the effective number format, including formula result types.
     // This assumes that a formula cell has already been calculated.
@@ -1672,7 +1672,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 
                     bool bBreak = ( aVars.GetLineBreak() || aVars.GetHorJust() == SVX_HOR_JUSTIFY_BLOCK );
                     // #i111387# #o11817313# disable automatic line breaks only for "General" number format
-                    if (bBreak && bCellIsValue && (aVars.GetResultValueFormat(aCell) % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+                    if (bBreak && bCellIsValue && (aVars.GetResultValueFormat() % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
                         bBreak = false;
 
                     bool bRepeat = aVars.IsRepeat() && !bBreak;
commit 45b0350eaa2615aa598cbce152da62b49032f74e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue May 7 02:00:25 2013 +0200

    remove one more use of inherited number formats
    
    Change-Id: If12ca06b45821efe9e52555095a45ae3ce2d377a

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 4851f20..d2dccc0 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -760,55 +760,13 @@ IMPL_FIXEDMEMPOOL_NEWDEL( XclExpFormulaCell )
 
 XclExpFormulaCell::XclExpFormulaCell(
         const XclExpRoot& rRoot, const XclAddress& rXclPos,
-        const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
-        const ScFormulaCell& rScFmlaCell,
+        sal_uInt32 nForcedXFId, const ScFormulaCell& rScFmlaCell,
         XclExpArrayBuffer& rArrayBfr,
         XclExpShrfmlaBuffer& rShrfmlaBfr,
         XclExpTableopBuffer& rTableopBfr ) :
     XclExpSingleCellBase( EXC_ID2_FORMULA, 0, rXclPos, nForcedXFId ),
     mrScFmlaCell( const_cast< ScFormulaCell& >( rScFmlaCell ) )
 {
-    // *** Find result number format overwriting cell number format *** -------
-
-    if( GetXFId() == EXC_XFID_NOTFOUND )
-    {
-        SvNumberFormatter& rFormatter = rRoot.GetFormatter();
-        XclExpNumFmtBuffer& rNumFmtBfr = rRoot.GetNumFmtBuffer();
-
-        // current cell number format
-        sal_uLong nScNumFmt = pPattern ?
-            GETITEMVALUE( pPattern->GetItemSet(), SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) :
-            rNumFmtBfr.GetStandardFormat();
-
-        // alternative number format passed to XF buffer
-        sal_uLong nAltScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND;
-        /*  Xcl doesn't know Boolean number formats, we write
-            "TRUE";"FALSE" (language dependent). Don't do it for automatic
-            formula formats, because Excel gets them right. */
-        /*  #i8640# Don't set text format, if we have string results. */
-        short nFormatType = mrScFmlaCell.GetFormatType();
-        if( ((nScNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0) &&
-                (nFormatType != NUMBERFORMAT_LOGICAL) &&
-                (nFormatType != NUMBERFORMAT_TEXT) )
-            nAltScNumFmt = mrScFmlaCell.GetStandardFormat( rFormatter, nScNumFmt );
-        /*  If cell number format is Boolean and automatic formula
-            format is Boolean don't write that ugly special format. */
-        else if( (nFormatType == NUMBERFORMAT_LOGICAL) &&
-                (rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL) )
-            nAltScNumFmt = rNumFmtBfr.GetStandardFormat();
-
-        // #i41420# find script type according to result type (always latin for numeric results)
-        sal_Int16 nScript = ApiScriptType::LATIN;
-        bool bForceLineBreak = false;
-        if( nFormatType == NUMBERFORMAT_TEXT )
-        {
-            String aResult = mrScFmlaCell.GetString();
-            bForceLineBreak = mrScFmlaCell.IsMultilineResult();
-            nScript = XclExpStringHelper::GetLeadingScriptType( rRoot, aResult );
-        }
-        SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt, bForceLineBreak ) );
-    }
-
     // *** Convert the formula token array *** --------------------------------
 
     ScAddress aScPos( static_cast< SCCOL >( rXclPos.mnCol ), static_cast< SCROW >( rXclPos.mnRow ), rRoot.GetCurrScTab() );
@@ -2374,7 +2332,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
             case CELLTYPE_FORMULA:
             {
                 xCell.reset(new XclExpFormulaCell(
-                    GetRoot(), aXclPos, pPattern, nMergeBaseXFId,
+                    GetRoot(), aXclPos, nMergeBaseXFId,
                     *rScCell.mpFormula, maArrayBfr, maShrfmlaBfr, maTableopBfr));
             }
             break;
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 655d6ea..b0253b3 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -451,8 +451,7 @@ class XclExpFormulaCell : public XclExpSingleCellBase
 
 public:
     explicit            XclExpFormulaCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
-                            const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
-                            const ScFormulaCell& rScFmlaCell,
+                            sal_uInt32 nForcedXFId, const ScFormulaCell& rScFmlaCell,
                             XclExpArrayBuffer& rArrayBfr,
                             XclExpShrfmlaBuffer& rShrfmlaBfr,
                             XclExpTableopBuffer& rTableopBfr );


More information about the Libreoffice-commits mailing list