writerfilter/source/dmapper/DomainMapper.cxx      |    7 ++++++-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   14 +++++++++-----
 writerfilter/source/dmapper/PropertyMap.hxx       |    1 +
 3 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit aeb7683ae745717fe5e283b6ada065183aa730f4
Author: Jürgen Schmidt <j...@apache.org>
Date:   Thu Jun 7 11:44:03 2012 +0000

    Resolves: #i119621# 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
    
    (cherry picked from commit 5b87b9b8bc679dfbb308646a6da7584d4b418337)
    
    Conflicts:
        writerfilter/source/dmapper/DomainMapper_Impl.cxx
    
    Change-Id: I2149a7338b128d0dd1c1317a259e537d2a1e1063

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 2744ac3..d136e1b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1878,13 +1878,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, 
PropertyMapPtr rContext, SprmType
         break;  // sprmPPropRMark
     case NS_sprm::LN_POutLvl:
         {
+            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:
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 175e53f..eb45169 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1957,7 +1957,6 @@ bool lcl_FindInCommand(
 }
 
 
-
 void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale)
 {
     PropertyMapPtr pTopContext = GetTopContext();
@@ -2549,7 +2548,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, such 
as 1-9 in a table of contents without page numbers
 //                    if( lcl_FindInCommand( pContext->GetCommand(), 'n', 
sValue ))
 //                    {
                         //todo: what does the description mean?
@@ -2558,9 +2557,14 @@ void DomainMapper_Impl::handleToc
     if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue ))
     {
         bFromOutline = true;
-        sal_Int32 nIndex = 0;
-        sValue.getToken( 0, '-', nIndex );
-        nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? 
sValue.copy(nIndex).toInt32() : 0);
+        if (sValue.isEmpty())
+            nMaxLevel = WW_OUTLINE_MAX;
+        else
+        {
+            sal_Int32 nIndex = 0;
+            sValue.getToken( 0, '-', nIndex );
+            nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? 
sValue.copy(nIndex).toInt32() : 0);
+        }
     }
 //                  \p Defines the separator between the table entry and its 
page number
     if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx 
b/writerfilter/source/dmapper/PropertyMap.hxx
index 6bbb4c7..75d78c1 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -374,6 +374,7 @@ typedef boost::shared_ptr<ParagraphProperties>  
ParagraphPropertiesPtr;
   -----------------------------------------------------------------------*/
 
 #define WW_OUTLINE_MAX  sal_Int16( 9 )
+#define WW_OUTLINE_MIN  sal_Int16( 0 )
 
 class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to