diff options
27 files changed, 73 insertions, 73 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 03d60bf97ee4..fce2fc648275 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -551,7 +551,7 @@ public: inline bool In( const ScAddress& ) const; ///< is Address& in Range? inline bool In( const ScRange& ) const; ///< is Range& in Range? - SC_DLLPUBLIC ScRefFlags Parse( const OUString&, const ScDocument*, + SC_DLLPUBLIC ScRefFlags Parse( const OUString&, const ScDocument&, const ScAddress::Details& rDetails = ScAddress::detailsOOOa1, ScAddress::ExternalInfo* pExtInfo = nullptr, const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks = nullptr, diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx index 8801e9690b3d..7fdb6a33d23d 100644 --- a/sc/qa/extras/anchor.cxx +++ b/sc/qa/extras/anchor.cxx @@ -267,13 +267,13 @@ void ScAnchorTest::testCopyColumnWithImages() { // 1. Copy source range ScRange aSrcRange; - aSrcRange.Parse("A1:A11", pDoc, pDoc->GetAddressConvention()); + aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange); pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false); // 2. Paste to target range ScRange aDstRange; - aDstRange.Parse("D1:D11", pDoc, pDoc->GetAddressConvention()); + aDstRange.Parse("D1:D11", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange); pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc); @@ -290,13 +290,13 @@ void ScAnchorTest::testCopyColumnWithImages() { // 1. Copy source cells ScRange aSrcRange; - aSrcRange.Parse("A3:B3", pDoc, pDoc->GetAddressConvention()); + aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange); pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false); // 2. Paste to target cells ScRange aDstRange; - aDstRange.Parse("G3:H3", pDoc, pDoc->GetAddressConvention()); + aDstRange.Parse("G3:H3", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange); pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc); @@ -337,7 +337,7 @@ void ScAnchorTest::testCutWithImages() { // Cut source range ScRange aSrcRange; - aSrcRange.Parse("A1:A11", pDoc, pDoc->GetAddressConvention()); + aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange); pViewShell->GetViewData().GetView()->CutToClip(); @@ -355,7 +355,7 @@ void ScAnchorTest::testCutWithImages() { // Cut source cells ScRange aSrcRange; - aSrcRange.Parse("A3:B3", pDoc, pDoc->GetAddressConvention()); + aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention()); pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange); pViewShell->GetViewData().GetView()->CutToClip(); diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx index a15dee9aad62..70971c1d804a 100644 --- a/sc/qa/unit/copy_paste_test.cxx +++ b/sc/qa/unit/copy_paste_test.cxx @@ -90,7 +90,7 @@ void ScCopyPasteTest::testCopyPasteXLS() // 2. Highlight B2:C5 ScRange aSrcRange; - ScRefFlags nRes = aSrcRange.Parse("B2:C5", &rDoc, rDoc.GetAddressConvention()); + ScRefFlags nRes = aSrcRange.Parse("B2:C5", rDoc, rDoc.GetAddressConvention()); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); ScMarkData aMark(rDoc.GetSheetLimits()); @@ -150,7 +150,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, ScDocument& // 1. Copy ScRange aSrcRange; - ScRefFlags nRes = aSrcRange.Parse(rSrcRange, &rDoc, rDoc.GetAddressConvention()); + ScRefFlags nRes = aSrcRange.Parse(rSrcRange, rDoc, rDoc.GetAddressConvention()); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange); pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aSrcRange)); @@ -158,7 +158,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, ScDocument& // 2. Paste ScRange aDstRange; - nRes = aDstRange.Parse(rDstRange, &rDoc, rDoc.GetAddressConvention()); + nRes = aDstRange.Parse(rDstRange, rDoc, rDoc.GetAddressConvention()); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange); pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aDstRange)); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 560d4c51fd21..b0a6084d9db9 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -396,7 +396,7 @@ ScRangeList getChartRanges(ScDocument& rDoc, const SdrOle2Obj& rChartObj) for (size_t i = 0, n = aRangeReps.size(); i < n; ++i) { ScRange aRange; - ScRefFlags nRes = aRange.Parse(aRangeReps[i], &rDoc, rDoc.GetAddressConvention()); + ScRefFlags nRes = aRange.Parse(aRangeReps[i], rDoc, rDoc.GetAddressConvention()); if (nRes & ScRefFlags::VALID) // This is a range address. aRanges.push_back(aRange); diff --git a/sc/qa/unit/range.cxx b/sc/qa/unit/range.cxx index 7ca6e631caf0..f20def220318 100644 --- a/sc/qa/unit/range.cxx +++ b/sc/qa/unit/range.cxx @@ -82,7 +82,7 @@ void ScRangeTest::testRangeParsing() { ScRange aRange; ScDocument& rDoc = m_xDocShRef->GetDocument(); - ScRefFlags nRes = aRange.Parse(":1", &rDoc, formula::FormulaGrammar::CONV_OOO); + ScRefFlags nRes = aRange.Parse(":1", rDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); } diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 42118a15fc4c..e2033cadebc6 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -4326,7 +4326,7 @@ void ScFiltersTest::testEmptyRowsXLSXML() }; ScRange aDataRange; - aDataRange.Parse("A1:B9", &rDoc); + aDataRange.Parse("A1:B9", rDoc); bool bSuccess = checkOutput(&rDoc, aDataRange, aOutputCheck, "Expected output"); CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess); } diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index b82f1271fb12..00bffef9de29 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -317,47 +317,47 @@ void Test::testFormulaParseReference() ScRange aRange; aRange.aStart.SetTab(0); - nRes = aRange.Parse(":B", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse(":B", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse(":B2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse(":B2", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("B2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("B2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse(":2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse(":2", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse(":2B", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse(":2B", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("2B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("2B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("abc_foo:abc_bar", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("abc_foo:abc_bar", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("B1:B2~C1", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("B1:B2~C1", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID)); aRange.aStart.SetTab(0); - nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("B:B", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col()); @@ -375,7 +375,7 @@ void Test::testFormulaParseReference() static_cast<sal_uInt16>(nRes & (ScRefFlags::ROW_ABS | ScRefFlags::ROW2_ABS))); aRange.aStart.SetTab(0); - nRes = aRange.Parse("2:2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("2:2", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col()); @@ -392,7 +392,7 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS), static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS))); - nRes = aRange.Parse("NoQuote.B:C", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("NoQuote.B:C", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aRange.aStart.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col()); @@ -411,7 +411,7 @@ void Test::testFormulaParseReference() // Both rows at sheet bounds and relative => convert to absolute => entire column reference. aRange.aStart.SetTab(0); - nRes = aRange.Parse("B1:B1048576", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("B1:B1048576", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col()); @@ -430,7 +430,7 @@ void Test::testFormulaParseReference() // Both columns at sheet bounds and relative => convert to absolute => entire row reference. aRange.aStart.SetTab(0); - nRes = aRange.Parse("A2:AMJ2", m_pDoc, formula::FormulaGrammar::CONV_OOO); + nRes = aRange.Parse("A2:AMJ2", *m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID)); CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab()); CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col()); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 4596074e102a..39e950aa0418 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1524,7 +1524,7 @@ bool ConvertDoubleRef( const ScDocument& rDoc, const OUString& rRefString, SCTAB if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == -1)) { ScRange aRange( ScAddress( 0, 0, nDefTab)); - ScRefFlags nRes = aRange.Parse( rRefString, &rDoc, rDetails, pExtInfo); + ScRefFlags nRes = aRange.Parse( rRefString, rDoc, rDetails, pExtInfo); if ( nRes & ScRefFlags::VALID ) { rStartRefAddress.Set( aRange.aStart, @@ -1735,7 +1735,7 @@ static ScRefFlags lcl_ScRange_Parse_OOo( ScRange& rRange, return nRes1; } -ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc, +ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument& rDoc, const ScAddress::Details& rDetails, ScAddress::ExternalInfo* pExtInfo, const uno::Sequence<sheet::ExternalLinkInfo>* pExternalLinks, @@ -1749,20 +1749,20 @@ ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc, case formula::FormulaGrammar::CONV_XL_A1: case formula::FormulaGrammar::CONV_XL_OOX: { - return lcl_ScRange_Parse_XL_A1( *this, rString.getStr(), pDoc, false, pExtInfo, + return lcl_ScRange_Parse_XL_A1( *this, rString.getStr(), &rDoc, false, pExtInfo, (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : nullptr), nullptr, pErrRef ); } case formula::FormulaGrammar::CONV_XL_R1C1: { - return lcl_ScRange_Parse_XL_R1C1( *this, rString.getStr(), pDoc, rDetails, false, pExtInfo, nullptr ); + return lcl_ScRange_Parse_XL_R1C1( *this, rString.getStr(), &rDoc, rDetails, false, pExtInfo, nullptr ); } default: case formula::FormulaGrammar::CONV_OOO: { - return lcl_ScRange_Parse_OOo( *this, rString, pDoc, pExtInfo, pErrRef ); + return lcl_ScRange_Parse_OOo( *this, rString, &rDoc, pExtInfo, pErrRef ); } } } @@ -1771,7 +1771,7 @@ ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc, ScRefFlags ScRange::ParseAny( const OUString& rString, const ScDocument& rDoc, const ScAddress::Details& rDetails ) { - ScRefFlags nRet = Parse( rString, &rDoc, rDetails ); + ScRefFlags nRet = Parse( rString, rDoc, rDetails ); const ScRefFlags nValid = ScRefFlags::VALID | ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID; if ( (nRet & nValid) != nValid ) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 134f89d68612..d9ceab95ea8f 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3190,7 +3190,7 @@ bool ScCompiler::IsDoubleReference( const OUString& rName, const OUString* pErrR ScRange aRange( aPos, aPos ); const ScAddress::Details aDetails( pConv->meConv, aPos ); ScAddress::ExternalInfo aExtInfo; - ScRefFlags nFlags = aRange.Parse( rName, &rDoc, aDetails, &aExtInfo, &maExternalLinks, pErrRef ); + ScRefFlags nFlags = aRange.Parse( rName, rDoc, aDetails, &aExtInfo, &maExternalLinks, pErrRef ); if( nFlags & ScRefFlags::VALID ) { ScComplexRefData aRef; diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index 5f84aa08742f..5fa5cf59c3db 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -451,7 +451,7 @@ void ScRangeData::MakeValidName( const ScDocument& rDoc, OUString& rName ) ScAddress::Details details( static_cast<FormulaGrammar::AddressConvention>( nConv ) ); // Don't check Parse on VALID, any partial only VALID may result in // #REF! during compile later! - while (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO || + while (aRange.Parse(rName, rDoc, details) != ScRefFlags::ZERO || aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO) { // Range Parse is partially valid also with invalid sheet name, @@ -487,7 +487,7 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, co ScAddress::Details details( static_cast<FormulaGrammar::AddressConvention>( nConv ) ); // Don't check Parse on VALID, any partial only VALID may result in // #REF! during compile later! - if (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO || + if (aRange.Parse(rName, rDoc, details) != ScRefFlags::ZERO || aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO ) { return NAME_INVALID_CELL_REF; diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 49a5d227614b..034c0063a492 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -497,7 +497,7 @@ bool ScRangeStringConverter::GetRangeFromString( aUIString[ nIndex + 1 ] == '.' ) aUIString = aUIString.replaceAt( nIndex + 1, 1, "" ); - bResult = ((rRange.Parse(aUIString, &rDocument, eConv) & ScRefFlags::VALID) == + bResult = ((rRange.Parse(aUIString, rDocument, eConv) & ScRefFlags::VALID) == ScRefFlags::VALID); // #i77703# chart ranges in the file format contain both sheet names, even for an external reference sheet. diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index ed729725695d..5881990eb535 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -309,10 +309,10 @@ OUString XclExpName::GetWithDefaultRangeSeparator( const OUString& rSymbol ) con // convert with validation ScRange aRange; ScAddress::Details detailsXL( ::formula::FormulaGrammar::CONV_XL_A1 ); - ScRefFlags nRes = aRange.Parse( rSymbol.copy(0, nPos), &GetDoc(), detailsXL ); + ScRefFlags nRes = aRange.Parse( rSymbol.copy(0, nPos), GetDoc(), detailsXL ); if ( nRes & ScRefFlags::VALID ) { - nRes = aRange.Parse( rSymbol.copy(nPos+1), &GetDoc(), detailsXL ); + nRes = aRange.Parse( rSymbol.copy(nPos+1), GetDoc(), detailsXL ); if ( nRes & ScRefFlags::VALID ) { return rSymbol.replaceFirst(";", ","); diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx index 537149108597..69d5786fe0ec 100644 --- a/sc/source/filter/oox/revisionfragment.cxx +++ b/sc/source/filter/oox/revisionfragment.cxx @@ -410,7 +410,7 @@ void RevisionLogFragment::importRrc( const AttributeList& rAttribs ) return; OUString aRefStr = rAttribs.getString(XML_ref, OUString()); - mpImpl->maRange.Parse(aRefStr, &getScDocument(), formula::FormulaGrammar::CONV_XL_OOX); + mpImpl->maRange.Parse(aRefStr, getScDocument(), formula::FormulaGrammar::CONV_XL_OOX); if (!mpImpl->maRange.IsValid()) return; diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index ccce5bb9e436..142f78a5205b 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -188,7 +188,7 @@ os::src_range_t ScOrcusRefResolver::resolve_range(const char* p, size_t n) OUString aStr(p, n, mrGlobalSettings.getTextEncoding()); ScRange aRange; - aRange.Parse(aStr, &mrGlobalSettings.getDoc().getDoc(), + aRange.Parse(aStr, mrGlobalSettings.getDoc().getDoc(), formula::FormulaGrammar::extractRefConvention( mrGlobalSettings.getCalcGrammar())); diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 11c0b9b792ad..59073a9b3516 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1171,26 +1171,26 @@ GetEditAs( const XclObjAny& rObj ) namespace { -ScRefFlags parseRange(const OUString& rString, ScRange& rRange, const ScDocument* pDoc) +ScRefFlags parseRange(const OUString& rString, ScRange& rRange, const ScDocument& rDoc) { // start with the address convention set in the document - formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); - ScRefFlags nResult = rRange.Parse(rString, pDoc, eConv); + formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention(); + ScRefFlags nResult = rRange.Parse(rString, rDoc, eConv); if ( nResult & ScRefFlags::VALID ) return nResult; // try the default calc address convention - nResult = rRange.Parse(rString, pDoc); + nResult = rRange.Parse(rString, rDoc); if ( nResult & ScRefFlags::VALID ) return nResult; // try excel a1 - nResult = rRange.Parse(rString, pDoc, formula::FormulaGrammar::CONV_XL_A1); + nResult = rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_A1); if ( nResult & ScRefFlags::VALID ) return nResult; // try r1c1 - return rRange.Parse(rString, pDoc, formula::FormulaGrammar::CONV_XL_R1C1); + return rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_R1C1); } ScRefFlags parseAddress(const OUString& rString, ScAddress& rAddress, const ScDocument* pDoc) @@ -1226,7 +1226,7 @@ void transformURL(const OUString& rOldURL, OUString& rNewURL, const ScDocument& ScRange aRange; ScAddress aAddress; - ScRefFlags nResult = parseRange(aAddressString, aRange, &rDoc); + ScRefFlags nResult = parseRange(aAddressString, aRange, rDoc); if ( nResult & ScRefFlags::VALID ) { OUString aString = aRange.Format(rDoc, nResult, formula::FormulaGrammar::CONV_XL_OOX); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 9c008807e3b4..23e7c0cb2af0 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1756,7 +1756,7 @@ static OUString lcl_Calculate( const OUString& rFormula, ScDocument& rDoc, const } ScRange aTestRange; - if ( bColRowName || (aTestRange.Parse(rFormula, &rDoc) & ScRefFlags::VALID) ) + if ( bColRowName || (aTestRange.Parse(rFormula, rDoc) & ScRefFlags::VALID) ) aValue += " ..."; return aValue; diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index ddece83a3b2a..f2e36c577f40 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2326,7 +2326,7 @@ static ScNameInputType lcl_GetInputType( const OUString& rText ) if (rText == ScResId(STR_MANAGE_NAMES)) eRet = SC_MANAGE_NAMES; - else if ( aRange.Parse( rText, &rDoc, eConv ) & ScRefFlags::VALID ) + else if ( aRange.Parse( rText, rDoc, eConv ) & ScRefFlags::VALID ) eRet = SC_NAME_INPUT_RANGE; else if ( aAddress.Parse( rText, &rDoc, eConv ) & ScRefFlags::VALID ) eRet = SC_NAME_INPUT_CELL; diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index f8aa54ad60d4..2b1ab6abc576 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -407,7 +407,7 @@ void ScPivotLayoutDialog::UpdateSourceRange() { OUString aSourceString = mxSourceEdit->GetText(); ScRange aSourceRange; - ScRefFlags nResult = aSourceRange.Parse(aSourceString, &mrDocument, maAddressDetails); + ScRefFlags nResult = aSourceRange.Parse(aSourceString, mrDocument, maAddressDetails); bool bIsValid = (nResult & ScRefFlags::VALID) == ScRefFlags::VALID; // aSourceString is valid diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 585e862d3c33..cd2c84a5b885 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -287,7 +287,7 @@ IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button&, rBtn, void) if ( bEditInputOk ) { - ScRefFlags nResult = ScRange().Parse( theAreaStr, pDoc, eConv ); + ScRefFlags nResult = ScRange().Parse( theAreaStr, *pDoc, eConv ); if ( (nResult & ScRefFlags::VALID) == ScRefFlags::ZERO ) { @@ -304,7 +304,7 @@ IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button&, rBtn, void) * a ScQueryParam from the filter area: */ - ScRefFlags nResult = theFilterArea.Parse( theAreaStr, pDoc, eConv ); + ScRefFlags nResult = theFilterArea.Parse( theAreaStr, *pDoc, eConv ); if ( (nResult & ScRefFlags::VALID) == ScRefFlags::VALID ) { @@ -413,7 +413,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit&, rEd, void ) if ( pDoc && pViewData ) { OUString theCurAreaStr = rEd.GetText(); - ScRefFlags nResult = ScRange().Parse( theCurAreaStr, pDoc ); + ScRefFlags nResult = ScRange().Parse( theCurAreaStr, *pDoc ); if ( (nResult & ScRefFlags::VALID) == ScRefFlags::VALID ) { diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index eadec19d03ee..8b752a0f5411 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2459,7 +2459,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem, // because the address item in a DDE entry is *not* normalized when saved // into ODF. ScRange aRange; - bool bValid = ( (aRange.Parse(aPos, &m_aDocument, formula::FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID) || + bool bValid = ( (aRange.Parse(aPos, m_aDocument, formula::FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID) || (aRange.aStart.Parse(aPos, &m_aDocument, formula::FormulaGrammar::CONV_OOO) & ScRefFlags::VALID) ); ScServerObject* pObj = nullptr; // NULL = error diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 4bae9f2a798b..68df1169a93f 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -183,7 +183,7 @@ ScImportExport::ScImportExport( ScDocument& r, const OUString& rPos ) } formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention(); // Range? - if (aRange.Parse(aPos, &rDoc, eConv) & ScRefFlags::VALID) + if (aRange.Parse(aPos, rDoc, eConv) & ScRefFlags::VALID) bSingle = false; // Cell? else if (aRange.aStart.Parse(aPos, &rDoc, eConv) & ScRefFlags::VALID) diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index 02d87033a00d..84287b3f93d1 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -87,7 +87,7 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const OUString& rItem ) : // For DDE link, we always must parse references using OOO A1 convention. - if ( aRange.Parse( rItem, &rDoc, FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID ) + if ( aRange.Parse( rItem, rDoc, FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID ) { // area reference } diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 36a8905fa10e..20f60edbc6c4 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -350,7 +350,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult } ScRange aTestRange; - if ( bColRowName || (aTestRange.Parse(rStrExp, m_pDoc) & ScRefFlags::VALID) ) + if ( bColRowName || (aTestRange.Parse(rStrExp, *m_pDoc) & ScRefFlags::VALID) ) rStrResult += " ..."; // area } diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx index bdc42cdd5be8..f56b09149a83 100644 --- a/sc/source/ui/miscdlgs/datastreamdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx @@ -106,7 +106,7 @@ ScRange DataStreamDlg::GetStartRange() OUString aStr = m_xEdRange->get_text(); ScDocument& rDoc = m_pDocShell->GetDocument(); ScRange aRange; - ScRefFlags nRes = aRange.Parse(aStr, &rDoc, rDoc.GetAddressConvention()); + ScRefFlags nRes = aRange.Parse(aStr, rDoc, rDoc.GetAddressConvention()); if ( ((nRes & ScRefFlags::VALID) == ScRefFlags::ZERO) || !aRange.IsValid()) { // Invalid range. diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 9ac58fb569d6..42223748f0f9 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -332,7 +332,7 @@ bool ScPrintAreasDlg::Impl_CheckRefStrings() for ( sal_Int32 nIdx = 0; nIdx >= 0; ) { const OUString aOne = aStrPrintArea.getToken(0, sep, nIdx); - ScRefFlags nResult = aRange.Parse( aOne, pDoc, eConv ); + ScRefFlags nResult = aRange.Parse( aOne, *pDoc, eConv ); if ((nResult & nValidRange) != nValidRange) { ScRefFlags nAddrResult = aAddr.Parse( aOne, pDoc, eConv ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 948cef3aa6ee..237441bffef2 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1397,7 +1397,7 @@ static bool lcl_ParseTarget( const OUString& rTarget, ScRange& rTargetRange, too bool bRangeValid = false; bool bRectValid = false; - if ( rTargetRange.Parse( rTarget, &rDoc ) & ScRefFlags::VALID ) + if ( rTargetRange.Parse( rTarget, rDoc ) & ScRefFlags::VALID ) { bRangeValid = true; // range reference } diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 86961c989cc5..5d94edb3ba99 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -84,22 +84,22 @@ namespace }; ScRefFlagsAndType lcl_ParseRangeOrAddress(ScRange& rScRange, ScAddress& rScAddress, - const OUString& aAddress, const ScDocument* pDoc) + const OUString& aAddress, const ScDocument& rDoc) { ScRefFlagsAndType aRet; formula::FormulaGrammar::AddressConvention eConv; // start with the address convention set in the document - eConv = pDoc->GetAddressConvention(); - aRet.nResult = rScRange.Parse(aAddress, pDoc, eConv); + eConv = rDoc.GetAddressConvention(); + aRet.nResult = rScRange.Parse(aAddress, rDoc, eConv); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::RANGE; return aRet; } - aRet.nResult = rScAddress.Parse(aAddress, pDoc, eConv); + aRet.nResult = rScAddress.Parse(aAddress, &rDoc, eConv); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::ADDRESS; @@ -107,14 +107,14 @@ namespace } // try the default Calc (A1) address convention - aRet.nResult = rScRange.Parse(aAddress, pDoc); + aRet.nResult = rScRange.Parse(aAddress, rDoc); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::RANGE; return aRet; } - aRet.nResult = rScAddress.Parse(aAddress, pDoc); + aRet.nResult = rScAddress.Parse(aAddress, &rDoc); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::ADDRESS; @@ -122,7 +122,7 @@ namespace } // try the Excel A1 address convention - aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1); + aRet.nResult = rScRange.Parse(aAddress, rDoc, formula::FormulaGrammar::CONV_XL_A1); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::RANGE; @@ -130,7 +130,7 @@ namespace } // try the Excel A1 address convention - aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1); + aRet.nResult = rScAddress.Parse(aAddress, &rDoc, formula::FormulaGrammar::CONV_XL_A1); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::ADDRESS; @@ -138,14 +138,14 @@ namespace } // try Excel R1C1 address convention - aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1); + aRet.nResult = rScRange.Parse(aAddress, rDoc, formula::FormulaGrammar::CONV_XL_R1C1); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::RANGE; return aRet; } - aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1); + aRet.nResult = rScAddress.Parse(aAddress, &rDoc, formula::FormulaGrammar::CONV_XL_R1C1); if (aRet.nResult & ScRefFlags::VALID) { aRet.eDetected = DetectFlags::ADDRESS; @@ -324,7 +324,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) ScMarkData& rMark = rViewData.GetMarkData(); ScRange aScRange; ScAddress aScAddress; - ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, &rDoc); + ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, rDoc); ScRefFlags nResult = aResult.nResult; SCTAB nTab = rViewData.GetTabNo(); bool bMark = true; |