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

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Jun 30 08:24:48 PDT 2010


 patches/dev300/iso-ooxml-sw.diff |  131 ++++++++++++++++++++++++++++++---------
 1 file changed, 103 insertions(+), 28 deletions(-)

New commits:
commit cb22c1638092691fa65687627b90bcdebe204143
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Jun 30 17:23:28 2010 +0200

    Docx fixes to export end/start instead of left/right
    
    * patches/dev300/iso-ooxml-sw.diff:

diff --git a/patches/dev300/iso-ooxml-sw.diff b/patches/dev300/iso-ooxml-sw.diff
index 716d4b7..3561904 100644
--- a/patches/dev300/iso-ooxml-sw.diff
+++ b/patches/dev300/iso-ooxml-sw.diff
@@ -1,10 +1,17 @@
+Changes to make Docx export fit ISO specs
+
+From: Cédric Bosdonnat <cedricbosdo at openoffice.org>
+
+
 ---
- sw/source/filter/ww8/docxattributeoutput.cxx |   69 +++++++++++++++----------
+
+ sw/source/filter/ww8/docxattributeoutput.cxx |  109 ++++++++++++++++++--------
  sw/source/filter/ww8/docxexport.hxx          |    3 +
- 2 files changed, 44 insertions(+), 28 deletions(-)
+ 2 files changed, 80 insertions(+), 32 deletions(-)
+
 
 diff --git sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/docxattributeoutput.cxx
-index 430c1e4..9615d4f 100644
+index 13e735f..55612c1 100644
 --- sw/source/filter/ww8/docxattributeoutput.cxx
 +++ sw/source/filter/ww8/docxattributeoutput.cxx
 @@ -27,6 +27,7 @@
@@ -15,7 +22,7 @@ index 430c1e4..9615d4f 100644
  #include "docxfootnotes.hxx"
  #include "writerwordglue.hxx"
  #include "wrtww8.hxx"
-@@ -1166,16 +1167,19 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
+@@ -1173,16 +1174,19 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co
      pSerializer->singleElementNS( XML_w, elementToken, xAttrs );
  }
  
@@ -38,7 +45,7 @@ index 430c1e4..9615d4f 100644
      };
      const USHORT* pBrd = aBorders;
      for( int i = 0; i < 4; ++i, ++pBrd )
-@@ -1191,11 +1195,14 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
+@@ -1198,11 +1202,14 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
      m_pSerializer->startElementNS( XML_w, XML_tcPr, FSEND );
  
      const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
@@ -54,7 +61,7 @@ index 430c1e4..9615d4f 100644
      m_pSerializer->endElementNS( XML_w, XML_tcBorders );
  
      // Vertical merges
-@@ -1241,9 +1248,12 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
+@@ -1248,9 +1255,12 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
          BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
      };
  
@@ -69,7 +76,39 @@ index 430c1e4..9615d4f 100644
      };
      const USHORT* pBrd = aBorders;
      for( int i = 0; i < 4; ++i, ++pBrd )
-@@ -1434,9 +1444,12 @@ void DocxAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Point
+@@ -1368,6 +1378,9 @@ void DocxAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*
+ 
+ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+ {
++    DocxExport& rExport = dynamic_cast< DocxExport& >( GetExport() );
++    bool bEcma = rExport.GetFilter().getVersion( ) == oox::core::ECMA_DIALECT;
++
+     // Write the table properties
+     m_pSerializer->startElementNS( XML_w, XML_tblPr, FSEND );
+ 
+@@ -1399,13 +1412,19 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
+             pJcVal = "center";
+             break;
+         case text::HoriOrientation::RIGHT:
+-            pJcVal = "right";
++            if ( bEcma )
++                pJcVal = "right";
++            else
++                pJcVal = "end";
+             break;
+         default:
+         case text::HoriOrientation::NONE:
+         case text::HoriOrientation::LEFT_AND_WIDTH:
+         {
+-            pJcVal = "left";
++            if ( bEcma )
++                pJcVal = "left";
++            else
++                pJcVal = "start";
+             nIndent = sal_Int32( pTblFmt->GetLRSpace( ).GetLeft( ) );
+             break;
+         }
+@@ -1441,9 +1460,12 @@ void DocxAttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Point
      const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
      const SwFrmFmt * pFrmFmt = pTabBox->GetFrmFmt();
  
@@ -83,7 +122,7 @@ index 430c1e4..9615d4f 100644
      m_pSerializer->endElementNS( XML_w, XML_tblBorders );
  }
  
-@@ -1492,7 +1505,7 @@ void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t p
+@@ -1499,7 +1521,7 @@ void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t p
      const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
  
      const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( );
@@ -92,7 +131,7 @@ index 430c1e4..9615d4f 100644
  
      m_pSerializer->singleElementNS( XML_w, XML_cantSplit,
             FSNS( XML_w, XML_val ), pCantSplit,
-@@ -1507,7 +1520,7 @@ void DocxAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTabl
+@@ -1514,7 +1536,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,
@@ -101,7 +140,7 @@ index 430c1e4..9615d4f 100644
                  FSEND );
      }
  }
-@@ -1892,7 +1905,7 @@ void DocxAttributeOutput::PageBreakBefore( bool bBreak )
+@@ -1899,7 +1921,7 @@ void DocxAttributeOutput::PageBreakBefore( bool bBreak )
          m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore, FSEND );
      else
          m_pSerializer->singleElementNS( XML_w, XML_pageBreakBefore,
@@ -110,7 +149,7 @@ index 430c1e4..9615d4f 100644
                  FSEND );
  }
  
-@@ -1968,7 +1981,7 @@ void DocxAttributeOutput::SectionFormProtection( bool bProtected )
+@@ -1975,7 +1997,7 @@ void DocxAttributeOutput::SectionFormProtection( bool bProtected )
          m_pSerializer->singleElementNS( XML_w, XML_formProt, FSEND );
      else
          m_pSerializer->singleElementNS( XML_w, XML_formProt,
@@ -119,7 +158,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLineNumberInfo& /*rLnNumInfo*/ )
-@@ -2316,8 +2329,8 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
+@@ -2323,8 +2345,8 @@ void DocxAttributeOutput::CharCaseMap( const SvxCaseMapItem& rCaseMap )
              m_pSerializer->singleElementNS( XML_w, XML_caps, FSEND );
              break;
          default: // Something that ooxml does not support
@@ -130,7 +169,7 @@ index 430c1e4..9615d4f 100644
              break;
      }
  }
-@@ -2338,7 +2351,7 @@ void DocxAttributeOutput::CharContour( const SvxContourItem& rContour )
+@@ -2345,7 +2367,7 @@ void DocxAttributeOutput::CharContour( const SvxContourItem& rContour )
      if ( rContour.GetValue() )
          m_pSerializer->singleElementNS( XML_w, XML_outline, FSEND );
      else
@@ -139,7 +178,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
-@@ -2349,8 +2362,8 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
+@@ -2356,8 +2378,8 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
              m_pSerializer->singleElementNS( XML_w, XML_dstrike, FSEND );
              break;
          case STRIKEOUT_NONE:
@@ -150,7 +189,7 @@ index 430c1e4..9615d4f 100644
              break;
          default:
              m_pSerializer->singleElementNS( XML_w, XML_strike, FSEND );
-@@ -2467,7 +2480,7 @@ void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture )
+@@ -2466,7 +2488,7 @@ void DocxAttributeOutput::CharPosture( const SvxPostureItem& rPosture )
      if ( rPosture.GetPosture() != ITALIC_NONE )
          m_pSerializer->singleElementNS( XML_w, XML_i, FSEND );
      else
@@ -159,7 +198,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
-@@ -2475,7 +2488,7 @@ void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
+@@ -2474,7 +2496,7 @@ void DocxAttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
      if ( rShadow.GetValue() )
          m_pSerializer->singleElementNS( XML_w, XML_shadow, FSEND );
      else
@@ -168,7 +207,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
-@@ -2512,7 +2525,7 @@ void DocxAttributeOutput::CharWeight( const SvxWeightItem& rWeight )
+@@ -2511,7 +2533,7 @@ void DocxAttributeOutput::CharWeight( const SvxWeightItem& rWeight )
      if ( rWeight.GetWeight() == WEIGHT_BOLD )
          m_pSerializer->singleElementNS( XML_w, XML_b, FSEND );
      else
@@ -177,7 +216,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& )
-@@ -2550,7 +2563,7 @@ void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture )
+@@ -2549,7 +2571,7 @@ void DocxAttributeOutput::CharPostureCJK( const SvxPostureItem& rPosture )
      if ( rPosture.GetPosture() != ITALIC_NONE )
          m_pSerializer->singleElementNS( XML_w, XML_i, FSEND );
      else
@@ -186,7 +225,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
-@@ -2558,7 +2571,7 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
+@@ -2557,7 +2579,7 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
      if ( rWeight.GetWeight() == WEIGHT_BOLD )
          m_pSerializer->singleElementNS( XML_w, XML_b, FSEND );
      else
@@ -195,7 +234,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
-@@ -2576,7 +2589,7 @@ void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
+@@ -2575,7 +2597,7 @@ void DocxAttributeOutput::CharPostureCTL( const SvxPostureItem& rPosture)
      if ( rPosture.GetPosture() != ITALIC_NONE )
          m_pSerializer->singleElementNS( XML_w, XML_iCs, FSEND );
      else
@@ -204,7 +243,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
-@@ -2584,7 +2597,7 @@ void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
+@@ -2583,7 +2605,7 @@ void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
      if ( rWeight.GetWeight() == WEIGHT_BOLD )
          m_pSerializer->singleElementNS( XML_w, XML_bCs, FSEND );
      else
@@ -213,7 +252,7 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
-@@ -2662,8 +2675,8 @@ void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
+@@ -2661,8 +2683,8 @@ void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
              m_pSerializer->singleElementNS( XML_w, XML_imprint, FSEND );
              break;
          default:
@@ -224,7 +263,7 @@ index 430c1e4..9615d4f 100644
              break;
      }
  }
-@@ -2673,7 +2686,7 @@ void DocxAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden )
+@@ -2672,7 +2694,7 @@ void DocxAttributeOutput::CharHidden( const SvxCharHiddenItem& rHidden )
      if ( rHidden.GetValue() )
          m_pSerializer->singleElementNS( XML_w, XML_vanish, FSEND );
      else
@@ -233,7 +272,46 @@ index 430c1e4..9615d4f 100644
  }
  
  void DocxAttributeOutput::TextINetFormat( const SwFmtINetFmt& rLink )
-@@ -2963,7 +2976,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
+@@ -2932,13 +2954,36 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
+ {
+     const char *pAdjustString;
+ 
++    DocxExport& rExport = dynamic_cast< DocxExport& >( GetExport() );
++    bool bEcma = rExport.GetFilter().getVersion( ) == oox::core::ECMA_DIALECT;
++
++    const SfxItemSet* pItems = rExport.GetCurItemSet();
++    const SvxFrameDirectionItem* rFrameDir = static_cast< const SvxFrameDirectionItem* >( pItems->GetItem( RES_FRAMEDIR ) );
++
++    bool bRtl = false;
++    short nDir = rFrameDir->GetValue();
++    bRtl = ( nDir == FRMDIR_HORI_RIGHT_TOP );
++    
++    if ( nDir == FRMDIR_ENVIRONMENT )
++        nDir = GetExport( ).GetDefaultFrameDirection( );
++
+     switch ( rAdjust.GetAdjust() )
+     {
+         case SVX_ADJUST_LEFT:
+-            pAdjustString = "left";
++            if ( bEcma )
++                pAdjustString = "left";
++            else if ( bRtl )
++                pAdjustString = "end";
++            else
++                pAdjustString = "start";
+             break;
+         case SVX_ADJUST_RIGHT:
+-            pAdjustString = "right";
++            if ( bEcma )
++                pAdjustString = "right";
++            else if ( bRtl )
++                pAdjustString = "start";
++            else
++                pAdjustString = "end";
+             break;
+         case SVX_ADJUST_BLOCKLINE:
+         case SVX_ADJUST_BLOCK:
+@@ -2956,7 +3001,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
  void DocxAttributeOutput::ParaSplit( const SvxFmtSplitItem& rSplit )
  {
      if (rSplit.GetValue())
@@ -242,7 +320,7 @@ index 430c1e4..9615d4f 100644
      else
          m_pSerializer->singleElementNS( XML_w, XML_keepLines, FSEND );
  }
-@@ -2973,7 +2986,7 @@ void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
+@@ -2966,7 +3011,7 @@ void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
      if (rWidows.GetValue())
          m_pSerializer->singleElementNS( XML_w, XML_widowControl, FSEND );
      else
@@ -265,6 +343,3 @@ index 5873f95..8c6d3c6 100644
      /// Access to the attribute output class.
      virtual AttributeOutputBase& AttrOutput() const;
  
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list