[Libreoffice-commits] core.git: Branch 'aoo/trunk' - writerfilter/source
Steve Yin
steve_y at apache.org
Wed Jul 2 21:07:36 PDT 2014
writerfilter/source/dmapper/CellColorHandler.cxx | 20 +++++++++++++++++---
writerfilter/source/dmapper/CellColorHandler.hxx | 5 +++--
writerfilter/source/dmapper/DomainMapper.cxx | 12 +++++++++++-
3 files changed, 31 insertions(+), 6 deletions(-)
New commits:
commit 29072b501b276ac4d0129a86ab31d0b8634e5283
Author: Steve Yin <steve_y at apache.org>
Date: Thu Jul 3 02:52:17 2014 +0000
Issue 119044 - Highlighter from DOCX file not imported correctly
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index feba9c6..deafbb6 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -44,7 +44,7 @@ LoggedProperties(dmapper_logger, "CellColorHandler"),
m_nShadowType( 0 ),
m_nColor( 0xffffffff ),
m_nFillColor( 0xffffffff ),
-m_bParagraph( false )
+m_eType( Others )
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
@@ -225,8 +225,22 @@ TablePropertyMapPtr CellColorHandler::getProperties()
nApplyColor = ( (nRed/1000) << 0x10 ) + ((nGreen/1000) << 8) + nBlue/1000;
}
- pPropertyMap->Insert( m_bParagraph ? PROP_PARA_BACK_COLOR : PROP_BACK_COLOR, false,
- uno::makeAny( nApplyColor ));
+ sal_Int32 objType = PROP_CHAR_BACK_COLOR;
+
+ switch(m_eType)
+ {
+ case P:
+ pPropertyMap->Insert( PROP_PARA_BACK_COLOR, false, uno::makeAny( nApplyColor ));
+ break;
+ case C:
+ pPropertyMap->Insert( PROP_CHAR_BACK_COLOR, false, uno::makeAny( nApplyColor ));
+ break;
+ case Others:
+ default:
+ pPropertyMap->Insert( PROP_BACK_COLOR, false, uno::makeAny( nApplyColor ));
+ break;
+ }
+
return pPropertyMap;
}
} //namespace dmapper
diff --git a/writerfilter/source/dmapper/CellColorHandler.hxx b/writerfilter/source/dmapper/CellColorHandler.hxx
index 3ecfe68..b65c4d0 100644
--- a/writerfilter/source/dmapper/CellColorHandler.hxx
+++ b/writerfilter/source/dmapper/CellColorHandler.hxx
@@ -39,7 +39,8 @@ public:
sal_Int32 m_nShadowType;
sal_Int32 m_nColor;
sal_Int32 m_nFillColor;
- bool m_bParagraph;
+ enum Type {P, C, Others};
+ Type m_eType;
private:
// Properties
@@ -52,7 +53,7 @@ public:
::boost::shared_ptr<TablePropertyMap> getProperties();
- void setParagraph() { m_bParagraph = true; }
+ void setType(Type type) { m_eType = type; }
};
typedef boost::shared_ptr< CellColorHandler > CellColorHandlerPtr;
}}
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 02248d2..4a06a1e 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2617,7 +2617,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
if( pProperties.get())
{
CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
- pCellColorHandler->setParagraph();
+ pCellColorHandler->setType(CellColorHandler::P);
pProperties->resolve(*pCellColorHandler);
rContext->insert( pCellColorHandler->getProperties(), true );
}
@@ -3186,6 +3186,16 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
break; // sprmCBrc
case NS_sprm::LN_CShd:
/* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ {
+ CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
+ pCellColorHandler->setType(CellColorHandler::C);
+ pProperties->resolve(*pCellColorHandler);
+ rContext->insert( pCellColorHandler->getProperties(), true );
+ }
+ }
break; // sprmCShd
case NS_sprm::LN_CIdslRMarkDel:
/* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
More information about the Libreoffice-commits
mailing list