You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by js...@apache.org on 2012/06/07 14:44:04 UTC

svn commit: r1347590 - in /incubator/ooo/trunk/main/writerfilter/source/dmapper: DomainMapper.cxx DomainMapper_Impl.cxx PropertyMap.hxx

Author: jsc
Date: Thu Jun  7 12:44:03 2012
New Revision: 1347590

URL: http://svn.apache.org/viewvc?rev=1347590&view=rev
Log:
119621: Outline level in sample file lost 

fix:
- PropertyMap.hxx, add definition for outline level min value
- DomainMapper.cxx, import outline level for paragraph property
- DomainMapper_Impl.cxx, fix TOC import if no range is given 

Patch By: Yolanda Zhang Ying
Reviewed By: jsc


Modified:
    incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.hxx

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx?rev=1347590&r1=1347589&r2=1347590&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Thu Jun  7 12:44:03 2012
@@ -2647,13 +2647,18 @@ void DomainMapper::sprmWithProps( Sprm& 
     case NS_sprm::LN_POutLvl:
         /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
         { 
+            sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
             if( m_pImpl->IsStyleSheetImport() )
             {
-                sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
 
                 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
                 pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
             }
+            else
+            {
+                nLvl = nLvl >= WW_OUTLINE_MIN && nLvl < WW_OUTLINE_MAX? nLvl+1 : 0; //0 means no outline level set on
+                rContext->Insert(PROP_OUTLINE_LEVEL, true, uno::makeAny ( nLvl ));
+            }
         }
         break;  // sprmPOutLvl
     case NS_sprm::LN_PFBiDi:

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx?rev=1347590&r1=1347589&r2=1347590&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Thu Jun  7 12:44:03 2012
@@ -2014,7 +2014,7 @@ bool lcl_FindInCommand(
 //                    {
                             //todo: entries can only be included completely
 //                    }
-//                  \n Builds a table of contents or a range of entries, sucah as “1-9”, in a table of contents without page numbers
+//                  \n Builds a table of contents or a range of entries, sucah as ?-9? in a table of contents without page numbers
 //                    if( lcl_FindInCommand( rCommand, 'n', sValue ))
 //                    {
                         //todo: what does the description mean?
@@ -2721,7 +2721,7 @@ void DomainMapper_Impl::handleToc
 //                    {
                             //todo: entries can only be included completely
 //                    }
-//                  \n Builds a table of contents or a range of entries, sucah as “1-9”, in a table of contents without page numbers
+//                  \n Builds a table of contents or a range of entries, sucah as ?-9? in a table of contents without page numbers
 //                    if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
 //                    {
                         //todo: what does the description mean?
@@ -2731,9 +2731,14 @@ void DomainMapper_Impl::handleToc
     {
         bFromOutline = true;
         UniString sParam( sValue );
-        xub_StrLen nIndex = 0;
-        sParam.GetToken( 0, '-', nIndex );
-        nMaxLevel = sal_Int16( sParam.Copy( nIndex ).ToInt32( ) );
+        if (!sParam.Len())
+            nMaxLevel = WW_OUTLINE_MAX;
+        else
+        {
+            xub_StrLen nIndex = 0;
+            sParam.GetToken( 0, '-', nIndex );
+            nMaxLevel = sal_Int16( sParam.Copy( nIndex ).ToInt32( ) );
+        }
     }
 //                  \p Defines the separator between the table entry and its page number
     if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.hxx?rev=1347590&r1=1347589&r2=1347590&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.hxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/PropertyMap.hxx Thu Jun  7 12:44:03 2012
@@ -384,6 +384,7 @@ typedef boost::shared_ptr<ParagraphPrope
   -----------------------------------------------------------------------*/
 
 #define WW_OUTLINE_MAX  sal_Int16( 9 )
+#define WW_OUTLINE_MIN  sal_Int16( 0 )
 
 class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties