Bug 168182 - In Writer, the "Load style from template" command cannot copy styles from docx file (it can copy styles from an odt file only)
Summary: In Writer, the "Load style from template" command cannot copy styles from doc...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-29 19:14 UTC by NarayanAras
Modified: 2026-01-17 15:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NarayanAras 2025-08-29 19:14:35 UTC
Description:
In Writer, the "Load style from template" command cannot copy styles from docx file (it can copy styles from an odt file only).

Steps to Reproduce:
1. Create/Open any text file 
2. Select the Styles > Load styles from template menu command.
3. Select all checkboxes at the bottom of the dialog
   (Paragraph and character, frame, Page, List, Overwrite)
4. Click on the "From file..." button at the bottom.
5. Browse to any docx file that has a distinct styles applied.
6. Click on the "Open" button.
   There is no effect at all. (The command fails silently.)

7. Repeat all steps, but this time select an odt file with distinct styles.
   This time the styles are copied.

 

Actual Results:
As described above

Expected Results:
Styles should be copied from docx also.
Or else the "Browse" dialog should be limited to odt only.


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Windows 11
OS is 64bit: yes
Comment 1 m_a_riosv 2025-08-29 21:10:04 UTC
Please paste here the information on Menu/Help/About LibreOffice (There is an icon to copy)


As I know docx, file only has paragraph styles, not other styles.
Comment 2 NarayanAras 2025-08-30 11:53:15 UTC
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d1fc7efb90b4a122c0d160295be6a266ad5471a4
CPU threads: 8; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

---------------------------------------------
Grok says that docx can store 5 sdtyles: paragraph, character, list, tables, and link.

But odt files can store the following styles additionally:
1. Page Styles
2. Frame Styles 
3. Section Styles
4. Graphic Styles.

So it should be able to copy at least these styles.

Also, the UI needs to be changed depending upon which file we are copying the styles from. (the non-available styles should be grayed out.)

Another problem: The copy template from... dialog allows ALL formats. So if I select a markdown or csv file, they have no stytle-definitions! So, it makes no sense to show such files to the user in this dialog!
Comment 3 Buovjaga 2026-01-17 15:21:40 UTC
I can't reproduce - the dialog only lists odt, ott, stw and sxw files. No matter if I use Windows file dialog or LibreOffice's own (from Tools - Options - LibreOffice - General). I also tested with the Windows 26.2 bibisect repository with the exact hash you mentioned in comment 2.

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 680(Build:0)
CPU threads: 2; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

(In reply to NarayanAras from comment #2)
> Grok says that docx can store 5 sdtyles: paragraph, character, list, tables,
> and link.

Quoting an LLM is worthless. Only real sources matter.
https://learn.microsoft.com/en-us/office/open-xml/word/how-to-create-and-add-a-character-style-to-a-word-processing-document?tabs=cs-0%2Ccs-1%2Ccs-2%2Ccs-3%2Ccs-4%2Ccs-5%2Ccs-6%2Ccs#style-types

WordprocessingML supports six style types, four of which you can specify using the type attribute on the style element. The following information, from section 17.7.4.17 in the ISO/IEC 29500 specification, introduces style types.

Style types refers to the property on a style which defines the type of style created with this style definition. WordprocessingML supports six types of style definitions by the values for the style definition's type attribute:

    Paragraph styles
    Character styles
    Linked styles (paragraph + character) Accomplished via the link element (ยง17.7.4.6).
    Table styles
    Numbering styles
    Default paragraph + character properties