[Libreoffice-commits] .: 3 commits - oox/inc oox/source

Radek Doulík rodo at kemper.freedesktop.org
Tue Jan 18 11:00:58 PST 2011


 oox/inc/oox/drawingml/textparagraphproperties.hxx |    2 
 oox/source/drawingml/textparagraphproperties.cxx  |   29 ++++++----
 oox/source/helper/propertymap.cxx                 |   60 ++++++++++++++--------
 3 files changed, 58 insertions(+), 33 deletions(-)

New commits:
commit 64aace4a51a7e751432f1af20bdb1c19536a6adc
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Jan 18 20:00:08 2011 +0100

    set characters encoding for symbol fonts, n#656934

diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 6600104..c35a25f 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -307,6 +307,7 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, P
     OUString aBulletFontName;
     sal_Int16 nBulletFontPitch = 0;
     sal_Int16 nBulletFontFamily = 0;
+    sal_Bool bSymbolFont = sal_False;
     if( pFilterBase) {
         if (maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) )
         {
@@ -319,6 +320,18 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, P
             aFontDesc.Name = aBulletFontName;
             aFontDesc.Pitch = nBulletFontPitch;
             aFontDesc.Family = nBulletFontFamily;
+            if ( aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings 2" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings 3" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Monotype Sorts" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Monotype Sorts 2" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Webdings" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "StarBats" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "StarMath" ) ||
+                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "ZapfDingbats" ) ) {
+                aFontDesc.CharSet = RTL_TEXTENCODING_SYMBOL;
+                bSymbolFont = sal_True;
+            }
             rPropMap[ PROP_BulletFont ] <<= aFontDesc;
             rPropMap[ PROP_BulletFontName ] <<= aBulletFontName;
         }
@@ -328,16 +341,7 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, P
 
         msBulletChar >>= sBuChar;
 
-        if( pFilterBase && sBuChar.getLength() == 1 && maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase )
-            && ( aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings 2" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Wingdings 3" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Monotype Sorts" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Monotype Sorts 2" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "Webdings" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "StarBats" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "StarMath" ) ||
-                 aBulletFontName.equalsIgnoreAsciiCaseAscii( "ZapfDingbats" ) ) )
+        if( pFilterBase && sBuChar.getLength() == 1 && maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) && bSymbolFont )
         {
             sal_Unicode nBuChar = sBuChar.toChar();
             nBuChar &= 0x00ff;
commit 83281ee7380598e89a44142a4fff1b159d9ea6ab
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Jan 18 14:58:30 2011 +0100

    fix default bullet size, n#656934

diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 3a536cb..6600104 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -443,6 +443,9 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
         {
             if( !rioBulletMap.empty() )
             {
+                // fix default bullet size to be 100%
+                if( rioBulletMap.find( PROP_BulletRelSize ) == rioBulletMap.end() )
+                    rioBulletMap[ PROP_BulletRelSize ] <<= static_cast< sal_Int16 >( 100 );
                 Sequence< PropertyValue > aBulletPropSeq = rioBulletMap.makePropertyValueSequence();
                 xNumRule->replaceByIndex( getLevel(), makeAny( aBulletPropSeq ) );
             }
commit 7c2dbe65adf9336549e8dd3b62905da3cb38ea40
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Jan 18 14:56:43 2011 +0100

    extend debug dump so that it dumps numbering rules

diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index 8c09533..c0af7c9 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -115,7 +115,7 @@ public:
     float                               getCharHeightPoints( float fDefault ) const;
 
 #if OSL_DEBUG_LEVEL > 0
-    void dump();
+    void dump() const;
 #endif
 
 protected:
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 58ced11..3a536cb 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -464,7 +464,7 @@ float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
 
 #if OSL_DEBUG_LEVEL > 0
 
-void TextParagraphProperties::dump()
+void TextParagraphProperties::dump() const
 {
     Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
     Reference< ::com::sun::star::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.presentation.TitleTextShape" ) ), UNO_QUERY );
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 206ab27..5aea56b 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/container/XIndexReplace.hpp>
 #include "properties.hxx"
 #include "oox/token/propertylist.hxx"
 
@@ -50,6 +51,7 @@ using ::com::sun::star::beans::XPropertyChangeListener;
 using ::com::sun::star::beans::XPropertySet;
 using ::com::sun::star::beans::XPropertySetInfo;
 using ::com::sun::star::beans::XVetoableChangeListener;
+using ::com::sun::star::container::XIndexReplace;
 
 #if OSL_DEBUG_LEVEL > 0
 #include <cstdio>
@@ -248,20 +250,8 @@ Reference< XPropertySet > PropertyMap::makePropertySet() const
 }
 
 #if OSL_DEBUG_LEVEL > 0
-void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
+static void lclDumpAnyValue( Any value)
 {
-    Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
-    Sequence< beans::Property > props = info->getProperties ();
-
-    OSL_TRACE("dump props, len: %d", props.getLength ());
-
-    for (int i=0; i < props.getLength (); i++) {
-        OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
-        fprintf (stderr,"%30s = ", name.getStr() );
-
-    try {
-        Any value = rXPropSet->getPropertyValue( props [i].Name );
-
         OUString strValue;
         sal_Int32 intValue = 0;
         sal_uInt32 uintValue = 0;
@@ -274,6 +264,7 @@ void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
     WritingMode aWritingMode;
     TextVerticalAdjust aTextVertAdj;
     TextHorizontalAdjust aTextHorizAdj;
+    Reference< XIndexReplace > xNumRule;
 
         if( value >>= strValue )
             fprintf (stderr,"\"%s\"\n", USS( strValue ) );
@@ -289,11 +280,23 @@ void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
             fprintf (stderr,"%f\n", floatValue);
         else if( value >>= boolValue )
             fprintf (stderr,"%d            (bool)\n", boolValue);
-    else if( value >>= aWritingMode )
-        fprintf (stderr, "%d writing mode\n", aWritingMode);
-    else if( value >>= aTextVertAdj ) {
-        const char* s = "uknown";
-        switch( aTextVertAdj ) {
+        else if( value >>= xNumRule ) {
+            fprintf (stderr, "XIndexReplace\n");
+            for (int k=0; k<xNumRule->getCount(); k++) {
+                Sequence< PropertyValue > aBulletPropSeq;
+                fprintf (stderr, "level %d\n", k);
+                if (xNumRule->getByIndex (k) >>= aBulletPropSeq) {
+                    for (int j=0; j<aBulletPropSeq.getLength(); j++) {
+                        fprintf(stderr, "%46s = ", USS (aBulletPropSeq[j].Name));
+                        lclDumpAnyValue (aBulletPropSeq[j].Value);
+                    }
+                }
+            }
+        } else if( value >>= aWritingMode )
+            fprintf (stderr, "%d writing mode\n", aWritingMode);
+        else if( value >>= aTextVertAdj ) {
+            const char* s = "uknown";
+            switch( aTextVertAdj ) {
             case TextVerticalAdjust_TOP:
                 s = "top";
                 break;
@@ -340,9 +343,24 @@ void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
 //             fprintf (stderr,"%d            (RectanglePoint)\n", pointValue);
         else
       fprintf (stderr,"???           <unhandled type %s>\n", USS(value.getValueTypeName()));
-    } catch(Exception e) {
-        fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
-    }
+}
+
+void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
+{
+    Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
+    Sequence< beans::Property > props = info->getProperties ();
+
+    OSL_TRACE("dump props, len: %d", props.getLength ());
+
+    for (int i=0; i < props.getLength (); i++) {
+        OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
+        fprintf (stderr,"%30s = ", name.getStr() );
+
+        try {
+            lclDumpAnyValue (rXPropSet->getPropertyValue( props [i].Name ));
+        } catch(Exception e) {
+            fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list