[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 15 08:57:47 UTC 2019


 sw/source/filter/ww8/ww8par.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c13dc7884f314addd59edce06888db7a2de13d3d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Nov 14 17:37:17 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Nov 15 09:56:20 2019 +0100

    sw: WW8 import: instead of control character insert '?' for footnote
    
    SwWW8ImplReader::ReadChar() inserts a U+0002 control character to
    temporarily mark a footnote anchor; this is then deleted and replaced
    with a real footnote hint by SwWW8ImplReader::End_Footnote().
    
    The assumption is that it is necessary to insert a placeholder
    character to be able to apply formatting to it.
    
    But if the document is corrupted, the control character could survive
    the import, which sounds less than ideal.
    
    So either make this magic character more explicit by documenting it in
    hintids.hxx and removing any outstanding ones at the end of the import,
    or use a non-offensive character instead; since this should only affect
    invalid documents, choose the solution with the least effort.
    
    Change-Id: I76d396258b32e0f0fb6393942a58a4dc57912211
    Reviewed-on: https://gerrit.libreoffice.org/82723
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2a9f285b5757..ca2c97b2125d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3774,7 +3774,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
             break;
         case 0x2:               // TODO: Auto-Footnote-Number, should be replaced by SwWW8ImplReader::End_Footnote later
             if (!m_aFootnoteStack.empty())
-                cInsert = 0x2;
+                cInsert = '?';
             break;
         default:
             SAL_INFO( "sw.ww8.level2", "<unknownValue val=\"" << nWCharVal << "\">" );


More information about the Libreoffice-commits mailing list