Created attachment 195967 [details] Sample slide (PPTX) How to repeat: 1. Open sample document 2. Position the cursor in the longest of the three bullet points and either hit <Backspace> or add some characters. 3. Observe how the text box shrinks/expands on both sides, left and right, instead of just on the right side. This differs from Office 365 which only affects the right side of the box. One observation: The properties show a Text Anchor setting of upper center, not the most common upper left. Maybe an import issue? Seen in Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 560e5406f3c6e8e6ed0f1c251b6910465266ed8d CPU threads: 12; OS: Linux 6.10; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US and all the way back to at least 6.4.
Reproducible with Version: 24.8.0.3 (X86_64) / LibreOffice Community Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583 CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win Locale: es-ES (es_ES); UI: en-US Calc: CL threaded AND Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 85e4dc15d09dc3193870041b2814263971a27791 CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Seems to be independent of PPTX, this can be reproduced with Insert - Shape - Basic Shapes - Rectangle Format - Text Box and Shape - Text Attributes Under Custom Shape Text, enable "Resize shape to fit text" and disable "Word wrap text in shape" Type into the shape -> it grows/shrinks on both ends
Observation about PP behavior: It grows the right side of the shape if the text is left aligned. If the text is right aligned, the left side of the shape grows. If the text is centered or justified, both sides of the shape grow - just like in LO. If there are two paragraphs in the shape with different alignments, such as one left and one right aligned, then the first paragraphs alignment decides which side grows. But in this scenario reducing the text length does not reduce the shapes size. This latter behavior may be considered inconsistent/buggy in PP. Copying all these might make the most sense.
(In reply to Gabor Kelemen (allotropia) from comment #3) > Observation about PP behavior: > It grows the right side of the shape if the text is left aligned. > If the text is right aligned, the left side of the shape grows. > If the text is centered or justified, both sides of the shape grow - just > like in LO. : > Copying all these might make the most sense. Agreed. The above is what I would have expected. Personally (as the one who filed this report) this got triggered by the "one line, left aligned" (or "one paragraph, left aligned") case, which appears most common. What you describe in general makes sense, though.
(In reply to Gerald Pfeifer from comment #4) > (In reply to Gabor Kelemen (allotropia) from comment #3) > > Observation about PP behavior: > > It grows the right side of the shape if the text is left aligned. > > If the text is right aligned, the left side of the shape grows. > > If the text is centered or justified, both sides of the shape grow - just > > like in LO. > : > > Copying all these might make the most sense. > > Agreed. The above is what I would have expected. > > Personally (as the one who filed this report) this got triggered by the > "one line, left aligned" (or "one paragraph, left aligned") case, which > appears most common. What you describe in general makes sense, though. After investigating around this new feature I can see some conflict with an already existing feature unfortunatelly. Selecting a shape --> Format - Text Box and Shape - Text Attributes --> Under Text Anchor. There we can set the align of the text and the same time the selected position effect on the "Resize shape to fit text" option as well. If we anchor the text left the horizontal shape size will grow on the right end (if these options are set: enable "Resize shape to fit text" and disable "Word wrap text in shape") or, will grow on the left end if the anchor is set to right. And if the anchor is set to middle (full width) the shape size will grow on both end. (which is make sense). So its kind of the same feature as it was asked in this report, but in LibreOffice we have a seperate option/property/UI for that. Not sure what would be the best doind here. If we check the text alignment the same like we are checking the anchor position which setting should be considered first. Or we check both of them somehow... Any suggestion maybe @Heiko, @Gabor?
For a text box the Text Attributes dialog provides the Text Anchor set by default to top/middle. I would expect top/left to do the trick but that stops growing (middle and right work well). In both cases the [x] Fit width to text option needs to be activated, of course. If I go to middle/left my content becomes centered but grows to the right (same for bottom). And now it works here too (maybe the dialog needs to be restarted?). Whether the text box have to grow to the right or left depends on the writing system. Middle seems to be the compromise here. And I see no chance to make it dependent to the text direction of the paragraph. The anchor is placed at middle/middle in case of Impress with [x] Fit to Height. Works well in this scenario - who needs a text box to grow horizontally?; in what layout? NAB?
(In reply to Heiko Tietze from comment #6) > For a text box the Text Attributes dialog provides the Text Anchor set by > default to top/middle. I would expect top/left to do the trick [...] > The anchor is placed at middle/middle in case of Impress with [x] Fit to > Height. Works well in this scenario - who needs a text box to grow > horizontally?; in what layout? > > NAB? The concrete use case here, and quite typical I'll argue, is one receives a PPTX and wants to slightly tweak text, replacing "green" by "greener" or something like that. My expectation as a user is that in Impress this works like for my colleague originally doing the editing in PowerPoint: simply adjust the text, such as adding the two letter "er" here and (left) alignment still remains in place.
Created attachment 196623 [details] Screencast LibreOffice provides much more freedom in many situations. Sometimes not beneficial to usability, at least not for the average user. I can follow the implementation with growing to left/right if the anchor is set to the middle (also solving LTR/RTL trouble). MSO ignores the vertical alignment completely and always expands rightwards (in my setup). Now I wonder if Impress and/or Draw should focus on writing - which means to expand in the writing direction, or to adopt a drawing concept that puts the object first - and changes to the text keep the position. In any case we should check the filter. MSO default for text boxes is Vertical alignment = Top (not centered; no distinction between left/right possible) and we open such file with a text anchor at top/center.
Created attachment 196624 [details] Example
(In reply to Heiko Tietze from comment #8) > LibreOffice provides much more freedom in many situations. Sometimes not > beneficial to usability, at least not for the average user. I can confirm that. In this specific example, both my original test case as well as Heiko's "Example" from 2024-09-23, how do I get Impress to expand the existing text box rightwards? (I tried many things and failed. For example, creating a new textbox with the same settings under "Edit Style..." - "Alignment", "Dimensioning", and "Text" as the one in Heiko's test case, the two behave differently??)
Created attachment 196663 [details] More examples from PP Here is another example to demonstrate how it works in PP. First slide has centered text set in the shapes and all 6 vertical alignment options used on "Resize shape to fit text" enabled shapes. Typing into these grows the textbox on both ends. The second and third has the same shapes, but text is left and right aligned. Typing into these grows the textboxes on the opposite ends. When importing into Impress, all end up growing the textboxes on both ends. The interesting bit here is that the Text Anchor setting is mostly the same: either one of the three horizontally centered states. The "Top, Middle, Bottom" settings have horizontal "Left" alignment as well in PP (this is demonstrated on the fourth slide with Do not autofit shapes). On the other hand the right aligned rectangles look the same in PP as the left aligned ones, yet they behave differently - unlike in Impress. The fourth slide demonstrates the horizontal positioning in Do not Autofit shapes and their import. In Impress, the texboxes are visibly smaller than the shapes themselves and their Left or Center horizontal alignment is correct compared to Impress - so this works fine. Now, what is important in the Resize shape to fit case is that the textbox is the same size as the shape, so the horizontal alignment is not really in play. I think it should be possible to link the "Resize shape to fit " shapes first paragraphs alignment with the Text Anchor setting (in import and runtime as well) to mimic the behavior of PP, with relatively low effort and introduction of new properties/UI. This would not break existing text alignment behavior, as far as I can see.
Balazs Varga committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1d9ce0a67a71e51569cd33c26270eeece587a354 tdf#162571 - sd: Text box expands or shrinks on left or right or It will be available in 25.2.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.
Verified with last night's snapshot: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 5cf912b08e4a22f66ab1ec5fa601ba3e50e3c4cc CPU threads: 12; OS: Linux 6.11; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Thanks from a happy user!
*** Bug 104202 has been marked as a duplicate of this bug. ***