[Libreoffice-commits] core.git: 3 commits - include/svx svx/source

Matúš Kukan matus.kukan at collabora.com
Mon Jun 23 23:47:21 PDT 2014


 include/svx/unoshtxt.hxx           |    2 -
 svx/source/table/cell.cxx          |   56 +++----------------------------------
 svx/source/table/cell.hxx          |   10 ------
 svx/source/table/tablelayouter.cxx |    8 ++---
 svx/source/unodraw/unoshape.cxx    |    6 +--
 svx/source/unodraw/unoshtxt.cxx    |   16 +++-------
 6 files changed, 20 insertions(+), 78 deletions(-)

New commits:
commit 45f18e2ff2a54c412f296818fd73111cb62c7f3d
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Jun 23 21:18:14 2014 +0200

    sdr::table::Cell's XServiceInfo cleaning
    
    There is no "com.sun.star.table.cell" / "com.sun.star.drawing.cell".
    
    And remove unused XFastPropertySet methods which were not marked as override.
    
    Change-Id: I92c856ef16387758d00174708094b0e0c3a38bac

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 1b9a982..a4a37a9 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -858,27 +858,6 @@ Sequence< sal_Int8 > SAL_CALL Cell::getImplementationId(  ) throw (RuntimeExcept
     return css::uno::Sequence<sal_Int8>();
 }
 
-// XServiceInfo
-OUString SAL_CALL Cell::getImplementationName(  ) throw (RuntimeException, std::exception)
-{
-    return OUString( "com.sun.star.comp.svx.table.Cell" );
-}
-
-sal_Bool SAL_CALL Cell::supportsService( const OUString& ServiceName ) throw (RuntimeException, std::exception)
-{
-    return cppu::supportsService( this, ServiceName );
-}
-
-Sequence< OUString > SAL_CALL Cell::getSupportedServiceNames(  ) throw (RuntimeException, std::exception)
-{
-    Sequence< OUString > aSeq( SvxUnoTextBase::getSupportedServiceNames() );
-    sal_Int32 nIndex = aSeq.getLength();
-    aSeq.realloc( nIndex + 2 );
-    aSeq[nIndex++] = "com.sun.star.table.cell";
-    aSeq[nIndex++] = "com.sun.star.drawing.cell";
-    return aSeq;
-}
-
 // XLayoutConstrains
 ::com::sun::star::awt::Size SAL_CALL Cell::getMinimumSize()
     throw (RuntimeException,
@@ -1625,25 +1604,6 @@ Sequence< Any > SAL_CALL Cell::getPropertyDefaults( const Sequence< OUString >&
 }
 
 
-// XFastPropertySet
-
-
-void SAL_CALL Cell::setFastPropertyValue( sal_Int32 nHandle, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
-{
-    (void)aValue;
-    (void)nHandle;
-    throw UnknownPropertyException();
-}
-
-
-// TODO: Refactor this method!
-Any SAL_CALL Cell::getFastPropertyValue( sal_Int32 nHandle ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
-    (void)nHandle;
-    throw UnknownPropertyException();
-}
-
-
 // XText
 
 
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 82d717d..65fdcd0 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -111,11 +111,6 @@ public:
     SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
-    // XServiceInfo
-    SVX_DLLPRIVATE virtual OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    SVX_DLLPRIVATE virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-    SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
     // XLayoutConstrains
     SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize()
         throw (::com::sun::star::uno::RuntimeException,
@@ -167,10 +162,6 @@ public:
     SVX_DLLPRIVATE virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
-    // XFastPropertySet
-    SVX_DLLPRIVATE virtual void SAL_CALL setFastPropertyValue( ::sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-    SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( ::sal_Int32 nHandle ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
     // XText
     SVX_DLLPRIVATE virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent, sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     SVX_DLLPRIVATE virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& xContent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
commit 991eeb321595fb184b13032dd3a7734af33232d1
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Jun 23 20:54:46 2014 +0200

    Remove unused mpOwner in SvxTextEditSource.
    
    Change-Id: I824e8436945e056840386960308b8e63627a603f

diff --git a/include/svx/unoshtxt.hxx b/include/svx/unoshtxt.hxx
index 315737c..42a20ec 100644
--- a/include/svx/unoshtxt.hxx
+++ b/include/svx/unoshtxt.hxx
@@ -44,7 +44,7 @@ class SdrText;
 class SVX_DLLPUBLIC SvxTextEditSource : public SvxEditSource, public SvxViewForwarder
 {
 public:
-    SvxTextEditSource( SdrObject* pObj, SdrText* pText, ::com::sun::star::uno::XInterface* pOwner);
+    SvxTextEditSource( SdrObject* pObj, SdrText* pText );
 
     /** Since the views don't broadcast their dying, make sure that
         this object gets destroyed if the view becomes invalid
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 0407bbe..1b9a982 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -420,7 +420,7 @@ void Cell::SetModel(SdrModel* pNewModel)
         }
         else
         {
-            SetEditSource( new SvxTextEditSource( &GetObject(), this, static_cast< XWeak * >( this ) ) );
+            SetEditSource( new SvxTextEditSource( &GetObject(), this ) );
         }
 
         SetStyleSheet( 0, true );
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 1dd3bba..0c2e607 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -3962,7 +3962,7 @@ SvxShapeText::SvxShapeText( SdrObject* pObject ) throw ()
 : SvxShape( pObject, getSvxMapProvider().GetMap(SVXMAP_TEXT), getSvxMapProvider().GetPropertySet(SVXMAP_TEXT, SdrObject::GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
 {
     if( pObject && pObject->GetModel() )
-        SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) );
+        SetEditSource( new SvxTextEditSource( pObject, 0 ) );
 }
 
 
@@ -3970,7 +3970,7 @@ SvxShapeText::SvxShapeText( SdrObject* pObject, const SfxItemPropertyMapEntry* p
 : SvxShape( pObject, pPropertyMap, pPropertySet ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
 {
     if( pObject && pObject->GetModel() )
-        SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) );
+        SetEditSource( new SvxTextEditSource( pObject, 0 ) );
 }
 
 
@@ -3984,7 +3984,7 @@ SvxShapeText::~SvxShapeText() throw ()
 void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
 {
     if( pNewObj && (NULL == GetEditSource()))
-        SetEditSource( new SvxTextEditSource( pNewObj, 0, static_cast< uno::XWeak* >(this) ) );
+        SetEditSource( new SvxTextEditSource( pNewObj, 0 ) );
     SvxShape::Create( pNewObj, pNewPage );
 }
 
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 1e854d5..93205e6 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -102,7 +102,6 @@ private:
     bool                            mbShapeIsEditMode;          // #104157# only true, if HINT_BEGEDIT was received
     bool                            mbNotificationsDisabled;    // prevent EditEngine/Outliner notifications (e.g. when setting up forwarder)
 
-    XInterface*                     mpOwner;
     SvxUnoTextRangeBaseList         maTextRanges;
 
     SvxTextForwarder*               GetBackgroundTextForwarder();
@@ -121,7 +120,7 @@ private:
     void                            dispose();
 
 public:
-    SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText, XInterface* pOwner );
+    SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText );
     SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText, SdrView& rView, const Window& rWindow );
     virtual ~SvxTextEditSourceImpl();
 
@@ -158,7 +157,7 @@ public:
 
 
 
-SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText, XInterface* pOwner )
+SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText )
   : maRefCount      ( 0 ),
     mpObject        ( pObject ),
     mpText          ( pText ),
@@ -175,8 +174,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText
     mbOldUndoMode   ( false ),
     mbForwarderIsEditMode ( false ),
     mbShapeIsEditMode     ( false ),
-    mbNotificationsDisabled ( false ),
-    mpOwner( pOwner )
+    mbNotificationsDisabled ( false )
 {
     DBG_ASSERT( mpObject, "invalid pObject!" );
 
@@ -213,8 +211,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText
     mbOldUndoMode   ( false ),
     mbForwarderIsEditMode ( false ),
     mbShapeIsEditMode     ( true ),
-    mbNotificationsDisabled ( false ),
-    mpOwner(0)
+    mbNotificationsDisabled ( false )
 {
     if( !mpText )
     {
@@ -304,7 +301,6 @@ void SvxTextEditSourceImpl::ChangeModel( SdrModel* pNewModel )
 
         mpWindow = 0;
         m_xLinguServiceManager.clear();
-        mpOwner = 0;
 
         mpModel = pNewModel;
 
@@ -1039,9 +1035,9 @@ IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify)
 // SvxTextEditSource
 
 
-SvxTextEditSource::SvxTextEditSource( SdrObject* pObject, SdrText* pText, XInterface* pOwner )
+SvxTextEditSource::SvxTextEditSource( SdrObject* pObject, SdrText* pText )
 {
-    mpImpl = new SvxTextEditSourceImpl( pObject, pText, pOwner );
+    mpImpl = new SvxTextEditSourceImpl( pObject, pText );
     mpImpl->acquire();
 }
 
commit b8f7ea5da41d61d405adec54dcd10b54ee0e5591
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Jun 23 19:20:07 2014 +0200

    Related bnc#822625: Minimum height was not invalidated when rectangle changes.
    
    5792e76cb5beb630c135f57b74f57d74dd2dc2b0 was too optimistic and did not
    invalidate mnCachedMinHeight often enough.
    This was resulting in a grey area below table frame when resizing it.
    
    So, revert 5792e76cb5beb630c135f57b74f57d74dd2dc2b0
    "Related bnc#822625: Cache minimum height for table cells."
    and istead just use getMinimumWidth() in TableLayouter if that's all we need.
    getMinimumHeight() is expensive.
    
    Change-Id: I34c49dda75d6ccccaa5b4d3746114352621a40dd

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 6b0fc19..0407bbe 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -359,7 +359,6 @@ Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) th
 , mbMerged( false )
 , mnRowSpan( 1 )
 , mnColSpan( 1 )
-, mnCachedMinHeight( -1 )
 , mxTable( rTableObj.getTable() )
 {
     if( rTableObj.GetModel() )
@@ -526,7 +525,6 @@ void Cell::setMerged()
 
 void Cell::notifyModified()
 {
-    mnCachedMinHeight = -1;
     if( mxTable.is() )
         mxTable->setModified( sal_True );
 }
@@ -683,10 +681,8 @@ sal_Int32 Cell::getMinimumHeight()
     if( !mpProperties )
         return 0;
 
-    if( mnCachedMinHeight != -1 )
-        return mnCachedMinHeight;
-
     SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+    sal_Int32 nMinimumHeight = 0;
 
     Rectangle aTextRect;
     TakeTextAnchorRect( aTextRect );
@@ -697,7 +693,7 @@ sal_Int32 Cell::getMinimumHeight()
     if(pEditOutliner)
     {
         pEditOutliner->SetMaxAutoPaperSize(aSize);
-        mnCachedMinHeight = pEditOutliner->GetTextHeight()+1;
+        nMinimumHeight = pEditOutliner->GetTextHeight()+1;
     }
     else /*if ( hasText() )*/
     {
@@ -710,12 +706,12 @@ sal_Int32 Cell::getMinimumHeight()
         {
             rOutliner.SetText(*GetOutlinerParaObject());
         }
-        mnCachedMinHeight=rOutliner.GetTextHeight()+1;
+        nMinimumHeight=rOutliner.GetTextHeight()+1;
         rOutliner.Clear();
     }
 
-    mnCachedMinHeight += GetTextUpperDistance() + GetTextLowerDistance();
-    return mnCachedMinHeight;
+    nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
+    return nMinimumHeight;
 }
 
 
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index d5d7eb0..82d717d 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -226,7 +226,6 @@ private:
     bool      mbMerged;
     ::sal_Int32     mnRowSpan;
     ::sal_Int32     mnColSpan;
-    ::sal_Int32     mnCachedMinHeight;
 
     Rectangle maCellRect;
 
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 7f4651d..b3743eb 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -554,7 +554,7 @@ void TableLayouter::LayoutTableWidth( Rectangle& rArea, bool bFit )
                 }
                 else
                 {
-                    nMinWidth = std::max( nMinWidth, xCell->getMinimumSize().Width );
+                    nMinWidth = std::max( nMinWidth, xCell->getMinimumWidth() );
                 }
             }
         }
@@ -620,7 +620,7 @@ void TableLayouter::LayoutTableWidth( Rectangle& rArea, bool bFit )
         while( iter != aMergedCells[nCol].end() )
         {
             CellRef xCell( (*iter++) );
-            sal_Int32 nMinWidth = xCell->getMinimumSize().Width;
+            sal_Int32 nMinWidth = xCell->getMinimumWidth();
 
             for( sal_Int32 nMCol = nCol - xCell->getColumnSpan() + 1; (nMCol > 0) && (nMCol < nCol); ++nMCol )
                 nMinWidth -= maColumns[nMCol].mnSize;
@@ -704,7 +704,7 @@ void TableLayouter::LayoutTableHeight( Rectangle& rArea, bool bFit )
                 }
                 else
                 {
-                    nMinHeight = std::max( nMinHeight, xCell->getMinimumSize().Height );
+                    nMinHeight = std::max( nMinHeight, xCell->getMinimumHeight() );
                 }
             }
         }
@@ -771,7 +771,7 @@ void TableLayouter::LayoutTableHeight( Rectangle& rArea, bool bFit )
         while( iter != aMergedCells[nRow].end() )
         {
             CellRef xCell( (*iter++) );
-            sal_Int32 nMinHeight = xCell->getMinimumSize().Height;
+            sal_Int32 nMinHeight = xCell->getMinimumHeight();
 
             for( sal_Int32 nMRow = nRow - xCell->getRowSpan() + 1; (nMRow > 0) && (nMRow < nRow); ++nMRow )
                 nMinHeight -= maRows[nMRow].mnSize;


More information about the Libreoffice-commits mailing list