Description: Wrong symbol for placing images which can be misleading specially for beginners. Steps to Reproduce: 1. Try to place an image "After text" while selecting the "image after text" option from menu. Its impossible! You should actually select "image before text"! Actual Results: I got confused for some time. Expected Results: Swap "image after text" and "image before text" Reproducible: Always User Profile Reset: No Additional Info: Look at the attached screenshot!
Created attachment 186291 [details] The bug indication
Well, actually, "After" seems like "Text after image" in LTR mode... but it's true that the graphic doesn't change when the paragraph direction is flipped. However - the problem is even worse than you think. It's possible for the same object to overlap more than one paragraph - and one might be LTR while the other is RTL. What image would be used then? And what is the user's intent w.r.t. wrapping in that case? So, this is not just a problem with the icon on the toolbar or in the dialog (which is an issue of course), but a deeper one as well.
Rizal, what do you think?
@Eyal Rozenberg I think we can look at where the image in anchored. If it is anchored to a RTL paragraph or RTL character then the icons need to be swapped. What do you think?
(In reply to Heiko Tietze from comment #3) > Rizal, what do you think? Generally speaking, current non LTR icon behaviour is suboptimal. I would like to see proper RTL support for icon themes from coding point of view. Currently, many icons just flipped horizontally for RTL text and 90 degrees clockwise for top to bottom text. See tdf#149956. Instead of using the flipping method above, I suggest that LibreOffice intelligently recognizes the RTL content and then instructs it to use a separate RTL version of the icon file. Say for example lc_defaultnumbering.<png|svg> for LTR content, then there's lc_defaultnumberingrtl.<png|svg> for RTL one. The only way I as an icon designer can change the appearance of an icon from LTR to RTL is to use a localized variant. For example I created some RTL icons in cmd/ar/ and cmd/32/ar directories for Arabic (and linking it for Hebrew, Urdu and Parsi). This is actually quite problematic, however, because there is no guarantee that users of Arabic RTL text will definitely use the Arabic interface. It is possible that the interface used is American English while the content produced is RTL text. Then the localized icons that I made became even more messy when given the flipping treatment.
Apologize, I should probably refer to tdf#70102 (In reply to Rizal Muttaqin from comment #5) > See tdf#149956.
(In reply to Rizal Muttaqin from comment #5) > lc_defaultnumberingrtl.<png|svg> for RTL one. or maybe lc_defaultnumbering-rtl.<png|svg> / lc_defaultnumbering_rtl.<.png|svg> for reading convenience
Let's add RTL specific icons (in addition to the language specific). Caolan, easyhack or GSoC project?
We do have some places where we swap the images depending on RTL. But as far as I know we do it based on the UI language and not the "current" direction of text. So see: framework/source/fwe/xml/toolboxdocumenthandler.cxx sfx2/source/sidebar/SidebarToolBox.cxx sfx2/source/toolbox/weldutils.cxx sfx2/source/toolbox/weldutils.cxx and search for uno:ParaLeftToRight and see the swap to ParaRightToLeft (etc) when AllSettings::GetLayoutRTL is true and references to bug #39370 as an example. So I think it could be: a) An easy hack to at least centralize those existing different places into one piece of code so we have just one copy of the swapping image name logic b) Assuming that the current swapping images idea is a good thing, then the question is if we should be changing those images depending on the current language/direction context. Some competitive comparison might be helpful to find out there, what do other similar products do, or anything seen as "doing the right thing". We do have QueryState which decides if a given toolbox item is enabled/disabled etc in the current context. I could see us adding another thing that can be queried (Or maybe we already have one, isn't there some paragraph direction toolbox item somewhere, does that generally give a single result, or how does it handle ambiguity right now?) to get an answer for the RTL in the context that could be used to do this swapping basically dynamically instead of just the UI direction.
(In reply to Caolán McNamara from comment #9) > We do have some places where we swap the images depending on RTL. But we mirror the existing image and do not use some special icon, right? The proposal is to have this opportunity.
Yes we currently use a different icon from a equivalent command for the other direction so we look for something that will appear flipped IIRC. In either case of the existing hackery or new proposal I don't think we currently take current context into account, only the UI mode
My proposal: Change the behavior. When detecting RTL content switch icons to proper icon files instead of flipping them and remove unnecessary RTL icons that resides in all RTL UI languages (Arabic, Hebrew, Parsi, Urdu).