Kaydet (Commit) 11fda1bd authored tarafından Jian Fang Zhang's avatar Jian Fang Zhang

#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
üst 8a32f50b
......@@ -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 */
......
......@@ -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 );
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment