rpms/openoffice.org/devel openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch, 1.3, 1.4

Caolan McNamara caolanm at fedoraproject.org
Thu Mar 12 13:17:27 UTC 2009


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17831

Modified Files:
	openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch 
Log Message:
a bit of a dogs dinner with toc, prefer my own impl

openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch:

Index: openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch	13 Feb 2009 12:15:19 -0000	1.3
+++ openoffice.org-3.0.1.ooo97488.sw.ww8toc.patch	12 Mar 2009 13:17:27 -0000	1.4
@@ -1,3 +1,150 @@
+Index: ww8atr.cxx
+===================================================================
+--- openoffice.org.orig/sw/source/filter/ww8/ww8atr.cxx	(.../OOO310_m5/sw/source/filter/ww8/ww8atr.cxx)	(revision 269407)
++++ openoffice.org/sw/source/filter/ww8/ww8atr.cxx	(.../OOO310_m4/sw/source/filter/ww8/ww8atr.cxx)	(revision 269407)
+@@ -2141,42 +2141,46 @@
+ 
+                 if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
+                 {
+-                    // --> OD 2009-02-27 #i99641#
+-                    // The following code does not determine the minimum outline
+-                    // level for the TOC
+-//                    // Search over all the outline styles used and figure out
+-//                    // what is the minimum outline level we need to display
+-//                    // (ignoring headline styles 1-9)
+-//                    //BYTE nLvl = 0, nMinLvl = 0; //#outline level, removed by zhaojianwei
+-//                    int nLvl = 0, nMinLvl = 0;      //<-end,add by zhaojianwei
+-//                    const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
+-//                    const SwTxtFmtColl* pColl;
+-//                    for( n = rColls.Count(); n; )
+-//                    {
+-//                        pColl = rColls[ --n ];
+-//                        //nLvl = pColl->GetOutlineLevel();    //#outline level,zhaojianwei
+-//                        //USHORT nPoolId = pColl->GetPoolFmtId();
+-//                        //if( MAXLEVEL > nLvl && nMinLvl < nLvl &&        //<-end, ->add by zhaojianwei
+-//                        USHORT nPoolId = pColl->GetPoolFmtId();
+-//                        if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
+-//                          nMinLvl < (nLvl = pColl->GetAssignedOutlineStyleLevel()) && //<-end,zhaojianwei
+-//                            ( RES_POOLCOLL_HEADLINE1 > nPoolId ||
+-//                              RES_POOLCOLL_HEADLINE9 < nPoolId ))
+-//                        {
+-//                            // If we are using the default heading styles then use nTOXLvl
+-//                            if(!nMinLvl)
+-//                                nLvl = nTOXLvl;
+-//                            else
+-//                                nLvl = nMinLvl < nTOXLvl ? nMinLvl : (BYTE)nTOXLvl;
+-//                            nMinLvl = nLvl;
+-//                        }
+-//                    }
+-                    const int nMinLvl = nTOXLvl;
++                    // Search over all the outline styles used and figure out
++                    // what is the minimum outline level we need to display
++                    // (ignoring headline styles 1-9)
++                    //BYTE nLvl = 0, nMinLvl = 0;	//#outline level, removed by zhaojianwei
++					int nLvl = 0, nMinLvl = 0;		//<-end,add by zhaojianwei
++                    const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
++                    const SwTxtFmtColl* pColl;
++                    for( n = rColls.Count(); n; )
++                    {
++                        pColl = rColls[ --n ];
++                        //nLvl = pColl->GetOutlineLevel();	//#outline level,zhaojianwei
++                        //USHORT nPoolId = pColl->GetPoolFmtId();
++                        //if( MAXLEVEL > nLvl && nMinLvl < nLvl &&		//<-end, ->add by zhaojianwei
++						USHORT nPoolId = pColl->GetPoolFmtId();
++						if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
++							nMinLvl < (nLvl = pColl->GetAssignedOutlineStyleLevel()) &&	//<-end,zhaojianwei
++                            ( RES_POOLCOLL_HEADLINE1 > nPoolId ||
++                              RES_POOLCOLL_HEADLINE9 < nPoolId ))
++                        {
++                            // If we are using the default heading styles then use nTOXLvl
++                            if(!nMinLvl)
++                                nLvl = nTOXLvl;
++                            else
++                                nLvl = nMinLvl < nTOXLvl ? nMinLvl : (BYTE)nTOXLvl;
++                            nMinLvl = nLvl;
++                        }
++                    }
+ 
++                    // --> OD 2008-12-19 #i70748#
++                    // Correction: in the above loop the <nMinLvl> is set != 0,
++                    // if a to outline style assigned paragraph style exists,
++                    // which does not belong to the default ones.
++                    // It has to be considered that the last checked
++                    // to outline style assigned paragraph style could have
++                    // assigned outline style level == 0.
++                    // Thus, check on and export of <nMinLvl> instead of <nLvl>.
+ //                    if( nLvl )
+                     if ( nMinLvl > 0 )
+                     {
+-                        int nTmpLvl = nMinLvl;
++                        int nTmpLvl = nMinLvl + 1;
+                         if (nTmpLvl > WW8ListManager::nMaxLevel)
+                             nTmpLvl = WW8ListManager::nMaxLevel;
+ 
+@@ -2187,39 +2191,33 @@
+                     }
+                     // <--
+ 
+-                    // --> OD 2009-02-27 #i99641#
+-                    // not needed to additional export paragraph style with
+-                    // an outline level to the /t option
+-//                    if( nMinLvl > 0 )
+-//                    // <--
+-//                    {
+-//                        // collect this templates into the \t otion
+-//                        const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
+-//                        const SwTxtFmtColl* pColl;
+-//                        int nLvl = 0;
+-//                        for( n = rColls.Count(); n;)
+-//                        {
+-//                            pColl = rColls[--n];
+-//                            //nLvl =  pColl->GetOutlineLevel();         //#outline level, removed by zhaojianwei
+-//                            //if (MAXLEVEL > nLvl && nMinLvl <= nLvl)
+-//                            //{                                         //<-end, ->add by zhaojianwei
+-//                            if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
+-//                                nMinLvl <= ( nLvl = pColl->GetAssignedOutlineStyleLevel()))
+-//                            {                                           //<-end,zhaojianwei
+-//                                if( sTOption.Len() )
+-//                                    sTOption += ';';
+-//                                (( sTOption += pColl->GetName() ) += ';' )
+-//                                        += String::CreateFromInt32( nLvl + 1 );
+-//                            }
+-//                        }
+-//                    }
++                    // --> OD 2008-12-19 #i70748#
++                    // See above, checking <nLvl != nMinLvl> does not make sense.
++//                    if( nLvl != nMinLvl )
++                    if( nMinLvl > 0 )
++                    // <--
++                    {
++                        // collect this templates into the \t otion
++                        for( n = rColls.Count(); n;)
++                        {
++                            pColl = rColls[--n];
++                            //nLvl =  pColl->GetOutlineLevel();			//#outline level, removed by zhaojianwei
++                            //if (MAXLEVEL > nLvl && nMinLvl <= nLvl)
++                            //{											//<-end, ->add by zhaojianwei
++							if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
++								nMinLvl <= ( nLvl = pColl->GetAssignedOutlineStyleLevel()))
++							{											//<-end,zhaojianwei
++								if( sTOption.Len() )
++                                    sTOption += ';';
++                                (( sTOption += pColl->GetName() ) += ';' )
++                                        += String::CreateFromInt32( nLvl + 1 );
++                            }
++                        }
++                    }
+                 }
+ 
+                 if( nsSwTOXElement::TOX_TEMPLATE & pTOX->GetCreateType() )
+-                    // --> OD 2009-02-27 #i99641#
+-                    // Consider additional styles regardless of TOX-outlinelevel
+-                    for( n = 0; n < MAXLEVEL; ++n )
+-                    // <--
++                    for( n = 0; n < nTOXLvl; ++n )
+                     {
+                         const String& rStyles = pTOX->GetStyleNames( n );
+                         if( rStyles.Len() )
 Index: source/filter/ww8/ww8atr.cxx
 ===================================================================
 RCS file: /cvs/sw/sw/source/filter/ww8/ww8atr.cxx,v




More information about the fedora-extras-commits mailing list