[PATCH 8/9] remove dead code in calc ui vbremove dead code in calc ui vbaa

pjacquod pjacquod at alumni.ethz.ch
Sat Nov 20 13:39:30 PST 2010


---
 sc/source/ui/vba/service.cxx       |   25 -------------------------
 sc/source/ui/vba/vbarange.cxx      |   17 +----------------
 sc/source/ui/vba/vbawsfunction.cxx |   19 -------------------
 3 files changed, 1 insertions(+), 60 deletions(-)

diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx
index 036f0d3..05dc4ab 100644
--- a/sc/source/ui/vba/service.cxx
+++ b/sc/source/ui/vba/service.cxx
@@ -89,35 +89,10 @@ extern "C"
         lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
     {
         OSL_TRACE("In component_writeInfo");
-#if 0
-    // Component registration
-        if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
-        range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) )
-        {
-            // Singleton registration
-            try
-            {
-                registry::XRegistryKey * pKey =
-                    reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
 
-                Reference< registry::XRegistryKey >xKey = pKey->createKey(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ("ooo.vba.Globals/UNO/SINGLETONS/ooo.vba.theGlobals") )) );
-                xKey->setStringValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                    ("ooo.vba.Globals") )) );
-                return sal_True;
-            }
-            catch( uno::Exception& /*e*/ )
-            {
-                //recomp & friends will detect false returned and fail
-            }
-        }
-        return sal_False;
-#else
     // Component registration
         return component_writeInfoHelper( pServiceManager, pRegistryKey,
         range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl, textframe::serviceDecl );
-#endif
-
     }
 
     SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index a47069b..da141c3 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -3071,7 +3071,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
     }
 
     // sanity check required params
-    if ( !What.getLength() /*|| !Replacement.getLength()*/ )
+    if ( !What.getLength()  )
         throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, missing params" )) , uno::Reference< uno::XInterface >() );
     rtl::OUString sWhat = VBAToRegexp( What);
     // #TODO #FIXME SearchFormat & ReplacesFormat are not processed
@@ -3425,15 +3425,6 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
     // 2) #TODO #FIXME need to refactor this ( below ) into a IsSingleCell() method
     uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW );
 
-    // 'Fraid I don't remember what I was trying to achieve here ???
-/*
-    if (  isSingleCellRange() )
-    {
-        uno::Reference< XRange > xCurrent = CurrentRegion();
-        xCurrent->Sort( Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3 );
-        return;
-    }
-*/
     // set up defaults
 
     sal_Int16 nOrder1 = aSortParam.bAscending[0] ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
@@ -5205,12 +5196,6 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru
 ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL
 ScVbaRange::getQueryTable() throw (::com::sun::star::uno::RuntimeException)
 {
-    /*
-    if (m_pQueryTable == NULL)
-    {
-        m_pQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl
-    }
-    //*/
     if (!m_xQueryTable.is())
     {
         m_xQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl
diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx
index b87ec85..f58c3cd 100644
--- a/sc/source/ui/vba/vbawsfunction.cxx
+++ b/sc/source/ui/vba/vbawsfunction.cxx
@@ -231,25 +231,6 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence<
         }
     }
 
-#if 0
-    // MATCH function should alwayse return a double value, but currently if the first argument is XCellRange, MATCH function returns an array instead of a double value. Don't know why?
-    // To fix this issue in safe, current solution is to convert this array to a double value just for MATCH function.
-    String aUpper( FunctionName );
-    ScCompiler aCompiler( NULL, ScAddress() );
-    OpCode eOp = aCompiler.GetEnglishOpCode( aUpper.ToUpperAscii() );
-    if( eOp == ocMatch )
-    {
-        double fVal = 0.0;
-        if( aRet >>= fVal )
-            return aRet;
-        uno::Sequence< uno::Sequence< uno::Any > > aSequence;
-        if( !( ( aRet >>= aSequence ) && ( aSequence.getLength() > 0 ) &&
-            ( aSequence[0].getLength() > 0 ) && ( aSequence[0][0] >>= fVal ) ) )
-                throw uno::RuntimeException();
-        aRet <<= fVal;
-    }
-#endif
-
     return aRet;
 }
 
-- 
1.7.1


--------------070903000307090300090306
Content-Type: text/x-patch;
 name="0009-removed-dead-code-in-calc-core-tools.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0009-removed-dead-code-in-calc-core-tools.patch"



More information about the LibreOffice mailing list