diff options
Diffstat (limited to 'svx/source/table')
-rw-r--r-- | svx/source/table/accessiblecell.cxx | 11 | ||||
-rw-r--r-- | svx/source/table/accessiblecell.hxx | 1 | ||||
-rw-r--r-- | svx/source/table/accessibletableshape.cxx | 11 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 66 | ||||
-rw-r--r-- | svx/source/table/cell.hxx | 180 | ||||
-rw-r--r-- | svx/source/table/celleditsource.hxx | 2 | ||||
-rw-r--r-- | svx/source/table/makefile.mk | 17 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 15 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 45 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.hxx | 113 | ||||
-rw-r--r-- | svx/source/table/tablehandles.cxx | 281 | ||||
-rw-r--r-- | svx/source/table/tablehandles.hxx | 5 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/viewcontactoftableobj.cxx | 37 |
14 files changed, 405 insertions, 381 deletions
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 6f4bea3cbd40..d76d5e1b3079 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -573,4 +573,15 @@ sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent (void) throw (Runt return mnIndexInParent; } +::rtl::OUString SAL_CALL AccessibleCell::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException) +{ + ThrowIfDisposed (); + ::vos::OGuard aSolarGuard (::Application::GetSolarMutex()); + + if( mxCell.is() ) + return mxCell->getName(); + + return AccessibleCellBase::getAccessibleName(); +} + } // end of namespace accessibility diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx index 166495ecc83d..95c8d684fe3b 100644 --- a/svx/source/table/accessiblecell.hxx +++ b/svx/source/table/accessiblecell.hxx @@ -85,6 +85,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet(void) throw(::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(void) throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException); // XAccessibleComponent virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint) throw (::com::sun::star::uno::RuntimeException); diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index 89e18137eeb0..455d39eee467 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -160,6 +160,8 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild( sal_Int32 maChildMap[xCell] = xAccessibleCell; + xAccessibleCell->Init(); + Reference< XAccessible > xChild( xAccessibleCell.get() ); return xChild; } @@ -501,10 +503,11 @@ Reference< XAccessible > SAL_CALL AccessibleTableShape::getAccessibleCellAt( sal ::vos::OGuard aSolarGuard (::Application::GetSolarMutex()); checkCellPosition( nColumn, nRow ); - (void)nRow; - (void)nColumn; - Reference< XAccessible > xRet; - return xRet; + sal_Int32 nChildIndex = 0; + if( mxImpl->mxTable.is() ) + nChildIndex = mxImpl->mxTable->getColumnCount() * nRow + nColumn; + + return getAccessibleChild( nChildIndex ); } //-------------------------------------------------------------------- diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 4ac7b4754f8d..46268a68ca02 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1757,5 +1757,71 @@ void SAL_CALL Cell::disposing( const EventObject& /*Source*/ ) throw (RuntimeExc dispose(); } +static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow ) +{ + rtl::OUStringBuffer aBuf; + + if (nCol < 26*26) + { + if (nCol < 26) + aBuf.append( static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nCol))); + else + { + aBuf.append( static_cast<sal_Unicode>( 'A' + + (static_cast<sal_uInt16>(nCol) / 26) - 1)); + aBuf.append( static_cast<sal_Unicode>( 'A' + + (static_cast<sal_uInt16>(nCol) % 26))); + } + } + else + { + String aStr; + while (nCol >= 26) + { + sal_Int32 nC = nCol % 26; + aStr += static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nC)); + nCol = nCol - nC; + nCol = nCol / 26 - 1; + } + aStr += static_cast<sal_Unicode>( 'A' + + static_cast<sal_uInt16>(nCol)); + aStr.Reverse(); + aBuf.append( aStr); + } + aBuf.append( OUString::valueOf(nRow+1) ); + return aBuf.makeStringAndClear(); +} + +OUString Cell::getName() +{ + // todo: optimize! + OUString sName; + if( mxTable.is() ) try + { + Reference< XCell > xThis( static_cast< XCell* >( this ) ); + + sal_Int32 nRowCount = mxTable->getRowCount(); + sal_Int32 nColCount = mxTable->getColumnCount(); + for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ ) + { + for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ ) + { + Reference< XCell > xCell( mxTable->getCellByPosition( nCol, nRow ) ); + if( xCell == xThis ) + { + return getCellName( nCol, nRow ); + } + } + } + } + catch( Exception& ) + { + } + + return sName; +} + } } diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx index e48fe5bf74d9..901fe4735e51 100644 --- a/svx/source/table/cell.hxx +++ b/svx/source/table/cell.hxx @@ -58,7 +58,7 @@ namespace sdr { namespace table { // ----------------------------------------------------------------------------- -class Cell : public SdrText, +class SVX_DLLPUBLIC Cell : public SdrText, public SvxUnoTextBase, public ::com::sun::star::table::XMergeableCell, public ::com::sun::star::awt::XLayoutConstrains, @@ -68,156 +68,158 @@ class Cell : public SdrText, friend class CellUndo; public: - static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ); + SVX_DLLPRIVATE static rtl::Reference< Cell > create( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ); // private - void dispose(); + SVX_DLLPRIVATE void dispose(); // SdrTextShape proxy bool IsTextEditActive(); - bool hasText() const; + SVX_DLLPRIVATE bool hasText() const; - void cloneFrom( const CellRef& rCell ); + SVX_DLLPRIVATE void cloneFrom( const CellRef& rCell ); - void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; } - const ::Rectangle& getCellRect() const { return maCellRect; } - ::Rectangle& getCellRect() { return maCellRect; } + SVX_DLLPRIVATE void setCellRect( ::Rectangle& rCellRect ) { maCellRect = rCellRect; } + SVX_DLLPRIVATE const ::Rectangle& getCellRect() const { return maCellRect; } + SVX_DLLPRIVATE ::Rectangle& getCellRect() { return maCellRect; } OutlinerParaObject* GetEditOutlinerParaObject() const; - void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr ); - virtual SfxStyleSheet* GetStyleSheet() const; + SVX_DLLPRIVATE void SetStyleSheet( SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr ); + SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const; SfxStyleSheetPool* GetStyleSheetPool() const; - virtual const Rectangle& GetCurrentBoundRect() const; - virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const; + SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const; + SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const; - virtual const SfxItemSet& GetItemSet() const; - void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems); + SVX_DLLPRIVATE virtual const SfxItemSet& GetItemSet() const; + SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems); void SetMergedItem(const SfxPoolItem& rItem); - sal_Int32 getMinimumWidth(); - sal_Int32 getMinimumHeight(); + SVX_DLLPRIVATE sal_Int32 getMinimumWidth(); + SVX_DLLPRIVATE sal_Int32 getMinimumHeight(); - long GetTextLeftDistance() const; - long GetTextRightDistance() const; - long GetTextUpperDistance() const; - long GetTextLowerDistance() const; + SVX_DLLPRIVATE long GetTextLeftDistance() const; + SVX_DLLPRIVATE long GetTextRightDistance() const; + SVX_DLLPRIVATE long GetTextUpperDistance() const; + SVX_DLLPRIVATE long GetTextLowerDistance() const; - SdrTextVertAdjust GetTextVerticalAdjust() const; + SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const; SdrTextHorzAdjust GetTextHorizontalAdjust() const; - virtual void SetModel(SdrModel* pNewModel); + SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel); - void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ); - void mergeContent( const CellRef& xSourceCell ); - void replaceContentAndFormating( const CellRef& xSourceCell ); + SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ); + SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell ); + SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell ); - void setMerged(); + SVX_DLLPRIVATE void setMerged(); // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& Type ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL acquire() throw (); + SVX_DLLPRIVATE virtual void SAL_CALL release() throw (); // XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // XLayoutConstrains - virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException); // XMergeableCell - virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getRowSpan() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColumnSpan() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::sal_Bool SAL_CALL isMerged() throw (::com::sun::star::uno::RuntimeException); // XCell - virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException); - virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setFormula( const ::rtl::OUString& aFormula ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual double SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setValue( double nValue ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::table::CellContentType SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual sal_Int32 SAL_CALL getError() throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::beans::XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 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); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, 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 getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XMultiPropertySet - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::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::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::beans::XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XMultiPropertyStates - virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); // XFastPropertySet - 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); - 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); + 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 - 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); - 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); + 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); + 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); // XSimpleText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& aTextPosition ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, const ::rtl::OUString& aString, ::sal_Bool bAbsorb ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, ::sal_Int16 nControlCharacter, ::sal_Bool bAbsorb ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); // XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual ::rtl::OUString SAL_CALL getString( ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL setString( const ::rtl::OUString& aString ) throw (::com::sun::star::uno::RuntimeException); // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + SVX_DLLPRIVATE virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); - virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); + SVX_DLLPRIVATE virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); - void AddUndo(); + SVX_DLLPRIVATE void AddUndo(); using SvxUnoTextRangeBase::setPropertyValue; using SvxUnoTextRangeBase::getPropertyValue; - sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell ); + SVX_DLLPRIVATE sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell ); - static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell ); + SVX_DLLPRIVATE static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell ); - void notifyModified(); + SVX_DLLPRIVATE void notifyModified(); + + ::rtl::OUString getName(); protected: - virtual const SfxItemSet& GetObjectItemSet(); - virtual void SetObjectItem(const SfxPoolItem& rItem); + SVX_DLLPRIVATE virtual const SfxItemSet& GetObjectItemSet(); + SVX_DLLPRIVATE virtual void SetObjectItem(const SfxPoolItem& rItem); - ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ); + SVX_DLLPRIVATE ::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ); private: - Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw(); - virtual ~Cell() throw(); + SVX_DLLPRIVATE Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) throw(); + SVX_DLLPRIVATE virtual ~Cell() throw(); const SvxItemPropertySet* mpPropSet; diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx index 72d0f18c582f..1d097dc6ede5 100644 --- a/svx/source/table/celleditsource.hxx +++ b/svx/source/table/celleditsource.hxx @@ -73,7 +73,7 @@ public: void lock(); void unlock(); - // the viewforwarder interface + // the SvxViewForwarder interface virtual BOOL IsValid() const; virtual Rectangle GetVisArea() const; virtual Point LogicToPixel( const Point&, const MapMode& ) const; diff --git a/svx/source/table/makefile.mk b/svx/source/table/makefile.mk index 8789cd4da86b..ae0dc5eb685a 100644 --- a/svx/source/table/makefile.mk +++ b/svx/source/table/makefile.mk @@ -36,6 +36,7 @@ PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch PRJNAME=svx TARGET=table +LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE; # --- Settings ----------------------------------------------------- @@ -45,9 +46,9 @@ ENABLE_EXCEPTIONS=TRUE; # --- Files -------------------------------------------------------- -SLOFILES= \ +LIB1TARGET= $(SLB)$/$(TARGET)-core.lib +LIB1OBJFILES= \ $(SLO)$/propertyset.obj\ - $(SLO)$/celleditsource.obj\ $(SLO)$/cell.obj\ $(SLO)$/cellrange.obj\ $(SLO)$/cellcursor.obj\ @@ -61,13 +62,19 @@ SLOFILES= \ $(SLO)$/tablelayouter.obj\ $(SLO)$/tablehandles.obj\ $(SLO)$/tablecontroller.obj\ - $(SLO)$/tabledesign.obj\ - $(SLO)$/tableundo.obj\ - $(SLO)$/accessibletableshape.obj\ + $(SLO)$/tableundo.obj + +LIB2TARGET= $(SLB)$/$(TARGET).lib +LIB2OBJFILES= \ + $(SLO)$/celleditsource.obj \ + $(SLO)$/tabledesign.obj \ + $(SLO)$/accessibletableshape.obj \ $(SLO)$/accessiblecell.obj \ $(SLO)$/tablertfexporter.obj \ $(SLO)$/tablertfimporter.obj +SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) + SRS1NAME=table SRC1FILES= table.src diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index c42feb83c742..44caaee6c148 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1930,21 +1930,6 @@ void lcl_VertLine( OutputDevice& rDev, const Point& rTop, const Point& rBottom, // -------------------------------------------------------------------- -SdrObject* SdrTableObj::CheckHit(const Point& rPnt, USHORT /*nTol*/, const SetOfByte* pVisiLayer) const -{ - if(pVisiLayer && !pVisiLayer->IsSet(sal::static_int_cast< sal_uInt8 >(GetLayer()))) - { - return NULL; - } - - if( (rPnt.X() >= aOutRect.Left()) && (rPnt.X() <= aOutRect.Right()) && (rPnt.Y() >= aOutRect.Top()) && rPnt.Y() <= aOutRect.Bottom() ) - return const_cast<SdrObject*>(static_cast<const SdrObject*>(this)); - - return NULL; -} - -// -------------------------------------------------------------------- - void SdrTableObj::TakeObjNameSingul(XubString& rName) const { rName = ImpGetResStr(STR_ObjNameSingulTable); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 1d7b3f8a3295..c99c2b3c2262 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -493,7 +493,7 @@ void SvxTableController::GetState( SfxItemSet& rSet ) // -------------------------------------------------------------------- -void SvxTableController::onInsert( sal_uInt16 nSId ) +void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) { ::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() ); if( !pTableObj ) @@ -501,6 +501,21 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) if( mxTable.is() ) try { + // + bool bInsertAfter = true; + sal_uInt16 nCount = 0; + if( pArgs ) + { + const SfxPoolItem* pItem = 0; + pArgs->GetItemState(nSId, FALSE, &pItem); + if (pItem) + { + nCount = ((const SfxInt16Item* )pItem)->GetValue(); + if(SFX_ITEM_SET == pArgs->GetItemState(SID_TABLE_PARAM_INSERT_AFTER, TRUE, &pItem)) + bInsertAfter = ((const SfxBoolItem* )pItem)->GetValue(); + } + } + CellPos aStart, aEnd; if( hasSelectedCells() ) { @@ -508,9 +523,12 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } else { - aStart.mnCol = mxTable->getColumnCount() - 1; - aStart.mnRow = mxTable->getRowCount() - 1; - aEnd = aStart; + if( bInsertAfter ) + { + aStart.mnCol = mxTable->getColumnCount() - 1; + aStart.mnRow = mxTable->getRowCount() - 1; + aEnd = aStart; + } } if( pTableObj->IsTextEditActive() ) @@ -535,8 +553,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } Reference< XTableColumns > xCols( mxTable->getColumns() ); - const sal_Int32 nNewColumns = aEnd.mnCol - aStart.mnCol + 1; - xCols->insertByIndex( aEnd.mnCol + 1, nNewColumns ); + const sal_Int32 nNewColumns = (nCount == 0) ? (aEnd.mnCol - aStart.mnCol + 1) : nCount; + const sal_Int32 nNewStartColumn = aEnd.mnCol + (bInsertAfter ? 1 : 0); + xCols->insertByIndex( nNewStartColumn, nNewColumns ); for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ ) { @@ -552,7 +571,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) if( mpModel ) mpModel->SetChanged(); - aStart.mnCol = aEnd.mnCol+1; + aStart.mnCol = nNewStartColumn; aStart.mnRow = 0; aEnd.mnCol = aStart.mnCol + nNewColumns - 1; aEnd.mnRow = mxTable->getRowCount() - 1; @@ -570,8 +589,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) } Reference< XTableRows > xRows( mxTable->getRows() ); - const sal_Int32 nNewRows = aEnd.mnRow - aStart.mnRow + 1; - xRows->insertByIndex( aEnd.mnRow + 1, nNewRows ); + const sal_Int32 nNewRows = (nCount == 0) ? (aEnd.mnRow - aStart.mnRow + 1) : nCount; + const sal_Int32 nNewRowStart = aEnd.mnRow + (bInsertAfter ? 1 : 0); + xRows->insertByIndex( nNewRowStart, nNewRows ); for( sal_Int32 nOffset = 0; nOffset < nNewRows; nOffset++ ) { @@ -591,7 +611,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId ) mpModel->SetChanged(); aStart.mnCol = 0; - aStart.mnRow = aEnd.mnRow+1; + aStart.mnRow = nNewRowStart; aEnd.mnCol = mxTable->getColumnCount() - 1; aEnd.mnRow = aStart.mnRow + nNewRows - 1; break; @@ -759,7 +779,7 @@ void SvxTableController::Execute( SfxRequest& rReq ) { case SID_TABLE_INSERT_ROW: case SID_TABLE_INSERT_COL: - onInsert( nSId ); + onInsert( nSId, rReq.GetArgs() ); break; case SID_TABLE_DELETE_ROW: case SID_TABLE_DELETE_COL: @@ -1490,7 +1510,7 @@ bool SvxTableController::executeAction( sal_uInt16 nAction, bool bSelect, Window CellPos aNextCell( pTableObj->getNextCell( aSelectionEnd, true ) ); if( aSelectionEnd == aNextCell ) { - onInsert( SID_TABLE_INSERT_ROW ); + onInsert( SID_TABLE_INSERT_ROW, 0 ); aNextCell = pTableObj->getNextCell( aSelectionEnd, true ); } gotoCell( aNextCell, false, pWindow, nAction ); @@ -1952,7 +1972,6 @@ void SvxTableController::updateSelectionOverlay() if( pOverlayManager ) { // sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_INVERT; - // sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_HATCH; sdr::overlay::CellOverlayType eType = sdr::overlay::CELL_OVERLAY_TRANSPARENT; sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges ); diff --git a/svx/source/table/tablecontroller.hxx b/svx/source/table/tablecontroller.hxx index 4caf7cd957a1..e13fad84179e 100644 --- a/svx/source/table/tablecontroller.hxx +++ b/svx/source/table/tablecontroller.hxx @@ -43,6 +43,7 @@ class SdrObjEditView; class SdrObject; +class SfxItemSet; namespace sdr { namespace table { @@ -50,97 +51,97 @@ const sal_Int16 SELTYPE_NONE = 0; const sal_Int16 SELTYPE_MOUSE = 1; const sal_Int16 SELTYPE_KEYS = 2; -class SvxTableController: public sdr::SelectionController +class SVX_DLLPUBLIC SvxTableController: public sdr::SelectionController { public: - SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ); - virtual ~SvxTableController(); + SVX_DLLPRIVATE SvxTableController( SdrObjEditView* pView, const SdrObject* pObj ); + SVX_DLLPRIVATE virtual ~SvxTableController(); - virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin); - virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin); - virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin); - virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin); + SVX_DLLPRIVATE virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin); - virtual bool DeleteMarked(); + SVX_DLLPRIVATE virtual bool DeleteMarked(); - virtual void onSelectionHasChanged(); + SVX_DLLPRIVATE virtual void onSelectionHasChanged(); - virtual void GetState( SfxItemSet& rSet ); - virtual void Execute( SfxRequest& rReq ); + SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ); + SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ); - virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; - virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); + SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; + SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); // slots - void onInsert( sal_uInt16 nSId ); - void onDelete( sal_uInt16 nSId ); - void onSelect( sal_uInt16 nSId ); - void onFormatTable( SfxRequest& rReq ); - void MergeMarkedCells(); - void SplitMarkedCells(); - void DistributeColumns(); - void DistributeRows(); - void SetVertical( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = 0 ); + SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onFormatTable( SfxRequest& rReq ); + SVX_DLLPRIVATE void MergeMarkedCells(); + SVX_DLLPRIVATE void SplitMarkedCells(); + SVX_DLLPRIVATE void DistributeColumns(); + SVX_DLLPRIVATE void DistributeRows(); + SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId ); - static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ); + SVX_DLLPRIVATE static rtl::Reference< sdr::SelectionController > create( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController ); - void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const; - void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll); + SVX_DLLPRIVATE void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const; + SVX_DLLPRIVATE void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll); - virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; - virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SVX_DLLPRIVATE virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + SVX_DLLPRIVATE virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); - virtual bool GetMarkedObjModel( SdrPage* pNewPage ); - virtual bool PasteObjModel( const SdrModel& rModel ); + SVX_DLLPRIVATE virtual bool GetMarkedObjModel( SdrPage* pNewPage ); + SVX_DLLPRIVATE virtual bool PasteObjModel( const SdrModel& rModel ); - bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); } + SVX_DLLPRIVATE bool hasSelectedCells() const { return mbCellSelectionMode || mpView->IsTextEdit(); } void getSelectedCells( CellPos& rFirstPos, CellPos& rLastPos ); void setSelectedCells( const CellPos& rFirstPos, const CellPos& rLastPos ); void clearSelection(); void selectAll(); - void onTableModified(); + SVX_DLLPRIVATE void onTableModified(); private: SvxTableController(SvxTableController &); // not defined void operator =(SvxTableController &); // not defined // internals - void ApplyBorderAttr( const SfxItemSet& rAttr ); - void UpdateTableShape(); + SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr ); + SVX_DLLPRIVATE void UpdateTableShape(); - void SetTableStyle( const SfxItemSet* pArgs ); - void SetTableStyleSettings( const SfxItemSet* pArgs ); + SVX_DLLPRIVATE void SetTableStyle( const SfxItemSet* pArgs ); + SVX_DLLPRIVATE void SetTableStyleSettings( const SfxItemSet* pArgs ); - bool PasteObject( SdrTableObj* pPasteTableObj ); + SVX_DLLPRIVATE bool PasteObject( SdrTableObj* pPasteTableObj ); - bool checkTableObject(); - bool updateTableObject(); - const CellPos& getSelectionStart(); - void setSelectionStart( const CellPos& rPos ); - const CellPos& getSelectionEnd(); - ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor(); - void checkCell( CellPos& rPos ); + SVX_DLLPRIVATE bool checkTableObject(); + SVX_DLLPRIVATE bool updateTableObject(); + SVX_DLLPRIVATE const CellPos& getSelectionStart(); + SVX_DLLPRIVATE void setSelectionStart( const CellPos& rPos ); + SVX_DLLPRIVATE const CellPos& getSelectionEnd(); + SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellCursor > getSelectionCursor(); + SVX_DLLPRIVATE void checkCell( CellPos& rPos ); - void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ); + SVX_DLLPRIVATE void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ); - void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 ); - bool StopTextEdit(); + SVX_DLLPRIVATE void EditCell( const CellPos& rPos, ::Window* pWindow, const ::com::sun::star::awt::MouseEvent* pMouseEvent = 0, sal_uInt16 nAction = 0 ); + SVX_DLLPRIVATE bool StopTextEdit(); - void DeleteTable(); + SVX_DLLPRIVATE void DeleteTable(); - sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow ); - bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow ); - void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 ); + SVX_DLLPRIVATE sal_uInt16 getKeyboardAction( const KeyEvent& rKEvt, Window* pWindow ); + SVX_DLLPRIVATE bool executeAction( sal_uInt16 nAction, bool bSelect, Window* pWindow ); + SVX_DLLPRIVATE void gotoCell( const CellPos& rCell, bool bSelect, Window* pWindow, sal_uInt16 nAction = 0 ); - void StartSelection( const CellPos& rPos ); - void UpdateSelection( const CellPos& rPos ); - void RemoveSelection(); - void updateSelectionOverlay(); - void destroySelectionOverlay(); + SVX_DLLPRIVATE void StartSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void UpdateSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void RemoveSelection(); + SVX_DLLPRIVATE void updateSelectionOverlay(); + SVX_DLLPRIVATE void destroySelectionOverlay(); - void findMergeOrigin( CellPos& rPos ); + SVX_DLLPRIVATE void findMergeOrigin( CellPos& rPos ); DECL_LINK( UpdateHdl, void * ); diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index 6b88e1d9a0ac..72e10e29c336 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -38,60 +38,36 @@ #include <vcl/salbtype.hxx> #include <vcl/canvastools.hxx> #include <vcl/hatch.hxx> - #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/range/b2drectangle.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> - #include <svx/sdr/overlay/overlayobject.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/sdrpagewindow.hxx> #include <sdrpaintwindow.hxx> #include <svx/svdmrkv.hxx> #include <svx/svdpagv.hxx> - +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <svx/sdr/overlay/overlayhatchrect.hxx> +#include <drawinglayer/primitive2d/hittestprimitive2d.hxx> namespace sdr { namespace table { -class OverlayTableEdge : public sdr::overlay::OverlayObject -{ -protected: - basegfx::B2DPolyPolygon maPolyPolygon; - - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - -public: - OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon ); - virtual ~OverlayTableEdge(); -}; - // -------------------------------------------------------------------- -class OverlayTableBorder : public sdr::overlay::OverlayObject +class OverlayTableEdge : public sdr::overlay::OverlayObject { protected: basegfx::B2DPolyPolygon maPolyPolygon; + bool mbVisible; - // Draw geometry - virtual void drawGeometry(OutputDevice& rOutputDevice); - - // Create the BaseRange. This method needs to calculate maBaseRange. - virtual void createBaseRange(OutputDevice& rOutputDevice); - - virtual void transform(const basegfx::B2DHomMatrix& rMatrix); - - virtual sal_Bool isHit(const basegfx::B2DPoint& rPos, double fTol = 0.0) const; + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); public: - OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon ); - virtual ~OverlayTableBorder(); + OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible ); + virtual ~OverlayTableEdge(); }; // -------------------------------------------------------------------- @@ -134,40 +110,23 @@ sal_Int32 TableEdgeHdl::GetValidDragOffset( const SdrDragStat& rDrag ) const basegfx::B2DPolyPolygon TableEdgeHdl::getSpecialDragPoly(const SdrDragStat& rDrag) const { - return GetPolyPolygon(false, &rDrag); -} + basegfx::B2DPolyPolygon aVisible; + basegfx::B2DPolyPolygon aInvisible; -bool TableEdgeHdl::IsHdlHit(const Point& rPnt) const -{ - if( GetPointNum() != 0 ) - { - double fTol = 0.0; - if( pHdlList ) - { - SdrMarkView* pView = pHdlList->GetView(); - if( pView ) - { - OutputDevice* pOutDev = pView->GetFirstOutputDevice(); - if( pOutDev ) - { - fTol = static_cast<double>(pOutDev->PixelToLogic(Size(3, 3)).Width()); - } - } - } + // create and return visible and non-visible parts for drag + getPolyPolygon(aVisible, aInvisible, &rDrag); + aVisible.append(aInvisible); - basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y()); - if( basegfx::tools::isInEpsilonRange( maVisiblePolygon, aPosition, fTol ) ) - return sal_True; - } - return false; + return aVisible; } - -basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag /*= 0*/ ) const +void TableEdgeHdl::getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const { - basegfx::B2DPolyPolygon aRetValue; - + // changed method to create visible and invisible partial polygons in one run in + // separate PolyPolygons; both kinds are used basegfx::B2DPoint aOffset(aPos.X(), aPos.Y()); + rVisible.clear(); + rInvisible.clear(); if( pDrag ) { @@ -176,37 +135,35 @@ basegfx::B2DPolyPolygon TableEdgeHdl::GetPolyPolygon( bool bOnlyVisible, const S } basegfx::B2DPoint aStart(aOffset), aEnd(aOffset); - int nPos = mbHorizontal ? 0 : 1; - - // base line hit, check for edges TableEdgeVector::const_iterator aIter( maEdges.begin() ); + while( aIter != maEdges.end() ) { TableEdge aEdge(*aIter++); - if( aEdge.meState == Visible || ( aEdge.meState == Invisible && !bOnlyVisible ) ) - { - aStart[nPos] = aOffset[nPos] + aEdge.mnStart; - aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd; + aStart[nPos] = aOffset[nPos] + aEdge.mnStart; + aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd; - basegfx::B2DPolygon aPolygon; - aPolygon.append( aStart ); - aPolygon.append( aEnd ); + basegfx::B2DPolygon aPolygon; + aPolygon.append( aStart ); + aPolygon.append( aEnd ); - aRetValue.append( aPolygon ); + if(aEdge.meState == Visible) + { + rVisible.append(aPolygon); + } + else + { + rInvisible.append(aPolygon); } } - - return aRetValue; } void TableEdgeHdl::CreateB2dIAObject() { GetRidOfIAObject(); - maVisiblePolygon = GetPolyPolygon(false); - if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden()) { SdrMarkView* pView = pHdlList->GetView(); @@ -214,20 +171,40 @@ void TableEdgeHdl::CreateB2dIAObject() if(pPageView) { - for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++) - { - // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b]; - const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow); + basegfx::B2DPolyPolygon aVisible; + basegfx::B2DPolyPolygon aInvisible; - if(rPageWindow.GetPaintWindow().OutputToWindow()) + // get visible and invisible parts + getPolyPolygon(aVisible, aInvisible, 0); + + if(aVisible.count() || aInvisible.count()) + { + for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++) { - if(rPageWindow.GetOverlayManager()) - { - ::sdr::overlay::OverlayObject* pOverlayObject = - new OverlayTableEdge( GetPolyPolygon(true) ); + const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow); - rPageWindow.GetOverlayManager()->add(*pOverlayObject); - maOverlayGroup.append(*pOverlayObject); + if(rPageWindow.GetPaintWindow().OutputToWindow()) + { + if(rPageWindow.GetOverlayManager()) + { + if(aVisible.count()) + { + // create overlay object for visible parts + sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true); + rPageWindow.GetOverlayManager()->add(*pOverlayObject); + maOverlayGroup.append(*pOverlayObject); + } + + if(aInvisible.count()) + { + // also create overlay object vor invisible parts to allow + // a standard HitTest using the primitives from that overlay object + // (see OverlayTableEdge implementation) + sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false); + rPageWindow.GetOverlayManager()->add(*pOverlayObject); + maOverlayGroup.append(*pOverlayObject); + } + } } } } @@ -237,9 +214,10 @@ void TableEdgeHdl::CreateB2dIAObject() ////////////////////////////////////////////////////////////////////////////// -OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon ) +OverlayTableEdge::OverlayTableEdge( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bVisible ) : OverlayObject(Color(COL_GRAY)) , maPolyPolygon( rPolyPolygon ) +, mbVisible(bVisible) { } @@ -247,47 +225,35 @@ OverlayTableEdge::~OverlayTableEdge() { } -void OverlayTableEdge::drawGeometry(OutputDevice& rOutputDevice) +drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayObjectPrimitive2DSequence() { - rOutputDevice.SetLineColor(getBaseColor()); - rOutputDevice.SetFillColor(); + drawinglayer::primitive2d::Primitive2DSequence aRetval; - for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++) + if(maPolyPolygon.count()) { -/* - const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a); - const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L)); - const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L)); - const Point aStartPoint(FRound(aStart.getX()), FRound(aStart.getY())); - const Point aEndPoint(FRound(aEnd.getX()), FRound(aEnd.getY())); - rOutputDevice.DrawLine(aStartPoint, aEndPoint); -*/ - PolyPolygon aPolyPolygon( maPolyPolygon ); - rOutputDevice.DrawTransparent( aPolyPolygon, 50 ); - } -} - -void OverlayTableEdge::transform(const basegfx::B2DHomMatrix& rMatrix) -{ - maPolyPolygon.transform( rMatrix ); -} - -void OverlayTableEdge::createBaseRange(OutputDevice& /*rOutputDevice*/) -{ - // reset range and expand it - maBaseRange.reset(); - - if(isHittable()) - { - for(sal_uInt32 a(0L); a < maPolyPolygon.count();a ++) + // Discussed with CL. Currently i will leave the transparence out since this + // a little bit expensive. We may check the look with drag polygons later + const drawinglayer::primitive2d::Primitive2DReference aReference( + new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D( + maPolyPolygon, + getBaseColor().getBColor())); + + if(mbVisible) + { + // visible, just return as sequence + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); + } + else { - const basegfx::B2DPolygon aPolygon = maPolyPolygon.getB2DPolygon(a); - const basegfx::B2DPoint aStart(aPolygon.getB2DPoint(0L)); - const basegfx::B2DPoint aEnd(aPolygon.getB2DPoint(aPolygon.count() - 1L)); - maBaseRange.expand(aStart); - maBaseRange.expand(aEnd); + // embed in HitTest primitive to support HitTest of this overlay object + const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1); + const drawinglayer::primitive2d::Primitive2DReference aNewReference( + new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence)); + aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1); } } + + return aRetval; } // ==================================================================== @@ -325,16 +291,15 @@ void TableBorderHdl::CreateB2dIAObject() { if(rPageWindow.GetOverlayManager()) { - OutputDevice& rOutDev = rPageWindow.GetPaintWindow().GetOutputDevice(); - - Size aBorderSize( rOutDev.PixelToLogic( Size( 6, 6 ) ) ); - basegfx::B2DRectangle aRect( vcl::unotools::b2DRectangleFromRectangle( maRectangle ) ); - basegfx::B2DPolyPolygon aPolyPolygon; - aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) ); - aRect.grow( aBorderSize.nA ); - aPolyPolygon.append(basegfx::tools::createPolygonFromRect( aRect ) ); - - ::sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableBorder( aPolyPolygon ); + const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle)); + sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect( + aRange.getMinimum(), + aRange.getMaximum(), + Color(0x80, 0x80, 0x80), + 6.0, + 0.0, + 45 * F_PI180, + 0.0); rPageWindow.GetOverlayManager()->add(*pOverlayObject); maOverlayGroup.append(*pOverlayObject); @@ -345,55 +310,7 @@ void TableBorderHdl::CreateB2dIAObject() } } -OverlayTableBorder::OverlayTableBorder( const basegfx::B2DPolyPolygon& rPolyPolygon ) -: OverlayObject(Color(COL_GRAY)) -, maPolyPolygon( rPolyPolygon ) -{ -} - -OverlayTableBorder::~OverlayTableBorder() -{ -} - -// Hittest with logical coordinates -sal_Bool OverlayTableBorder::isHit(const basegfx::B2DPoint& rPos, double /*fTol = 0.0*/) const -{ - if(isHittable()) - { - if( basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(1), rPos, true ) ) - if( !basegfx::tools::isInside( maPolyPolygon.getB2DPolygon(0), rPos, false ) ) - return sal_True; - } - return sal_False; -} - -// Draw geometry -void OverlayTableBorder::drawGeometry(OutputDevice& rOutputDevice) -{ - svtools::ColorConfig aColorConfig; - Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - const Hatch aHatch( HATCH_SINGLE, aHatchCol, 3, 450 ); - PolyPolygon aPolyPolygon( maPolyPolygon ); - rOutputDevice.DrawHatch( aPolyPolygon, aHatch ); -} - -// Create the BaseRange. This method needs to calculate maBaseRange. -void OverlayTableBorder::createBaseRange(OutputDevice& /*rOutputDevice*/) -{ - if(isHittable()) - { - maBaseRange = basegfx::tools::getRange(maPolyPolygon); - } - else - { - maBaseRange.reset(); - } -} - -void OverlayTableBorder::transform(const basegfx::B2DHomMatrix& rMatrix) -{ - maPolyPolygon.transform( rMatrix ); -} +////////////////////////////////////////////////////////////////////////////// } // end of namespace table } // end of namespace sdr diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx index a6831f72bc88..e78d7fc4bdd3 100644 --- a/svx/source/table/tablehandles.hxx +++ b/svx/source/table/tablehandles.hxx @@ -57,8 +57,6 @@ class TableEdgeHdl : public SdrHdl public: TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges ); - virtual bool IsHdlHit(const Point& rPnt) const; - sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const; virtual Pointer GetPointer() const; @@ -68,7 +66,7 @@ public: bool IsHorizontalEdge() const { return mbHorizontal; } basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const; - basegfx::B2DPolyPolygon GetPolyPolygon( bool bOnlyVisible, const SdrDragStat* pDrag = 0 ) const; + void getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const; protected: // create marker for this kind @@ -77,7 +75,6 @@ protected: private: bool mbHorizontal; sal_Int32 mnMin, mnMax; - basegfx::B2DPolyPolygon maVisiblePolygon; TableEdgeVector maEdges; }; diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 5c1aca5a4542..b2620452d31a 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -118,6 +118,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const width += maColumns[aPos.mnCol++].mnSize; nColSpan--; + nColSpan--; } } } @@ -128,6 +129,7 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const return basegfx::B2ITuple( width, height ); } + // ----------------------------------------------------------------------------- bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index c1c58977be64..45a24211f7b2 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -599,7 +599,30 @@ namespace sdr const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet(); const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol); const SdrText* pSdrText = rTableObj.getText(nTextIndex); - drawinglayer::attribute::SdrFillTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(rCellItemSet, pSdrText); + drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0; + + if(pSdrText) + { + // #i101508# take cell's local text frame distances into account + const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance()); + const sal_Int32 nRight(xCurrentCell->GetTextRightDistance()); + const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance()); + const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance()); + + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText, + &nLeft, + &nUpper, + &nRight, + &nLower); + } + else + { + pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( + rCellItemSet, + pSdrText); + } if(pAttribute) { @@ -664,17 +687,7 @@ namespace sdr if(pNewShadowAttribute) { - // attention: shadow is added BEFORE object stuff to render it BEHIND object (!) - const drawinglayer::primitive2d::Primitive2DReference xShadow(drawinglayer::primitive2d::createShadowPrimitive(xRetval, *pNewShadowAttribute)); - - if(xShadow.is()) - { - drawinglayer::primitive2d::Primitive2DSequence xContentWithShadow(2); - xContentWithShadow[0] = xShadow; - xContentWithShadow[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::GroupPrimitive2D(xRetval)); - xRetval = xContentWithShadow; - } - + xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute); delete pNewShadowAttribute; } } |