Bug 94221 - Fontwork "text along path" has wrong text orientation
Summary: Fontwork "text along path" has wrong text orientation
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: x86 (IA32) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0 target:5.1.4
Keywords: bisected, needUITest, regression
: 96186 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-14 22:33 UTC by Regina Henschel
Modified: 2016-10-25 19:02 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the wrong orientation (15.49 KB, image/png)
2015-09-14 22:33 UTC, Regina Henschel
Details
Screenshot of correct orientation in AOO (12.26 KB, image/png)
2015-09-14 22:34 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2015-09-14 22:33:32 UTC
Created attachment 118716 [details]
Screenshot of the wrong orientation

Customize a toolbar with command "Fontwork" from category "Format".
Draw an arc.
Add a sentence to the arc. (Use double-click or key F2 to get edit mode.)
Keep the arc selected and click on new Fontwork-icon.
In the Fontwork-Window click on the icon top, second from left, tooltip "Rotate".
The letters should become perpendicular to the line, but they are upright and there spacing is messed up.
Comment 1 Regina Henschel 2015-09-14 22:34:06 UTC
Created attachment 118717 [details]
Screenshot of correct orientation in AOO
Comment 2 Buovjaga 2015-09-19 15:30:21 UTC
Yep, the letters should point in the direction of the curve normals.

Win 7 Pro 64-bit, Version: 5.0.1.2 (32-bit)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: fi-FI (fi_FI)
Comment 3 Buovjaga 2015-12-04 19:18:30 UTC
*** Bug 96186 has been marked as a duplicate of this bug. ***
Comment 4 Regina Henschel 2016-05-04 20:12:59 UTC
The problem has been introduced with
https://cgit.freedesktop.org/libreoffice/core/commit/?id=13c71694fce1bf0d9c968581e418886052d1c8c7
(Caolán McNamara)
which replaces the old kind dialog with a "glade" dialog. The commit removed the defines in svx/source/dialog/fontwork.hrc. These has been
42#define TBI_STYLE_OFF           1
43#define TBI_STYLE_ROTATE        2
44#define TBI_STYLE_UPRIGHT       3
45#define TBI_STYLE_SLANTX        4
46#define TBI_STYLE_SLANTY        5
...

In 
svx/source/dialog/fontwork.cxx
it had been used as
case XFT_ROTATE : nId = TBI_STYLE_ROTATE;
and therefore nId had got the value "2".

With the new dialog the enum XFormTextStyle from
/core/include/svx/xenum.hxx 
is directly used.

Now the statement in fontwork.cxx is
case XFT_ROTATE : nId = nStyleRotateId;
and therefore nId gets a wrong value.

The same kind of error happens with the alignment settings and the shadow direction in that dialog. Please compare the old behavior, which you can still see in AOO, with the new behavior and you will notice, that the current action is shifted by one compared to the clicked button. You click "rotate" and get "upright", or you click "upright" and get "hori", or you click shadow "vertical" and get "slant".
Comment 5 Regina Henschel 2016-05-05 16:12:49 UTC
I have already found a reason: The items of class GtkSeparatorToolItem in svx\uiconfig\ui\dockingfontwork.ui are count too. Therefore you have to increase the numbers after the separator in SvxFontWorkDialog in svx\source\dialog\fontwork.cxx.

For example
get(m_pTbxStyle, "style");
    nStyleOffId = m_pTbxStyle->GetItemId(0);
    m_pTbxStyle->SetItemBits(nStyleOffId, ToolBoxItemBits::AUTOCHECK);
    // separator is item "1"
    nStyleRotateId = m_pTbxStyle->GetItemId(2);
    m_pTbxStyle->SetItemBits(nStyleRotateId, ToolBoxItemBits::AUTOCHECK|ToolBoxItemBits::RADIOCHECK);
    nStyleUprightId = m_pTbxStyle->GetItemId(3);

instead of
get(m_pTbxStyle, "style");
    nStyleOffId = m_pTbxStyle->GetItemId(0);
    m_pTbxStyle->SetItemBits(nStyleOffId, ToolBoxItemBits::AUTOCHECK);
    nStyleRotateId = m_pTbxStyle->GetItemId(1);
    m_pTbxStyle->SetItemBits(nStyleRotateId, ToolBoxItemBits::AUTOCHECK|ToolBoxItemBits::RADIOCHECK);
    nStyleUprightId = m_pTbxStyle->GetItemId(2);

But that is not the only problem. The alignment group (left, center, right, autosize) does not work correct in the way, that only one may be selected. And toggle of "text contour" does not work.
Comment 6 Regina Henschel 2016-05-05 16:24:18 UTC
Found: CHECKABLE and RADIOCHECK are set wrongly.
Comment 7 Commit Notification 2016-05-05 22:23:33 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#94221 repair dialog for text along path

It will be available in 5.2.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 8 Commit Notification 2016-05-09 12:41:04 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=77191f727fdf844e3780d5c1aec8225b344718e7&h=libreoffice-5-1

tdf#94221 repair dialog for text along path

It will be available in 5.1.4.

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.