[ooo-build-commit] .: 2 commits - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Jun 15 03:13:56 PDT 2010


 patches/dev300/apply                       |    4 
 patches/dev300/iso-ooxml-sw.diff           |  287 +++++++++++++++++++++++++++++
 patches/dev300/sw-ww8-ruby-export-fix.diff |   50 +++++
 3 files changed, 340 insertions(+), 1 deletion(-)

New commits:
commit 0b5a7478bdd7fd1be304e9cb2b395ac7f42f9c61
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Jun 15 12:12:34 2010 +0200

    Fixing i#79246
    
    * patches/dev300/apply:
    * patches/dev300/sw-ww8-ruby-export-fix.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 6a020c4..58a18b2 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3239,7 +3239,7 @@ SectionOwner => jholesov
 # Improved document comparison
 writer-doc-comparison.diff, tzvetelina
 # Help files for the document comparison
-writer-doc-comparison-help.diff, tzvetelina
+#writer-doc-comparison-help.diff, tzvetelina
 
 
 [ ExtensionFixes ]
@@ -3315,6 +3315,7 @@ sw-changes-format-fix.diff, Fong, n#545815
 # short/ushort mixup
 sw-doc-image-export-size.diff, bnc#554549, i#59648, tml
 ww8-image-position.diff
+sw-ww8-ruby-export-fix.diff, i#79246, cbosdo
 
 # add missing patch to upstreamed ppt gradient fix
 ppt-customshape-shading-fix.diff, i#102797, thorsten
@@ -3360,6 +3361,7 @@ gnome-screen-saver.diff, i#106372, cmc
 [ OOXMLExport ]
 oox-pptx-export-update-to-ooo320.diff, rodo
 docx-fixes02.diff, n#581604, cbosdo
+iso-ooxml-sw.diff, cbosdo
 
 [ OOXMLExport321 and not OOXMLExportDevel ]
 # FIXME dev300-m77 oox-chart-export-part1.diff, Fong
diff --git a/patches/dev300/sw-ww8-ruby-export-fix.diff b/patches/dev300/sw-ww8-ruby-export-fix.diff
new file mode 100644
index 0000000..bb3f641
--- /dev/null
+++ b/patches/dev300/sw-ww8-ruby-export-fix.diff
@@ -0,0 +1,50 @@
+diff --git sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtw8nds.cxx
+index f207dd8..57e4920 100644
+--- sw/source/filter/ww8/wrtw8nds.cxx
++++ sw/source/filter/ww8/wrtw8nds.cxx
+@@ -36,6 +36,7 @@
+ #include <functional>
+ #include <iostream>
+ #include <hintids.hxx>
++#include <comphelper/processfactory.hxx>
+ #include <tools/urlobj.hxx>
+ #include <editeng/boxitem.hxx>
+ #include <editeng/cmapitem.hxx>
+@@ -50,8 +51,10 @@
+ #include <editeng/brkitem.hxx>
+ #include <editeng/frmdiritem.hxx>
+ #include <editeng/tstpitem.hxx>
++#include <editeng/unolingu.hxx>
+ #include "svl/urihelper.hxx"
+ #include <svl/whiter.hxx>
++#include <unotools/localedatawrapper.hxx>
+ #include <fmtpdsc.hxx>
+ #include <fmtfsize.hxx>
+ #include <fmtornt.hxx>
+@@ -109,6 +112,7 @@
+ 
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::i18n;
++using namespace ::com::sun::star::lang;
+ using namespace sw::util;
+ using namespace sw::types;
+ using namespace sw::mark;
+@@ -739,7 +743,17 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/,
+     aStr += String::CreateFromInt32(nHeight);
+     aStr += '(';
+     aStr += rRuby.GetText();
+-    aStr.APPEND_CONST_ASC( ");" );
++    aStr.APPEND_CONST_ASC( ")" );
++
++    // The parameter separator depends on the FIB.lid
++    Locale aTempLocale;
++    SvxLanguageToLocale( aTempLocale, m_rWW8Export.pFib->lid );
++    LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
++    if ( aLocaleWrapper.getNumDecimalSep().EqualsAscii( "." ) )
++        aStr.APPEND_CONST_ASC( "," );
++    else
++        aStr.APPEND_CONST_ASC( ";" );
++
+     m_rWW8Export.OutputField( 0, ww::eEQ, aStr,
+             WRITEFIELD_START | WRITEFIELD_CMD_START );
+ }
commit e815fc5e1bc0733a120cc916e06019d0c6713b6d
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Jun 15 12:11:59 2010 +0200

    patch fixing some differences between ECMA and ISO specs of OOXML
    
    * patches/dev300/iso-ooxml-sw.diff:

diff --git a/patches/dev300/iso-ooxml-sw.diff b/patches/dev300/iso-ooxml-sw.diff
new file mode 100644
index 0000000..3d4f437
--- /dev/null
+++ b/patches/dev300/iso-ooxml-sw.diff
@@ -0,0 +1,287 @@
+Changes for ISO OOXML in Sw
+
+From: Cédric Bosdonnat <cedricbosdo at openoffice.org>
+
+
+---
+
+ sw/source/filter/ww8/docxattributeoutput.cxx |   69 +++++++++++++++-----------
+ sw/source/filter/ww8/docxexport.hxx          |    3 +
+ sw/source/filter/ww8/wrtww8.hxx              |    1 
+ 3 files changed, 45 insertions(+), 28 deletions(-)
+
+
+diff --git sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/docxattributeoutput.cxx
+index 1ec35d4..9f87dc7 100644
+--- sw/source/filter/ww8/docxattributeoutput.cxx
++++ sw/source/filter/ww8/docxattributeoutput.cxx
+@@ -27,6 +27,7 @@
+ 
+ #include "docxattributeoutput.hxx"
+ #include "docxexport.hxx"
++#include "docxexportfilter.hxx"
+ #include "docxfootnotes.hxx"
+ #include "writerwordglue.hxx"
+ #include "wrtww8.hxx"
+@@ -1189,16 +1190,19 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
+     pSerializer->singleElementNS( XML_w, elementToken, xAttrs );
+ }
+ 
+-static void impl_pageBorders( FSHelperPtr pSerializer, const SvxBoxItem& rBox )
++static void impl_pageBorders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, bool bUseStartEnd = false )
+ {
+     static const USHORT aBorders[] =
+     {
+         BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
+     };
+ 
+-    static const USHORT aXmlElements[] = 
++    const USHORT aXmlElements[] = 
+     {
+-        XML_top, XML_left, XML_bottom, XML_right
++        XML_top,
++        bUseStartEnd ? XML_start : XML_left,
++        XML_bottom,
++        bUseStartEnd ? XML_end : XML_right
+     };
+     const USHORT* pBrd = aBorders;
+     for( int i = 0; i < 4; ++i, ++pBrd )
+@@ -1214,11 +1218,14 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
+     m_pSerializer->startElementNS( XML_w, XML_tcPr, FSEND );
+ 
+     const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
++    
++    DocxExport& rExport = dynamic_cast< DocxExport& >( GetExport() );
++    bool bEcma = rExport.GetFilter().getVersion( ) == oox::core::ECMA_DIALECT;
+ 
+     // The cell borders
+     m_pSerializer->startElementNS( XML_w, XML_tcBorders, FSEND );
+     SwFrmFmt *pFmt = pTblBox->GetFrmFmt( );
+-    impl_pageBorders( m_pSerializer, pFmt->GetBox( ) );
++    impl_pageBorders( m_pSerializer, pFmt->GetBox( ), !bEcma );
+     m_pSerializer->endElementNS( XML_w, XML_tcBorders );
+ 
+     // Vertical merges
+@@ -1264,9 +1271,12 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
+         BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
+     };
+ 
+-    static const USHORT aXmlElements[] = 
++    const USHORT aXmlElements[] = 
+     {
+-        XML_top, XML_left, XML_bottom, XML_right
++        XML_top, 
++        bEcma ? XML_left : XML_start, 
++        XML_bottom, 
++        bEcma ? XML_right : XML_end
+     };
+     const USHORT* pBrd = aBorders;
+     for( int i = 0; i < 4; ++i, ++pBrd )
+@@ -1457,9 +1467,12 @@ void DocxAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Point
+     const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
+     const SwFrmFmt * pFrmFmt = pTabBox->GetFrmFmt();
+ 
++    DocxExport& rExport = dynamic_cast< DocxExport& >( GetExport() );
++    bool bEcma = rExport.GetFilter().getVersion( ) == oox::core::ECMA_DIALECT;
++
+     // the defaults of the table are taken from the top-left cell
+     m_pSerializer->startElementNS( XML_w, XML_tblBorders, FSEND );
+-    impl_pageBorders( m_pSerializer, pFrmFmt->GetBox( ) );
++    impl_pageBorders( m_pSerializer, pFrmFmt->GetBox( ), !bEcma );
+     m_pSerializer->endElementNS( XML_w, XML_tblBorders );
+ }
+ 
+@@ -1515,7 +1528,7 @@ void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t p
+     const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
+ 
+     const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( );
+-    const char* pCantSplit = ( !rSplittable.GetValue( ) ) ? "on" : "off";
++    const char* pCantSplit = ( !rSplittable.GetValue( ) ) ? "true" : "false";
+ 
+     m_pSerializer->singleElementNS( XML_w, XML_cantSplit,
+            FSNS( XML_w, XML_val ), pCantSplit,
+@@ -1530,7 +1543,7 @@ void DocxAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTabl
+     if ( m_rExport.TrueFrameDirection( *pFrmFmt ) == FRMDIR_HORI_RIGHT_TOP )
+     {
+         m_pSerializer->singleElementNS( XML_w, XML_bidiVisual,
+-                FSNS( XML_w, XML_val ), "on",
++                FSNS( XML_w, XML_val ), "true",
+                 FSEND );
+     }
+ }
+@@ -1914,7 +1927,7 @@ void DocxAttributeOutput::PageBreakBefore( bool bBreak )
+         m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore, FSEND );
+     else
+         m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore,
+-                FSNS( XML_w, XML_val ), "off",
++                FSNS( XML_w, XML_val ), "false",
+                 FSEND );
+ }
+ 
+@@ -1990,7 +2003,7 @@ void DocxAttributeOutput::SectionFormProtection( bool bProtected )
+         m_pSerializer->singleElementNS( XML_w, XML_formProt, FSEND );
+     else
+         m_pSerializer->singleElementNS( XML_w, XML_formProt,
+-                FSNS( XML_w, XML_val ), "off", FSEND );
++                FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLineNumberInfo& /*rLnNumInfo*/ )
+@@ -2338,8 +2351,8 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
+             m_pSerializer->singleElementNS( XML_w, XML_caps, FSEND );
+             break;
+         default: // Something that ooxml does not support
+-            m_pSerializer->singleElementNS( XML_w, XML_smallCaps, FSNS( XML_w, XML_val ), "off", FSEND );
+-            m_pSerializer->singleElementNS( XML_w, XML_caps, FSNS( XML_w, XML_val ), "off", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_smallCaps, FSNS( XML_w, XML_val ), "false", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_caps, FSNS( XML_w, XML_val ), "false", FSEND );
+             break;
+     }
+ }
+@@ -2360,7 +2373,7 @@ void DocxAttributeOutput::CharContour( const SvxContourItem& rContour )
+     if ( rContour.GetValue() )
+         m_pSerializer->singleElementNS( XML_w, XML_outline, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_outline, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_outline, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
+@@ -2371,8 +2384,8 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
+             m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSEND );
+             break;
+         case STRIKEOUT_NONE:
+-            m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSNS( XML_w, XML_val ), "off", FSEND );
+-            m_pSerializer->singleElementNS( XML_w, XML_strike, FSNS( XML_w, XML_val ), "off", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSNS( XML_w, XML_val ), "false", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_strike, FSNS( XML_w, XML_val ), "false", FSEND );
+             break;
+         default:
+             m_pSerializer->singleElementNS( XML_w, XML_strike, FSEND );
+@@ -2481,7 +2494,7 @@ void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture )
+     if ( rPosture.GetPosture() != ITALIC_NONE )
+         m_pSerializer->singleElementNS( XML_w, XML_i, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
+@@ -2489,7 +2502,7 @@ void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
+     if ( rShadow.GetValue() )
+         m_pSerializer->singleElementNS( XML_w, XML_shadow, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_shadow, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_shadow, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
+@@ -2526,7 +2539,7 @@ void DocxAttributeOutput::CharWeight( const SvxWeightItem& rWeight )
+     if ( rWeight.GetWeight() == WEIGHT_BOLD )
+         m_pSerializer->singleElementNS( XML_w, XML_b, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& )
+@@ -2564,7 +2577,7 @@ void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture )
+     if ( rPosture.GetPosture() != ITALIC_NONE )
+         m_pSerializer->singleElementNS( XML_w, XML_i, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_i, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
+@@ -2572,7 +2585,7 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
+     if ( rWeight.GetWeight() == WEIGHT_BOLD )
+         m_pSerializer->singleElementNS( XML_w, XML_b, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
+@@ -2590,7 +2603,7 @@ void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
+     if ( rPosture.GetPosture() != ITALIC_NONE )
+         m_pSerializer->singleElementNS( XML_w, XML_iCs, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_iCs, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_iCs, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
+@@ -2598,7 +2611,7 @@ void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
+     if ( rWeight.GetWeight() == WEIGHT_BOLD )
+         m_pSerializer->singleElementNS( XML_w, XML_bCs, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_bCs, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_bCs, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
+@@ -2676,8 +2689,8 @@ void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
+             m_pSerializer->singleElementNS( XML_w, XML_imprint, FSEND );
+             break;
+         default:
+-            m_pSerializer->singleElementNS( XML_w, XML_emboss, FSNS( XML_w, XML_val ), "off", FSEND );
+-            m_pSerializer->singleElementNS( XML_w, XML_imprint, FSNS( XML_w, XML_val ), "off", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_emboss, FSNS( XML_w, XML_val ), "false", FSEND );
++            m_pSerializer->singleElementNS( XML_w, XML_imprint, FSNS( XML_w, XML_val ), "false", FSEND );
+             break;
+     }
+ }
+@@ -2687,7 +2700,7 @@ void DocxAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden )
+     if ( rHidden.GetValue() )
+         m_pSerializer->singleElementNS( XML_w, XML_vanish, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_vanish, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_vanish, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ void DocxAttributeOutput::TextINetFormat( const SwFmtINetFmt& rLink )
+@@ -2971,7 +2984,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
+ void DocxAttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit )
+ {
+     if (rSplit.GetValue())
+-        m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSNS( XML_w, XML_val ), "false", FSEND );
+     else
+         m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSEND );
+ }
+@@ -2981,7 +2994,7 @@ void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
+     if (rWidows.GetValue())
+         m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSEND );
+     else
+-        m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSNS( XML_w, XML_val ), "off", FSEND );
++        m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSNS( XML_w, XML_val ), "false", FSEND );
+ }
+ 
+ static void impl_WriteTabElement( FSHelperPtr pSerializer,
+diff --git sw/source/filter/ww8/docxexport.hxx sw/source/filter/ww8/docxexport.hxx
+index 5873f95..8c6d3c6 100644
+--- sw/source/filter/ww8/docxexport.hxx
++++ sw/source/filter/ww8/docxexport.hxx
+@@ -85,6 +85,9 @@ class DocxExport : public MSWordExportBase
+     oox::vml::VMLExport *m_pVMLExport;
+ 
+ public:
++
++    DocxExportFilter& GetFilter() { return *m_pFilter; };
++
+     /// Access to the attribute output class.
+     virtual AttributeOutputBase& AttrOutput() const;
+ 
+diff --git sw/source/filter/ww8/wrtww8.hxx sw/source/filter/ww8/wrtww8.hxx
+index a8d536c..4f96b6e 100644
+--- sw/source/filter/ww8/wrtww8.hxx
++++ sw/source/filter/ww8/wrtww8.hxx
+@@ -759,6 +759,7 @@ protected:
+     virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt) = 0;
+ 
+ protected:
++
+     /// Output SwEndNode
+     virtual void OutputEndNode( const SwEndNode& );
+ 


More information about the ooo-build-commit mailing list