From f004aa99514d385f3ee254bba735f5eaeb7d9ad8 Mon Sep 17 00:00:00 2001 From: Jacek Fraczek Date: Wed, 5 Oct 2016 22:00:51 +0200 Subject: tdf#89307: Removed SvRef::operator T*() Conditional statements are using SvRef::Is() method. Changed static_cast(svRef) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- starmath/qa/cppunit/test_cursor.cxx | 8 ++++---- starmath/qa/cppunit/test_node.cxx | 2 +- starmath/qa/cppunit/test_nodetotextvisitors.cxx | 8 ++++---- starmath/qa/cppunit/test_parse.cxx | 2 +- starmath/qa/extras/mmlexport-test.cxx | 2 +- starmath/qa/extras/mmlimport-test.cxx | 2 +- starmath/source/document.cxx | 2 +- starmath/source/smdetect.cxx | 2 +- starmath/source/unofilter.cxx | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) (limited to 'starmath') diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 51e555f777fd..6cbc4fe2ef41 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -71,7 +71,7 @@ void Test::testCopyPaste() std::unique_ptr xTree(SmParser().Parse(sInput)); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(xTree.get(), xDocShRef); + SmCursor aCursor(xTree.get(), xDocShRef.get()); ScopedVclPtrInstance pOutputDevice; // go to the position at "*" @@ -94,7 +94,7 @@ void Test::testCopySelectPaste() std::unique_ptr xTree(SmParser().Parse(sInput)); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(xTree.get(), xDocShRef); + SmCursor aCursor(xTree.get(), xDocShRef.get()); ScopedVclPtrInstance pOutputDevice; // go to the right end @@ -121,7 +121,7 @@ void Test::testCutPaste() std::unique_ptr xTree(SmParser().Parse(sInput)); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(xTree.get(), xDocShRef); + SmCursor aCursor(xTree.get(), xDocShRef.get()); ScopedVclPtrInstance pOutputDevice; // go to the position at "*" @@ -144,7 +144,7 @@ void Test::testCutSelectPaste() std::unique_ptr xTree(SmParser().Parse(sInput)); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(xTree.get(), xDocShRef); + SmCursor aCursor(xTree.get(), xDocShRef.get()); ScopedVclPtrInstance pOutputDevice; // go to the right end diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index b07f26ca039a..fbeca91dbdc1 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -55,7 +55,7 @@ void NodeTest::setUp() void NodeTest::tearDown() { - if (mxDocShell) + if (mxDocShell.Is()) mxDocShell->DoClose(); BootstrapFixture::tearDown(); } diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index f6f82918eee1..c3c17f96cb7a 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -521,7 +521,7 @@ void Test::testBinomInBinHor() pTree = SmParser().Parse(sInput); pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(pTree, xDocShRef); + SmCursor aCursor(pTree, xDocShRef.get()); ScopedVclPtrInstance< VirtualDevice > pOutputDevice; // move forward (more than) enough places to be at the end @@ -549,7 +549,7 @@ void Test::testBinVerInUnary() pTree = SmParser().Parse(sInput); pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(pTree, xDocShRef); + SmCursor aCursor(pTree, xDocShRef.get()); ScopedVclPtrInstance< VirtualDevice > pOutputDevice; // move forward (more than) enough places to be at the end @@ -578,7 +578,7 @@ void Test::testBinHorInSubSup() SmNode* pTree = SmParser().Parse(sInput); pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(pTree, xDocShRef); + SmCursor aCursor(pTree, xDocShRef.get()); ScopedVclPtrInstance< VirtualDevice > pOutputDevice; // Insert an RSup expression with a BinHor for the exponent @@ -606,7 +606,7 @@ void Test::testUnaryInMixedNumberAsNumerator() SmNode* pTree = SmParser().Parse(sInput); pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef); - SmCursor aCursor(pTree, xDocShRef); + SmCursor aCursor(pTree, xDocShRef.get()); ScopedVclPtrInstance< VirtualDevice > pOutputDevice; // move forward (more than) enough places to be at the end diff --git a/starmath/qa/cppunit/test_parse.cxx b/starmath/qa/cppunit/test_parse.cxx index fd601c1d4463..2aff581cf375 100644 --- a/starmath/qa/cppunit/test_parse.cxx +++ b/starmath/qa/cppunit/test_parse.cxx @@ -52,7 +52,7 @@ void ParseTest::setUp() void ParseTest::tearDown() { - if (mxDocShell) + if (mxDocShell.Is()) mxDocShell->DoClose(); BootstrapFixture::tearDown(); } diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 3a2d222f18e4..1266ca0ec3e5 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -63,7 +63,7 @@ void MathMLExportTest::setUp() void MathMLExportTest::tearDown() { - if (mxDocShell) + if (mxDocShell.Is()) mxDocShell->DoClose(); BootstrapFixture::tearDown(); } diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index fcb6be9e6d8a..5ca5d70e8012 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -80,7 +80,7 @@ void Test::setUp() void Test::tearDown() { - if (mxDocShell) mxDocShell->DoClose(); + if (mxDocShell.Is()) mxDocShell->DoClose(); BootstrapFixture::tearDown(); } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index deb7d1514003..64847fd591e0 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -702,7 +702,7 @@ bool SmDocShell::ConvertFrom(SfxMedium &rMedium) { // is this a MathType Storage? MathType aEquation( maText ); - bSuccess = aEquation.Parse( aStorage ); + bSuccess = aEquation.Parse( aStorage.get() ); if ( bSuccess ) Parse(); } diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 058f387124b2..18dfa736bd51 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -76,7 +76,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor if ( aStorage->IsStream("Equation Native") ) { sal_uInt8 nVersion; - if ( GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3 ) + if ( GetMathTypeVersion( aStorage.get(), nVersion ) && nVersion <=3 ) return OUString("math_MathType_3x"); } } diff --git a/starmath/source/unofilter.cxx b/starmath/source/unofilter.cxx index e5369e2d3d98..8caf72ef308a 100644 --- a/starmath/source/unofilter.cxx +++ b/starmath/source/unofilter.cxx @@ -76,7 +76,7 @@ sal_Bool MathTypeFilter::filter(const uno::Sequence& rDesc SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); OUString aText = pDocShell->GetText(); MathType aEquation(aText); - bSuccess = aEquation.Parse(aStorage); + bSuccess = aEquation.Parse(aStorage.get()); if (bSuccess) { pDocShell->SetText(aText); -- cgit v1.2.3