From 84c985399e331fe1206b15078654d08b6c41a502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Fri, 20 Apr 2007 10:42:49 +0000 Subject: [PATCH] a bit of code cleanup while reading it --- writerfilter/source/dmapper/DomainMapper.cxx | 15 ++++++++------- writerfilter/source/dmapper/StyleSheetTable.cxx | 16 +++++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index cabd615baf7d..5b48466b1dcb 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: DomainMapper.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: fridrich_strba $ $Date: 2007-04-18 19:08:07 $ + * last change: $Author: fridrich_strba $ $Date: 2007-04-20 11:42:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -2043,7 +2043,7 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType break; // sprmCKcd case 0x0858:// sprmCFEmboss /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ - case 060:// sprmCFBold + case 60:// sprmCFBold case 0x085C:// sprmCFBoldBi (offset 0x27 to normal bold) /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ case 0x085D:// sprmCFItalicBi (offset 0x27 to normal italic) @@ -2134,7 +2134,7 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType OSL_ASSERT("what type was it"); } } - sal_uInt16 nPropertyNameId = 0; + switch( nId ) { case 060:/*sprmCFBold*/ @@ -2168,7 +2168,7 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType case 0x838: /*sprmCFOutline*/ case 0x839: /*sprmCFShadow*/ case 0x83c: /*sprmCFVanish*/ - nPropertyNameId = static_cast( ePropertyId ); + rContext->Insert(ePropertyId, uno::makeAny( nIntValue ? true : false )); break; case 0x83a: /*sprmCFSmallCaps*/ rContext->Insert(ePropertyId, @@ -2184,8 +2184,6 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType break; } - if(nPropertyNameId) - rContext->Insert((PropertyIds)nPropertyNameId, uno::makeAny( nIntValue ? true : false ) ); } } break; @@ -2373,6 +2371,8 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ break; // sprmCPropRMark case 0x2859: + // The file-format has many character animations. We have only + // one, so we use it always. Suboptimal solution though. if (nIntValue) rContext->Insert(PROP_CHAR_FLASH, uno::makeAny( true )); else @@ -3021,6 +3021,7 @@ void DomainMapper::sprm( doctok::Sprm& sprm_, PropertyMapPtr rContext, SprmType case NS_ooxml::LN_EG_RPrBase_bdr: case NS_ooxml::LN_EG_RPrBase_eastAsianLayout: case NS_ooxml::LN_EG_RPrBase_u: + case NS_ooxml::LN_EG_RPrBase_lang: case NS_ooxml::LN_CT_PPrBase_spacing: case NS_ooxml::LN_CT_PPrBase_ind: case NS_ooxml::LN_CT_PPrBase_tabs: diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 17f40093e59f..7a20ed2edb86 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -4,9 +4,9 @@ * * $RCSfile: StyleSheetTable.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: fridrich_strba $ $Date: 2007-04-17 15:05:38 $ + * last change: $Author: fridrich_strba $ $Date: 2007-04-20 11:42:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -67,6 +67,8 @@ #include #endif #include +#include +#include using namespace ::com::sun::star; namespace dmapper @@ -782,23 +784,23 @@ void StyleSheetTable::ApplyStyleSheets(uno::Reference< text::XTextDocument> xTex } if(bAddFollowStyle) { - beans::PropertyValue aNew; - aNew.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FollowStyle")); //find the name of the Next style std::vector< StyleSheetEntry >::iterator aNextStyleIt = m_pImpl->m_aStyleSheetEntries.begin(); for( ; aNextStyleIt != m_pImpl->m_aStyleSheetEntries.end(); ++aNextStyleIt ) if(aNextStyleIt->nStyleIdentifierD == aIt->nNextStyleIdentifier) { + beans::PropertyValue aNew; + aNew.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FollowStyle")); aNew.Value = uno::makeAny(ConvertStyleName( aNextStyleIt->sStyleName/*, bParaStyle*/ )); + aSortedPropVals.Insert( aNew ); break; } - aSortedPropVals.Insert( aNew ); // pNames[--nSetProperties] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FollowStyle")); // pValues[nSetProperties] = uno::makeAny( // m_pImpl->m_aStyleSheetEntries[aIt->nNextStyleIdentifier].sStyleName); } - uno::Reference< beans::XMultiPropertySet > xMultiPropertySet( xStyle, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XMultiPropertySet > xMultiPropertySet( xStyle, uno::UNO_QUERY_THROW); // xMultiPropertySet->setPropertyValues( aNames, aValues ); xMultiPropertySet->setPropertyValues( aSortedPropVals.getNames(), aSortedPropVals.getValues() ); } @@ -964,7 +966,7 @@ const StyleSheetEntry* StyleSheetTable::FindParentStyleSheet(sal_Int32 nBaseStyl "Body Text Indent 3", 0, //83 "Block Text", 0, //84 "Hyperlink", "Internet link", //85 - "Followed Hyperlink", "Visited Internet Link//86", + "Followed Hyperlink", "Visited Internet Link", //86 "Strong", "Strong Emphasis", //87 "Emphasis", "Emphasis", //88 "Document Map", 0, //89