ooo-build r13953 - in branches/ooo-build-3-0: . patches/dev300



Author: kyoshida
Date: Thu Sep 18 22:15:41 2008
New Revision: 13953
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13953&view=rev

Log:
2008-09-18  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/calc-multiline-formula-ref.diff: updated for slight
	optimization for odf export.


Modified:
   branches/ooo-build-3-0/ChangeLog
   branches/ooo-build-3-0/patches/dev300/calc-multiline-formula-ref.diff

Modified: branches/ooo-build-3-0/patches/dev300/calc-multiline-formula-ref.diff
==============================================================================
--- branches/ooo-build-3-0/patches/dev300/calc-multiline-formula-ref.diff	(original)
+++ branches/ooo-build-3-0/patches/dev300/calc-multiline-formula-ref.diff	Thu Sep 18 22:15:41 2008
@@ -1,8 +1,8 @@
 diff --git sc/inc/cell.hxx sc/inc/cell.hxx
-index ac35dc6..83620a1 100644
+index a56f8b0..a5aa3cf 100644
 --- sc/inc/cell.hxx
 +++ sc/inc/cell.hxx
-@@ -475,6 +475,9 @@ public:
+@@ -460,6 +460,9 @@ public:
  	inline BOOL		IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
  	EditTextObject*		CreateURLObject() ;
      void            GetURLResult( String& rURL, String& rCellText );
@@ -31,7 +31,7 @@
  				ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
  							const Point& rScrPosPixel,
 diff --git sc/inc/formularesult.hxx sc/inc/formularesult.hxx
-index 727476c..1836303 100644
+index 727476c..290b99d 100644
 --- sc/inc/formularesult.hxx
 +++ sc/inc/formularesult.hxx
 @@ -38,6 +38,12 @@
@@ -51,7 +51,7 @@
      bool                mbToken :1; // whether content of union is a token
      bool                mbEmpty :1; // empty cell result
      bool                mbEmptyDisplayedAsString :1;    // only if mbEmpty
-+    Multiline           meMultiline :2; // result is multiline
++    Multiline           meMultiline; // result is multiline
  
      /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
          prior to assigning other types */
@@ -167,10 +167,10 @@
  }
  
 diff --git sc/source/core/data/cell.cxx sc/source/core/data/cell.cxx
-index ed6a75e..ba0a973 100644
+index 6a0ba53..c330826 100644
 --- sc/source/core/data/cell.cxx
 +++ sc/source/core/data/cell.cxx
-@@ -1813,6 +1813,13 @@ void ScFormulaCell::GetURLResult( String& rURL, String& rCellText )
+@@ -1805,6 +1805,13 @@ void ScFormulaCell::GetURLResult( String& rURL, String& rCellText )
      }
  }
  
@@ -185,10 +185,10 @@
  {
      String aCellText;
 diff --git sc/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx
-index a4c9a1c..fc6df5f 100644
+index 5580b56..f770a60 100644
 --- sc/source/core/data/cell2.cxx
 +++ sc/source/core/data/cell2.cxx
-@@ -163,7 +163,7 @@ void ScEditCell::GetString( String& rString ) const
+@@ -134,7 +134,7 @@ void ScEditCell::GetString( String& rString ) const
          // auch Text von URL-Feldern, Doc-Engine ist eine ScFieldEditEngine
          EditEngine& rEngine = pDoc->GetEditEngine();
          rEngine.SetText( *pData );
@@ -198,10 +198,10 @@
          if ( rString.Len() < MAXSTRLEN )
              ((ScEditCell*)this)->pString = new String( rString );   //! non-const
 diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
-index 474da0f..d898aaa 100644
+index b105a88..96c7377 100644
 --- sc/source/core/data/column.cxx
 +++ sc/source/core/data/column.cxx
-@@ -2317,8 +2317,10 @@ BOOL ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const
+@@ -2239,8 +2239,10 @@ BOOL ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const
  	while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE )
  	{
  		ScBaseCell* pCell = pItems[nIndex].pCell;
@@ -215,10 +215,10 @@
  			rFirst = nRow;
  			return TRUE;
 diff --git sc/source/core/data/column2.cxx sc/source/core/data/column2.cxx
-index 8e75dcd..888a51e 100644
+index eff0391..d81817d 100644
 --- sc/source/core/data/column2.cxx
 +++ sc/source/core/data/column2.cxx
-@@ -793,9 +793,12 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
+@@ -241,9 +241,12 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
  		}
  
  		BOOL bAddMargin = TRUE;
@@ -294,10 +294,10 @@
  
  Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToTop )
 diff --git sc/source/filter/excel/xestyle.cxx sc/source/filter/excel/xestyle.cxx
-index 55edbf1..0a5231e 100644
+index 3d548e2..647585b 100644
 --- sc/source/filter/excel/xestyle.cxx
 +++ sc/source/filter/excel/xestyle.cxx
-@@ -1963,9 +1963,9 @@ sal_uInt32 XclExpXFBuffer::InsertWithFont( const ScPatternAttr* pPattern, sal_In
+@@ -1921,9 +1921,9 @@ sal_uInt32 XclExpXFBuffer::InsertWithFont( const ScPatternAttr* pPattern, sal_In
      return InsertCellXF( pPattern, nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, nForceXclFont, bForceLineBreak );
  }
  
@@ -331,10 +331,10 @@
  
      // *** Convert the formula token array *** --------------------------------
 diff --git sc/source/filter/inc/xestyle.hxx sc/source/filter/inc/xestyle.hxx
-index 16bd7ed..810e301 100644
+index 0ad3898..a43c173 100644
 --- sc/source/filter/inc/xestyle.hxx
 +++ sc/source/filter/inc/xestyle.hxx
-@@ -617,10 +617,13 @@ public:
+@@ -602,10 +602,13 @@ public:
          @param nXFFlags  Additional flags allowing to control the creation of an XF.
          @param nForceScNumFmt  The number format to be exported, e.g. formula
              result type. This format will always overwrite the cell's number format.
@@ -349,52 +349,129 @@
      /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
          @return  A unique XF record ID. */
      sal_uInt32          InsertStyle( const SfxStyleSheetBase* pStyleSheet );
+diff --git sc/source/filter/xml/XMLExportIterator.cxx sc/source/filter/xml/XMLExportIterator.cxx
+index 8ba7cad..8a7e52b 100644
+--- sc/source/filter/xml/XMLExportIterator.cxx
++++ sc/source/filter/xml/XMLExportIterator.cxx
+@@ -568,6 +568,7 @@ ScMyCell::ScMyCell() :
+ 	aShapeList(),
+ 	aDetectiveObjVec(),
+     nValidationIndex(-1),
++    pBaseCell(NULL),
+ 	bIsAutoStyle( sal_False ),
+ 	bHasShape( sal_False ),
+ 	bIsMergedBase( sal_False ),
+diff --git sc/source/filter/xml/XMLExportIterator.hxx sc/source/filter/xml/XMLExportIterator.hxx
+index abe9185..0b0d51c 100644
+--- sc/source/filter/xml/XMLExportIterator.hxx
++++ sc/source/filter/xml/XMLExportIterator.hxx
+@@ -48,6 +48,7 @@ class	ScHorizontalCellIterator;
+ struct	ScMyCell;
+ class	ScXMLExport;
+ class	ScFormatRangeStyles;
++class   ScBaseCell;
+ 
+ //==============================================================================
+ 
+@@ -312,6 +313,8 @@ struct ScMyCell
+ 	sal_Int32					nNumberFormat;
+ 	com::sun::star::table::CellContentType	nType;
+ 
++    ScBaseCell*                 pBaseCell;
++
+ 	sal_Bool					bIsAutoStyle;
+ 
+ 	sal_Bool					bHasShape;
 diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
-index c8c629e..535ed45 100644
+index 18b2bd1..7a3679a 100644
 --- sc/source/filter/xml/xmlexprt.cxx
 +++ sc/source/filter/xml/xmlexprt.cxx
-@@ -2410,7 +2410,8 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
+@@ -2348,7 +2348,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
  
  	if (!bIsEmpty)
  	{
 -		if ((aCell.nType == table::CellContentType_TEXT) && IsEditCell(aCell))
-+		if ((aCell.nType == table::CellContentType_TEXT && IsEditCell(aCell)) || 
-+            IsMultiLineFormulaCell(aCell))
++        if ((aCell.nType == table::CellContentType_TEXT && IsEditCell(aCell)) || IsMultiLineFormulaCell(aCell))
  		{
              bEditCell = sal_True;
              uno::Reference<text::XText> xText(xCurrentTableCellRange->getCellByPosition(aCell.aCellAddress.Column, aCell.aCellAddress.Row), uno::UNO_QUERY);
-@@ -2907,6 +2908,22 @@ sal_Bool ScXMLExport::IsEditCell(ScMyCell& rCell) const
+@@ -2814,12 +2814,15 @@ sal_Bool ScXMLExport::IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& a
+ 	return (aCell1.nType == aCell2.nType);
+ }
+ 
+-sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress) const
++sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell) const
+ {
+ 	ScAddress aCoreAddress(static_cast<SCCOL>(aAddress.Column),
+ 						static_cast<SCROW>(aAddress.Row),
+ 						static_cast<SCTAB>(aAddress.Sheet));
+ 	ScBaseCell* pBaseCell = GetDocument() ? GetDocument()->GetCell(aCoreAddress) : NULL;
++    if (pMyCell)
++        pMyCell->pBaseCell = pBaseCell;
++
+ 	if (pBaseCell)
+ 		return (pBaseCell->GetCellType() == CELLTYPE_EDIT);
+ 	return sal_False;
+@@ -2832,12 +2835,37 @@ sal_Bool ScXMLExport::IsEditCell(ScMyCell& rCell) const
+ 		return rCell.bIsEditCell;
+ 	else
+ 	{
+-		rCell.bIsEditCell = IsEditCell(rCell.aCellAddress);
++		rCell.bIsEditCell = IsEditCell(rCell.aCellAddress, &rCell);
+ 		rCell.bKnowWhetherIsEditCell = sal_True;
+ 		return rCell.bIsEditCell;
  	}
  }
  
-+sal_Bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell) const
++sal_Bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell)
 +{
-+    if (!pDoc)
-+        return false;
++    if (rCell.pBaseCell)
++    {
++        if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
++            return false;
 +
++        return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
++    }
++
++    ScDocument* pDoc = GetDocument();
 +    ScAddress aAddr(static_cast<SCCOL>(rCell.aCellAddress.Column), 
-+                    static_cast<SCROW>(rCell.aCellAddress.Row), 
++                    static_cast<SCROW>(rCell.aCellAddress.Row),
 +                    static_cast<SCTAB>(rCell.aCellAddress.Sheet));
++    ScBaseCell* pBaseCell = pDoc ? pDoc->GetCell(aAddr) : NULL;
++    if (!pBaseCell)
++        return false;
 +
-+    ScBaseCell* pCell = pDoc->GetCell(aAddr);
-+    if (!pCell || pCell->GetCellType() != CELLTYPE_FORMULA)
++    rCell.pBaseCell = pBaseCell;
++    if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
 +        return false;
 +
-+    return static_cast<ScFormulaCell*>(pCell)->IsMultilineResult();
++    return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
 +}
 +
  sal_Bool ScXMLExport::IsAnnotationEqual(const uno::Reference<table::XCell>& /* xCell1 */,
                                          const uno::Reference<table::XCell>& /* xCell2 */)
  {
 diff --git sc/source/filter/xml/xmlexprt.hxx sc/source/filter/xml/xmlexprt.hxx
-index 6a366f5..e8477e5 100644
+index 8415096..af8d34f 100644
 --- sc/source/filter/xml/xmlexprt.hxx
 +++ sc/source/filter/xml/xmlexprt.hxx
-@@ -185,6 +185,7 @@ class ScXMLExport : public SvXMLExport
- 	sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress) const;
+@@ -60,6 +60,7 @@ class XMLNumberFormatAttributesExportHelper;
+ class ScChartListener;
+ class SfxItemPool;
+ class ScAddress;
++class ScBaseCell;
+ 
+ typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec;
+ 
+@@ -180,9 +181,10 @@ class ScXMLExport : public SvXMLExport
+ 	void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
+ 
+ 	sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
+-	sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress) const;
++	sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
  	sal_Bool IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const;
  	sal_Bool IsEditCell(ScMyCell& rCell) const;
-+    sal_Bool IsMultiLineFormulaCell(ScMyCell& rCell) const;
++    sal_Bool IsMultiLineFormulaCell(ScMyCell& rCell);
  	sal_Bool IsAnnotationEqual(const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell1,
  								const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell2);
  	sal_Bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);
@@ -435,10 +512,10 @@
  					aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
  					aBufStr += String::CreateFromInt32( c );
 diff --git sc/source/ui/view/output2.cxx sc/source/ui/view/output2.cxx
-index c472906..c92818e 100644
+index 6425234..1375df6 100644
 --- sc/source/ui/view/output2.cxx
 +++ sc/source/ui/view/output2.cxx
-@@ -1427,11 +1427,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
+@@ -1352,11 +1352,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
  				}
  				if (bDoCell && !bNeedEdit)
  				{



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