Bug 152591

Summary: Deprecate css::text::XTextDocument::reformat(), and document that it does nothing
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: sdkAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: sberg.fun, xiscofauli
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 143781    

Description Mike Kaganski 2022-12-19 12:34:05 UTC
css::text::XTextDocument::reformat is documented [1] to "reformat the contents of the document". However, the implementation of the method [2] does nothing except for boilerplate check that the object is still valid. This has been so since the initial import (commit 7b0b5cdfeed656b279bc32cd929630d5fc25878b, 2000-09-18).

css::text::XTextDocument inherits from css::frame::XModel; and the latter has a 'refresh' method [3], which implementation in SwXTextDocument calls SwViewShell::Reformat [4].

It seems that (a) the original idea of css::text::XTextDocument::reformat is to do the same as what css::frame::XModel::refresh does; and (b) that it makes no sense to implement it now, and a better fix wuld be to just deprecate it and update its documentation.

[1] https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/text/XTextDocument.idl?r=5687eba4#38
[2] https://opengrok.libreoffice.org/xref/core/sw/source/uibase/uno/unotxdoc.cxx?r=c2bcbd36#462
[3] https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/xforms/XModel.idl?r=5687eba4#49
[4] https://opengrok.libreoffice.org/xref/core/sw/source/uibase/uno/unotxdoc.cxx?r=c2bcbd36#2172
Comment 1 Stephan Bergmann 2022-12-19 13:04:33 UTC
@Mike, who put me on cc:  Probably better to seek advice from somebody knowledgeable about Writer, than from somebody knowledgeable about the UNO mechanisms.
Comment 2 Xisco FaulĂ­ 2023-09-11 12:41:00 UTC
Hello Mike,
Should this be discussed in the development mailinglist ?