[ooo-build-commit] patches/dev300
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Thu May 28 02:44:28 PDT 2009
patches/dev300/docx-import-fixes.diff | 78 ++++++++++++++++++++--------------
1 file changed, 47 insertions(+), 31 deletions(-)
New commits:
commit c28bd6993c12c4a8abbe36663815da6d694c1751
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu May 28 11:43:11 2009 +0200
Docx import: footnote character properties
The imported docx footnote/endnote anchors had the wrong character
properties set. Fixes a part of n#478972.
* patches/dev300/docx-import-fixes.diff:
diff --git a/patches/dev300/docx-import-fixes.diff b/patches/dev300/docx-import-fixes.diff
index 00673e1..e48afa8 100644
--- a/patches/dev300/docx-import-fixes.diff
+++ b/patches/dev300/docx-import-fixes.diff
@@ -3084,7 +3084,7 @@ index c183252..d301acf 100644
}}
diff --git writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx
-index 051a2b8..8693754 100644
+index 051a2b8..02d2c90 100644
--- writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -36,6 +36,8 @@
@@ -3341,23 +3341,27 @@ index 051a2b8..8693754 100644
m_aTextAppendStack.pop();
}
/*-- 24.05.2007 14:22:28---------------------------------------------------
-@@ -1368,9 +1379,11 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
- aFontProps->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( pTopContext->GetFootnoteFontName() ));
- aFontProperties = aFontProps->GetPropertyValues();
+@@ -1351,31 +1362,99 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
+ {
+ xFootnote->setLabel( ::rtl::OUString( pTopContext->GetFootnoteSymbol() ) );
}
--
- appendTextContent( uno::Reference< text::XTextContent >( xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties );
- m_aTextAppendStack.push(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ));
+- FontTablePtr pFontTable = GetFontTable();
+- uno::Sequence< beans::PropertyValue > aFontProperties;
+- if( pFontTable && pTopContext->GetFootnoteFontId() >= 0 && pFontTable->size() > (size_t)pTopContext->GetFootnoteFontId() )
++
++ appendTextContent( uno::Reference< text::XTextContent >( xFootnoteText, uno::UNO_QUERY_THROW ),
++ pTopContext->GetPropertyValues( ) );
++ m_aTextAppendStack.push(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ));
+
+ // Redlines for the footnote anchor
+ CheckRedline( xFootnote->getAnchor( ) );
- }
- catch( uno::Exception& )
- {
-@@ -1378,6 +1391,87 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
- }
- }
-
++ }
++ catch( uno::Exception& )
++ {
++ OSL_ENSURE( false, "exception in PushFootOrEndnote" );
++ }
++}
++
+void DomainMapper_Impl::CreateRedline( uno::Reference< text::XTextRange > xRange, RedlineParamsPtr& pRedline )
+{
+ if ( pRedline.get( ) )
@@ -3366,7 +3370,13 @@ index 051a2b8..8693754 100644
+ clog << "REDLINE: Writing redline: " << pRedline->m_nId << endl;
+#endif
+ try
-+ {
+ {
+- const FontEntry* pFontEntry = pFontTable->getFontEntry(sal_uInt32(pTopContext->GetFootnoteFontId()));
+- PropertyMapPtr aFontProps( new PropertyMap );
+- aFontProps->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( pFontEntry->sFontName ));
+- aFontProps->Insert(PROP_CHAR_FONT_CHAR_SET, true, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding ));
+- aFontProps->Insert(PROP_CHAR_FONT_PITCH, true, uno::makeAny( pFontEntry->nPitchRequest ));
+- aFontProperties = aFontProps->GetPropertyValues();
+ ::rtl::OUString sType;
+ PropertyNameSupplier & rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier( );
+ switch ( pRedline->m_nToken & 0xffff )
@@ -3390,25 +3400,32 @@ index 051a2b8..8693754 100644
+ pRedlineProperties[1].Value <<= lcl_DateStringToDateTime( pRedline->m_sDate );
+
+ xRedline->makeRedline( sType, aRedlineProperties );
-+ }
+ }
+- else if(pTopContext->GetFootnoteFontName().getLength())
+ catch( const uno::Exception & rEx )
-+ {
+ {
+- PropertyMapPtr aFontProps( new PropertyMap );
+- aFontProps->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( pTopContext->GetFootnoteFontName() ));
+- aFontProperties = aFontProps->GetPropertyValues();
+#if DEBUG
+ clog << "REDLINE: error - " << rtl::OUStringToOString( rEx.Message, RTL_TEXTENCODING_UTF8 ).getStr( ) << endl;
+#endif
+ ( void ) rEx;
+ OSL_ENSURE( false, "Exception in makeRedline" );
-+ }
+ }
+ }
+}
-+
+
+- appendTextContent( uno::Reference< text::XTextContent >( xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties );
+- m_aTextAppendStack.push(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ));
+void DomainMapper_Impl::CheckParaRedline( uno::Reference< text::XTextRange > xRange )
+{
+ if ( m_pParaRedline.get( ) )
+ {
+ CreateRedline( xRange, m_pParaRedline );
+ ResetParaRedline( );
-+ }
+ }
+- catch( uno::Exception& )
+}
+
+void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > xRange )
@@ -3416,7 +3433,8 @@ index 051a2b8..8693754 100644
+ vector<RedlineParamsPtr>::iterator pIt = m_aRedlines.begin( );
+ vector< RedlineParamsPtr > aCleaned;
+ for (; pIt != m_aRedlines.end( ); pIt++ )
-+ {
+ {
+- OSL_ENSURE( false, "exception in PushFootOrEndnote" );
+ CreateRedline( xRange, *pIt );
+
+ // Adding the non-mod redlines to the temporary vector
@@ -3424,7 +3442,7 @@ index 051a2b8..8693754 100644
+ {
+ aCleaned.push_back( *pIt );
+ }
-+ }
+ }
+
+ m_aRedlines.swap( aCleaned );
+}
@@ -3437,12 +3455,10 @@ index 051a2b8..8693754 100644
+void DomainMapper_Impl::EndParaChange( )
+{
+ m_bIsParaChange = false;
-+}
-+
- /*-- 22.12.2008 13:45:15---------------------------------------------------
+ }
- -----------------------------------------------------------------------*/
-@@ -1416,57 +1510,58 @@ void DomainMapper_Impl::PopAnnotation()
+ /*-- 22.12.2008 13:45:15---------------------------------------------------
+@@ -1416,57 +1495,58 @@ void DomainMapper_Impl::PopAnnotation()
m_xAnnotationField.clear();
}
@@ -3539,7 +3555,7 @@ index 051a2b8..8693754 100644
}
/*-- 12.09.2006 08:07:55---------------------------------------------------
-@@ -2952,6 +3047,7 @@ void DomainMapper_Impl::CloseFieldCommand()
+@@ -2952,6 +3032,7 @@ void DomainMapper_Impl::CloseFieldCommand()
bool bHyperlinks = false;
bool bFromOutline = false;
bool bFromEntries = false;
@@ -3547,7 +3563,7 @@ index 051a2b8..8693754 100644
::rtl::OUString sTemplate;
::rtl::OUString sChapterNoSeparator;
// \a Builds a table of figures but does not include the captions's label and number
-@@ -3001,6 +3097,10 @@ void DomainMapper_Impl::CloseFieldCommand()
+@@ -3001,6 +3082,10 @@ void DomainMapper_Impl::CloseFieldCommand()
if( lcl_FindInCommand( pContext->GetCommand(), 'o', sValue ))
{
bFromOutline = true;
@@ -3558,7 +3574,7 @@ index 051a2b8..8693754 100644
}
// \p Defines the separator between the table entry and its page number
if( lcl_FindInCommand( pContext->GetCommand(), 'p', sValue ))
-@@ -3048,6 +3148,7 @@ void DomainMapper_Impl::CloseFieldCommand()
+@@ -3048,6 +3133,7 @@ void DomainMapper_Impl::CloseFieldCommand()
xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(::rtl::OUString()));
if( !bTableOfFigures )
{
@@ -3566,7 +3582,7 @@ index 051a2b8..8693754 100644
xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_OUTLINE ), uno::makeAny( bFromOutline ));
xTOC->setPropertyValue( rPropNameSupplier.GetName( PROP_CREATE_FROM_MARKS ), uno::makeAny( bFromEntries ));
if( sTemplate.getLength() )
-@@ -3531,14 +3632,98 @@ bool DomainMapper_Impl::ExecuteFrameConversion()
+@@ -3531,14 +3617,98 @@ bool DomainMapper_Impl::ExecuteFrameConversion()
}
return bRet;
}
More information about the ooo-build-commit
mailing list