n#760764 dmapper: don't ignore character properties of text fields

Change-Id: If1497d78b8c31a4b2e5677bb57f40a0343a819a9
This commit is contained in:
Miklos Vajna
2012-05-29 15:31:11 +02:00
parent 6e6d81e9cf
commit 9486851bae
2 changed files with 11 additions and 1 deletions

View File

@@ -196,6 +196,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsColumnBreakDeferred( false ),
m_bIsPageBreakDeferred( false ),
m_pLastSectionContext( ),
m_pLastCharacterContext(),
m_nCurrentTabStopIndex( 0 ),
m_sCurrentParaStyleId(),
m_bInStyleSheetImport( false ),
@@ -361,6 +362,8 @@ void DomainMapper_Impl::PopProperties(ContextType eId)
{
m_pLastSectionContext = m_aPropertyStacks[eId].top( );
}
else if (eId == CONTEXT_CHARACTER)
m_pLastCharacterContext = m_aPropertyStacks[eId].top();
m_aPropertyStacks[eId].pop();
m_aContextStack.pop();
@@ -3173,7 +3176,13 @@ void DomainMapper_Impl::PopFieldContext()
if( xToInsert.is() )
{
uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( xTextAppend, uno::UNO_QUERY_THROW );
xTextAppendAndConvert->appendTextContent( xToInsert, uno::Sequence< beans::PropertyValue >() );
uno::Sequence<beans::PropertyValue> aValues;
// Character properties of the field show up here the
// last (always empty) run. Inherit character
// properties from there.
if (m_pLastCharacterContext.get())
aValues = m_pLastCharacterContext->GetPropertyValues();
xTextAppendAndConvert->appendTextContent(xToInsert, aValues);
}
else
{

View File

@@ -326,6 +326,7 @@ private:
PropertyMapPtr m_pTopContext;
PropertyMapPtr m_pLastSectionContext;
PropertyMapPtr m_pLastCharacterContext;
::std::vector<DeletableTabStop> m_aCurrentTabStops;
sal_uInt32 m_nCurrentTabStopIndex;