[Libreoffice] sw: numbering misbehaviour

Octavio Alvarez alvarezp at alvarezp.ods.org
Fri Dec 17 23:54:32 PST 2010


On Fri, 17 Dec 2010 12:28:06 -0800, Caolán McNamara <caolanm at redhat.com>
wrote:

> Btw, if you were interested in fixing that numbering problem, You might
> be interested in this similar bug, e.g.

I brute-forcedly narrowed it down to the following patch, but I'm REALLY
unsure of it. I don't know I should change it to FALSE (as I did in the
patch) or remove the if () block altogether.

To add uncertainty to it, the line was not git blamable.

I append the relevant backtrace. I patched frame #1.


==============================================

commit 743e922538aafaa75e814c047b31a508353c24eb
Author: Octavio Alvarez <alvarezp at alvarezp.ods.org>
Date:   Fri Dec 17 23:39:25 2010 -0800

       sw: allow expand format on certain circumstances.

       Applying bullets or numbering on a line when cursor is
       at the end of a line would make new text appear with
       default formatting and the paragraph was left broken, as
       after saving and reloading the file, it would come back
       as default format.

       Reported by Caolan.

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index d87b32b..f47231f 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -422,7 +422,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
                {
                    nPtPos = nMkPos = rSt.GetIndex();
                    if( bTxtAttr )
-                    pTxtNd->DontExpandFmt( rSt, TRUE );
+                    pTxtNd->DontExpandFmt( rSt, FALSE );
                }
            }


==============================================

Breakpoint 12, SwTxtNode::DontExpandFmt (this=0xac2d10e0, rIdx=...,
bFlag=true, bFmtToTxtAttributes=1 '\001')
       at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/core/txtnode/ndtxt.cxx:1148
1148	                m_pSwpHints->NoteInHistory( pTmp );
(gdb) n
1149	                pTmp->SetDontExpand( bFlag );
(gdb) bt

#0  SwTxtNode::DontExpandFmt (this=0xac2d10e0, rIdx=..., bFlag=true,
bFmtToTxtAttributes=1 '\001')
       at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/core/txtnode/ndtxt.cxx:1149

#1  0xadda0d46 in SwDoc::ResetAttrs (this=0xaf81b314, rRg=..., bTxtAttr=1
'\001', pAttrs=0xbfffe574, bSendDataChangedEvents=true)
       at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/core/doc/docfmt.cxx:425

#2  0xaddcdbb1 in SwDoc::SetNumRule (this=0xaf81b314, rPam=..., rRule=...,
bCreateNewList=true, sContinuedListId=..., bSetItem=1 '\001',
bResetIndentAttrs=true)
       at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/core/doc/docnum.cxx:933

#3  0xadb52945 in SwEditShell::SetCurNumRule (this=0xac275068, rRule=...,
bCreateNewList=true, sContinuedListId=..., bResetIndentAttrs=true)
       at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/core/edit/ednumber.cxx:720

#4  0xae48f4b0 in SwWrtShell::NumOrBulletOn (this=0xac275068, bNum=0
'\000') at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/ui/wrtsh/wrtsh1.cxx:1351

#5  0xae48f783 in SwWrtShell::BulletOn (this=0xac275068) at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/ui/wrtsh/wrtsh1.cxx:1410

#6  0xae3a55e8 in SwTextShell::ExecEnterNum (this=0xaa079678, rReq=...) at
/home/alvarezp/src/libreoffice/bootstrap/clone/writer/sw/source/ui/shells/txtnum.cxx:90

#7  0xae390736 in SfxStubSwTextShellExecEnterNum (pShell=0xaa079678,
rReq=...) at ../../../unxlngi6.pro/inc/swslots.hxx:2401

#8  0xb73c4fd8 in SfxShell::CallExec (this=0xaa079678, pFunc=0xae390712
<SfxStubSwTextShellExecEnterNum(SfxShell*, SfxRequest&)>, rReq=...) at
../../inc/sfx2/shell.hxx:201



-- 
Octavio.

Twitter: @alvarezp2000 -- Identi.ca: @alvarezp


More information about the LibreOffice mailing list