diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-25 15:33:49 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-25 16:11:09 +0200 |
commit | 1ecdc7aaf661e97a33cf521f553481d79cd26de2 (patch) | |
tree | 34811d2f9f17691c749622ff61a42b79f1da15d5 /sc/source/ui/docshell | |
parent | bb98778dbf761a0c88c96117add00a66e5cc6c95 (diff) |
resolved fdo#67249 use ScFieldEditEngine to resolve field content
ScEditUtil::GetString() iterated over the paragraphs of an
EditTextObject where GetText() does not resolve field content but
returns the embedded field markers. To resolve field content an
ScFieldEditEngine is needed.
This makes it necessary to pass an ScDocument* to obtain the
ScFieldEditEngine from, or for cases where there is no ScDocument in the
context use a static ScFieldEditEngine which unfortunately is not
capable of resolving document specific fields of course, such as
DOCINFO_TITLE and TABLE.
Also added unit test.
Change-Id: Ife3c23b2fec2514b32303239d276c49869786eb5
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 33535ac59835..4b39da6209bc 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1935,7 +1935,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt } else { - ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter); + ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &aDocument); bString = false; } } @@ -1985,7 +1985,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt } else { - ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter); + ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &aDocument); bString = false; } } diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index afa49ba356b0..c07913f882fe 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -940,7 +940,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck #if OSL_DEBUG_LEVEL > 0 OUString aValue; if ( eSourceType == SC_CAT_CONTENT ) - ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue ); + ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue, &aDocument ); OStringBuffer aError(OUStringToOString(aValue, osl_getThreadTextEncoding())); aError.append(RTL_CONSTASCII_STRINGPARAM(" weggelassen")); @@ -1005,7 +1005,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck OSL_ENSURE( aSourceRange.aStart == aSourceRange.aEnd, "huch?" ); ScAddress aPos = aSourceRange.aStart; OUString aValue; - ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue ); + ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue, &aDocument ); sal_uInt8 eMatrix = MM_NONE; const ScCellValue& rCell = ((const ScChangeActionContent*)pSourceAction)->GetNewCell(); if (rCell.meType == CELLTYPE_FORMULA) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 87a9b16c84fa..4ab3d03ff747 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1274,7 +1274,7 @@ static FormulaToken* convertToToken( ScRefCellValue& rCell ) { case CELLTYPE_EDIT: case CELLTYPE_STRING: - return new formula::FormulaStringToken(rCell.getString()); + return new formula::FormulaStringToken(rCell.getString(NULL)); case CELLTYPE_VALUE: return new formula::FormulaDoubleToken(rCell.mfValue); case CELLTYPE_FORMULA: @@ -1364,7 +1364,7 @@ static ScTokenArray* convertToTokenArray( { case CELLTYPE_EDIT: case CELLTYPE_STRING: - xMat->PutString(aCell.getString(), nC, nR); + xMat->PutString(aCell.getString(NULL), nC, nR); break; case CELLTYPE_VALUE: xMat->PutDouble(aCell.mfValue, nC, nR); |