[Solved] Fail to set Anchor as Character (Default)

Discuss the word processor

[Solved] Fail to set Anchor as Character (Default)

Postby nomnex » Fri Sep 21, 2012 9:26 am

http://user.services.openoffice.org/en/ ... =7&t=24871

Does not work for me on LO 3.3.4

I enclosed a sample document.



Updating the Graphics frame style has no effect. The following images I insert are always anchored to the paragraph.
Last edited by nomnex on Fri Oct 05, 2012 7:56 am, edited 4 times in total.
OpenOffice.org Writer isn't a replacement for anything; it's simply a better piece of software -- Bruce Byfield
[LO 3.3.4 on Fedora 15 LXDE]
User avatar
nomnex
 
Posts: 180
Joined: Thu Aug 06, 2009 11:12 pm
Location: Japan

Re: Fail to set Anchor as Character (Default)

Postby Hagar Delest » Fri Sep 21, 2012 10:50 am

Have you tried to tweak the styles.xml file as indicated in the bug report (I've fixed the links, changed after the move to Apache)?
AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Fail to set Anchor as Character (Default)

Postby acknak » Fri Sep 21, 2012 3:29 pm

You can also try loading the frame style from the document in this post: viewtopic.php?p=211302#p211302

There are some instructions there too if you look down a couple of posts.

That works for me with LibO 3.5
AOO 4 • Linux • Fedora 17
User avatar
acknak
Moderator
 
Posts: 17420
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Fail to set Anchor as Character (Default)

Postby nomnex » Mon Sep 24, 2012 5:11 pm

Hagar Delest wrote:Have you tried to tweak the styles.xml file as indicated in the bug report (I've fixed the links, changed after the move to Apache)?


Actually the link to bug 19814 in both threads were pointing to a wrong direction. Glad you fixed them. It's working great now.

I had to unchecked Size optimization for ODF in the LibreOffice general option to read the file with a XML editor. Do I check it back? does it make any difference.

To edit the styles.xml, I changed the .odf in .zip, unzip, modified the styles.xml, zip, changed the extension to .odf. Is it the way to do it? It works equally without modifying the .odf extension.

As for acknack suggestion to load the frame style from the document, that's exactly what I did to propagate the change to my existing templates. Thanks to both of you.
Last edited by nomnex on Tue Sep 25, 2012 3:11 am, edited 1 time in total.
OpenOffice.org Writer isn't a replacement for anything; it's simply a better piece of software -- Bruce Byfield
[LO 3.3.4 on Fedora 15 LXDE]
User avatar
nomnex
 
Posts: 180
Joined: Thu Aug 06, 2009 11:12 pm
Location: Japan

Re: Fail to set Anchor as Character (Default)

Postby Hagar Delest » Mon Sep 24, 2012 8:45 pm

Size optimization makes no difference, it's just a matter of line carriage in the xml file.

Once you've opened the .odt with an archive manager (sometimes you indeed need to rename it to .zip), open the styles.xml file and look for the following tag:
<style:style style:name="Graphics" style:family="graphic">

Then change
text:anchor-type="paragraph"
to
text:anchor-type="as-char"

Save the change, rename it to its initial extension and it should be fine.
AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Fail to set Anchor as Character (Default)

Postby nomnex » Thu Oct 04, 2012 2:26 am

I did not give much thought the first time, because I was glad to have a fix, but every time I edit a template styles.xml, a "file corrupted" message appears (LibreOffice 3.3).

I followed Hagar instructions:
$ unizip foo.ott
modify styles.xml
$ zip foo.ott *

This is the file after modification:


The message I get, when I open the file after modification:
LibreOffice 3.3_2012_1004_091011.png


I can select to repair the file, and all is fine, but I have some concerns, since I use it as my default template. How about this warning message?
Last edited by nomnex on Fri Oct 05, 2012 7:56 am, edited 1 time in total.
OpenOffice.org Writer isn't a replacement for anything; it's simply a better piece of software -- Bruce Byfield
[LO 3.3.4 on Fedora 15 LXDE]
User avatar
nomnex
 
Posts: 180
Joined: Thu Aug 06, 2009 11:12 pm
Location: Japan

Re: Fail to set Anchor as Character (Default)

Postby Hagar Delest » Thu Oct 04, 2012 8:16 am

Can you upload the original file? Sometimes there are strange results with the un/zip operation.
AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Fail to set Anchor as Character (Default)

Postby nomnex » Thu Oct 04, 2012 9:11 am

I can reproduce it 100%
I re-set the default writer template.
I created a new template of it: a4_foo.ott, then I did the following:
$ unzip a4_foo.ott
Edit style.xml > "paragraph" to "as-char"
$ zip a_foo.ott *

I also tried with a .odt file, and also by changing the file extension from .ott to .zip, but not to avail.

Original:


Modified (should pop-up the "file corrupted" waring):
Last edited by nomnex on Fri Oct 05, 2012 7:57 am, edited 2 times in total.
OpenOffice.org Writer isn't a replacement for anything; it's simply a better piece of software -- Bruce Byfield
[LO 3.3.4 on Fedora 15 LXDE]
User avatar
nomnex
 
Posts: 180
Joined: Thu Aug 06, 2009 11:12 pm
Location: Japan

Re: Fail to set Anchor as Character (Default)

Postby nomnex » Thu Oct 04, 2012 9:45 am

I guess I found my answer here: viewtopic.php?f=20&t=36628.
To my knowledge, the zip command copies recusively into dir. by default. I did not use the -r option in my commands above. This option seems to fix the problem:
Code: Select all   Expand viewCollapse view
$ zip -r foo.ott .
OpenOffice.org Writer isn't a replacement for anything; it's simply a better piece of software -- Bruce Byfield
[LO 3.3.4 on Fedora 15 LXDE]
User avatar
nomnex
 
Posts: 180
Joined: Thu Aug 06, 2009 11:12 pm
Location: Japan

Re: Fail to set Anchor as Character (Default)

Postby Hagar Delest » Thu Oct 04, 2012 9:48 am

Yes, that's the problem I was thinking about. Your forum search got it right, well done.
AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France


Return to Writer

Who is online

Users browsing this forum: No registered users and 27 guests