Bug 92145 - Writer text table rows can't be resized (with disabled rulers)
Summary: Writer text table rows can't be resized (with disabled rulers)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.2
Keywords: bibisected, bisected, regression
: 93268 93339 93554 93629 94532 (view as bug list)
Depends on:
Blocks: RenderContext
  Show dependency treegraph
 
Reported: 2015-06-18 01:44 UTC by Matthew Francis
Modified: 2016-10-31 01:18 UTC (History)
18 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Francis 2015-06-18 01:44:56 UTC
Since late 5.0 master, the rows in a text table can't be resized using the mouse. The "drag" cursor appears when the mouse is placed over a row divider, but immediately returns to a text cursor upon attempting to drag.
Comment 1 Matthew Francis 2015-06-18 01:50:28 UTC
Bisected, so taking the liberty of setting to NEW

This seems to have begun in the below patch set.
Adding Cc to quikee@gmail.com; Could you possibly take a look at this one? Thanks


commit 6cea2e61cf77bfe5bc53aa6002807c9b38e77499
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Tue Apr 28 15:09:39 2015 +0900

    fix compile: delegate RenderContext parameter to super
    
    Change-Id: I1c08e29c45d8334db52b129a957098481f3e57a4

commit 704ebef99de606f5a60c495130e6e3d791981042
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Tue Apr 28 12:55:45 2015 +0900

    remove old Paint(Rect&) method in vcl::Window
    
    Change-Id: I0f3377eaeb68f4933ccc3f86c9136c97c09c464d

commit 9905a8b953953b9ec5e123a17997d5931978acfe
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Tue Apr 28 12:53:27 2015 +0900

    replace Paint calls to Invalidate + fix compilation
    
    Change-Id: Id716c47d56922ab6ce0c3adb3d426ea814980674

commit f50fd9692ed7b9632c0f8dad9508f5a207679be4
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Tue Apr 28 11:00:54 2015 +0900

    mass rewrite Paint(Rect&) to Paint(RenderContext&, Rect&)
    
    Change-Id: Ia1667246064d11827dbd149def15e5bf08b119b8
Comment 2 Kevin Suo 2015-07-02 05:00:48 UTC
*** Bug 92413 has been marked as a duplicate of this bug. ***
Comment 3 Kevin Suo 2015-07-02 05:02:01 UTC
Changed platform to ALL, it also affects Windows as discussed in bug 92413.
Comment 4 tommy27 2015-07-02 05:16:14 UTC
has any of you tested 5.1.0 master?

I'm under Win8.1x64 using LibO 5.1.0.0.alpha1+
Build ID: ee3d40b30816a8fc6d4e8f984659c8dfac19ec3b
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-26_00:21:32
Locale: en-US (it_IT)

I confirm the issue about columns (you cannot change table height) but I don't confirm the problem with rows (I can easily modify the table width)
Comment 5 Maxim Monastirsky 2015-08-08 18:22:39 UTC
*** Bug 93268 has been marked as a duplicate of this bug. ***
Comment 6 Cor Nouws 2015-08-11 07:27:34 UTC
*** Bug 93339 has been marked as a duplicate of this bug. ***
Comment 7 Maxim Monastirsky 2015-08-24 17:54:27 UTC
*** Bug 93554 has been marked as a duplicate of this bug. ***
Comment 8 Maxim Monastirsky 2015-08-24 17:57:27 UTC
As Jay pointed out in Bug 93554, this happens only with hidden rulers.
Comment 9 Maxim Monastirsky 2015-08-24 17:59:04 UTC
*** Bug 93629 has been marked as a duplicate of this bug. ***
Comment 10 Björn Michaelsen 2015-08-28 11:46:00 UTC
Blocking on 91488, as per comment 1 seems to be RenderContext related.
Comment 11 Kevin Suo 2015-09-10 04:11:14 UTC
(In reply to Maxim Monastirsky from comment #8)

I did some more testing and found the following information:

1. Hide the ruler, close Writer, open Writer, then insert table
-> Not possible to adjust table ROWS AND COLUMNS.
(This is what Jay's bug 93554 and my bug 92413 describes)

2.When un-hide the ruler, then you can adjust the table column, but you can not adjust table row.
(This is what this bug 92145 describes.)

Thus, there are two different bugs. Bug 93554 and 92413 are not duplicates of this bug 92145.

I set the summary text back to what Matthew Francis has originally reported, and remove those un-duplicates.
Comment 12 László Németh 2015-09-10 12:24:37 UTC
The reason of the bug  is the following change:

commit 9905a8b953953b9ec5e123a17997d5931978acfe
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Tue Apr 28 12:53:27 2015 +0900

    replace Paint calls to Invalidate + fix compilation
    
    Change-Id: Id716c47d56922ab6ce0c3adb3d426ea814980674

...
@@ -2364,7 +2364,7 @@ bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
         // update ruler
         if ( mbFormat )
         {
-            Paint(Rectangle());
+            Invalidate();
             mnUpdateFlags &= ~RULER_UPDATE_DRAW;
         }
...


Paint() sets the mpData values by calling ImplFormat() and ImplCalc(), and these data are used by StartDocDrag() to check the place of the click.

When the rulers are switched off, now Paint()/ImplFormat()/ImplCalc() aren't called, and mpData will contain only initial empty data, first resulting
bad false return value (RULER_TYPE_OUTSIDE case) in ImplHitTest(): 

bool Ruler::ImplHitTest( const Point& rPos, RulerSelection* pHitTest,
                         bool bRequireStyle, sal_uInt16 nRequiredStyle ) const

...
    if ((nX < mpData->nRulVirOff - nXExtraOff) ||
         (nX > mpData->nRulVirOff + mpData->nRulWidth + nXExtraOff) ||
         (nY < 0) ||
         (nY > nHitBottom) )
    {
        pHitTest->nPos = 0;
        pHitTest->eType = RULER_TYPE_OUTSIDE;
        return false;
    }
...

because mpData->nRulVirOff is zero.
Comment 13 Maxim Monastirsky 2015-09-10 18:27:03 UTC
(In reply to Kevin Suo from comment #11)
> 2.When un-hide the ruler, then you can adjust the table column, but you can
> not adjust table row.
> (This is what this bug 92145 describes.)
It's the same bug. Rows are affected by the *vertical* ruler (which is hidden by default), while columns by the horizontal ruler.
Comment 14 Maxim Monastirsky 2015-09-10 18:28:28 UTC
*** Bug 93554 has been marked as a duplicate of this bug. ***
Comment 15 Commit Notification 2015-09-11 15:33:28 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ed031895f6f5b361cccc6811b53c6f2b9cfc3e23

tdf#92145: Writer table rows/columns can't be resized

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 László Németh 2015-09-11 20:21:25 UTC
Fixed in the master, and it will be fixed in LO 5.0, too, see https://gerrit.libreoffice.org/#/c/18507/.

Thanks for your help and thanks to Tomaž Vajngerl for the suggested fix.
Comment 17 Commit Notification 2015-09-12 17:35:14 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=00379a83cad8a016c54b3d90fef472a2ca6aeb96&h=libreoffice-5-0

tdf#92145: Writer table rows/columns can't be resized

It will be available in 5.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Jean-Baptiste Faure 2015-09-12 21:20:23 UTC
Verified fixed in Version: 5.0.3.0.0+
Build ID: 00379a83cad8a016c54b3d90fef472a2ca6aeb96
Ubuntu_15.04_x86-64
Locale : fr-FR (fr_FR.UTF-8)

Thank you very much
Best regards. JBF
Comment 19 info 2015-09-13 12:05:13 UTC
Thank you very much!!
Best regards, JV!
Comment 20 Commit Notification 2015-09-16 07:15:56 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-5-0-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1bd52dd711cd4a563b08cc682ffa9d02b201e632&h=libreoffice-5-0-2

tdf#92145: Writer table rows/columns can't be resized

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 Andy 2015-09-16 10:09:23 UTC
I have now tried 5.0.2.1
The patch works partially in my experience:
Open an empty writer file. Create a table in it, try to drag borders to resize columns and it fails as before.

Now visualise the ruler. keep it on or hide it again as you prefer, but from the moment you visualize it table columns are correctly resizable by direct dragging.

In short, you need to visualize the ruler once in the doc to activate the colunms dragging. You can even show the ruler, hide it immediately and then any table created subsequently will allow direct column resizing.

Obviously, the column borders drag-and-resize should work even if rulers are never shown.
Thanks
Comment 22 Jean-Baptiste Faure 2015-09-16 10:17:09 UTC
(In reply to Andy from comment #21)
> I have now tried 5.0.2.1
> The patch works partially in my experience:

The patch is not in 5.0.2.1, it will be in 5.0.2.2. It has been pushed on 5.0.2 branch only 3 hours ago. If you want to test, you should try a daily build.

Best regards. JBF
Comment 23 Yan Pas 2015-09-16 19:50:32 UTC
Is #44773 reproducible after this fix?
Comment 24 Maxim Monastirsky 2015-09-26 19:03:51 UTC
*** Bug 94532 has been marked as a duplicate of this bug. ***
Comment 25 Robinson Tryon (qubit) 2015-12-17 09:14:11 UTC Comment hidden (obsolete)