summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürgen Schmidt <jsc@apache.org>2012-06-07 11:44:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-04-05 09:35:12 +0100
commitaeb7683ae745717fe5e283b6ada065183aa730f4 (patch)
tree2f345ab93506aef2c6191f82e9809eeac8bb9917
parent31fedbe9f782976b6aa4615b6fd171ed52137c94 (diff)
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
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx7
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx14
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx1
3 files changed, 16 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2744ac30fc67..d136e1be5c40 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
1878 break; // sprmPPropRMark 1878 break; // sprmPPropRMark
1879 case NS_sprm::LN_POutLvl: 1879 case NS_sprm::LN_POutLvl:
1880 { 1880 {
1881 sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
1881 if( m_pImpl->IsStyleSheetImport() ) 1882 if( m_pImpl->IsStyleSheetImport() )
1882 { 1883 {
1883 sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
1884 1884
1885 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); 1885 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
1886 pStyleSheetPropertyMap->SetOutlineLevel( nLvl ); 1886 pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
1887 } 1887 }
1888 else
1889 {
1890 nLvl = nLvl >= WW_OUTLINE_MIN && nLvl < WW_OUTLINE_MAX? nLvl+1 : 0; //0 means no outline level set on
1891 rContext->Insert(PROP_OUTLINE_LEVEL, true, uno::makeAny ( nLvl ));
1892 }
1888 } 1893 }
1889 break; // sprmPOutLvl 1894 break; // sprmPOutLvl
1890 case NS_sprm::LN_PFBiDi: 1895 case NS_sprm::LN_PFBiDi:
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 175e53fa98c4..eb45169be270 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1957,7 +1957,6 @@ bool lcl_FindInCommand(
1957} 1957}
1958 1958
1959 1959
1960
1961void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale) 1960void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale)
1962{ 1961{
1963 PropertyMapPtr pTopContext = GetTopContext(); 1962 PropertyMapPtr pTopContext = GetTopContext();
@@ -2549,7 +2548,7 @@ void DomainMapper_Impl::handleToc
2549// { 2548// {
2550 //todo: entries can only be included completely 2549 //todo: entries can only be included completely
2551// } 2550// }
2552// \n Builds a table of contents or a range of entries, sucah as �1-9�, in a table of contents without page numbers 2551// \n Builds a table of contents or a range of entries, such as 1-9 in a table of contents without page numbers
2553// if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue )) 2552// if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
2554// { 2553// {
2555 //todo: what does the description mean? 2554 //todo: what does the description mean?
@@ -2558,9 +2557,14 @@ void DomainMapper_Impl::handleToc
2558 if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue )) 2557 if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue ))
2559 { 2558 {
2560 bFromOutline = true; 2559 bFromOutline = true;
2561 sal_Int32 nIndex = 0; 2560 if (sValue.isEmpty())
2562 sValue.getToken( 0, '-', nIndex ); 2561 nMaxLevel = WW_OUTLINE_MAX;
2563 nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? sValue.copy(nIndex).toInt32() : 0); 2562 else
2563 {
2564 sal_Int32 nIndex = 0;
2565 sValue.getToken( 0, '-', nIndex );
2566 nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? sValue.copy(nIndex).toInt32() : 0);
2567 }
2564 } 2568 }
2565// \p Defines the separator between the table entry and its page number 2569// \p Defines the separator between the table entry and its page number
2566 if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue )) 2570 if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 6bbb4c72aa46..75d78c190e1a 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -374,6 +374,7 @@ typedef boost::shared_ptr<ParagraphProperties> ParagraphPropertiesPtr;
374 -----------------------------------------------------------------------*/ 374 -----------------------------------------------------------------------*/
375 375
376#define WW_OUTLINE_MAX sal_Int16( 9 ) 376#define WW_OUTLINE_MAX sal_Int16( 9 )
377#define WW_OUTLINE_MIN sal_Int16( 0 )
377 378
378class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties 379class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
379 380