summaryrefslogtreecommitdiff
path: root/writerfilter
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 /writerfilter
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
Diffstat (limited to 'writerfilter')
-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
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 175e53fa98c4..eb45169be270 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 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;
-----------------------------------------------------------------------*/
#define WW_OUTLINE_MAX sal_Int16( 9 )
+#define WW_OUTLINE_MIN sal_Int16( 0 )
class StyleSheetPropertyMap : public PropertyMap, public ParagraphProperties