Bug 43807 - ODF import loses Drop Caps character style
Summary: ODF import loses Drop Caps character style
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: All All
: medium normal
Assignee: Tamás Zolnai
URL:
Whiteboard: odf target:4.2.0 target:4.1.2 target:...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 16:28 UTC by Pedro
Modified: 2013-08-23 09:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODF showing that Dropcap character style is not saved (13.76 KB, application/vnd.oasis.opendocument.text)
2011-12-13 16:28 UTC, Pedro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro 2011-12-13 16:28:03 UTC
Created attachment 54413 [details]
Sample ODF showing that Dropcap character style is not saved

The option Character Style (defined in Format, Paragraph, tab Drop Caps) is not retained in ODF (saving in DOC does)

The initial letter should be in Times New Roman. Choosing from the drop list Character Style the option Drop Caps shows the Drop Cap as expected. However saving and reloading the document shows that this setting was not saved.

This bug is present since at least version 3.3.4 (didn't check back) and occurs in 3.4.4 and 3.5.0Beta1
Comment 1 Carlo Strata 2012-04-26 12:24:10 UTC
Hi Everyone!

I have just verified and reproduced this ancient and long time bug.

This is my environment:
- OpenSuSE linux 12.1, x86-64 architecture, kernel 3.1.10-31;
- LibreOffice, linux, x86-64, 3.5.3.1 (RC1) and 3.5.3.2 (RC2), vanilla rpm builds;
- in the tools -> Options -> Load / Save -> General -> Predifined file format and ODF settings -> ODF format version, I have the default settings, that are "1.2 extended".

I translate menus from the Italian GUIed LibreOffice so that the items may slightly differ.

I also have seen that any style you choose in "Format -> Paragraph -> Drop Caps tab" you'll get:
- the style is rendered only in the dialog box and never in the document;
- in the while you edit the document the Drop Caps style is stored as well as a "setting without any effect" (looking that with right mouse click on that paragraph -> Format -> Paragraph -> Drop Caps tab"), but is definitively lost as well as you save and reload the document itself (as already stated in the first comment of this bug).

I think this bug has gained new attention. ;-)

Have a nice evening,

Carlo
Comment 2 sasha.libreoffice 2012-04-30 03:15:58 UTC
reproduced in 3.5.2 on Fedora 64 bit and Windows 7 32 bit
Field "Character style" indeed not working on tab "Drop caps" in direct paragraph formatting and in paragraph style format.

Workaround: select dropcaps character directly in text and apply character style or font.
Comment 3 sasha.libreoffice 2012-11-26 13:21:26 UTC
What is interesting: UNO documentation from SDK contain this:
:: com :: sun :: star :: style :: struct DropCapFormat
which have only 3 members: Lines, Count, Distance.
No "Character Style" there. Therefore Character Style belong only to characters, not to Drop Caps. Possible not finished UI feature for more easy assign Character Style to Drop Caps character.
Comment 4 sasha.libreoffice 2012-11-26 14:43:09 UTC
Also, property DropCapCharStyleName exist among paragraph properties
We can assign it using this macro:
Sub Main
doc=ThisComponent
text=doc.getText()
Vcur=doc.getCurrentController().getViewCursor()
cur=text.createTextCursorByRange(Vcur)
cur.setPropertyValue("DropCapCharStyleName","Bullets")
End Sub

We can see result in Paragraph dialog, style there changes. But after saving/reloading it disappears
Comment 5 Commit Notification 2013-08-18 07:59:27 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "master":

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

fdo#43807: Fix import of drop caps character style



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 6 sasha.libreoffice 2013-08-19 10:14:16 UTC
Thanks for fixing this bug
Comment 7 Michael Stahl (allotropia) 2013-08-20 13:40:44 UTC
the problem is in the import, thanks Zolnai Tamás for fixing it.

also the style does appear to be used in the document here.
(and in case you find it's not please file a separate bug for that)
Comment 8 Commit Notification 2013-08-20 13:46:36 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6fd191c80a8c4637a1757b9d5132a33c6602f13b&h=libreoffice-4-1

fdo#43807: Fix import of drop caps character style


It will be available in LibreOffice 4.1.2.

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 9 Commit Notification 2013-08-20 13:47:33 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=93dc3cc8fca6c3873739da1388570e635ee87b90&h=libreoffice-4-0

fdo#43807: Fix import of drop caps character style


It will be available in LibreOffice 4.0.6.

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 10 Tamás Zolnai 2013-08-21 13:20:55 UTC
(In reply to comment #6)
> Thanks for fixing this bug

Thanks for your helpful comments and Basic code example. It makes easier to find the problem.
Comment 11 Pedro 2013-08-23 09:43:27 UTC
(In reply to comment #5)
> Zolnai Tamas committed a patch related to this issue.
> It has been pushed to "master":

Hi Zolnai

Thank you for fixing this long standing bug and especially for pushing it to all the current branches so that this is fixed for all as of the next release!

Kudos!