[PATCH 3/3] Dead code deletion again

Wol anthony at youngman.org.uk
Sun Nov 28 08:15:13 PST 2010


---
 reportdesign/source/core/sdr/PropertyForward.cxx   |    2 +-
 reportdesign/source/core/sdr/ReportDrawPage.cxx    |    1 -
 reportdesign/source/core/sdr/ReportUndoFactory.cxx |    1 -
 reportdesign/source/core/sdr/RptModel.cxx          |   11 ----------
 reportdesign/source/core/sdr/RptObject.cxx         |   22 +++----------------
 reportdesign/source/core/sdr/RptObjectListener.cxx |    7 ------
 reportdesign/source/core/sdr/UndoEnv.cxx           |    3 --
 7 files changed, 5 insertions(+), 42 deletions(-)

diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
index 7cef3bf..30f8200 100644
--- a/reportdesign/source/core/sdr/PropertyForward.cxx
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -94,7 +94,7 @@ OPropertyMediator::OPropertyMediator(const Reference< XPropertySet>& _xSource
             DBG_UNHANDLED_EXCEPTION();
             (void)e;
         }
-    } // if ( m_xDest.is() && m_xSource.is() )
+    }
     osl_decrementInterlockedCount(&m_refCount);
 }
 // -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
index 31c977b..3126c35 100644
--- a/reportdesign/source/core/sdr/ReportDrawPage.cxx
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -134,7 +134,6 @@ uno::Reference< drawing::XShape >  OReportDrawPage::_CreateShape( SdrObject *pOb
             SvxOle2Shape* pShape = new SvxOle2Shape( pObj );
             xShape.set(*pShape,uno::UNO_QUERY);
             pShape->setShapeKind(pObj->GetObjIdentifier());
-            //xShape = new SvxOle2Shape( pOle2Obj );
         }
 
         if ( !xShape.is() )
diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
index 0f2fbce..2c77948 100644
--- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx
+++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
@@ -96,7 +96,6 @@ SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, b
 SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
 {
     return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL);
-    //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? TRUE : FALSE );
 }
 
 SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 689ecd9..3be333a 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -71,13 +71,6 @@ OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition
     m_pUndoEnv = new OXUndoEnvironment(*this);
     m_pUndoEnv->acquire();
     SetSdrUndoFactory(new OReportUndoFactory);
-
- //   SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT);
-    //SvxFontHeightToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT);
-    //SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR);
-    //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2);
-    //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND);
-    //SvxColorToolBoxControl::RegisterControl(SID_BACKGROUND_COLOR);
 }
 
 //----------------------------------------------------------------------------
@@ -134,10 +127,6 @@ void OReportModel::SetModified(sal_Bool _bModified)
 SdrPage* OReportModel::RemovePage(USHORT nPgNum)
 {
     OReportPage* pPage = dynamic_cast<OReportPage*>(SdrModel::RemovePage(nPgNum));
-    //if ( pPage )
-    //{
-    //    m_pUndoEnv->RemoveSection(pPage);
-    //}
     return pPage;
 }
 // -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 3f622a4..2552da8 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -230,7 +230,7 @@ namespace
                     default:
                         OSL_ENSURE(0,"Illegal text alignment value!");
                         break;
-                } // switch(eParagraphAdjust)
+                }
                 aRet <<= nTextAlign;
             }
             return aRet;
@@ -251,7 +251,6 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)));
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)));
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)));
-                    //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN));
                 }
                 return s_aNameMap;
             }
@@ -292,7 +291,6 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter)));
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)));
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)));
-                    //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter)));
                     ::boost::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust());
                     s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust)));
                 }
@@ -749,11 +747,6 @@ void OUnoObject::NbcMove( const Size& rSize )
 
             // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
             int nNewX = m_xReportComponent->getPositionX() + rSize.A();
-            // can this hinder us to set components outside the area?
-            // if (nNewX < 0)
-            // {
-            //     nNewX = 0;
-            // }
             m_xReportComponent->setPositionX(nNewX);
             int nNewY = m_xReportComponent->getPositionY() + rSize.B();
             if (nNewY < 0 && !bUndoMode)
@@ -766,14 +759,7 @@ void OUnoObject::NbcMove( const Size& rSize )
         }
         if (bPositionFixed)
         {
-            // OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
-            // if ( pRptModel )
-            // {
-            //    if (! pRptModel->GetUndoEnv().IsLocked())
-            //    {
-                    GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
-            //    }
-            // }
+            GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
         }
         // set geometry properties	
         SetPropsFromRect(GetLogicRect());
@@ -1139,7 +1125,7 @@ uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const
         {
             xSource.set(xChartDoc->getDataProvider(),uno::UNO_QUERY);
         }
-    } // if( xCompSupp.is())
+    }
     return xSource;
 }
 // -----------------------------------------------------------------------------
@@ -1175,7 +1161,7 @@ void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XMod
             uno::Reference< lang::XMultiServiceFactory> xFac(_xModel,uno::UNO_QUERY);
             uno::Reference< chart2::data::XDatabaseDataProvider > xDataProvider( xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider"))),uno::UNO_QUERY);
             xReceiver->attachDataProvider( xDataProvider.get() );
-        } // if( xReceiver.is() )
+        }
     }
     catch(uno::Exception)
     {
diff --git a/reportdesign/source/core/sdr/RptObjectListener.cxx b/reportdesign/source/core/sdr/RptObjectListener.cxx
index 16ba836..3321dea 100644
--- a/reportdesign/source/core/sdr/RptObjectListener.cxx
+++ b/reportdesign/source/core/sdr/RptObjectListener.cxx
@@ -56,13 +56,6 @@ OObjectListener::~OObjectListener()
 
 void SAL_CALL OObjectListener::disposing( const  ::com::sun::star::lang::EventObject& ) throw( ::com::sun::star::uno::RuntimeException)
 {
-    /*
-    // disconnect the listener
-    if (m_pObject)
-    {
-        (m_pObject->m_xPropertyChangeListener).clear();
-    }
-    */
 }
 
 // XPropertyChangeListener
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 70f132d..b4d643c 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -213,8 +213,6 @@ void SAL_CALL OXUndoEnvironment::disposing(const EventObject& e) throw( RuntimeE
             RemoveSection(xSection);
         else
             RemoveElement(xSourceSet);
-        /*if (!m_pImpl->m_aPropertySetCache.empty())
-            m_pImpl->m_aPropertySetCache.erase(xSourceSet);*/
     }
 }
 
@@ -383,7 +381,6 @@ void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) thro
 //------------------------------------------------------------------------------
 void OXUndoEnvironment::implSetModified()
 {
-    //if ( !IsLocked() )
     m_pImpl->m_rModel.SetModified( sal_True );
 }
 
-- 
1.7.2.2


--------------080602040607070908060107--


More information about the LibreOffice mailing list