View | Details | Raw Unified | Return to issue 35913
Collapse All | Expand All

(-)sc/inc/cell.hxx (+3 lines)
Lines 460-465 public: Link Here
460
	inline BOOL		IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
460
	inline BOOL		IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
461
	EditTextObject*		CreateURLObject() ;
461
	EditTextObject*		CreateURLObject() ;
462
    void            GetURLResult( String& rURL, String& rCellText );
462
    void            GetURLResult( String& rURL, String& rCellText );
463
464
    /** Determines whether or not the result string contains more than one paragraph */
465
    bool            IsMultilineResult();
463
};
466
};
464
467
465
//			Iterator fuer Referenzen in einer Formelzelle
468
//			Iterator fuer Referenzen in einer Formelzelle
(-)sc/inc/editutil.hxx (+5 lines)
Lines 63-70 class ScEditUtil Link Here
63
63
64
public:
64
public:
65
	static String ModifyDelimiters( const String& rOld );
65
	static String ModifyDelimiters( const String& rOld );
66
67
    /// Retrieves string with paragraphs delimited by spaces
66
	static String GetSpaceDelimitedString( const EditEngine& rEngine );
68
	static String GetSpaceDelimitedString( const EditEngine& rEngine );
67
69
70
    /// Retrieves string with paragraphs delimited by new lines ('\n').
71
    static String GetMultilineString( const EditEngine& rEngine );
72
68
public:
73
public:
69
				ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
74
				ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
70
							const Point& rScrPosPixel,
75
							const Point& rScrPosPixel,
(-)sc/inc/formularesult.hxx (-3 / +37 lines)
Lines 38-43 Link Here
38
    and memory consumption. */
38
    and memory consumption. */
39
class ScFormulaResult
39
class ScFormulaResult
40
{
40
{
41
    enum Multiline
42
    {
43
        MULTILINE_UNKNOWN = 0,
44
        MULTILINE_FALSE,
45
        MULTILINE_TRUE
46
    };
41
    union
47
    union
42
    {
48
    {
43
        double          mfValue;    // double result direct for performance and memory consumption
49
        double          mfValue;    // double result direct for performance and memory consumption
Lines 47-52 class ScFormulaResult Link Here
47
    bool                mbToken :1; // whether content of union is a token
53
    bool                mbToken :1; // whether content of union is a token
48
    bool                mbEmpty :1; // empty cell result
54
    bool                mbEmpty :1; // empty cell result
49
    bool                mbEmptyDisplayedAsString :1;    // only if mbEmpty
55
    bool                mbEmptyDisplayedAsString :1;    // only if mbEmpty
56
    Multiline           meMultiline; // result is multiline
50
57
51
    /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
58
    /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
52
        prior to assigning other types */
59
        prior to assigning other types */
Lines 69-80 public: Link Here
69
                                /** Effectively type svUnknown. */
76
                                /** Effectively type svUnknown. */
70
                                ScFormulaResult()
77
                                ScFormulaResult()
71
                                    : mpToken(NULL), mnError(0), mbToken(true),
78
                                    : mpToken(NULL), mnError(0), mbToken(true),
72
                                    mbEmpty(false), mbEmptyDisplayedAsString(false) {}
79
                                    mbEmpty(false), mbEmptyDisplayedAsString(false),
80
                                    meMultiline(MULTILINE_UNKNOWN) {}
73
81
74
                                ScFormulaResult( const ScFormulaResult & r )
82
                                ScFormulaResult( const ScFormulaResult & r )
75
                                    : mnError( r.mnError), mbToken( r.mbToken),
83
                                    : mnError( r.mnError), mbToken( r.mbToken),
76
                                    mbEmpty( r.mbEmpty),
84
                                    mbEmpty( r.mbEmpty),
77
                                    mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString)
85
                                    mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString),
86
                                    meMultiline( r.meMultiline)
78
                                {
87
                                {
79
                                    if (mbToken)
88
                                    if (mbToken)
80
                                    {
89
                                    {
Lines 99-105 public: Link Here
99
    /** Same comments as for SetToken() apply! */
108
    /** Same comments as for SetToken() apply! */
100
    explicit                    ScFormulaResult( const ScToken* p )
109
    explicit                    ScFormulaResult( const ScToken* p )
101
                                    : mnError(0), mbToken(false),
110
                                    : mnError(0), mbToken(false),
102
                                    mbEmpty(false), mbEmptyDisplayedAsString(false)
111
                                    mbEmpty(false), mbEmptyDisplayedAsString(false),
112
                                    meMultiline(MULTILINE_UNKNOWN)
103
                                {
113
                                {
104
                                    SetToken( p);
114
                                    SetToken( p);
105
                                }
115
                                }
Lines 153-158 public: Link Here
153
        details instead. */
163
        details instead. */
154
    inline  bool                IsValue() const;
164
    inline  bool                IsValue() const;
155
165
166
    /** Determines whether or not the result is a string containing more than 
167
        one paragraph */
168
    inline  bool                IsMultiline();
169
156
    /** Get error code if set or GetCellResultType() is svError or svUnknown,
170
    /** Get error code if set or GetCellResultType() is svError or svUnknown,
157
        else 0. */
171
        else 0. */
158
    inline  USHORT              GetResultError() const;
172
    inline  USHORT              GetResultError() const;
Lines 211-216 inline void ScFormulaResult::ResetToDefaults() Link Here
211
    mnError = 0;
225
    mnError = 0;
212
    mbEmpty = false;
226
    mbEmpty = false;
213
    mbEmptyDisplayedAsString = false;
227
    mbEmptyDisplayedAsString = false;
228
    meMultiline = MULTILINE_UNKNOWN;
214
}
229
}
215
230
216
231
Lines 232-241 inline void ScFormulaResult::ResolveToken( const ScToken * p ) Link Here
232
                mbToken = false;
247
                mbToken = false;
233
                // set in case mnError is 0 now, which shouldn't happen but ...
248
                // set in case mnError is 0 now, which shouldn't happen but ...
234
                mfValue = 0.0;
249
                mfValue = 0.0;
250
                meMultiline = MULTILINE_FALSE;
235
                break;
251
                break;
236
            case svEmptyCell:
252
            case svEmptyCell:
237
                mbEmpty = true;
253
                mbEmpty = true;
238
                mbEmptyDisplayedAsString = static_cast<const ScEmptyCellToken*>(p)->IsDisplayedAsString();
254
                mbEmptyDisplayedAsString = static_cast<const ScEmptyCellToken*>(p)->IsDisplayedAsString();
255
                meMultiline = MULTILINE_FALSE;
239
                p->DecRef();
256
                p->DecRef();
240
                mbToken = false;
257
                mbToken = false;
241
                break;
258
                break;
Lines 243-248 inline void ScFormulaResult::ResolveToken( const ScToken * p ) Link Here
243
                mfValue = p->GetDouble();
260
                mfValue = p->GetDouble();
244
                p->DecRef();
261
                p->DecRef();
245
                mbToken = false;
262
                mbToken = false;
263
                meMultiline = MULTILINE_FALSE;
246
                break;
264
                break;
247
            default:
265
            default:
248
                mpToken = p;
266
                mpToken = p;
Lines 270-275 inline void ScFormulaResult::Assign( const ScFormulaResult & r ) Link Here
270
        mbToken = false;
288
        mbToken = false;
271
        mbEmpty = true;
289
        mbEmpty = true;
272
        mbEmptyDisplayedAsString = r.mbEmptyDisplayedAsString;
290
        mbEmptyDisplayedAsString = r.mbEmptyDisplayedAsString;
291
        meMultiline = r.meMultiline;
273
    }
292
    }
274
    else if (r.mbToken)
293
    else if (r.mbToken)
275
    {
294
    {
Lines 352-357 inline void ScFormulaResult::SetDouble( double f ) Link Here
352
            mpToken->DecRef();
371
            mpToken->DecRef();
353
        mfValue = f;
372
        mfValue = f;
354
        mbToken = false;
373
        mbToken = false;
374
        meMultiline = MULTILINE_FALSE;
355
    }
375
    }
356
}
376
}
357
377
Lines 404-409 inline bool ScFormulaResult::IsValue() const Link Here
404
    return sv == svDouble || sv == svError || sv == svEmptyCell;
424
    return sv == svDouble || sv == svError || sv == svEmptyCell;
405
}
425
}
406
426
427
inline bool ScFormulaResult::IsMultiline()
428
{
429
    if (meMultiline == MULTILINE_UNKNOWN)
430
    {
431
        const String& rStr = GetString();
432
        if (rStr.Len() && rStr.Search( _LF ) != STRING_NOTFOUND)
433
            meMultiline = MULTILINE_TRUE;
434
        else
435
            meMultiline = MULTILINE_FALSE;
436
    }
437
    return meMultiline == MULTILINE_TRUE;
438
}
439
407
440
408
inline USHORT ScFormulaResult::GetResultError() const
441
inline USHORT ScFormulaResult::GetResultError() const
409
{
442
{
Lines 537-542 inline void ScFormulaResult::SetHybridDouble( double f ) Link Here
537
    {
570
    {
538
        mfValue = f;
571
        mfValue = f;
539
        mbToken = false;
572
        mbToken = false;
573
        meMultiline = MULTILINE_FALSE;
540
    }
574
    }
541
}
575
}
542
576
(-)sc/source/core/data/cell.cxx (+7 lines)
Lines 1805-1810 void ScFormulaCell::GetURLResult( String& rURL, String& rCellText ) Link Here
1805
    }
1805
    }
1806
}
1806
}
1807
1807
1808
bool ScFormulaCell::IsMultilineResult()
1809
{
1810
    if (!IsValue())
1811
        return aResult.IsMultiline();
1812
    return false;
1813
}
1814
1808
EditTextObject* ScFormulaCell::CreateURLObject()
1815
EditTextObject* ScFormulaCell::CreateURLObject()
1809
{
1816
{
1810
    String aCellText;
1817
    String aCellText;
(-)sc/source/core/data/cell2.cxx (-1 / +1 lines)
Lines 134-140 void ScEditCell::GetString( String& rString ) const Link Here
134
        // auch Text von URL-Feldern, Doc-Engine ist eine ScFieldEditEngine
134
        // auch Text von URL-Feldern, Doc-Engine ist eine ScFieldEditEngine
135
        EditEngine& rEngine = pDoc->GetEditEngine();
135
        EditEngine& rEngine = pDoc->GetEditEngine();
136
        rEngine.SetText( *pData );
136
        rEngine.SetText( *pData );
137
        rString = ScEditUtil::GetSpaceDelimitedString(rEngine);     // space between paragraphs
137
        rString = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs
138
        // kurze Strings fuer Formeln merken
138
        // kurze Strings fuer Formeln merken
139
        if ( rString.Len() < MAXSTRLEN )
139
        if ( rString.Len() < MAXSTRLEN )
140
            ((ScEditCell*)this)->pString = new String( rString );   //! non-const
140
            ((ScEditCell*)this)->pString = new String( rString );   //! non-const
(-)sc/source/core/data/column.cxx (-2 / +4 lines)
Lines 2239-2246 BOOL ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const Link Here
2239
	while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE )
2239
	while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE )
2240
	{
2240
	{
2241
		ScBaseCell* pCell = pItems[nIndex].pCell;
2241
		ScBaseCell* pCell = pItems[nIndex].pCell;
2242
		if ( pCell->GetCellType() == CELLTYPE_EDIT ||
2242
        CellType eCellType = pCell->GetCellType();
2243
			 IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) )
2243
		if ( eCellType == CELLTYPE_EDIT ||
2244
			 IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) ||
2245
             ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) )
2244
		{
2246
		{
2245
			rFirst = nRow;
2247
			rFirst = nRow;
2246
			return TRUE;
2248
			return TRUE;
(-)sc/source/core/data/column2.cxx (-2 / +5 lines)
Lines 241-249 long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, Link Here
241
		}
241
		}
242
242
243
		BOOL bAddMargin = TRUE;
243
		BOOL bAddMargin = TRUE;
244
		BOOL bEditEngine = ( pCell->GetCellType() == CELLTYPE_EDIT ||
244
        CellType eCellType = pCell->GetCellType();
245
246
		BOOL bEditEngine = ( eCellType == CELLTYPE_EDIT ||
245
								eOrient == SVX_ORIENTATION_STACKED ||
247
								eOrient == SVX_ORIENTATION_STACKED ||
246
								IsAmbiguousScript( nScript ) );
248
								IsAmbiguousScript( nScript ) ||
249
                                ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) );
247
250
248
		if (!bEditEngine)									// direkte Ausgabe
251
		if (!bEditEngine)									// direkte Ausgabe
249
		{
252
		{
(-)sc/source/core/data/column3.cxx (-2 / +11 lines)
Lines 898-905 ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, Link Here
898
							String aString;
898
							String aString;
899
							pForm->GetString(aString);
899
							pForm->GetString(aString);
900
							if ( aString.Len() )
900
							if ( aString.Len() )
901
								pNew = new ScStringCell(aString);
901
                            {
902
								// #33224# LeerStrings nicht kopieren
902
                                if ( pForm->IsMultilineResult() )
903
                                {
904
                                    pNew = new ScEditCell( aString, pDestDoc );
905
                                }
906
                                else
907
                                {
908
                                    pNew = new ScStringCell(aString);
909
                                    // #33224# LeerStrings nicht kopieren
910
                                }
911
                            }
903
						}
912
						}
904
					}
913
					}
905
					if ( pNew && pSource->GetNotePtr() && ( nFlags & IDF_NOTE ) )
914
					if ( pNew && pSource->GetNotePtr() && ( nFlags & IDF_NOTE ) )
(-)sc/source/core/tool/editutil.cxx (-2 / +12 lines)
Lines 82-100 String ScEditUtil::ModifyDelimiters( const String& rOld ) Link Here
82
	return aRet;
82
	return aRet;
83
}
83
}
84
84
85
String ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
85
static String lcl_GetDelimitedString( const EditEngine& rEngine, const sal_Char c )
86
{
86
{
87
	String aRet;
87
	String aRet;
88
	USHORT nParCount = rEngine.GetParagraphCount();
88
	USHORT nParCount = rEngine.GetParagraphCount();
89
	for (USHORT nPar=0; nPar<nParCount; nPar++)
89
	for (USHORT nPar=0; nPar<nParCount; nPar++)
90
	{
90
	{
91
		if (nPar > 0)
91
		if (nPar > 0)
92
			aRet += ' ';
92
			aRet += c;
93
		aRet += rEngine.GetText( nPar );
93
		aRet += rEngine.GetText( nPar );
94
	}
94
	}
95
	return aRet;
95
	return aRet;
96
}
96
}
97
97
98
String ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
99
{
100
    return lcl_GetDelimitedString(rEngine, ' ');
101
}
102
103
String ScEditUtil::GetMultilineString( const EditEngine& rEngine )
104
{
105
    return lcl_GetDelimitedString(rEngine, '\n');
106
}
107
98
//------------------------------------------------------------------------
108
//------------------------------------------------------------------------
99
109
100
Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToTop )
110
Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToTop )
(-)sc/source/filter/excel/xestyle.cxx (-2 / +2 lines)
Lines 1921-1929 sal_uInt32 XclExpXFBuffer::InsertWithFont( const ScPatternAttr* pPattern, sal_In Link Here
1921
    return InsertCellXF( pPattern, nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, nForceXclFont, bForceLineBreak );
1921
    return InsertCellXF( pPattern, nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, nForceXclFont, bForceLineBreak );
1922
}
1922
}
1923
1923
1924
sal_uInt32 XclExpXFBuffer::InsertWithNumFmt( const ScPatternAttr* pPattern, sal_Int16 nScript, ULONG nForceScNumFmt )
1924
sal_uInt32 XclExpXFBuffer::InsertWithNumFmt( const ScPatternAttr* pPattern, sal_Int16 nScript, ULONG nForceScNumFmt, bool bForceLineBreak )
1925
{
1925
{
1926
    return InsertCellXF( pPattern, nScript, nForceScNumFmt, EXC_FONT_NOTFOUND, false );
1926
    return InsertCellXF( pPattern, nScript, nForceScNumFmt, EXC_FONT_NOTFOUND, bForceLineBreak );
1927
}
1927
}
1928
1928
1929
sal_uInt32 XclExpXFBuffer::InsertStyle( const SfxStyleSheetBase* pStyleSheet )
1929
sal_uInt32 XclExpXFBuffer::InsertStyle( const SfxStyleSheetBase* pStyleSheet )
(-)sc/source/filter/excel/xetable.cxx (-1 / +3 lines)
Lines 760-772 XclExpFormulaCell::XclExpFormulaCell( Link Here
760
760
761
        // #i41420# find script type according to result type (always latin for numeric results)
761
        // #i41420# find script type according to result type (always latin for numeric results)
762
        sal_Int16 nScript = ApiScriptType::LATIN;
762
        sal_Int16 nScript = ApiScriptType::LATIN;
763
        bool bForceLineBreak = false;
763
        if( nFormatType == NUMBERFORMAT_TEXT )
764
        if( nFormatType == NUMBERFORMAT_TEXT )
764
        {
765
        {
765
            String aResult;
766
            String aResult;
766
            mrScFmlaCell.GetString( aResult );
767
            mrScFmlaCell.GetString( aResult );
768
            bForceLineBreak = mrScFmlaCell.IsMultilineResult();
767
            nScript = XclExpStringHelper::GetLeadingScriptType( rRoot, aResult );
769
            nScript = XclExpStringHelper::GetLeadingScriptType( rRoot, aResult );
768
        }
770
        }
769
        SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt ) );
771
        SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt, bForceLineBreak ) );
770
    }
772
    }
771
773
772
    // *** Convert the formula token array *** --------------------------------
774
    // *** Convert the formula token array *** --------------------------------
(-)sc/source/filter/inc/xestyle.hxx (-1 / +4 lines)
Lines 602-611 public: Link Here
602
        @param nXFFlags  Additional flags allowing to control the creation of an XF.
602
        @param nXFFlags  Additional flags allowing to control the creation of an XF.
603
        @param nForceScNumFmt  The number format to be exported, e.g. formula
603
        @param nForceScNumFmt  The number format to be exported, e.g. formula
604
            result type. This format will always overwrite the cell's number format.
604
            result type. This format will always overwrite the cell's number format.
605
        @param bForceLineBreak  true = Set line break flag unconditionally.
606
            This is required for cells that contain multi-line text.
605
        @return  A unique XF record ID. */
607
        @return  A unique XF record ID. */
606
    sal_uInt32          InsertWithNumFmt(
608
    sal_uInt32          InsertWithNumFmt(
607
                            const ScPatternAttr* pPattern, sal_Int16 nScript,
609
                            const ScPatternAttr* pPattern, sal_Int16 nScript,
608
                            ULONG nForceScNumFmt );
610
                            ULONG nForceScNumFmt,
611
                            bool bForceLineBreak );
609
    /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
612
    /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
610
        @return  A unique XF record ID. */
613
        @return  A unique XF record ID. */
611
    sal_uInt32          InsertStyle( const SfxStyleSheetBase* pStyleSheet );
614
    sal_uInt32          InsertStyle( const SfxStyleSheetBase* pStyleSheet );
(-)sc/source/filter/xml/XMLExportIterator.cxx (+1 lines)
Lines 568-573 ScMyCell::ScMyCell() : Link Here
568
	aShapeList(),
568
	aShapeList(),
569
	aDetectiveObjVec(),
569
	aDetectiveObjVec(),
570
    nValidationIndex(-1),
570
    nValidationIndex(-1),
571
    pBaseCell(NULL),
571
	bIsAutoStyle( sal_False ),
572
	bIsAutoStyle( sal_False ),
572
	bHasShape( sal_False ),
573
	bHasShape( sal_False ),
573
	bIsMergedBase( sal_False ),
574
	bIsMergedBase( sal_False ),
(-)sc/source/filter/xml/XMLExportIterator.hxx (+3 lines)
Lines 48-53 class ScHorizontalCellIterator; Link Here
48
struct	ScMyCell;
48
struct	ScMyCell;
49
class	ScXMLExport;
49
class	ScXMLExport;
50
class	ScFormatRangeStyles;
50
class	ScFormatRangeStyles;
51
class   ScBaseCell;
51
52
52
//==============================================================================
53
//==============================================================================
53
54
Lines 312-317 struct ScMyCell Link Here
312
	sal_Int32					nNumberFormat;
313
	sal_Int32					nNumberFormat;
313
	com::sun::star::table::CellContentType	nType;
314
	com::sun::star::table::CellContentType	nType;
314
315
316
    ScBaseCell*                 pBaseCell;
317
315
	sal_Bool					bIsAutoStyle;
318
	sal_Bool					bIsAutoStyle;
316
319
317
	sal_Bool					bHasShape;
320
	sal_Bool					bHasShape;
(-)sc/source/filter/xml/xmlexprt.cxx (-3 / +31 lines)
Lines 2348-2354 void ScXMLExport::WriteCell (ScMyCell& aCell) Link Here
2348
2348
2349
	if (!bIsEmpty)
2349
	if (!bIsEmpty)
2350
	{
2350
	{
2351
		if ((aCell.nType == table::CellContentType_TEXT) && IsEditCell(aCell))
2351
        if ((aCell.nType == table::CellContentType_TEXT && IsEditCell(aCell)) || IsMultiLineFormulaCell(aCell))
2352
		{
2352
		{
2353
            bEditCell = sal_True;
2353
            bEditCell = sal_True;
2354
            uno::Reference<text::XText> xText(xCurrentTableCellRange->getCellByPosition(aCell.aCellAddress.Column, aCell.aCellAddress.Row), uno::UNO_QUERY);
2354
            uno::Reference<text::XText> xText(xCurrentTableCellRange->getCellByPosition(aCell.aCellAddress.Column, aCell.aCellAddress.Row), uno::UNO_QUERY);
Lines 2814-2825 sal_Bool ScXMLExport::IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& a Link Here
2814
	return (aCell1.nType == aCell2.nType);
2814
	return (aCell1.nType == aCell2.nType);
2815
}
2815
}
2816
2816
2817
sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress) const
2817
sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell) const
2818
{
2818
{
2819
	ScAddress aCoreAddress(static_cast<SCCOL>(aAddress.Column),
2819
	ScAddress aCoreAddress(static_cast<SCCOL>(aAddress.Column),
2820
						static_cast<SCROW>(aAddress.Row),
2820
						static_cast<SCROW>(aAddress.Row),
2821
						static_cast<SCTAB>(aAddress.Sheet));
2821
						static_cast<SCTAB>(aAddress.Sheet));
2822
	ScBaseCell* pBaseCell = GetDocument() ? GetDocument()->GetCell(aCoreAddress) : NULL;
2822
	ScBaseCell* pBaseCell = GetDocument() ? GetDocument()->GetCell(aCoreAddress) : NULL;
2823
    if (pMyCell)
2824
        pMyCell->pBaseCell = pBaseCell;
2825
2823
	if (pBaseCell)
2826
	if (pBaseCell)
2824
		return (pBaseCell->GetCellType() == CELLTYPE_EDIT);
2827
		return (pBaseCell->GetCellType() == CELLTYPE_EDIT);
2825
	return sal_False;
2828
	return sal_False;
Lines 2832-2843 sal_Bool ScXMLExport::IsEditCell(ScMyCell& rCell) const Link Here
2832
		return rCell.bIsEditCell;
2835
		return rCell.bIsEditCell;
2833
	else
2836
	else
2834
	{
2837
	{
2835
		rCell.bIsEditCell = IsEditCell(rCell.aCellAddress);
2838
		rCell.bIsEditCell = IsEditCell(rCell.aCellAddress, &rCell);
2836
		rCell.bKnowWhetherIsEditCell = sal_True;
2839
		rCell.bKnowWhetherIsEditCell = sal_True;
2837
		return rCell.bIsEditCell;
2840
		return rCell.bIsEditCell;
2838
	}
2841
	}
2839
}
2842
}
2840
2843
2844
sal_Bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell)
2845
{
2846
    if (rCell.pBaseCell)
2847
    {
2848
        if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
2849
            return false;
2850
2851
        return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
2852
    }
2853
2854
    ScDocument* pDoc = GetDocument();
2855
    ScAddress aAddr(static_cast<SCCOL>(rCell.aCellAddress.Column), 
2856
                    static_cast<SCROW>(rCell.aCellAddress.Row),
2857
                    static_cast<SCTAB>(rCell.aCellAddress.Sheet));
2858
    ScBaseCell* pBaseCell = pDoc ? pDoc->GetCell(aAddr) : NULL;
2859
    if (!pBaseCell)
2860
        return false;
2861
2862
    rCell.pBaseCell = pBaseCell;
2863
    if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
2864
        return false;
2865
2866
    return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
2867
}
2868
2841
sal_Bool ScXMLExport::IsAnnotationEqual(const uno::Reference<table::XCell>& /* xCell1 */,
2869
sal_Bool ScXMLExport::IsAnnotationEqual(const uno::Reference<table::XCell>& /* xCell1 */,
2842
                                        const uno::Reference<table::XCell>& /* xCell2 */)
2870
                                        const uno::Reference<table::XCell>& /* xCell2 */)
2843
{
2871
{
(-)sc/source/filter/xml/xmlexprt.hxx (-1 / +3 lines)
Lines 60-65 class XMLNumberFormatAttributesExportHelper; Link Here
60
class ScChartListener;
60
class ScChartListener;
61
class SfxItemPool;
61
class SfxItemPool;
62
class ScAddress;
62
class ScAddress;
63
class ScBaseCell;
63
64
64
typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec;
65
typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec;
65
66
Lines 180-188 class ScXMLExport : public SvXMLExport Link Here
180
	void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
181
	void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
181
182
182
	sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
183
	sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
183
	sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress) const;
184
	sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
184
	sal_Bool IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const;
185
	sal_Bool IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const;
185
	sal_Bool IsEditCell(ScMyCell& rCell) const;
186
	sal_Bool IsEditCell(ScMyCell& rCell) const;
187
    sal_Bool IsMultiLineFormulaCell(ScMyCell& rCell);
186
	sal_Bool IsAnnotationEqual(const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell1,
188
	sal_Bool IsAnnotationEqual(const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell1,
187
								const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell2);
189
								const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell2);
188
	sal_Bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);
190
	sal_Bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);
(-)sc/source/ui/app/transobj.cxx (-1 / +4 lines)
Lines 815-821 void ScTransferObj::StripRefs( ScDocument* pDoc, Link Here
815
				{
815
				{
816
					String aStr;
816
					String aStr;
817
					pFCell->GetString(aStr);
817
					pFCell->GetString(aStr);
818
					pNew = new ScStringCell( aStr );
818
                    if ( pFCell->IsMultilineResult() )
819
                        pNew = new ScEditCell( aStr, pDestDoc );
820
                    else
821
                        pNew = new ScStringCell( aStr );
819
				}
822
				}
820
				pDestDoc->PutCell( nCol,nRow,nDestTab, pNew );
823
				pDestDoc->PutCell( nCol,nRow,nDestTab, pNew );
821
824
(-)sc/source/ui/docshell/impex.cxx (+2 lines)
Lines 1606-1611 BOOL ScImportExport::Sylk2Doc( SvStream& rStrm ) Link Here
1606
1606
1607
BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
1607
BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
1608
{
1608
{
1609
    const String SYLK_LF = String::CreateFromAscii("\x1b :");
1609
	SCCOL nCol;
1610
	SCCOL nCol;
1610
	SCROW nRow;
1611
	SCROW nRow;
1611
	SCCOL nStartCol = aRange.aStart.Col();
1612
	SCCOL nStartCol = aRange.aStart.Col();
Lines 1660-1665 BOOL ScImportExport::Doc2Sylk( SvStream& rStrm ) Link Here
1660
				case CELLTYPE_EDIT:
1661
				case CELLTYPE_EDIT:
1661
				hasstring:
1662
				hasstring:
1662
					pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr );
1663
					pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr );
1664
                    aCellStr.SearchAndReplaceAll( _LF, SYLK_LF );
1663
1665
1664
					aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
1666
					aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
1665
					aBufStr += String::CreateFromInt32( c );
1667
					aBufStr += String::CreateFromInt32( c );
(-)sc/source/ui/view/output2.cxx (-2 / +4 lines)
Lines 1352-1362 void ScOutputData::DrawStrings( BOOL bPixelToLogic ) Link Here
1352
				}
1352
				}
1353
				if (bDoCell && !bNeedEdit)
1353
				if (bDoCell && !bNeedEdit)
1354
				{
1354
				{
1355
					if ( pCell->GetCellType() == CELLTYPE_FORMULA )
1355
					BOOL bFormulaCell = (pCell->GetCellType() == CELLTYPE_FORMULA );
1356
					if ( bFormulaCell )
1356
						lcl_CreateInterpretProgress( bProgress, pDoc, (ScFormulaCell*)pCell );
1357
						lcl_CreateInterpretProgress( bProgress, pDoc, (ScFormulaCell*)pCell );
1357
					if ( aVars.SetText(pCell) )
1358
					if ( aVars.SetText(pCell) )
1358
						pOldPattern = NULL;
1359
						pOldPattern = NULL;
1359
                    bNeedEdit = aVars.HasEditCharacters();
1360
                    bNeedEdit = aVars.HasEditCharacters() ||
1361
					                (bFormulaCell && ((ScFormulaCell*)pCell)->IsMultilineResult());
1360
                }
1362
                }
1361
                if (bDoCell && !bNeedEdit)
1363
                if (bDoCell && !bNeedEdit)
1362
                {
1364
                {

Return to issue 35913