diff options
Diffstat (limited to 'svx/source/table/tablecontroller.cxx')
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 1cb3035e4abb..74c42cb86e38 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -554,9 +554,14 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ ) { - Reference< XPropertySet >( xCols->getByIndex( aEnd.mnCol + nOffset + 1 ), UNO_QUERY_THROW )-> + // Resolves fdo#61540 + // On Insert before, the reference column whose size is going to be + // used for newly created column(s) is wrong. As the new columns are + // inserted before the reference column, the reference column moved + // to the new position by no., of new columns i.e (earlier+newcolumns). + Reference< XPropertySet >(xCols->getByIndex(nNewStartColumn+nOffset), UNO_QUERY_THROW )-> setPropertyValue( sSize, - Reference< XPropertySet >( xCols->getByIndex( aStart.mnCol + nOffset ), UNO_QUERY_THROW )-> + Reference< XPropertySet >(xCols->getByIndex( bInsertAfter?nNewStartColumn-1:nNewStartColumn+nNewColumns ), UNO_QUERY_THROW )-> getPropertyValue( sSize ) ); } |