summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJian Fang Zhang <zhangjf@apache.org>2012-09-04 07:11:49 +0000
committerJian Fang Zhang <zhangjf@apache.org>2012-09-04 07:11:49 +0000
commit11fda1bd134b07c5bcaca6186d63107ec9f47b98 (patch)
treecebfd04b7d25d431bbb05408ff5a2d2823886a14 /writerfilter
parent8a32f50ba7a50ff621ffc6609e97a0823baf7979 (diff)
#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
Notes
Notes: merged as: 5f0c969f43538e8a92ed37c27fab228d97b1bebe
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx23
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx59
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx3
3 files changed, 49 insertions, 36 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index fbd4fe2e717c..71d08fe18f1f 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -119,9 +119,9 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
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& rSprm, PropertyMapPtr rContext, SprmType
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 */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c0d86543f9d8..1acb8e4391ea 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -120,33 +120,34 @@ void FIB::SetData( Id nName, sal_Int32 nValue )
-----------------------------------------------------------------------*/
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 );
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index e279a3c27e63..3e48a74615fb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -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,