sc/source/core/data/column3.cxx | 25 ++++++++++++++++++++----- sc/source/core/tool/token.cxx | 3 +++ sc/source/filter/xml/xmlexprt.cxx | 7 ------- 3 files changed, 23 insertions(+), 12 deletions(-)
New commits: commit 64ea6100c6a6b85bea1d01715b17724de045810a Author: Kohei Yoshida <[email protected]> Date: Tue Feb 18 22:57:39 2014 -0500 fdo#72491: Always set input as text when that's requested. Even when the text begins with '='. (cherry picked from commit ca50752c34de4477c696471b707e1b8136e27661) Conflicts: sc/source/core/data/column3.cxx Change-Id: I6e0a995f3042240b9f78068b5d0b9b758eb253ed diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c19662e..4bd6a5a 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1185,6 +1185,19 @@ void ScColumn::StartListeningInArea( sc::StartListeningContext& rCxt, SCROW nRow } } +namespace { + +void applyTextNumFormat( ScColumn& rCol, ScDocument& rDoc, SCROW nRow, SvNumberFormatter* pFormatter ) +{ + sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); + ScPatternAttr aNewAttrs(rDoc.GetPool()); + SfxItemSet& rSet = aNewAttrs.GetItemSet(); + rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat)); + rCol.ApplyPattern(nRow, aNewAttrs); +} + +} + bool ScColumn::ParseString( ScCellValue& rCell, SCROW nRow, SCTAB nTabP, const String& rString, formula::FormulaGrammar::AddressConvention eConv, @@ -1217,6 +1230,12 @@ bool ScColumn::ParseString( { if ( rString.Len() == 1 ) // = Text rCell.set(rString); + else if (aParam.meSetTextNumFormat == ScSetStringParam::Always) + { + // Set the cell format type to Text. + applyTextNumFormat(*this, *pDocument, nRow, aParam.mpNumFormatter); + rCell.set(rString); + } else // = Formula rCell.set( new ScFormulaCell( @@ -1325,11 +1344,7 @@ bool ScColumn::ParseString( if (aParam.meSetTextNumFormat != ScSetStringParam::Never && aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal)) { // Set the cell format type to Text. - sal_uInt32 nFormat = aParam.mpNumFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); - ScPatternAttr aNewAttrs(pDocument->GetPool()); - SfxItemSet& rSet = aNewAttrs.GetItemSet(); - rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) ); - ApplyPattern(nRow, aNewAttrs); + applyTextNumFormat(*this, *pDocument, nRow, aParam.mpNumFormatter); } rCell.set(rString); commit ad1aed031148f3e2278eb2c6e3c285cdf61160f7 Author: Kohei Yoshida <[email protected]> Date: Fri Feb 14 20:39:18 2014 -0500 fdo#72691: Allow overwriting of string value with numeric one. This can legitimately happen when you have a matrix with a reference to another cell inside, and the referenced cell originally contained a string value then later overwritten by a numeric value. Example. Put a "Text" in A1, and in B1 put a 1x1 matrix {=A1}. It displays "Text" in B1. Then put 11 in A1. Prior to this change, B1 would become blank. With this change, B1 will display 11. Change-Id: I3feba3a8658e1a5ebf6f9e5ac34de2d579464ddb (cherry picked from commit 9bf907a8278cecd816368db7b8c4ab745a914a59) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 3dff6a9..cd14c4c 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1084,6 +1084,9 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f ) case svDouble: const_cast<FormulaToken*>(xUpperLeft.get())->GetDoubleAsReference() = f; break; + case svString: + xUpperLeft = new FormulaDoubleToken( f); + break; case svUnknown: if (!xUpperLeft) { commit 827d589da74b3f6656a7e5726b106bc087ba9bd7 Author: Kohei Yoshida <[email protected]> Date: Fri Feb 14 11:41:02 2014 -0500 fdo#72390: Let's not skip auto styles from unmodified sheets. We do re-use sheet XML stream for unmodified sheets on re-save, which is okay. But skipping auto style population from unmodified sheets is not okay because autostyles are shared across all sheets and written outside the sheet XML streams. Skipping styles from unmodified sheets could potentially fail to export used styles, not to mention could cause a crash as reported in the bug. Change-Id: I73e439f7354e341c2c07e28ecca5452193985860 (cherry picked from commit 5000e64ecc55efd47d92714cf6db375ff37aac4b) (cherry picked from commit 47e540d8323e8ea2db5e7aae455503b32f306ca3) diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 09dc864..4b09c3b 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2322,10 +2322,6 @@ void ScXMLExport::_ExportAutoStyles() CollectShapesAutoStyles(nTableCount); for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable, IncrementProgressBar(false)) { - bool bUseStream = pSheetData && pDoc && pDoc->IsStreamValid((SCTAB)nTable) && - pSheetData->HasStreamPos(nTable) && xSourceStream.is() && - !pDoc->GetChangeTrack(); - Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY); if (!xTable.is()) continue; @@ -2344,9 +2340,6 @@ void ScXMLExport::_ExportAutoStyles() } } - if (bUseStream) - continue; - // collect other auto-styles only for non-copied sheets Reference<sheet::XUniqueCellFormatRangesSupplier> xCellFormatRanges ( xTable, uno::UNO_QUERY ); if ( xCellFormatRanges.is() ) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
