[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/lib/kotext
From:       David Faure <faure () kde ! org>
Date:       2006-01-06 18:05:07
Message-ID: 1136570707.722041.13149.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 494983 by dfaure:

Some fixes for unnumbered headings - see \
kofficetests/documents/native/kword/text/oo_unnumbered_heading.odt


 M  +3 -1      KoStyleCollection.cpp  
 M  +12 -2     KoTextDocument.cpp  
 M  +2 -0      KoTextParag.cpp  


--- trunk/koffice/lib/kotext/KoStyleCollection.cpp #494982:494983
@@ -232,10 +232,12 @@
         // short version:
         // kdDebug() << style << "  " << style->name() << "    " << \
style->displayName() << "  followingStyle=" << style->followingStyle() << \
endl;  
-        kdDebug() << "Style " << style << "  " << style->name() <<endl;
+        kdDebug() << "Style " << style << "  " << style->name() << "  \
isOutline=" << style->isOutline() << endl;  kdDebug() << "   format: " << \
                style->format().key() <<endl;
         static const char * const s_align[] = { "Auto", "Left", "Right", \
                "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", };
         kdDebug() << "  align: " << \
s_align[(Qt::AlignmentFlags)style->paragLayout().alignment] << endl; +      \
if ( style->paragLayout().counter ) +            kdDebug() << "  counter \
level=" << style->paragLayout().counter->depth() << endl;  
         kdDebug() << "   following style: " << style->followingStyle() << \
                " "
                   << ( style->followingStyle() ? \
                style->followingStyle()->name() : QString::null ) << endl;
--- trunk/koffice/lib/kotext/KoTextDocument.cpp #494982:494983
@@ -1555,14 +1555,24 @@
             int restartNumbering = -1;
             if ( listItem.hasAttributeNS( KoXmlNS::text, "start-value" ) )
                 restartNumbering = listItem.attributeNS( KoXmlNS::text, \
"start-value", QString::null ).toInt(); +            bool isListHeader = \
listItem.localName() == "list-header" || listItem.attributeNS( \
KoXmlNS::text, "is-list-header", QString::null ) == "is-list-header";  \
                KoTextParag* oldLast = lastParagraph;
             lastParagraph = loadOasisText( listItem, context, \
                lastParagraph, styleColl, nextParagraph );
             KoTextParag* firstListItem = oldLast ? oldLast->next() : \
firstParag(); +            KoTextParag* p = firstListItem;
             // It's either list-header (normal text on top of list) or \
                list-item
-            if ( listItem.localName() != "list-header" && firstListItem ) \
{ +            if ( !isListHeader && firstListItem ) {
                 // Apply list style to first paragraph inside list-item
-                firstListItem->applyListStyle( context, restartNumbering, \
orderedList, false, level ); +                bool isOutline = \
firstListItem->counter() && firstListItem->counter()->numbering() == \
KoParagCounter::NUM_CHAPTER; +                \
firstListItem->applyListStyle( context, restartNumbering, orderedList, \
isOutline, level ); +                p = p->next();
             }
+            // Make text:h inside list-item (as non first child) \
unnumbered. +            while ( p && p != lastParagraph->next() ) {
+                if ( p->counter() )
+                    p->counter()->setNumbering( KoParagCounter::NUM_NONE \
); +                p = p->next();
+            }
         }
     }
     if ( listOK )
--- trunk/koffice/lib/kotext/KoTextParag.cpp #494982:494983
@@ -2869,6 +2869,8 @@
         writer.startElement( "text:h", false /*no indent inside this tag*/ \
);  writer.addAttribute( "text:style-name", autoParagStyleName );
         writer.addAttribute( "text:outline-level", \
(int)paragCounter->depth() + 1 ); +        if ( paragCounter->numbering() \
== KoParagCounter::NUM_NONE ) +            writer.addAttribute( \
"text:is-list-header", "true" );  
         QString textNumber = paragCounter->text( this );
         if ( !textNumber.isEmpty() )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic