openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@apache.org
Subject svn commit: r1607520 - in /openoffice/trunk/main/writerfilter/source/dmapper: CellColorHandler.cxx CellColorHandler.hxx DomainMapper.cxx
Date Thu, 03 Jul 2014 02:52:17 GMT
Author: steve_y
Date: Thu Jul  3 02:52:17 2014
New Revision: 1607520

URL: http://svn.apache.org/r1607520
Log:
Issue 119044 - Highlighter from DOCX file not imported correctly

Modified:
    openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.cxx
    openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.hxx
    openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx

Modified: openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.cxx?rev=1607520&r1=1607519&r2=1607520&view=diff
==============================================================================
--- openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.cxx (original)
+++ openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.cxx Thu Jul  3 02:52:17
2014
@@ -44,7 +44,7 @@ LoggedProperties(dmapper_logger, "CellCo
 m_nShadowType( 0 ),
 m_nColor( 0xffffffff ),
 m_nFillColor( 0xffffffff ),
-m_bParagraph( false )
+m_eType( Others )
 {
 }
 /*-- 24.04.2007 09:06:35---------------------------------------------------
@@ -224,9 +224,23 @@ TablePropertyMapPtr  CellColorHandler::g
 
         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

Modified: openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.hxx?rev=1607520&r1=1607519&r2=1607520&view=diff
==============================================================================
--- openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.hxx (original)
+++ openoffice/trunk/main/writerfilter/source/dmapper/CellColorHandler.hxx Thu Jul  3 02:52:17
2014
@@ -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;
 }}

Modified: openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx?rev=1607520&r1=1607519&r2=1607520&view=diff
==============================================================================
--- openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx (original)
+++ openoffice/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Thu Jul  3 02:52:17
2014
@@ -2617,7 +2617,7 @@ void DomainMapper::sprmWithProps( Sprm& 
         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& 
         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 */



Mime
View raw message