Bug 36535 - EDITING: Updating of Frame Style not working correctly, anchoring to character do not updates
Summary: EDITING: Updating of Frame Style not working correctly, anchoring to characte...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: preBibisect, regression
: 36583 157108 (view as bug list)
Depends on:
Blocks: Anchor-and-Text-Wrap Styles-Management Writer-Styles-Frame
  Show dependency treegraph
 
Reported: 2011-04-23 17:22 UTC by Teresa Brady
Modified: 2024-04-12 17:14 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file to demonstrate the issue (41.17 KB, application/vnd.oasis.opendocument.text)
2022-06-30 11:03 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Teresa Brady 2011-04-23 17:22:09 UTC
In the stylist, the graphics 'Update Style' now only partially works.
Borders will apply. Background colour will apply. However, image anchoring will not apply.

This is exactly how I would change a graphics style in Writer:
1. Insert an image, modify its style (add borders) and presentation (anchor: as character)
2. Select "Update Style" on the graphics style in the stylist pane. Save document. Or save as template.
3. The graphics style immediately will be able to be used. I could immediately insert, or even paste an image into the document and the newly updated graphics style would apply itself (i.e. border applied, anchored to character).

This no longer works as of  LibO 3.3.2. and OOo 3.3.0.

These steps also worked with OOo 3.2.1, 3.2.0.
Comment 1 Björn Michaelsen 2011-12-23 12:01:30 UTC Comment hidden (obsolete)
Comment 2 sasha.libreoffice 2012-02-27 06:55:28 UTC
Reproducible in 3.5.0 on Fedora 64 bit with changing anchoring
(changing borders behaves correctly)
Comment 3 Teresa Brady 2012-12-30 13:02:37 UTC
This still occurs in release 3.6.2.2 with changing anchoring - only the changing of picture borders acts as is expected. Anchoring does not carry through. Windows 7, 64-bit.
Comment 4 sasha.libreoffice 2013-01-02 05:16:29 UTC
Thanks for additional testing
Sorry, but "version" means most early version of LO where bug is reproduced. Not current version. Changing back to 3.3.2 and platform to All

Setting keyword "regression" according to initial description
Comment 5 Maxime de Roucy 2013-09-20 14:59:31 UTC
I added this bug to the votelist wiki page :
https://wiki.documentfoundation.org/Vote_for_Enhancement#Votes_-_Writer
Comment 6 Maxime de Roucy 2013-09-20 15:00:39 UTC
wrong bug : forget the last comment
Comment 7 Fernando 2015-09-25 13:45:28 UTC
I agree. The default anchor type should be configurable. Just try to paste several images without any text in between, and with the default behaviour it acts very strange. I see dissapearing images sometimes. "Anchor as character" works perfectly, however. I almost always select "anchor as character" for images, as it's much more predictable.
Comment 8 Robinson Tryon (qubit) 2015-12-14 05:40:03 UTC Comment hidden (obsolete)
Comment 9 Jean-Baptiste Faure 2016-04-10 14:02:54 UTC
In LO 5.1 there is no UI to change anchoring in graphics styles. So I am not sure if the problem is really in the malfunctioning of "Update Style" or only that it is not allowed to define anchor in the graphics styles

Are you sure that it was allowed to change anchoring in the graphics style in some previous LO or OOo version?

Best regards. JBF
Comment 10 Zenaan Harkness 2016-08-29 11:53:45 UTC
Possible problem with any UI for "change anchoring" is that when anchoring is to para, which para? (presumably "current" para or "next" para, some algorithm), if e.g. anchored to "current page", then which para would be chosen when changing to "anchor to para"? The first para on the page? The first para that -starts- on this page? What if there is neither e.g.?

I.e., this is not a simple request.

The WYSIWYG View -> Normal view, when the object (frame, graphic etc) is selected, and the anchor is displayed, I think will always be the sane and expedient way to edit anchoring.

Notwithstanding, I say that "current anchor setting" -ought- be visible, e.g. as part of the "advanced properties" or "normal properties" for any selected object that has an anchor property. Advanced users always crave maximum siutational awareness, since it often helps to solve problems.
Comment 11 Teresa Brady 2017-12-20 14:51:43 UTC
(In reply to Jean-Baptiste Faure from comment #9)
> In LO 5.1 there is no UI to change anchoring in graphics styles. So I am not
> sure if the problem is really in the malfunctioning of "Update Style" or
> only that it is not allowed to define anchor in the graphics styles
> 
> Are you sure that it was allowed to change anchoring in the graphics style
> in some previous LO or OOo version?
> 
> Best regards. JBF

Yes, it was allowed to change anchoring in both LibreOffice and OpenOffice.
This video shows OpenOffice 3.2.1 working: https://youtu.be/V761IxmmosI
Kind regards,
TB
Comment 12 Thomas Lendo 2018-10-28 21:26:08 UTC
*** Bug 36583 has been marked as a duplicate of this bug. ***
Comment 13 Michael Stahl (allotropia) 2019-07-19 15:42:50 UTC
styles cannot contain anchor positions, and due to the implementation of class SwFormatAnchor that means it can't contain the anchor type either.

bug 112574 is related, a crash caused by a style containing anchor position.

presumably a similar crash bug was fixed in OOo 3.3.

but maybe it's possible to clear just the anchor position instead of the whole SwFormatAnchor in styles.
Comment 14 Regina Henschel 2019-07-19 17:39:06 UTC
(In reply to Michael Stahl (CIB) from comment #13)
> styles cannot contain anchor positions, and due to the implementation of
> class SwFormatAnchor that means it can't contain the anchor type either.

??
Our "Formula" style is
<style:style style:name="Formula" style:family="graphic">
   <style:graphic-properties text:anchor-type="as-char" svg:y="0mm" fo:margin-left="0mm" fo:margin-right="0mm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="middle" style:vertical-rel="text"/>
That has anchor type and position.

You can use your own styles. Write the style with all the needed graphic-properties into the styles.xml of an document template. You can then use the styles to change the anchor type and the position by applying the style, or you can select your style in the insert dialog of an image.

Looking in the tab "Organizer" of the style, you see the anchor-type in the "contains" section. The info about position is not complete there. In style "Formula" I see nothing, in my own style or in "Watermark" I see the position but not the "rel"-value. Nevertheless, assigning a frame style to an image will adapt anchor type and position.

It is only running LibreOffice, that does not allow to set the anchor type and position infos of styles. If a style exists, you can use it as expected.
Comment 15 Michael Stahl (allotropia) 2019-08-01 15:05:09 UTC
ah right now i remember another related bug 114396 ...

so the problem is that creating the style from the selection shouldn't call ClearItem(RES_ANCHOR) but instead override RES_ANCHOR with an item that is the same except it has its anchor position cleared; then it would be able to retain the anchor type.
Comment 16 QA Administrators 2022-05-13 03:43:55 UTC Comment hidden (obsolete)
Comment 17 Gabor Kelemen (allotropia) 2022-06-30 11:03:10 UTC
Created attachment 181033 [details]
Example file to demonstrate the issue

Still a problem in

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 51bfd4a3105e4a406dc8f220102520202a72150a
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

To test, open this file, it has an image of a ship with red double line border and 0.5 cm padding. Anchoring is As Char.

When selected and in the Styles sidebar the Graphics style is selected, using the "Update selected style" command in the "Styles actions" dropdown menu does not change the anchoring setting of the style, which is "To page". 
This was manually set by me, the LO-default is "To paragraph".
Inserting a new image to this document inserts it anchored as "To page".

So it looks to me that the "Update selected style" command should update the anchoring setting of the frame styles, ODF support and the UI is just fine nowadays.
Comment 18 Dieter 2023-09-20 06:36:35 UTC
*** Bug 157108 has been marked as a duplicate of this bug. ***
Comment 19 Dieter 2023-09-20 06:39:17 UTC
Still present in

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a4522ef5ce6a625054d83ec907aee07c156e94ed
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: CL threaded

Steps:
1. Open attachment 189375 [details]
2. Select the frame containing "In original Frame"
   Format->Frame and Objects->Properties
     ==> Confirm that Anchor is set to "As character"
   Close the Properties dialog 
3. In the Style panel: click the 3rd icon to select "Frame" styles
4. In the Styles menu (tiny triangle at upper right),
     do "New Style from Selection". Give it a name.
5. Select the new Frame style; rightclick->Edit Style
   Click the "Type" tab


Actual Results:
The new style has Anchor set to "To paragraph"

Expected Results:
Anchor "As character", as it is in the Frame the style was created from
Comment 20 Eyal Rozenberg 2024-04-12 17:14:45 UTC
Indeed, also seeing this with the reproduction instructions in comment #19 and:

24.2.0.2 (X86_64) / LibreOffice Community
Build ID: b1fd3a6f0759c6f806568e15c957f97194bbec8f
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US