Kaydet (Commit) 5b87b9b8 authored tarafından Jürgen Schmidt's avatar Jürgen Schmidt

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
üst 22602686
...@@ -2647,13 +2647,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType ...@@ -2647,13 +2647,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
case NS_sprm::LN_POutLvl: case NS_sprm::LN_POutLvl:
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
{ {
sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
if( m_pImpl->IsStyleSheetImport() ) if( m_pImpl->IsStyleSheetImport() )
{ {
sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
pStyleSheetPropertyMap->SetOutlineLevel( nLvl ); 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 break; // sprmPOutLvl
case NS_sprm::LN_PFBiDi: case NS_sprm::LN_PFBiDi:
......
...@@ -2014,7 +2014,7 @@ bool lcl_FindInCommand( ...@@ -2014,7 +2014,7 @@ bool lcl_FindInCommand(
// { // {
//todo: entries can only be included completely //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 )) // if( lcl_FindInCommand( rCommand, 'n', sValue ))
// { // {
//todo: what does the description mean? //todo: what does the description mean?
...@@ -2721,7 +2721,7 @@ void DomainMapper_Impl::handleToc ...@@ -2721,7 +2721,7 @@ void DomainMapper_Impl::handleToc
// { // {
//todo: entries can only be included completely //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 )) // if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
// { // {
//todo: what does the description mean? //todo: what does the description mean?
...@@ -2731,9 +2731,14 @@ void DomainMapper_Impl::handleToc ...@@ -2731,9 +2731,14 @@ void DomainMapper_Impl::handleToc
{ {
bFromOutline = true; bFromOutline = true;
UniString sParam( sValue ); UniString sParam( sValue );
xub_StrLen nIndex = 0; if (!sParam.Len())
sParam.GetToken( 0, '-', nIndex ); nMaxLevel = WW_OUTLINE_MAX;
nMaxLevel = sal_Int16( sParam.Copy( nIndex ).ToInt32( ) ); 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 // \p Defines the separator between the table entry and its page number
if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue )) if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))
......
...@@ -384,6 +384,7 @@ typedef boost::shared_ptr<ParagraphProperties> ParagraphPropertiesPtr; ...@@ -384,6 +384,7 @@ typedef boost::shared_ptr<ParagraphProperties> ParagraphPropertiesPtr;
-----------------------------------------------------------------------*/ -----------------------------------------------------------------------*/
#define WW_OUTLINE_MAX sal_Int16( 9 ) #define WW_OUTLINE_MAX sal_Int16( 9 )
#define WW_OUTLINE_MIN sal_Int16( 0 )
class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment