diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/inc/cell.hxx DEV300_m16/sc/inc/cell.hxx --- DEV300_m16-original/DEV300_m16/sc/inc/cell.hxx 2008-04-10 19:15:24.000000000 +0100 +++ DEV300_m16/sc/inc/cell.hxx 2008-07-25 08:00:25.000000000 +0100 @@ -428,6 +428,9 @@ inline BOOL IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); } EditTextObject* CreateURLObject() ; void GetURLResult( String& rURL, String& rCellText ); + + /** Determines whether the result string contains more than one paragraph */ + BOOL IsMultilineResult(); }; // Iterator fuer Referenzen in einer Formelzelle diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/inc/editutil.hxx DEV300_m16/sc/inc/editutil.hxx --- DEV300_m16-original/DEV300_m16/sc/inc/editutil.hxx 2008-04-10 19:31:47.000000000 +0100 +++ DEV300_m16/sc/inc/editutil.hxx 2008-07-25 08:01:35.000000000 +0100 @@ -63,8 +63,13 @@ public: static String ModifyDelimiters( const String& rOld ); + + /// Retrieves string with paragraphs delimited by spaces static String GetSpaceDelimitedString( const EditEngine& rEngine ); + /// Retrieves string with paragraphs delimited by new lines ('\n'). + static String GetMultilineString( const EditEngine& rEngine ); + public: ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ, const Point& rScrPosPixel, diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/core/data/cell2.cxx DEV300_m16/sc/source/core/data/cell2.cxx --- DEV300_m16-original/DEV300_m16/sc/source/core/data/cell2.cxx 2008-05-14 10:50:24.000000000 +0100 +++ DEV300_m16/sc/source/core/data/cell2.cxx 2008-07-22 17:32:29.000000000 +0100 @@ -162,7 +162,7 @@ // auch Text von URL-Feldern, Doc-Engine ist eine ScFieldEditEngine EditEngine& rEngine = pDoc->GetEditEngine(); rEngine.SetText( *pData ); - rString = ScEditUtil::GetSpaceDelimitedString(rEngine); // space between paragraphs + rString = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs // kurze Strings fuer Formeln merken if ( rString.Len() < MAXSTRLEN ) ((ScEditCell*)this)->pString = new String( rString ); //! non-const diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/core/data/cell.cxx DEV300_m16/sc/source/core/data/cell.cxx --- DEV300_m16-original/DEV300_m16/sc/source/core/data/cell.cxx 2008-05-14 10:50:09.000000000 +0100 +++ DEV300_m16/sc/source/core/data/cell.cxx 2008-07-22 18:08:27.000000000 +0100 @@ -1832,6 +1832,14 @@ } } +BOOL ScFormulaCell::IsMultilineResult() +{ + String aCellString; + GetString(aCellString); + BOOL bMoreThanOneLine = ( aCellString.Search( _LF ) != STRING_NOTFOUND ); + return bMoreThanOneLine; +} + EditTextObject* ScFormulaCell::CreateURLObject() { String aCellText; diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/core/data/column2.cxx DEV300_m16/sc/source/core/data/column2.cxx --- DEV300_m16-original/DEV300_m16/sc/source/core/data/column2.cxx 2008-04-10 20:20:05.000000000 +0100 +++ DEV300_m16/sc/source/core/data/column2.cxx 2008-07-22 18:47:52.000000000 +0100 @@ -793,9 +793,12 @@ } BOOL bAddMargin = TRUE; - BOOL bEditEngine = ( pCell->GetCellType() == CELLTYPE_EDIT || + CellType eCellType = pCell->GetCellType(); + + BOOL bEditEngine = ( eCellType == CELLTYPE_EDIT || eOrient == SVX_ORIENTATION_STACKED || - IsAmbiguousScript( nScript ) ); + IsAmbiguousScript( nScript ) || + ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) ); if (!bEditEngine) // direkte Ausgabe { diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/core/data/column.cxx DEV300_m16/sc/source/core/data/column.cxx --- DEV300_m16-original/DEV300_m16/sc/source/core/data/column.cxx 2008-04-10 20:19:38.000000000 +0100 +++ DEV300_m16/sc/source/core/data/column.cxx 2008-07-22 18:47:52.000000000 +0100 @@ -2264,8 +2264,10 @@ while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE ) { ScBaseCell* pCell = pItems[nIndex].pCell; - if ( pCell->GetCellType() == CELLTYPE_EDIT || - IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) ) + CellType eCellType = pCell->GetCellType(); + if ( eCellType == CELLTYPE_EDIT || + IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) || + ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) ) { rFirst = nRow; return TRUE; diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/core/tool/editutil.cxx DEV300_m16/sc/source/core/tool/editutil.cxx --- DEV300_m16-original/DEV300_m16/sc/source/core/tool/editutil.cxx 2008-04-10 20:52:15.000000000 +0100 +++ DEV300_m16/sc/source/core/tool/editutil.cxx 2008-07-22 17:33:05.000000000 +0100 @@ -82,6 +82,19 @@ return aRet; } +String ScEditUtil::GetMultilineString( const EditEngine& rEngine ) +{ + String aRet; + USHORT nParCount = rEngine.GetParagraphCount(); + for (USHORT nPar=0; nPar 0) + aRet += '\n'; + aRet += rEngine.GetText( nPar ); + } + return aRet; +} + String ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine ) { String aRet; diff -Naur --exclude='unxlngi6.*' --exclude='*.swp' DEV300_m16-original/DEV300_m16/sc/source/ui/view/output2.cxx DEV300_m16/sc/source/ui/view/output2.cxx --- DEV300_m16-original/DEV300_m16/sc/source/ui/view/output2.cxx 2008-04-11 02:34:35.000000000 +0100 +++ DEV300_m16/sc/source/ui/view/output2.cxx 2008-07-22 18:47:50.000000000 +0100 @@ -1427,11 +1427,13 @@ } if (bDoCell && !bNeedEdit) { - if ( pCell->GetCellType() == CELLTYPE_FORMULA ) + BOOL bFormulaCell = (pCell->GetCellType() == CELLTYPE_FORMULA ); + if ( bFormulaCell ) lcl_CreateInterpretProgress( bProgress, pDoc, (ScFormulaCell*)pCell ); if ( aVars.SetText(pCell) ) pOldPattern = NULL; - bNeedEdit = aVars.HasEditCharacters(); + bNeedEdit = aVars.HasEditCharacters() || + (bFormulaCell && ((ScFormulaCell*)pCell)->IsMultilineResult()); } if (bDoCell && !bNeedEdit) {