[PATCH 4/4] Dead code and spelling mistakes

Wol anthony at youngman.org.uk
Tue Nov 23 17:07:16 PST 2010


---
 dbaccess/source/ui/browser/brwctrlr.cxx          |   36 ++----------------
 dbaccess/source/ui/browser/dsEntriesNoExp.cxx    |    2 +-
 dbaccess/source/ui/browser/exsrcbrw.cxx          |    4 +-
 dbaccess/source/ui/browser/genericcontroller.cxx |   12 ++-----
 dbaccess/source/ui/browser/sbagrid.cxx           |   42 ++++++----------------
 dbaccess/source/ui/browser/unodatbr.cxx          |   11 ++----
 6 files changed, 25 insertions(+), 82 deletions(-)

diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 5fb791d..bfa82e3 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1209,31 +1209,17 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t
     // the filter or the sort criterias have changed ? -> update our parser
     if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND))
     {
-      //  if (m_xParser.is())
-            //DO_SAFE( m_xParser->setElementaryQuery(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new query to my parser !" );
     }
     else if (evt.PropertyName.equals(PROPERTY_FILTER))
     {
-  //      if ( m_xParser.is() && m_xParser->getFilter() != ::comphelper::getString(evt.NewValue))
-        //{
-        //	DO_SAFE( m_xParser->setFilter(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" );
-        //}
         InvalidateFeature(ID_BROWSER_REMOVEFILTER);
     }
     else if (evt.PropertyName.equals(PROPERTY_HAVING_CLAUSE))
     {
-        //if ( m_xParser.is() && m_xParser->getHavingClause() != ::comphelper::getString(evt.NewValue))
-        //{
-        //	DO_SAFE( m_xParser->setHavingClause(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" );
-        //}
         InvalidateFeature(ID_BROWSER_REMOVEFILTER);
     }
     else if (evt.PropertyName.equals(PROPERTY_ORDER))
     {
-        //if ( m_xParser.is() && m_xParser->getOrder() != ::comphelper::getString(evt.NewValue))
-        //{
-        //	DO_SAFE( m_xParser->setOrder(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new order to my parser !" );
-        //}
         InvalidateFeature(ID_BROWSER_REMOVEFILTER);
     }
 
@@ -1806,7 +1792,6 @@ void SbaXDataBrowserController::applyParserOrder(const ::rtl::OUString& _rOldOrd
     if (!bSuccess)
     {
         xFormSet->setPropertyValue(PROPERTY_ORDER, makeAny(_rOldOrder));
-        //DO_SAFE( _xParser->setOrder(_rOldOrder), "SbaXDataBrowserController::applyParserOrder: could not restore the old order of my parser !" );
 
         try
         {
@@ -1914,8 +1899,6 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
             String aFilter;
             if(!aDlg.Execute())
             {
-                //m_xParser->setFilter(sOldVal);
-                //m_xParser->setHavingClause(sOldHaving);
                 return; // if so we don't need to actualize the grid
             }
             aDlg.BuildWherePart();
@@ -1926,7 +1909,6 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
             String aOrder;
             if(!aDlg.Execute())
             {
-                //m_xParser->setOrder(sOldVal);
                 return; // if so we don't need to actualize the grid
             }
             aDlg.BuildOrderPart();
@@ -2535,7 +2517,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p
         if (!xCurrentColumn.is())
             continue;
 
-        // can we use this column control fo searching ?
+        // can we use this column control for searching ?
         if (!IsSearchableControl(xCurrentColumn))
             continue;
 
@@ -2621,7 +2603,7 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio
 
     try
     {
-        // let the grid snyc it's display with the cursor
+        // let the grid snyc its display with the cursor
         Reference< XPropertySet >  xModelSet(getControlModel(), UNO_QUERY);
         DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!");
         Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")));
@@ -2739,21 +2721,11 @@ void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( R
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen at sun.com", "SbaXDataBrowserController::unloaded" );
     m_xParser.clear();
     InvalidateAll();
-        // do this asynchron, there are other listeners reacting on this message ...
+        // do this asynchronously, there are other listeners reacting on this message ...
         // (it's a little hack : the grid columns are listening to this event, too, and their bound field may
         // change as a reaction on that event. as we have no chance to be notified of this change (which is
         // the one we're interested in) we give them time to do what they want to before invalidating our
         // bound-field-dependent slots ....
-    /*
-    try
-    {
-        ::comphelper::disposeComponent(m_xParser);
-    }
-    catch(Exception&)
-    {
-        OSL_ENSURE(0,"Exception thrown by dispose");
-    }
-    */
 }
 
 //------------------------------------------------------------------------------
@@ -2823,7 +2795,7 @@ sal_Bool SbaXDataBrowserController::isValidCursor() const
         {
             bIsValid = m_xParser.is();
         }
-    } // if ( !bIsValid )
+    }
     return bIsValid;
 }
 
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index ef2d668..95c280f 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -157,7 +157,7 @@ void SbaTableQueryBrowser::SelectionChanged()
         InvalidateFeature(ID_BROWSER_INSERTCOLUMNS);
         InvalidateFeature(ID_BROWSER_INSERTCONTENT);
         InvalidateFeature(ID_BROWSER_FORMLETTER);
-    } // if ( !m_bShowMenu )
+    }
     InvalidateFeature(ID_BROWSER_COPY);
     InvalidateFeature(ID_BROWSER_CUT);
 }
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index bc467cd..c27a17e 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -200,7 +200,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U
         Reference< XPropertySetInfo > xNewColProperties;
         if (xNewCol.is())
             xNewColProperties = xNewCol->getPropertySetInfo();
-        // set it's properties
+        // set its properties
         if (xNewColProperties.is())
         {
             const ::com::sun::star::beans::PropertyValue* pControlProps = aControlProps.getConstArray();
@@ -242,7 +242,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U
             return;
 
         Reference< XRowSet >  xMasterForm;
-        // search the arguments for he master form
+        // search the arguments for the master form
         for (sal_uInt16 i=0; i<aArgs.getLength(); ++i, ++pArguments)
         {
             if ((pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterForm")))) && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE))
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 4b3fd33..b0a6a2e 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -308,12 +308,6 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
         {
             xFrame.set(aValue.Value,UNO_QUERY_THROW);
         }
-        /* #i42316#
-        else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "ReadOnly" ) ) )
-        {
-            aValue.Value >>= m_bReadOnly;
-        }
-        */
         else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "Preview" ) ) )
         {
             aValue.Value >>= m_bPreview;
@@ -674,7 +668,7 @@ void OGenericUnoController::InvalidateAll()
 void OGenericUnoController::InvalidateAll_Impl()
 {
     // ---------------------------------
-    // invalidate all aupported features
+    // invalidate all supported features
 
     for (   SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
             aIter != m_aSupportedFeatures.end();
@@ -793,12 +787,12 @@ void OGenericUnoController::addStatusListener(const Reference< XStatusListener >
     if ( m_xUrlTransformer.is() )
         m_xUrlTransformer->parseStrict( aParsedURL );
 
-    // remeber the listener together with the URL
+    // remember the listener together with the URL
     m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) );
 
     // initially broadcast the state
     ImplBroadcastFeatureState( aParsedURL.Complete, aListener, sal_True );
-        // force the new state to be broadcasted to the new listener
+        // force the new state to be broadcast to the new listener
 }
 
 // -----------------------------------------------------------------------
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index b113264..e0da689 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -675,10 +675,6 @@ void SbaGridHeader::MouseButtonDown( const MouseEvent& _rMEvt )
             // the base class will start a column move here, which we don't want to allow
             // (at the moment. If we store relative positions with the columns, we can allow column moves ....)
 
-//			sal_uInt16	nPos(0);
-//			sal_uInt16	nHitTest = ImplHitTest( _rMEvt.GetPosPixel(), mnMouseOff, nPos );
-//			if (!nHitTest & HEAD_HITTEST_DIVIDER)
-//				return;
         }
 
     FmGridHeader::MouseButtonDown(_rMEvt);
@@ -863,7 +859,7 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu)
         rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), 0, nPos++);
         rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT));
         rMenu.InsertSeparator(nPos++);
-    } // if (!IsReadOnlyDB())
+    }
     
     if ( GetSelectRowCount() > 0 )
     {
@@ -1204,16 +1200,16 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
         sal_Bool bHitHandle = (nColPos == 0);
 
         // check which kind of dragging has to be initiated
-        if	(	bHitHandle							//	the handle column
+        if  (   bHitHandle                          //  the handle column
                                                     // AND
-            &&	(	GetSelectRowCount()						//	at least one row is selected
-                                                        // OR
-                ||	(	(nRow >= 0)							//	a row below the header
-                    &&	!bCurrentRowVirtual					//	we aren't appending a new record
-                    &&	(nRow != GetCurrentPos())			//	a row which is not the current one
-                    )									// OR
-                ||	(	(0 == GetSelectRowCount())			// no rows selected
-                    &&	(-1 == nRow)						// hit the header
+            &&  (   GetSelectRowCount()             //  at least one row is selected
+                                                    // OR
+                ||  (   (nRow >= 0)                 //  a row below the header
+                    &&  !bCurrentRowVirtual         //  we aren't appending a new record
+                    &&  (nRow != GetCurrentPos())   //  a row which is not the current one
+                    )                               // OR
+                ||  (   (0 == GetSelectRowCount())  // no rows selected
+                    &&  (-1 == nRow)                // hit the header
                     )
                 )
             )
@@ -1397,13 +1393,11 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos)
         {
             switch (_aType.mnSotId)
             {
-//				case SOT_FORMAT_RTF:					// RTF data descriptions
-//				case SOT_FORMATSTR_ID_HTML:				// HTML data descriptions
                 case SOT_FORMATSTR_ID_DBACCESS_TABLE:	// table descriptor
                 case SOT_FORMATSTR_ID_DBACCESS_QUERY:	// query descriptor
                 case SOT_FORMATSTR_ID_DBACCESS_COMMAND:	// SQL command
                     return true;
-            }	
+            }
             return false;
         }
     };
@@ -1500,20 +1494,6 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
             nAction = DND_ACTION_COPY;
     }
 
-/*
-    // check formats
-    SvDataObjectRef xDataObj = SvDataObject::PasteDragServer( rEvt );
-    if (!xDataObj.Is())
-        return sal_False;
-
-    const SvDataTypeList& rTypeList = xDataObj->GetTypeList();
-    if ((rTypeList.Get(Exchange::RegisterFormatName(String::CreateFromAscii(SBA_DATAEXCHANGE_FORMAT)))) )
-    {
-        bAllow = (GetOptions() & OPT_INSERT) && rEvt.GetColumnId() > 0 && rEvt.GetRow() >= 0;
-        ((BrowserDropEvent&)rEvt).SetAction(DROP_COPY);
-    }
-
-*/
     return (DND_ACTION_NONE != nAction) ? nAction : FmGridControl::AcceptDrop(rEvt);
 }
 
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 7a2c16f..d73bbad 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -955,7 +955,7 @@ void SbaTableQueryBrowser::checkDocumentDataSource()
     if (!bKnownDocDataSource)
     {
         if (NULL != pDataSourceEntry)
-        {	// at least the data source is know
+        {	// at least the data source is known
             if (NULL != pContainerEntry)
                 bKnownDocDataSource = sal_True; // assume we know it.
                 // TODO: should we expand the object container? This may be too expensive just for checking ....
@@ -1006,7 +1006,6 @@ namespace
         if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
         {
             _rDisplayName = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET);
-            //	_rDisplayName = aURL.getName(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET);
             _rUniqueId = aURL.GetMainURL( INetURLObject::NO_DECODE );
             return true;
         }
@@ -1149,7 +1148,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS
                             }
                         }
                     }
-                     //   m_pTreeView->getListBox().Expand(pCommandType);
                 }
                 while ( nIndex >= 0 );
             }
@@ -1308,7 +1306,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr
                     DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData());
                     if ( pData && pData->xConnection == xCon )
                     {
-                        // we set the conenction to null to avoid a second disposing of the connection
+                        // we set the connection to null to avoid a second disposing of the connection
                         pData->xConnection.clear();
                         closeConnection(pDSLoop,sal_False);
                         break;
@@ -1750,7 +1748,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const
                     {
                         aReturn.bEnabled = m_aCurrentFrame.isActive();
                         break;
-                    } // if ( getBrowserView()->getVclControl()->GetSelectRowCount() )
+                    }
                     else
                         aReturn.bEnabled = pControl->canCopyCellText(pControl->GetCurRow(), pControl->GetCurColumnId());
                     break;
@@ -3498,7 +3496,7 @@ sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand
 
     try
     {
-        // ontain the dss (data source signature) of the form
+        // contain the dss (data source signature) of the form
         ::rtl::OUString sDataSourceName;
         ::rtl::OUString sCommand;
         sal_Int32		nCommandType = CommandType::COMMAND;
@@ -3645,7 +3643,6 @@ void SbaTableQueryBrowser::postReloadForm()
 {
     InitializeGridModel(getFormComponent());
     LoadFinished(sal_True);
-    //updateTitle();
 }
 
 //------------------------------------------------------------------------------
-- 
1.7.2.2


--------------030406070604080807070801--


More information about the LibreOffice mailing list