diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-28 13:08:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-29 14:22:48 +0100 |
commit | 0ef5c47547bec6319b853326603f3b807407fe78 (patch) | |
tree | ced33b9ae621fa1cd807f8647a5149eed8bc743b /sc/source/filter/excel | |
parent | 07bde58988705ca45a619eb7a4e670a5d951abf6 (diff) |
sc: rowcol: tdf#50916 convert core/tool
Change-Id: I0fe5a7ef4a79d0832802945ce1b9da4752f1d5fc
Reviewed-on: https://gerrit.libreoffice.org/81598
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/excrecds.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/excel/xedbdata.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xeextlst.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xelink.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xepivotxml.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xeview.cxx | 2 |
10 files changed, 26 insertions, 23 deletions
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index b4da8ba38617..4fbe955d8b52 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -484,7 +484,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) XML_hashValue, rProt.maPasswordHash.maHashValue.isEmpty() ? nullptr : rProt.maPasswordHash.maHashValue.toUtf8().getStr(), XML_saltValue, rProt.maPasswordHash.maSaltValue.isEmpty() ? nullptr : rProt.maPasswordHash.maSaltValue.toUtf8().getStr(), XML_spinCount, rProt.maPasswordHash.mnSpinCount ? OString::number( rProt.maPasswordHash.mnSpinCount).getStr() : nullptr, - XML_sqref, rProt.maRangeList.is() ? XclXmlUtils::ToOString( *rProt.maRangeList).getStr() : nullptr); + XML_sqref, rProt.maRangeList.is() ? XclXmlUtils::ToOString( &rStrm.GetRoot().GetDoc(), *rProt.maRangeList).getStr() : nullptr); } rWorksheet->endElement( XML_protectedRanges); } @@ -986,7 +986,7 @@ void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm ) return; sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); - rWorksheet->startElement(XML_autoFilter, XML_ref, XclXmlUtils::ToOString(maRef)); + rWorksheet->startElement(XML_autoFilter, XML_ref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), maRef)); // OOXTODO: XML_extLst, XML_sortState if( !maFilterList.IsEmpty() ) maFilterList.SaveXml( rStrm ); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 38155ca6eaa8..d1fa70c52dd5 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -309,7 +309,8 @@ void XclExpMergedcells::SaveXml( XclExpXmlStream& rStrm ) for( size_t i = 0; i < nCount; ++i ) { const ScRange & rRange = maMergedRanges[ i ]; - rWorksheet->singleElement(XML_mergeCell, XML_ref, XclXmlUtils::ToOString(rRange)); + rWorksheet->singleElement(XML_mergeCell, XML_ref, + XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), rRange)); } rWorksheet->endElement( XML_mergeCells ); } @@ -521,7 +522,7 @@ void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm ) oox::getRelationship(Relationship::HYPERLINK), msTarget, true ) : OUString(); rStrm.GetCurrentStream()->singleElement( XML_hyperlink, - XML_ref, XclXmlUtils::ToOString(maScPos), + XML_ref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), maScPos), FSNS( XML_r, XML_id ), !sId.isEmpty() ? sId.toUtf8().getStr() : nullptr, @@ -1356,7 +1357,7 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat else if(pFormatEntry->GetType() == ScFormatEntry::Type::Date) maCFList.AppendNewRecord( new XclExpDateFormat( GetRoot(), static_cast<const ScCondDateFormatEntry&>(*pFormatEntry), ++rIndex ) ); } - aScRanges.Format( msSeqRef, ScRefFlags::VALID, nullptr, formula::FormulaGrammar::CONV_XL_OOX, ' ', true ); + aScRanges.Format( msSeqRef, ScRefFlags::VALID, &GetDoc(), formula::FormulaGrammar::CONV_XL_OOX, ' ', true ); if(!aExtEntries.empty() && xExtLst.get()) { @@ -1850,7 +1851,7 @@ void XclExpDV::SaveXml( XclExpXmlStream& rStrm ) XML_showDropDown, ToPsz( ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ), XML_showErrorMessage, ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWERROR ) ), XML_showInputMessage, ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWPROMPT ) ), - XML_sqref, XclXmlUtils::ToOString(maScRanges), + XML_sqref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), maScRanges), XML_type, lcl_GetValidationType(mnFlags) ); if( !msFormula1.isEmpty() ) { diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx index 416cb34da9a6..7dfb44eec058 100644 --- a/sc/source/filter/excel/xedbdata.cxx +++ b/sc/source/filter/excel/xedbdata.cxx @@ -182,7 +182,7 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ) XML_id, OString::number( rEntry.mnTableId), XML_name, rData.GetName().toUtf8(), XML_displayName, rData.GetName().toUtf8(), - XML_ref, XclXmlUtils::ToOString(aRange), + XML_ref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aRange), XML_headerRowCount, ToPsz10(rData.HasHeader()), XML_totalsRowCount, ToPsz10(rData.HasTotals()), XML_totalsRowShown, ToPsz10(rData.HasTotals()) // we don't support that but if there are totals they are shown diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 097eabd9f575..c49e6a709177 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1146,6 +1146,7 @@ const css::uno::Reference<css::chart::XChartDocument>& XclExpChartObj::GetChartD XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos, const ScPostIt* pScNote, const OUString& rAddText) : XclExpRecord(EXC_ID_NOTE) + , mrRoot(rRoot) , maScPos(rScPos) , mnObjId(EXC_OBJ_INVALID_ID) , mbVisible(pScNote && pScNote->IsCaptionShown()) @@ -1284,7 +1285,7 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm ) sax_fastparser::FSHelperPtr rComments = rStrm.GetCurrentStream(); rComments->startElement( XML_comment, - XML_ref, XclXmlUtils::ToOString(maScPos), + XML_ref, XclXmlUtils::ToOString(&mrRoot.GetDoc(), maScPos), XML_authorId, OString::number(nAuthorId) // OOXTODO: XML_guid ); diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index c2764b43da26..a3c25320ff72 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -464,7 +464,7 @@ void XclExpExtConditionalFormatting::SaveXml( XclExpXmlStream& rStrm ) maCfRules.SaveXml( rStrm ); rWorksheet->startElementNS(XML_xm, XML_sqref); - rWorksheet->write(XclXmlUtils::ToOString(maRange)); + rWorksheet->write(XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), maRange)); rWorksheet->endElementNS( XML_xm, XML_sqref ); diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 20fe2c914553..70603454b68d 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1230,26 +1230,26 @@ void XclExpCrn::SaveXml( XclExpXmlStream& rStrm ) if (rtl::math::isFinite( fVal)) { // t='n' is omitted - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(aAdr)); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aAdr)); pFS->startElement(XML_v); pFS->write( fVal ); } else { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(aAdr), XML_t, "e"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aAdr), XML_t, "e"); pFS->startElement(XML_v); pFS->write( "#VALUE!" ); // OOXTODO: support other error values } } else if( rValue.has< OUString >() ) { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(aAdr), XML_t, "str"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aAdr), XML_t, "str"); pFS->startElement(XML_v); pFS->write( rValue.get< OUString >() ); } else if( rValue.has< bool >() ) { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(aAdr), XML_t, "b"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aAdr), XML_t, "b"); pFS->startElement(XML_v); pFS->write( rValue.get< bool >() ? "1" : "0" ); } diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index f39bab0e63bf..e5af3d924863 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -271,7 +271,7 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr OUString aSheetName; GetDoc().GetName(rEntry.maSrcRange.aStart.Tab(), aSheetName); pDefStrm->singleElement(XML_worksheetSource, - XML_ref, XclXmlUtils::ToOString(rEntry.maSrcRange), + XML_ref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), rEntry.maSrcRange), XML_sheet, aSheetName.toUtf8()); pDefStrm->endElement(XML_cacheSource); @@ -864,7 +864,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP pPivotStrm->write("<")->writeId(XML_location); rStrm.WriteAttributes(XML_ref, - XclXmlUtils::ToOString(aOutRange), + XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), aOutRange), XML_firstHeaderRow, OUString::number(nFirstHeaderRow), XML_firstDataRow, OUString::number(nFirstDataRow), XML_firstDataCol, OUString::number(nFirstDataCol)); diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 937a7d0c8ed2..2a2518840828 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -718,18 +718,18 @@ OString XclXmlUtils::ToOString( const ScfUInt16Vec& rBuffer ) RTL_TEXTENCODING_UTF8); } -OString XclXmlUtils::ToOString( const ScRange& rRange, bool bFullAddressNotation ) +OString XclXmlUtils::ToOString( const ScDocument* pDoc, const ScRange& rRange, bool bFullAddressNotation ) { - OUString sRange(rRange.Format( ScRefFlags::VALID, nullptr, + OUString sRange(rRange.Format( ScRefFlags::VALID, pDoc, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ), bFullAddressNotation ) ); return sRange.toUtf8(); } -OString XclXmlUtils::ToOString( const ScRangeList& rRangeList ) +OString XclXmlUtils::ToOString( const ScDocument* pDoc, const ScRangeList& rRangeList ) { OUString s; - rRangeList.Format(s, ScRefFlags::VALID, nullptr, FormulaGrammar::CONV_XL_OOX, ' '); + rRangeList.Format(s, ScRefFlags::VALID, pDoc, FormulaGrammar::CONV_XL_OOX, ' '); return s.toUtf8(); } @@ -768,14 +768,14 @@ static ScRange lcl_ToRange( const XclRange& rRange ) return aRange; } -OString XclXmlUtils::ToOString( const XclRangeList& rRanges ) +OString XclXmlUtils::ToOString( const ScDocument* pDoc, const XclRangeList& rRanges ) { ScRangeList aRanges; for( const auto& rRange : rRanges ) { aRanges.push_back( lcl_ToRange( rRange ) ); } - return ToOString( aRanges ); + return ToOString( pDoc, aRanges ); } OUString XclXmlUtils::ToOUString( const char* s ) diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index d7a3adf8f7e6..27c7a4960da5 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1480,6 +1480,7 @@ void XclExpGuts::WriteBody( XclExpStream& rStrm ) } XclExpDimensions::XclExpDimensions( const XclExpRoot& rRoot ) : + mrRoot(rRoot), mnFirstUsedXclRow( 0 ), mnFirstFreeXclRow( 0 ), mnFirstUsedXclCol( 0 ), @@ -1523,7 +1524,7 @@ void XclExpDimensions::SaveXml( XclExpXmlStream& rStrm ) // To be compatible with MS Office 2007, // we need full address notation format // e.g. "A1:AMJ177" and not partial like: "1:177". - XML_ref, XclXmlUtils::ToOString(aRange, true) ); + XML_ref, XclXmlUtils::ToOString(&mrRoot.GetDoc(), aRange, true) ); } void XclExpDimensions::WriteBody( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 91a372700560..b7efb0ac1a27 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -232,7 +232,7 @@ void XclExpSelection::SaveXml( XclExpXmlStream& rStrm ) XML_pane, lcl_GetActivePane( mnPane ), XML_activeCell, XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), maSelData.maXclCursor ).getStr(), XML_activeCellId, OString::number(maSelData.mnCursorIdx), - XML_sqref, XclXmlUtils::ToOString(maSelData.maXclSelection) ); + XML_sqref, XclXmlUtils::ToOString(&rStrm.GetRoot().GetDoc(), maSelData.maXclSelection) ); } void XclExpSelection::WriteBody( XclExpStream& rStrm ) |