summaryrefslogtreecommitdiff
path: root/basic/qa
diff options
context:
space:
mode:
authorJacek Fraczek <fraczek.jacek@gmail.com>2016-10-05 22:00:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-10 08:48:30 +0000
commitf004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch)
treeaacd5792f553b8e9cbf029cc7e0797ed0dd423fe /basic/qa
parent728c7327bd97602a38723553ed044ea4c01d13b2 (diff)
tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) 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 <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic/qa')
-rw-r--r--basic/qa/cppunit/basic_coverage.cxx2
-rw-r--r--basic/qa/cppunit/basictest.cxx6
-rw-r--r--basic/qa/cppunit/test_nested_struct.cxx10
-rw-r--r--basic/qa/cppunit/test_vba.cxx8
4 files changed, 13 insertions, 13 deletions
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx
index 34f6ae3e729b..17612c4f749c 100644
--- a/basic/qa/cppunit/basic_coverage.cxx
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -77,7 +77,7 @@ void Coverage::run_test(const OUString& sFileURL)
if( !testMacro.HasError() )
{
SbxVariableRef pResult = testMacro.Run();
- if( pResult && pResult->GetInteger() == 1 )
+ if( pResult.Is() && pResult->GetInteger() == 1 )
{
bResult = true;
}
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index 7b5aa22a1927..2c4e86f0ea17 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -78,7 +78,7 @@ SbxVariableRef MacroSnippet::Run( const css::uno::Sequence< css::uno::Any >& rAr
SbxVariableRef pReturn = nullptr;
if ( !Compile() )
return pReturn;
- SbMethod* pMeth = mpMod ? static_cast<SbMethod*>(mpMod->Find( "doUnitTest", SbxClassType::Method )) : nullptr;
+ SbMethod* pMeth = mpMod.Is() ? static_cast<SbMethod*>(mpMod->Find( "doUnitTest", SbxClassType::Method )) : nullptr;
if ( pMeth )
{
if ( rArgs.getLength() )
@@ -90,7 +90,7 @@ SbxVariableRef MacroSnippet::Run( const css::uno::Sequence< css::uno::Any >& rAr
unoToSbxValue( pVar, rArgs[ i ] );
aArgs->Put( pVar, i + 1 );
}
- pMeth->SetParameters( aArgs );
+ pMeth->SetParameters( aArgs.get() );
}
pReturn = new SbxMethod( *static_cast<SbxMethod*>(pMeth));
}
@@ -105,7 +105,7 @@ SbxVariableRef MacroSnippet::Run()
bool MacroSnippet::Compile()
{
- CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod != nullptr );
+ CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod.get() != nullptr );
mpMod->Compile();
return !mbError;
}
diff --git a/basic/qa/cppunit/test_nested_struct.cxx b/basic/qa/cppunit/test_nested_struct.cxx
index 2fc06005072e..b1f060d8f152 100644
--- a/basic/qa/cppunit/test_nested_struct.cxx
+++ b/basic/qa/cppunit/test_nested_struct.cxx
@@ -182,7 +182,7 @@ void Nested_Struct::testAssign1Alt()
myMacro.Compile();
CPPUNIT_ASSERT_MESSAGE("testAssign1Alt fails with compile error",!myMacro.HasError() );
SbxVariableRef pNew = myMacro.Run();
- uno::Any aRet = sbxToUnoValue( pNew );
+ uno::Any aRet = sbxToUnoValue( pNew.get() );
table::TableBorder aBorder;
aRet >>= aBorder;
@@ -205,7 +205,7 @@ void Nested_Struct::testOldAssignAlt()
myMacro.Compile();
CPPUNIT_ASSERT_MESSAGE("testOldAssign fails with compile error",!myMacro.HasError() );
SbxVariableRef pNew = myMacro.Run();
- uno::Any aRet = sbxToUnoValue( pNew );
+ uno::Any aRet = sbxToUnoValue( pNew.get() );
table::TableBorder aBorder;
aRet >>= aBorder;
@@ -229,7 +229,7 @@ void Nested_Struct::testUnfixedVarAssignAlt()
myMacro.Compile();
CPPUNIT_ASSERT_MESSAGE("testUnfixedVarAssignAlt fails with compile error",!myMacro.HasError() );
SbxVariableRef pNew = myMacro.Run();
- uno::Any aRet = sbxToUnoValue( pNew );
+ uno::Any aRet = sbxToUnoValue( pNew.get() );
uno::Sequence< uno::Any > aResult;
bool bRes = aRet >>= aResult;
@@ -265,7 +265,7 @@ void Nested_Struct::testFixedVarAssignAlt()
myMacro.Compile();
CPPUNIT_ASSERT_MESSAGE("testFixedVarAssignAlt fails with compile error",!myMacro.HasError() );
SbxVariableRef pNew = myMacro.Run();
- uno::Any aRet = sbxToUnoValue( pNew );
+ uno::Any aRet = sbxToUnoValue( pNew.get() );
uno::Sequence< uno::Any > aResult;
bool bRes = aRet >>= aResult;
@@ -292,7 +292,7 @@ void Nested_Struct::testUnoAccess()
myMacro.Compile();
CPPUNIT_ASSERT_MESSAGE("testUnoAccess fails with compile error",!myMacro.HasError() );
SbxVariableRef pNew = myMacro.Run();
- uno::Any aRet = sbxToUnoValue( pNew );
+ uno::Any aRet = sbxToUnoValue( pNew.get() );
awt::WindowDescriptor aWinDesc;
aRet >>= aWinDesc;
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 7673f85e1e29..40ed2253330b 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -75,12 +75,12 @@ void VBATest::testMiscVBAFunctions()
MacroSnippet myMacro;
myMacro.LoadSourceFromFile( sMacroURL );
SbxVariableRef pReturn = myMacro.Run();
- if ( pReturn )
+ if ( pReturn.Is() )
{
fprintf(stderr, "macro result for %s\n", macroSource[ i ] );
fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() );
}
- CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn != nullptr );
+ CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != nullptr );
CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"), pReturn->GetOUString() );
}
}
@@ -146,12 +146,12 @@ void VBATest::testMiscOLEStuff()
MacroSnippet myMacro;
myMacro.LoadSourceFromFile( sMacroURL );
SbxVariableRef pReturn = myMacro.Run( aArgs );
- if ( pReturn )
+ if ( pReturn.Is() )
{
fprintf(stderr, "macro result for %s\n", macroSource[ i ] );
fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() );
}
- CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn != NULL );
+ CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != NULL );
CPPUNIT_ASSERT_MESSAGE("Result not as expected", pReturn->GetOUString() == "OK" );
}
#else