[Libreoffice-commits] .: 6 commits - basic/source embeddedobj/source svx/source

David Tardon dtardon at kemper.freedesktop.org
Wed Apr 27 23:30:50 PDT 2011


 basic/source/app/mybasic.cxx            |    9 +--------
 embeddedobj/source/msole/olepersist.cxx |   19 +++----------------
 svx/source/gallery2/galctrl.cxx         |    9 ++-------
 svx/source/svdraw/svdpagv.cxx           |   13 ++++---------
 svx/source/unodraw/unoshape.cxx         |    5 ++---
 5 files changed, 12 insertions(+), 43 deletions(-)

New commits:
commit 458988d4519cc5f690a2c2c4f707ac1202668e8a
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 08:20:09 2011 +0200

    microoptimize this

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 5b40b65..a90c06e 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -3084,13 +3084,12 @@ uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( cons
     if( mpImpl->mpMaster )
     {
         for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
-            pState[nIdx] = getPropertyState( pNames[nIdx] );
-
+            pState[nIdx] = mpImpl->mpMaster->getPropertyState( pNames[nIdx] );
     }
     else
     {
         for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
-            pState[nIdx] = getPropertyState( pNames[nIdx] );
+            pState[nIdx] = getPropertyState_( pNames[nIdx] );
     }
 
     return aRet;
commit 74367471d79c79f68cac7fb156c5e26884e3b18a
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 07:53:50 2011 +0200

    make this more readable

diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index faa5ed5..72bddc4 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -881,7 +881,8 @@ void SdrPageView::DeleteHelpLine(sal_uInt16 nNum)
 
 void SdrPageView::InsertHelpLine(const SdrHelpLine& rHL, sal_uInt16 nNum)
 {
-    if (nNum>aHelpLines.GetCount()) nNum=aHelpLines.GetCount();
+    if (nNum > aHelpLines.GetCount())
+        nNum = aHelpLines.GetCount();
     aHelpLines.Insert(rHL,nNum);
     if (GetView().IsHlplVisible())
         ImpInvalidateHelpLineArea(nNum);
commit 1e02a9396a30a706e7dd8d4b2f710d04f74737d7
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 07:52:27 2011 +0200

    both branches of the if are same

diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 0702436..faa5ed5 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -883,14 +883,8 @@ void SdrPageView::InsertHelpLine(const SdrHelpLine& rHL, sal_uInt16 nNum)
 {
     if (nNum>aHelpLines.GetCount()) nNum=aHelpLines.GetCount();
     aHelpLines.Insert(rHL,nNum);
-    if (GetView().IsHlplVisible()) {
-        if (GetView().IsHlplFront()) {
-            // Hier optimieren ...
-            ImpInvalidateHelpLineArea(nNum);
-         } else {
-            ImpInvalidateHelpLineArea(nNum);
-        }
-    }
+    if (GetView().IsHlplVisible())
+        ImpInvalidateHelpLineArea(nNum);
 }
 
 // Betretene Gruppe und Liste setzen
commit c0437c82761760aea3cfeffe0017002aa6da83e0
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 07:46:05 2011 +0200

    both branches of the if are same

diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index d492897..e611983 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -694,13 +694,8 @@ sal_Int8 GalleryListView::AcceptDrop( const BrowserAcceptDropEvent& )
 {
     sal_Int8 nRet = DND_ACTION_NONE;
 
-       if( mpTheme && !mpTheme->IsReadOnly() && !mpTheme ->IsImported() )
-    {
-        if( !mpTheme->IsDragging() )
-            nRet = DND_ACTION_COPY;
-        else
-            nRet = DND_ACTION_COPY;
-    }
+    if( mpTheme && !mpTheme->IsReadOnly() && !mpTheme ->IsImported() )
+        nRet = DND_ACTION_COPY;
 
     return nRet;
 }
commit 28d7509f63d6dac83915087834fc33442e0a5359
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 07:39:33 2011 +0200

    both branches of the if are same

diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 0def17c..f9abfc2 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -1820,22 +1820,9 @@ void SAL_CALL OleEmbeddedObject::storeOwn()
         if ( !xOutStream.is() )
             throw io::IOException(); //TODO: access denied
 
-        if ( m_bIsLink )
-        {
-            // just let the link store itself
-            // in case visual repersentation must be stored also
-            // the procedure should be the same as for embedded objects
-
-            uno::Reference< io::XOutputStream > xOutStream = GetStreamForSaving();
-
-            // should the component detect that it is a link???
-            StoreObjectToStream( xOutStream );
-        }
-        else
-        {
-            uno::Reference< io::XOutputStream > xOutStream = GetStreamForSaving();
-            StoreObjectToStream( xOutStream );
-        }
+        // TODO: does this work for links too?
+        uno::Reference< io::XOutputStream > xOutStream = GetStreamForSaving();
+        StoreObjectToStream( xOutStream );
 
         // the replacement is changed probably, and it must be in the object stream
         if ( !m_pOleComponent->IsWorkaroundActive() )
commit 90eec1d1b63185794a97a22a5ad8293777cdd9cb
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Apr 28 07:28:53 2011 +0200

    the if is useless here--both branches are same

diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx
index c26bce8..da192fe 100644
--- a/basic/source/app/mybasic.cxx
+++ b/basic/source/app/mybasic.cxx
@@ -257,14 +257,7 @@ sal_uInt16 MyBasic::BreakHdl()
         pWin->Highlight( GetLine(), GetCol1(), GetCol2() );
     }
 
-    if( IsBreak() )	// If Breakpoint (or "Run to Cursor")
-    {
-        return aBasicApp.pFrame->BreakHandler();
-    }
-    else
-    {
-        return aBasicApp.pFrame->BreakHandler();
-    }
+    return aBasicApp.pFrame->BreakHandler();
 }
 
 /***************************************************************************


More information about the Libreoffice-commits mailing list