[ooo-build-commit] .: Branch 'ooo-build-3-2' - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Feb 17 08:29:59 PST 2010


 patches/dev300/writerfilter-docx-numbering.diff |  300 ++++++++++++++++++++++--
 1 file changed, 281 insertions(+), 19 deletions(-)

New commits:
commit 68c87603b7ce03c41da4ea8a3abe1301f95f96cb
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Feb 17 17:27:14 2010 +0100

    Fixed n#180106 and improved numbering
    
    * patches/dev300/writerfilter-docx-numbering.diff:
        - Fixed n#180106 bug
        - The numbering type wasn't set to none
        - Improve the mapping of numbering types and add some examples in
          the UNO doc

diff --git a/patches/dev300/writerfilter-docx-numbering.diff b/patches/dev300/writerfilter-docx-numbering.diff
index e048395..fd0c325 100644
--- a/patches/dev300/writerfilter-docx-numbering.diff
+++ b/patches/dev300/writerfilter-docx-numbering.diff
@@ -1,8 +1,78 @@
+diff --git offapi/com/sun/star/style/NumberingType.idl offapi/com/sun/star/style/NumberingType.idl
+index e7c5935..0e7fe33 100644
+--- offapi/com/sun/star/style/NumberingType.idl
++++ offapi/com/sun/star/style/NumberingType.idl
+@@ -124,6 +124,7 @@ published constants NumberingType
+ 
+     //-------------------------------------------------------------------------
+     /** Numbering for Chinese lower case number
++        as "一,二,三..."
+      */
+     const short NUMBER_LOWER_ZH = 15;
+ 
+@@ -139,11 +140,13 @@ published constants NumberingType
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Chinese Tian Gan
++        as "甲,乙,丙..."
+      */
+     const short TIAN_GAN_ZH = 18;
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Chinese Di Zi
++        as "子,丑,寅..."
+      */
+     const short DI_ZI_ZH = 19;
+ 
+@@ -174,36 +177,43 @@ published constants NumberingType
+ 
+     //-------------------------------------------------------------------------
+     /** Numbering for Korean upper case number
++        as "壹,貳,參..."
+      */
+     const short NUMBER_UPPER_KO = 25;
+ 
+     //-------------------------------------------------------------------------
+     /** Numbering for Korean hangul number
++        as "일,이,삼..."
+      */
+     const short NUMBER_HANGUL_KO = 26;
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Korean Hangul Jamo
++        as "ㄱ,ㄴ,ㄷ..."
+      */
+     const short HANGUL_JAMO_KO = 27;
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Korean Hangul Syllable
++        as "가,나,다..."
+      */
+     const short HANGUL_SYLLABLE_KO = 28;
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Korean Hangul Circled Jamo
++        as "㉠,㉡,㉢..."
+      */
+     const short HANGUL_CIRCLED_JAMO_KO = 29;
+ 
+     //-------------------------------------------------------------------------
+     /** Bullet for Korean Hangul Circled Syllable
++        as "㉮,㉯,㉰..."
+      */
+     const short HANGUL_CIRCLED_SYLLABLE_KO = 30;
+ 
+     //-------------------------------------------------------------------------
+     /** Numbering in Arabic alphabet letters
++        as "أ,ب,ت..."
+ 
+         @since OOo 1.1.2
+      */
 diff --git writerfilter/inc/dmapper/DomainMapper.hxx writerfilter/inc/dmapper/DomainMapper.hxx
-index 3f2ad51..cbf314a 100644
+index 13f73d9..73ef5c8 100644
 --- writerfilter/inc/dmapper/DomainMapper.hxx
 +++ writerfilter/inc/dmapper/DomainMapper.hxx
-@@ -66,7 +66,8 @@ using namespace std;
+@@ -65,7 +65,8 @@ namespace dmapper
  
  class PropertyMap;
  class DomainMapper_Impl;
@@ -12,7 +82,7 @@ index 3f2ad51..cbf314a 100644
  
  // different context types require different sprm handling (e.g. names)
  enum SprmType
-@@ -137,7 +138,8 @@ public:
+@@ -136,7 +137,8 @@ public:
      ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetCurrentTextRange();
  
      ::rtl::OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties );
@@ -22,6 +92,179 @@ index 3f2ad51..cbf314a 100644
  
  private:
      void handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext);
+diff --git writerfilter/source/dmapper/ConversionHelper.cxx writerfilter/source/dmapper/ConversionHelper.cxx
+index 2a04148..1c58b97 100644
+--- writerfilter/source/dmapper/ConversionHelper.cxx
++++ writerfilter/source/dmapper/ConversionHelper.cxx
+@@ -557,26 +557,104 @@ sal_Int16 ConvertNumberingType(sal_Int32 nNFC)
+     switch(nNFC)
+     {
+         case NS_ooxml::LN_Value_ST_NumberFormat_decimal:
+-        case 0: nRet = style::NumberingType::ARABIC;                break;
++        case 0: 
++            nRet = style::NumberingType::ARABIC;                
++            break;
+         case NS_ooxml::LN_Value_ST_NumberFormat_upperRoman:
+-        case 1: nRet = style::NumberingType::ROMAN_UPPER;           break;
++        case 1: 
++            nRet = style::NumberingType::ROMAN_UPPER;           
++            break;
+         case NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman:
+-        case 2: nRet = style::NumberingType::ROMAN_LOWER;           break;
+-        case 3: nRet = style::NumberingType::CHARS_UPPER_LETTER_N;  break;
+-        case 4: nRet = style::NumberingType::CHARS_LOWER_LETTER_N;  break;
+-        case 5: nRet = style::NumberingType::ARABIC;                break;//ORDINAL
++        case 2: 
++            nRet = style::NumberingType::ROMAN_LOWER;
++            break;
++        case 3: 
++            nRet = style::NumberingType::CHARS_UPPER_LETTER_N; 
++            break;
++        case 4:
++            nRet = style::NumberingType::CHARS_LOWER_LETTER_N;
++            break;
++        case 5: 
++            nRet = style::NumberingType::ARABIC;
++            break;//ORDINAL
+         case NS_ooxml::LN_Value_ST_NumberFormat_bullet:
+         case 23:
+         case 25:
+             nRet = style::NumberingType::CHAR_SPECIAL;
+         break;
+-        case 255: nRet = style::NumberingType::NUMBER_NONE; break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_none:
++        case 255: 
++            nRet = style::NumberingType::NUMBER_NONE;
++            break;
+         case NS_ooxml::LN_Value_ST_NumberFormat_upperLetter:
+             nRet = style::NumberingType::CHARS_UPPER_LETTER;
+-        break;
++            break;
+         case  NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter:
+             nRet = style::NumberingType::CHARS_LOWER_LETTER;
+-        break;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_iroha:
++            nRet = style::NumberingType::IROHA_HALFWIDTH_JA;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_irohaFullWidth:
++            nRet = style::NumberingType::IROHA_FULLWIDTH_JA;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_aiueo:
++            nRet = style::NumberingType::AIU_HALFWIDTH_JA;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_aiueoFullWidth:
++            nRet = style::NumberingType::AIU_FULLWIDTH_JA;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_hebrew2:
++            nRet = style::NumberingType::CHARS_HEBREW;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_thaiLetters:
++            nRet = style::NumberingType::CHARS_THAI;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_russianLower:
++            nRet = style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_RU;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_russianUpper:
++            nRet = style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_RU;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircleChinese:
++        case NS_ooxml::LN_Value_ST_NumberFormat_ideographEnclosedCircle:
++            nRet = style::NumberingType::CIRCLE_NUMBER;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_ideographTraditional:
++            nRet = style::NumberingType::TIAN_GAN_ZH;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiac:
++            nRet = style::NumberingType::DI_ZI_ZH;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_ganada:
++            nRet = style::NumberingType::HANGUL_SYLLABLE_KO;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_chosung:
++            nRet = style::NumberingType::HANGUL_JAMO_KO;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital:
++        case NS_ooxml::LN_Value_ST_NumberFormat_koreanCounting:
++        case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital2:
++            nRet = style::NumberingType::NUMBER_HANGUL_KO;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_ideographLegalTraditional:
++            nRet = style::NumberingType::NUMBER_UPPER_ZH_TW;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_arabicAlpha:
++            nRet = style::NumberingType::CHARS_ARABIC;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_hindiVowels:
++            nRet = style::NumberingType::CHARS_NEPALI;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_japaneseLegal:
++            nRet = style::NumberingType::NUMBER_TRADITIONAL_JA;
++            break;
++        case NS_ooxml::LN_Value_ST_NumberFormat_chineseCounting:
++        case NS_ooxml::LN_Value_ST_NumberFormat_japaneseCounting:
++        case NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCounting:
++        case NS_ooxml::LN_Value_ST_NumberFormat_ideographDigital:
++            nRet = style::NumberingType::NUMBER_LOWER_ZH;
++            break;
+         default: nRet = style::NumberingType::ARABIC;
+     }
+ /*  TODO: Lots of additional values are available - some are supported in the I18 framework
+@@ -585,53 +663,27 @@ sal_Int16 ConvertNumberingType(sal_Int32 nNFC)
+     NS_ooxml::LN_Value_ST_NumberFormat_ordinalText = 91684;
+     NS_ooxml::LN_Value_ST_NumberFormat_hex = 91685;
+     NS_ooxml::LN_Value_ST_NumberFormat_chicago = 91686;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ideographDigital = 91687;
+-    NS_ooxml::LN_Value_ST_NumberFormat_japaneseCounting = 91688;
+-    NS_ooxml::LN_Value_ST_NumberFormat_aiueo = 91689;
+-    NS_ooxml::LN_Value_ST_NumberFormat_iroha = 91690;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalFullWidth = 91691;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalHalfWidth = 91692;
+-    NS_ooxml::LN_Value_ST_NumberFormat_japaneseLegal = 91693;
+     NS_ooxml::LN_Value_ST_NumberFormat_japaneseDigitalTenThousand = 91694;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircle = 91695;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalFullWidth2 = 91696;
+-    NS_ooxml::LN_Value_ST_NumberFormat_aiueoFullWidth = 91697;
+-    NS_ooxml::LN_Value_ST_NumberFormat_irohaFullWidth = 91698;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalZero = 91699;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ganada = 91701;
+-    NS_ooxml::LN_Value_ST_NumberFormat_chosung = 91702;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedFullstop = 91703;
+     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedParen = 91704;
+-    NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircleChinese = 91705;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ideographEnclosedCircle = 91706;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ideographTraditional = 91707;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiac = 91708;
+     NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiacTraditional = 91709;
+-    NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCounting = 91710;
+-    NS_ooxml::LN_Value_ST_NumberFormat_ideographLegalTraditional = 91711;
+     NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCountingThousand = 91712;
+     NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseDigital = 91713;
+-    NS_ooxml::LN_Value_ST_NumberFormat_chineseCounting = 91714;
+     NS_ooxml::LN_Value_ST_NumberFormat_chineseLegalSimplified = 91715;
+     NS_ooxml::LN_Value_ST_NumberFormat_chineseCountingThousand = 91716;
+-    NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital = 91717;
+-    NS_ooxml::LN_Value_ST_NumberFormat_koreanCounting = 91718;
+     NS_ooxml::LN_Value_ST_NumberFormat_koreanLegal = 91719;
+-    NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital2 = 91720;
+     NS_ooxml::LN_Value_ST_NumberFormat_vietnameseCounting = 91721;
+-    NS_ooxml::LN_Value_ST_NumberFormat_russianLower = 91722;
+-    NS_ooxml::LN_Value_ST_NumberFormat_russianUpper = 91723;
+-    NS_ooxml::LN_Value_ST_NumberFormat_none = 91724;
+     NS_ooxml::LN_Value_ST_NumberFormat_numberInDash = 91725;
++    NS_ooxml::LN_Value_ST_NumberFormat_arabicAbjad:
+     NS_ooxml::LN_Value_ST_NumberFormat_hebrew1 = 91726;
+-    NS_ooxml::LN_Value_ST_NumberFormat_hebrew2 = 91727;
+-    NS_ooxml::LN_Value_ST_NumberFormat_arabicAlpha = 91728;
+-    NS_ooxml::LN_Value_ST_NumberFormat_arabicAbjad = 91729;
+-    NS_ooxml::LN_Value_ST_NumberFormat_hindiVowels = 91730;
+     NS_ooxml::LN_Value_ST_NumberFormat_hindiConsonants = 91731;
+     NS_ooxml::LN_Value_ST_NumberFormat_hindiNumbers = 91732;
+     NS_ooxml::LN_Value_ST_NumberFormat_hindiCounting = 91733;
+-    NS_ooxml::LN_Value_ST_NumberFormat_thaiLetters = 91734;
+     NS_ooxml::LN_Value_ST_NumberFormat_thaiNumbers = 91735;
+     NS_ooxml::LN_Value_ST_NumberFormat_thaiCounting = 91736;*/
+     return nRet;
 diff --git writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/DomainMapper.cxx
 index 4115846..dadd45e 100644
 --- writerfilter/source/dmapper/DomainMapper.cxx
@@ -173,18 +416,18 @@ index 4115846..dadd45e 100644
  } //namespace dmapper
  } //namespace writerfilter
 diff --git writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx
-index f460109..586b002 100644
+index ed199f2..4a2394e 100644
 --- writerfilter/source/dmapper/DomainMapper_Impl.cxx
 +++ writerfilter/source/dmapper/DomainMapper_Impl.cxx
-@@ -82,6 +82,7 @@
- 
+@@ -83,6 +83,7 @@
  #if DEBUG
+ #include <stdio.h>
  #include <com/sun/star/lang/XServiceInfo.hpp>
 +#include <com/sun/star/style/TabStop.hpp>
  #endif
  
  #include <map>
-@@ -704,7 +705,7 @@ void DomainMapper_Impl::IncorporateTabStop( const DeletableTabStop &  rTabStop )
+@@ -705,7 +706,7 @@ void DomainMapper_Impl::IncorporateTabStop( const DeletableTabStop &  rTabStop )
    -----------------------------------------------------------------------*/
  uno::Sequence< style::TabStop > DomainMapper_Impl::GetCurrentTabStopAndClear()
  {
@@ -193,7 +436,7 @@ index f460109..586b002 100644
      style::TabStop* pArray = aRet.getArray();
      ::std::vector<DeletableTabStop>::const_iterator aIt = m_aCurrentTabStops.begin();
      ::std::vector<DeletableTabStop>::const_iterator aEndIt = m_aCurrentTabStops.end();
-@@ -757,11 +758,11 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
+@@ -758,11 +759,11 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
  /*-------------------------------------------------------------------------
  
    -----------------------------------------------------------------------*/
@@ -207,7 +450,7 @@ index f460109..586b002 100644
      return m_pListTable;
  }
  
-@@ -1092,6 +1093,18 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
+@@ -1093,6 +1094,18 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
                      aProperties[nLength].Value <<= aDrop;
                      aProperties[nLength].Name = rPropNameSupplier.GetName(PROP_DROP_CAP_FORMAT);
                  }
@@ -2363,10 +2606,10 @@ index 65cc216..0000000
 -#endif //
 diff --git writerfilter/source/dmapper/NumberingManager.cxx writerfilter/source/dmapper/NumberingManager.cxx
 new file mode 100644
-index 0000000..65788d0
+index 0000000..73c25bd
 --- /dev/null
 +++ writerfilter/source/dmapper/NumberingManager.cxx
-@@ -0,0 +1,1001 @@
+@@ -0,0 +1,1018 @@
 +#include "ConversionHelper.hxx"
 +#include "NumberingManager.hxx"
 +#include "StyleSheetTable.hxx"
@@ -2519,7 +2762,7 @@ index 0000000..65788d0
 +    } 
 +    sal_Int32 nMinLevel = nLevel;
 +    //now the text should either be empty or start with %
-+    nFound = 0;
++    nFound = sLevelText.getLength( ) > 1 ? 0 : -1;
 +    while( nFound >= 0 )
 +    {
 +        if( sLevelText.getLength() > 1 )
@@ -2898,6 +3141,8 @@ index 0000000..65788d0
 +                // Get the merged level properties
 +                uno::Sequence< beans::PropertyValue > aLvlProps = aProps[sal_Int32( nLevel )];
 +
++                lcl_printProperties( aLvlProps );
++
 +                // Get the char style
 +                uno::Sequence< beans::PropertyValue > aAbsCharStyleProps = pAbsLevel->GetCharStyleProperties( );
 +                uno::Sequence< beans::PropertyValue >& rAbsCharStyleProps = aAbsCharStyleProps;
@@ -3187,8 +3432,8 @@ index 0000000..65788d0
 +                if ( pListDef != NULL )
 +                {
 +                    // The current def should be a ListDef
-+                    pListDef->SetAbstractDefinition( 
-+                        m_aAbstractLists[ nAbstractNumId ] ); 
++                    pListDef->SetAbstractDefinition(
++                           GetAbstractList( nAbstractNumId ) ); 
 +                }
 +            }
 +            break;
@@ -3340,6 +3585,21 @@ index 0000000..65788d0
 +    }
 +}
 +
++AbstractListDef::Pointer ListsManager::GetAbstractList( sal_Int32 nId )
++{
++    AbstractListDef::Pointer pAbstractList;
++
++    int nLen = m_aAbstractLists.size( );
++    int i = 0;
++    while ( !pAbstractList.get( ) && i < nLen )
++    {
++        if ( m_aAbstractLists[i]->GetId( ) == nId )
++            pAbstractList = m_aAbstractLists[i];
++        i++;
++    }
++
++    return pAbstractList;
++}
 +
 +ListDef::Pointer ListsManager::GetList( sal_Int32 nId )
 +{
@@ -3370,10 +3630,10 @@ index 0000000..65788d0
 +} }
 diff --git writerfilter/source/dmapper/NumberingManager.hxx writerfilter/source/dmapper/NumberingManager.hxx
 new file mode 100644
-index 0000000..0f93c27
+index 0000000..a94aa75
 --- /dev/null
 +++ writerfilter/source/dmapper/NumberingManager.hxx
-@@ -0,0 +1,224 @@
+@@ -0,0 +1,226 @@
 +#ifndef INCLUDED_NUMBERINGMANAGER_HXX
 +#define INCLUDED_NUMBERINGMANAGER_HXX
 +
@@ -3564,6 +3824,8 @@ index 0000000..0f93c27
 +    AbstractListDef::Pointer                            m_pCurrentDefinition;
 +    bool                                                m_bIsLFOImport;
 +
++    AbstractListDef::Pointer    GetAbstractList( sal_Int32 nId );
++
 +public:
 +
 +    ListsManager(
@@ -3624,7 +3886,7 @@ index b46e502..f0c52ba 100644
  struct PropertyNameSupplier_Impl;
  class PropertyNameSupplier
 diff --git writerfilter/source/dmapper/StyleSheetTable.cxx writerfilter/source/dmapper/StyleSheetTable.cxx
-index 2d200c4..69a551b 100644
+index f716ccc..8e40914 100644
 --- writerfilter/source/dmapper/StyleSheetTable.cxx
 +++ writerfilter/source/dmapper/StyleSheetTable.cxx
 @@ -29,7 +29,7 @@
@@ -3636,7 +3898,7 @@ index 2d200c4..69a551b 100644
  #include <ConversionHelper.hxx>
  #include <TblStylePrHandler.hxx>
  #include <BorderHandler.hxx>
-@@ -1235,44 +1235,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
+@@ -1236,44 +1236,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
                              }
                          }
  
@@ -3738,7 +4000,7 @@ index 87e08e5..3bdca2d 100644
  
      WW8DocumentIterator::Pointer_t pIt = begin();
 diff --git writerfilter/source/ooxml/OOXMLDocumentImpl.cxx writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
-index df80785..4ae36eb 100644
+index 6dfe9c4..97ba13c 100644
 --- writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
 +++ writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
 @@ -326,9 +326,9 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)


More information about the ooo-build-commit mailing list