[PATCH] Resolves fdo#61540

Karthikeyan Krishnamurthi (via Code Review) gerrit at gerrit.libreoffice.org
Sat Mar 23 23:23:12 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2958

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/58/2958/1

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).

Change-Id: Ib52e3633aecb1220cdf709058391361376dc5f00
---
M svx/source/table/tablecontroller.cxx
1 file changed, 11 insertions(+), 4 deletions(-)



diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index ff6037c..dd3065e 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -554,10 +554,17 @@
 
             for( sal_Int32 nOffset = 0; nOffset < nNewColumns; nOffset++ )
             {
-                Reference< XPropertySet >( xCols->getByIndex( aEnd.mnCol + nOffset + 1 ), UNO_QUERY_THROW )->
-                    setPropertyValue( sSize,
-                        Reference< XPropertySet >( xCols->getByIndex( aStart.mnCol + nOffset ), UNO_QUERY_THROW )->
-                            getPropertyValue( sSize ) );
+              /*
+                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( bInsertAfter?nNewStartColumn-1:nNewStartColumn+nNewColumns ), UNO_QUERY_THROW )->
+                      getPropertyValue( sSize ) );
             }
 
             if( bUndo )

-- 
To view, visit https://gerrit.libreoffice.org/2958
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib52e3633aecb1220cdf709058391361376dc5f00
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Karthikeyan Krishnamurthi <karthikeyan at kacst.edu.sa>



More information about the LibreOffice mailing list