Kaydet (Commit) aeb7683a authored tarafından Jürgen Schmidt's avatar Jürgen Schmidt Kaydeden (comit) Caolán McNamara

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 5b87b9b8)

Conflicts:
	writerfilter/source/dmapper/DomainMapper_Impl.cxx

Change-Id: I2149a7338b128d0dd1c1317a259e537d2a1e1063
üst 31fedbe9
...@@ -1878,13 +1878,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType ...@@ -1878,13 +1878,18 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
break; // sprmPPropRMark break; // sprmPPropRMark
case NS_sprm::LN_POutLvl: case NS_sprm::LN_POutLvl:
{ {
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:
......
...@@ -1957,7 +1957,6 @@ bool lcl_FindInCommand( ...@@ -1957,7 +1957,6 @@ bool lcl_FindInCommand(
} }
void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale) void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale)
{ {
PropertyMapPtr pTopContext = GetTopContext(); PropertyMapPtr pTopContext = GetTopContext();
...@@ -2549,7 +2548,7 @@ void DomainMapper_Impl::handleToc ...@@ -2549,7 +2548,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, such as 1-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?
...@@ -2558,9 +2557,14 @@ void DomainMapper_Impl::handleToc ...@@ -2558,9 +2557,14 @@ void DomainMapper_Impl::handleToc
if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue )) if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue ))
{ {
bFromOutline = true; bFromOutline = true;
sal_Int32 nIndex = 0; if (sValue.isEmpty())
sValue.getToken( 0, '-', nIndex ); nMaxLevel = WW_OUTLINE_MAX;
nMaxLevel = static_cast<sal_Int16>(nIndex != -1 ? sValue.copy(nIndex).toInt32() : 0); 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 // \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 ))
......
...@@ -374,6 +374,7 @@ typedef boost::shared_ptr<ParagraphProperties> ParagraphPropertiesPtr; ...@@ -374,6 +374,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