You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by zh...@apache.org on 2012/09/04 10:11:49 UTC

svn commit: r1380481 - in /incubator/ooo/trunk/main/writerfilter/source/dmapper: DomainMapper.cxx DomainMapper_Impl.cxx DomainMapper_Impl.hxx

Author: zhangjf
Date: Tue Sep  4 08:11:49 2012
New Revision: 1380481

URL: http://svn.apache.org/viewvc?rev=1380481&view=rev
Log:
#i119607#, text font spacing in comments doesn't expand/condense by the expected value 

Found by: xiao ting xiao, tingxiaox@gmail.com 
Patch by: bjcheny, companycy@gmail.com
Review by: zhangjf

Modified:
    incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
    incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.hxx

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx?rev=1380481&r1=1380480&r2=1380481&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper.cxx Tue Sep  4 08:11:49 2012
@@ -119,9 +119,9 @@ DomainMapper::DomainMapper( const uno::R
                             uno::Reference< io::XInputStream > xInputStream,
                             uno::Reference< lang::XComponent > xModel,
                             SourceDocumentType eDocumentType) :
-LoggedProperties(dmapper_logger, "DomainMapper"), 
-LoggedTable(dmapper_logger, "DomainMapper"),
-LoggedStream(dmapper_logger, "DomainMapper"),
+    LoggedProperties(dmapper_logger, "DomainMapper"), 
+    LoggedTable(dmapper_logger, "DomainMapper"),
+    LoggedStream(dmapper_logger, "DomainMapper"),
     m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
     mnBackgroundColor(0), mbIsHighlightSet(false)
 {
@@ -3025,11 +3025,18 @@ void DomainMapper::sprmWithProps( Sprm& 
     case 71 : //"sprmCDxaSpace"
     case 96 : //"sprmCDxaSpace"
     case NS_sprm::LN_CDxaSpace:  // sprmCDxaSpace
-        /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
-        //Kerning half point values
-        //TODO: there are two kerning values -
-        // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
-        rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) );
+        {
+            /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
+            //Kerning half point values
+            //TODO: there are two kerning values -
+            // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
+            sal_Int16 nResult = static_cast<sal_Int16>(ConversionHelper::convertTwipToMM100(nIntValue));
+            if (m_pImpl->IsInComments())
+            {
+                nResult = static_cast<sal_Int16>(nIntValue);
+            }
+            rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny(nResult));
+        }
         break;
     case NS_sprm::LN_CHpsKern:  // sprmCHpsKern    auto kerning is bound to a minimum font size in Word - but not in Writer :-(
         /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx?rev=1380481&r1=1380480&r2=1380481&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx Tue Sep  4 08:11:49 2012
@@ -120,33 +120,34 @@ void FIB::SetData( Id nName, sal_Int32 n
 
   -----------------------------------------------------------------------*/
 DomainMapper_Impl::DomainMapper_Impl(
-            DomainMapper& rDMapper,
-            uno::Reference < uno::XComponentContext >  xContext,
-            uno::Reference< lang::XComponent >  xModel,
-            SourceDocumentType eDocumentType) :
-        m_eDocumentType( eDocumentType ),
-        m_rDMapper( rDMapper ),
-        m_xTextDocument( xModel, uno::UNO_QUERY ),
-        m_xTextFactory( xModel, uno::UNO_QUERY ),
-        m_xComponentContext( xContext ),
-        m_bFieldMode( false ),
-        m_bSetUserFieldContent( false ),
-        m_bIsFirstSection( true ),
-        m_bIsColumnBreakDeferred( false ),
-        m_bIsPageBreakDeferred( false ),
-        m_bIsInShape( false ),
-        m_bShapeContextAdded( false ),
-        m_pLastSectionContext( ),
-        m_nCurrentTabStopIndex( 0 ),
-        m_sCurrentParaStyleId(),
-        m_bInStyleSheetImport( false ),
-        m_bInAnyTableImport( false ),
-        m_bLineNumberingSet( false ),
-        m_bIsInFootnoteProperties( true ),
-        m_bIsCustomFtnMark( false ),
-        m_bIsParaChange( false ),
-        m_bParaChanged( false ),
-        m_bIsLastParaInSection( false )
+    DomainMapper& rDMapper,
+    uno::Reference < uno::XComponentContext >  xContext,
+    uno::Reference< lang::XComponent >  xModel,
+    SourceDocumentType eDocumentType) :
+    m_eDocumentType( eDocumentType ),
+    m_rDMapper( rDMapper ),
+    m_xTextDocument( xModel, uno::UNO_QUERY ),
+    m_xTextFactory( xModel, uno::UNO_QUERY ),
+    m_xComponentContext( xContext ),
+    m_bFieldMode( false ),
+    m_bSetUserFieldContent( false ),
+    m_bIsFirstSection( true ),
+    m_bIsColumnBreakDeferred( false ),
+    m_bIsPageBreakDeferred( false ),
+    m_bIsInShape( false ),
+    m_bShapeContextAdded( false ),
+    m_pLastSectionContext( ),
+    m_nCurrentTabStopIndex( 0 ),
+    m_sCurrentParaStyleId(),
+    m_bInStyleSheetImport( false ),
+    m_bInAnyTableImport( false ),
+    m_bLineNumberingSet( false ),
+    m_bIsInFootnoteProperties( true ),
+    m_bIsCustomFtnMark( false ),
+    m_bIsParaChange( false ),
+    m_bParaChanged( false ),
+    m_bIsLastParaInSection( false ),
+    m_bIsInComments( false )
 {
     appendTableManager( );
     GetBodyText();
@@ -1248,6 +1249,7 @@ void DomainMapper_Impl::PushAnnotation()
     try
     {
         PropertyMapPtr pTopContext = GetTopContext();
+        m_bIsInComments = true;
         m_xAnnotationField = uno::Reference< beans::XPropertySet >( GetTextFactory()->createInstance(
                 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.Annotation") ) ),
             uno::UNO_QUERY_THROW );
@@ -1257,7 +1259,7 @@ void DomainMapper_Impl::PushAnnotation()
     }
     catch( uno::Exception& )
     {
-        OSL_ENSURE( false, "exception in PushFootOrEndnote" );
+        OSL_ENSURE( false, "exception in PushAnnotation" );
     }
 }
 /*-- 24.05.2007 14:22:29---------------------------------------------------
@@ -1272,6 +1274,7 @@ void DomainMapper_Impl::PopFootOrEndnote
   -----------------------------------------------------------------------*/
 void DomainMapper_Impl::PopAnnotation()
 {
+    m_bIsInComments = false;
     m_aTextAppendStack.pop();
     uno::Sequence< beans::PropertyValue > aEmptyProperties;
     appendTextContent( uno::Reference< text::XTextContent >( m_xAnnotationField, uno::UNO_QUERY_THROW ), aEmptyProperties );

Modified: incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.hxx?rev=1380481&r1=1380480&r2=1380481&view=diff
==============================================================================
--- incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.hxx (original)
+++ incubator/ooo/trunk/main/writerfilter/source/dmapper/DomainMapper_Impl.hxx Tue Sep  4 08:11:49 2012
@@ -342,6 +342,7 @@ private:
 
     bool                            m_bParaChanged;
     bool                            m_bIsLastParaInSection;
+    bool                            m_bIsInComments;
 
     //annotation import
     uno::Reference< beans::XPropertySet >                                      m_xAnnotationField;
@@ -572,6 +573,8 @@ public:
     void SetCustomFtnMark(bool bSet) { m_bIsCustomFtnMark = bSet; }
     bool IsCustomFtnMark() const { return m_bIsCustomFtnMark;  }
 
+    bool IsInComments() const { return m_bIsInComments; };
+
     void RegisterFrameConversion(
         ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xFrameStartRange,
         ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xFrameEndRange,