Bug 38786 - Writer FILEOPEN: When open RTF file, tags \nofpages \chpgn ignored and rejected: treated as step children
Summary: Writer FILEOPEN: When open RTF file, tags \nofpages \chpgn ignored and reject...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.3.3 release
Hardware: All All
: medium major
Assignee: Miklos Vajna
Whiteboard: target:3.6.0 target:3.5.4
Keywords: filter:rtf, regression
Depends on:
Reported: 2011-06-29 15:39 UTC by wpiis
Modified: 2015-12-17 11:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

Automated database report (8.87 KB, application/rtf)
2012-04-18 08:56 UTC, Bernard Moreton
screenshot of attachment, made in msWord 2003 on Windows XP, Russian locale (101.89 KB, image/png)
2012-04-18 09:08 UTC, sasha.libreoffice

Note You need to log in before you can comment on or make changes to this bug.
Description wpiis 2011-06-29 15:39:16 UTC
When importing a document with \nofpages(Number of pages) and \chpgn(Current page number (as in headers).)
They are recognized a fields, but are not updated.
When the document is saved, the controls disappear.

Please correct.
Thanks, Tracey
BTW Objects that appear in their place are (msRTF1.9.1Spec):
PAGE (Fields> Numbering)
NUMPAGES (Fields> Docinfo)
\*\fldinst  PAGE
\*\fldinst  NUMPAGES
Comment 1 wpiis 2011-06-30 09:03:24 UTC
BTW I am not necessarily implying that PAGE and/or NUMPAGES should/must be replaced by \chpgn and \nofpages and PAGE and NUMPAGES removed.

Since 1987 \chpgn and \nofpages have ALWAYS been the (right/correct) RTF controls to supply/identify the fields/values for PAGE and NUMPAGES.

Both can/should be in place and added in the correct way:
Destinations added after the 1987 RTF Specification may be preceded by the control symbol \* (backslash asterisk). This control symbol identifies destinations whose related text should be ignored if the RTF reader does not recognize the destination control word. RTF writers should follow the convention of using this control symbol when adding new destinations or groups. Destinations whose related text should be inserted into the document even if the RTF reader does not recognize the destination should not use \*."

I assume that PAGE and/or NUMPAGES are being used for application place holders (which if applied correctly is OK),however PAGE and NUMPAGES are for the Information Group.

Just FYI, Tracey
Sean Burke in RTF Pocket Guide wrote:
For no really good reason, support for these RTF character sets is perfiect in some word processors, almost perfect in others..., and shoddy in others...
Comment 2 Björn Michaelsen 2011-12-23 12:25:44 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 sasha.libreoffice 2012-03-01 02:38:30 UTC
Thanks for bugreport and explanations of rtf internals.
Please, attach document that demonstrates this problem.
Comment 4 Bernard Moreton 2012-04-18 08:50:02 UTC
\chpgn is still ignored in 3.5.2
The problem is still of medium/major severity - documents with page numbering turned on all now show blanks where there should be numbers
Comment 5 Bernard Moreton 2012-04-18 08:56:35 UTC
Created attachment 60263 [details]
Automated database report

example of failure of \chpgn
Comment 6 sasha.libreoffice 2012-04-18 09:08:31 UTC
Created attachment 60265 [details]
screenshot of attachment, made in msWord 2003 on Windows XP, Russian locale
Comment 7 Miklos Vajna 2012-05-06 14:07:46 UTC
The lack of \chpgn handling is a regression, will fix tomorrow. \nofpages was already handled since 2011-07-13.
Comment 8 Not Assigned 2012-05-07 00:52:32 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":


fdo#38786 implement RTF_CHPGN
Comment 9 Miklos Vajna 2012-05-07 00:53:25 UTC
Marking as resolved.
Comment 10 sasha.libreoffice 2012-05-07 03:44:02 UTC
Thanks for fixing this bug and adding to automated tests
Comment 11 Not Assigned 2012-05-10 07:05:22 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":


fdo#38786 implement RTF_CHPGN

It will be available in LibreOffice 3.5.4.
Comment 12 Robinson Tryon (qubit) 2015-12-17 11:52:10 UTC
Migrating Whiteboard tags to Keywords: (filter:rtf)
Replace rtf_filter -> filter:rtf.