Bug 129655 - Shape textbox in writer ignores WritingMode.
Summary: Shape textbox in writer ignores WritingMode.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0 all versions
Hardware: All All
: medium normal
Assignee: Mark Hung
URL:
Whiteboard: target:6.5.0 target:6.4.1
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-27 16:11 UTC by Mark Hung
Modified: 2020-01-31 16:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample document with two kinds of shapes. (12.26 KB, application/vnd.oasis.opendocument.text)
2019-12-27 16:12 UTC, Mark Hung
Details
Failed to change writing mode. (1.97 KB, image/png)
2019-12-27 16:14 UTC, Mark Hung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hung 2019-12-27 16:11:19 UTC
Description:
Use macro to change writing mode of a Shape textbox. Comparing the text inside the shape without a textbox, the results are different.

Steps to Reproduce:
1.Open the attached document. There are two shapes. One has the textbox attached and the other doesn't.
2.Insert following Basic code as a macro and execute it.




Sub Main
  Dim oDrawPage As Variant
  Dim oObj1 As Variant
  Dim oObj2 As Variant
  Dim oObj3 As Variant
  Dim oObj4 As Variant
  Dim nTextWritingMode As Long

  oDrawPage = ThisComponent.getDrawPage()
  oObj1 = oDrawPage.getByIndex(0)

  oObj1.TextWritingMode = 2
  msgbox  "WritingMode:" & oObj1.TextWritingMode 
    oObj2 = oDrawPage.getByIndex(1)

  oObj2.TextWritingMode = 2
  msgbox  "WritingMode:" & oObj2.TextWritingMode 
End Sub

Actual Results:
The text in the textbox stays left-to-right.

Expected Results:
The text in the textbox should be top-to-down (TB-RL).


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Mark Hung 2019-12-27 16:12:59 UTC
Created attachment 156796 [details]
Sample document with two kinds of shapes.
Comment 2 Mark Hung 2019-12-27 16:14:15 UTC
Created attachment 156797 [details]
Failed to change writing mode.
Comment 3 Mark Hung 2019-12-27 16:16:28 UTC
Note that the following code also does not work.


Sub Main
  Dim oDrawPage As Variant
  Dim oObj1 As Variant
  Dim oObj2 As Variant
  Dim oObj3 As Variant
  Dim oObj4 As Variant
  Dim nTextWritingMode As Long

  oDrawPage = ThisComponent.getDrawPage()
  oObj1 = oDrawPage.getByIndex(0)

  oObj1.WritingMode = 2
  msgbox  "WritingMode:" & oObj1.WritingMode 
    oObj2 = oDrawPage.getByIndex(1)

  oObj2.WritingMode = 2
  msgbox  "WritingMode:" & oObj2.WritingMode 
End Sub
Comment 4 Xisco Faulí 2020-01-13 14:13:23 UTC
Patch in gerrit: https://gerrit.libreoffice.org/c/core/+/86638
Comment 5 Xisco Faulí 2020-01-13 14:24:48 UTC
also reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)
Comment 6 Xisco Faulí 2020-01-13 14:26:53 UTC
and 

Version: 4.5.0.0.alpha0+
Build ID: 2851ce5afd0f37764cbbc2c2a9a63c7adc844311
Locale: ca_ES
Comment 7 Commit Notification 2020-01-13 15:32:27 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/340b0eedaac17ff26799b09f6bbb2b115712e2d5

tdf#129655 Sync TextWritingMode to frame direction.

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2020-01-17 16:18:13 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/bc47eabad3f593aedd71307334fa50b222604bdd

tdf#129655 Sync TextWritingMode to frame direction.

It will be available in 6.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.