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

Radek Doulík rodo at kemper.freedesktop.org
Wed Nov 10 12:25:32 PST 2010


 oox/inc/oox/drawingml/textcharacterproperties.hxx         |    6 -
 oox/inc/oox/drawingml/textliststyle.hxx                   |    2 
 oox/inc/oox/drawingml/textparagraphproperties.hxx         |    7 -
 oox/inc/oox/ppt/customshowlistcontext.hxx                 |   66 ++++++++++++
 oox/inc/oox/ppt/pptimport.hxx                             |    4 
 oox/inc/oox/ppt/presentationfragmenthandler.hxx           |    2 
 oox/inc/oox/ppt/slidepersist.hxx                          |    4 
 oox/source/drawingml/table/tablecell.cxx                  |   39 ++++---
 oox/source/drawingml/table/tablestyletextstylecontext.cxx |   24 ++--
 oox/source/drawingml/textcharacterproperties.cxx          |   26 ++--
 oox/source/drawingml/textfield.cxx                        |    2 
 oox/source/drawingml/textliststyle.cxx                    |    2 
 oox/source/drawingml/textparagraph.cxx                    |    4 
 oox/source/drawingml/textparagraphproperties.cxx          |   77 ++++++++++----
 oox/source/helper/propertymap.cxx                         |    3 
 oox/source/ppt/customshowlistcontext.cxx                  |    2 
 oox/source/ppt/customshowlistcontext.hxx                  |   66 ------------
 oox/source/ppt/pptimport.cxx                              |    7 +
 oox/source/ppt/slidepersist.cxx                           |    7 +
 19 files changed, 216 insertions(+), 134 deletions(-)

New commits:
commit 1024c37c05a0d9b771271b13a829332086fca888
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Nov 10 21:24:12 2010 +0100

    fix how the table cells style is applied in pptx import, n#650008

diff --git a/oox/inc/oox/drawingml/textcharacterproperties.hxx b/oox/inc/oox/drawingml/textcharacterproperties.hxx
index 08102e8..d9e6f7b 100644
--- a/oox/inc/oox/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/oox/drawingml/textcharacterproperties.hxx
@@ -73,12 +73,14 @@ struct TextCharacterProperties
     /** Writes the properties to the passed property map. */
     void                pushToPropMap(
                             PropertyMap& rPropMap,
-                            const ::oox::core::XmlFilterBase& rFilter ) const;
+                            const ::oox::core::XmlFilterBase& rFilter,
+                            bool bUseOptional = false ) const;
 
     /** Writes the properties to the passed property set. */
     void                pushToPropSet(
                             PropertySet& rPropSet,
-                            const ::oox::core::XmlFilterBase& rFilter ) const;
+                            const ::oox::core::XmlFilterBase& rFilter,
+                            bool bUseOptional = false ) const;
 };
 
 // ============================================================================
diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx
index 8efa6a8..92d84c9 100644
--- a/oox/inc/oox/drawingml/textliststyle.hxx
+++ b/oox/inc/oox/drawingml/textliststyle.hxx
@@ -52,7 +52,7 @@ public:
     inline TextParagraphPropertiesVector&       getAggregationListStyle() { return maAggregationListStyle; };
 
 #if OSL_DEBUG_LEVEL > 0
-    void dump( int nLevels=9 );
+    void dump( int nLevels=9 ) const;
 #endif
 
 protected:
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 5fc1c99..9cd346b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -99,7 +99,7 @@ void applyBorder( TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::dra
         rLineProperties.assignUsed( *aIter->second );
 }
 
-void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < ::com::sun::star::table::XCell >& rxCell, oox::drawingml::FillProperties& rFillProperties,
+void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < text::XTextRange >& rxStart, oox::drawingml::FillProperties& rFillProperties,
      oox::drawingml::LineProperties& rLeftBorder,
      oox::drawingml::LineProperties& rRightBorder,
      oox::drawingml::LineProperties& rTopBorder,
@@ -125,9 +125,13 @@ void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const R
     aTextCharProps.maComplexFont = rTableStylePart.getComplexFont();
     aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont();
     aTextCharProps.maCharColor = rTableStylePart.getTextColor();
+    if( rTableStylePart.getTextBoldStyle().is_initialized() )
+        aTextCharProps.moBold = rTableStylePart.getTextBoldStyle();
+    if( rTableStylePart.getTextItalicStyle().is_initialized() )
+        aTextCharProps.moItalic = rTableStylePart.getTextItalicStyle();
 
-    PropertySet aPropSet( rxCell );
-    aTextCharProps.pushToPropSet( aPropSet, rFilterBase );
+    PropertySet aPropSet( rxStart );
+    aTextCharProps.pushToPropSet( aPropSet, rFilterBase, true );
 }
 
 void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell >& rxCell, const TableCell& rTableCell )
@@ -170,6 +174,9 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     applyTableCellProperties( rxCell, *this );
     TextCharacterProperties aTextStyleProps;
     getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle );
+    xAt->gotoStart( sal_True );
+    Reference< text::XTextRange > xStart( xAt, UNO_QUERY );
+    xAt->gotoEnd( sal_True );
 
     Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW );
     oox::drawingml::FillProperties aFillProperties;
@@ -184,7 +191,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     if ( rBackgroundFillPropertiesPtr.get() )
         aFillProperties.assignUsed( *rBackgroundFillPropertiesPtr );
 
-    applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+    applyTableStylePart( rFilterBase, xStart, aFillProperties,
         aLinePropertiesLeft,
         aLinePropertiesRight,
         aLinePropertiesTop,
@@ -195,7 +202,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
 
     if ( rProperties.isFirstRow() && ( nRow == 0 ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -206,7 +213,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isLastRow() && ( nRow == nMaxRow ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -217,7 +224,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isFirstCol() && ( nColumn == 0 ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -228,7 +235,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -247,7 +254,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
                 nBand++;
             if ( nBand & 1 )
             {
-                applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+                applyTableStylePart( rFilterBase, xStart, aFillProperties,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -258,7 +265,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
             }
             else
             {
-                applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+                applyTableStylePart( rFilterBase, xStart, aFillProperties,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -271,7 +278,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == 0 ) && ( nColumn == 0 ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -282,7 +289,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -293,7 +300,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -304,7 +311,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == nMaxColumn ) && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+        applyTableStylePart( rFilterBase, xStart, aFillProperties,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -323,7 +330,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
                 nBand++;
             if ( nBand & 1 )
             {
-                applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+                applyTableStylePart( rFilterBase, xStart, aFillProperties,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -334,7 +341,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
             }
             else
             {
-                applyTableStylePart( rFilterBase, rxCell, aFillProperties,
+                applyTableStylePart( rFilterBase, xStart, aFillProperties,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
index 520894f..e65e09a 100644
--- a/oox/source/drawingml/table/tablestyletextstylecontext.cxx
+++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
@@ -46,17 +46,21 @@ TableStyleTextStyleContext::TableStyleTextStyleContext( ContextHandler& rParent,
 : ContextHandler( rParent )
 , mrTableStylePart( rTableStylePart )
 {
-    sal_Int32 nB = xAttribs->getOptionalValueToken( XML_b, XML_def );
-    if ( nB == XML_on )
-        mrTableStylePart.getTextBoldStyle() = ::boost::optional< sal_Bool >( sal_True );
-    else if ( nB == XML_off )
-        mrTableStylePart.getTextBoldStyle() = ::boost::optional< sal_Bool >( sal_False );
+    if( xAttribs->hasAttribute( XML_b ) ) {
+        sal_Int32 nB = xAttribs->getOptionalValueToken( XML_b, XML_def );
+        if ( nB == XML_on )
+            mrTableStylePart.getTextBoldStyle() = ::boost::optional< sal_Bool >( sal_True );
+        else if ( nB == XML_off )
+            mrTableStylePart.getTextBoldStyle() = ::boost::optional< sal_Bool >( sal_False );
+    }
 
-    sal_Int32 nI = xAttribs->getOptionalValueToken( XML_i, XML_def );
-    if ( nI == XML_on )
-        mrTableStylePart.getTextItalicStyle() = ::boost::optional< sal_Bool >( sal_True );
-    else if ( nI == XML_off )
-        mrTableStylePart.getTextItalicStyle() = ::boost::optional< sal_Bool >( sal_False );
+    if( xAttribs->hasAttribute( XML_i ) ) {
+        sal_Int32 nI = xAttribs->getOptionalValueToken( XML_i, XML_def );
+        if ( nI == XML_on )
+            mrTableStylePart.getTextItalicStyle() = ::boost::optional< sal_Bool >( sal_True );
+        else if ( nI == XML_off )
+            mrTableStylePart.getTextItalicStyle() = ::boost::optional< sal_Bool >( sal_False );
+    }
 }
 
 TableStyleTextStyleContext::~TableStyleTextStyleContext()
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 4db1cd9..d9ffd8c 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -70,7 +70,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
     moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText );
 }
 
-void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter ) const
+    void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
 {
     OUString aFontName;
     sal_Int16 nFontPitch = 0;
@@ -134,15 +134,19 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
     rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) );
     rPropMap[ PROP_CharCaseMap ] <<= GetCaseMap( moCaseMap.get( XML_none ) );
 
-    float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL;
-    rPropMap[ PROP_CharWeight ] <<= fWeight;
-    rPropMap[ PROP_CharWeightAsian ] <<= fWeight;
-    rPropMap[ PROP_CharWeightComplex ] <<= fWeight;
+    if( !bUseOptional || moBold.has() ) {
+        float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL;
+        rPropMap[ PROP_CharWeight ] <<= fWeight;
+        rPropMap[ PROP_CharWeightAsian ] <<= fWeight;
+        rPropMap[ PROP_CharWeightComplex ] <<= fWeight;
+    }
 
-    awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE;
-    rPropMap[ PROP_CharPosture ] <<= eSlant;
-    rPropMap[ PROP_CharPostureAsian ] <<= eSlant;
-    rPropMap[ PROP_CharPostureComplex ] <<= eSlant;
+    if( !bUseOptional || moItalic.has() ) {
+        awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE;
+        rPropMap[ PROP_CharPosture ] <<= eSlant;
+        rPropMap[ PROP_CharPostureAsian ] <<= eSlant;
+        rPropMap[ PROP_CharPostureComplex ] <<= eSlant;
+    }
 
     bool bUnderlineFillFollowText = moUnderlineFillFollowText.get( false );
     if( moUnderline.has() && maUnderlineColor.isUsed() && !bUnderlineFillFollowText )
@@ -152,10 +156,10 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
     }
 }
 
-void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter ) const
+    void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter, bool bUseOptional ) const
 {
     PropertyMap aPropMap;
-    pushToPropMap( aPropMap, rFilter );
+    pushToPropMap( aPropMap, rFilter, bUseOptional );
     rPropSet.setProperties( aPropMap );
 }
 
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index b1d82ca..2f48719 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -67,7 +67,7 @@ void TextListStyle::apply( const TextListStyle& rTextListStyle )
 }
 
 #if OSL_DEBUG_LEVEL > 0
-void TextListStyle::dump( int nLevels )
+void TextListStyle::dump( int nLevels ) const
 {
     for ( int i = 0; i < nLevels; i++ )
     {
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 9d0ac72..206ab27 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -267,6 +267,7 @@ void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
         sal_uInt32 uintValue = 0;
         sal_Int16 int16Value = 0;
         sal_uInt16 uint16Value = 0;
+        float floatValue = 0;
         bool boolValue = false;
     LineSpacing spacing;
 //         RectanglePoint pointValue;
@@ -284,6 +285,8 @@ void PropertyMap::dump( Reference< XPropertySet > rXPropSet )
             fprintf (stderr,"%d            (hex: %x)\n", int16Value, int16Value);
         else if( value >>= uint16Value )
             fprintf (stderr,"%d            (hex: %x)\n", uint16Value, uint16Value);
+        else if( value >>= floatValue )
+            fprintf (stderr,"%f\n", floatValue);
         else if( value >>= boolValue )
             fprintf (stderr,"%d            (bool)\n", boolValue);
     else if( value >>= aWritingMode )
commit 1b89d0e985c63459d17ec7e1642a2fc56475470b
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Nov 10 15:48:53 2010 +0100

    better debug dump of text paragraph properties

diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index 0ef9b2c..8c09533 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -53,7 +53,7 @@ public:
     BulletList( );
     bool is() const;
     void apply( const BulletList& );
-    void pushToPropMap( const ::oox::core::XmlFilterBase& rFilterBase, PropertyMap& rPropMap ) const;
+    void pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& xPropMap ) const;
     void setBulletChar( const ::rtl::OUString & sChar );
     void setStartAt( sal_Int32 nStartAt ){ mnStartAt <<= static_cast< sal_Int16 >( nStartAt ); }
     void setType( sal_Int32 nType );
@@ -104,9 +104,10 @@ public:
     boost::optional< sal_Int32 >&       getFirstLineIndentation(){ return moFirstLineIndentation; }
 
     void                                apply( const TextParagraphProperties& rSourceProps );
-    void                                pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
+    void                                pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
                                             const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
                                                 PropertyMap& rioBulletList, const BulletList* pMasterBuList, sal_Bool bApplyBulletList, float fFontSize ) const;
+    void                                pushToPropSet( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet) const;
 
     /** Returns the largest character size of this paragraph. If possible the
         masterstyle should have been applied before, otherwise the character
@@ -114,7 +115,7 @@ public:
     float                               getCharHeightPoints( float fDefault ) const;
 
 #if OSL_DEBUG_LEVEL > 0
-    void dump() { maTextParagraphPropertyMap.dump(); OSL_TRACE("character height: %f", maTextCharacterProperties.getCharHeightPoints(-1)); }
+    void dump();
 #endif
 
 protected:
diff --git a/oox/inc/oox/ppt/customshowlistcontext.hxx b/oox/inc/oox/ppt/customshowlistcontext.hxx
new file mode 100644
index 0000000..4885cdd
--- /dev/null
+++ b/oox/inc/oox/ppt/customshowlistcontext.hxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+
+#ifndef OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
+#define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
+
+#include "oox/core/contexthandler.hxx"
+#include <vector>
+
+namespace oox { namespace ppt {
+
+
+    struct CustomShow
+    {
+        ::rtl::OUString				maName;
+        ::rtl::OUString				mnId;
+        std::vector< rtl::OUString >maSldLst;
+    };
+
+    /** CT_ */
+    class CustomShowListContext : public ::oox::core::ContextHandler
+    {
+        std::vector< CustomShow >& mrCustomShowList;
+
+    public:
+        CustomShowListContext( ::oox::core::ContextHandler& rParent,
+                std::vector< CustomShow >& rCustomShowList );
+
+        ~CustomShowListContext( );
+        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+            createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
+                throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+    };
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx
index c3a924e..ac2d0b7 100644
--- a/oox/inc/oox/ppt/pptimport.hxx
+++ b/oox/inc/oox/ppt/pptimport.hxx
@@ -67,6 +67,10 @@ public:
 
     sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
 
+#if OSL_DEBUG_LEVEL > 0
+    static XmlFilterBase* mpDebugFilterBase;
+#endif
+
 private:
     virtual GraphicHelper* implCreateGraphicHelper() const;
     virtual ::rtl::OUString implGetImplementationName() const;
diff --git a/oox/inc/oox/ppt/presentationfragmenthandler.hxx b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
index a6d684e..94b16bb 100644
--- a/oox/inc/oox/ppt/presentationfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
@@ -35,7 +35,7 @@
 #include "oox/ppt/slidepersist.hxx"
 #include "oox/core/fragmenthandler.hxx"
 #include "oox/core/relations.hxx"
-#include "customshowlistcontext.hxx"
+#include "oox/ppt/customshowlistcontext.hxx"
 
 #include <stack>
 #include <vector>
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx
index 68019d1..107cdc4 100644
--- a/oox/inc/oox/ppt/slidepersist.hxx
+++ b/oox/inc/oox/ppt/slidepersist.hxx
@@ -72,6 +72,10 @@ public:
 
     com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >    getPage() const { return mxPage; };
 
+#if OSL_DEBUG_LEVEL > 0
+    static com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxDebugPage;
+#endif
+
     void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; }
     SlidePersistPtr getMasterPersist() const { return mpMasterPagePtr; }
 
diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx
index be56b40..3527f23 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -152,7 +152,7 @@ void TextField::insertAt(
         Reference< XPropertySet > xProps( xStart, UNO_QUERY);
         PropertySet aPropSet( xProps );
 
-        maTextParagraphProperties.pushToPropSet( rFilterBase, xProps, aioBulletList, NULL, sal_True, 18 );
+        maTextParagraphProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, NULL, sal_True, 18 );
 
         TextCharacterProperties aTextCharacterProps( rTextCharacterStyle );
         aTextCharacterProps.assignUsed( maTextParagraphProperties.getTextCharacterProperties() );
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index fe535f9..2205d7b 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -103,10 +103,10 @@ void TextParagraph::insertAt(
         float fCharacterSize = 18;
         if ( pTextParagraphStyle.get() )
         {
-            pTextParagraphStyle->pushToPropSet( rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
+            pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
             fCharacterSize = pTextParagraphStyle->getCharHeightPoints( 18 );
         }
-        maProperties.pushToPropSet( rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
+        maProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
 
         // empty paragraphs do not have bullets in ppt
         if ( !nParagraphSize )
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index eed5b4a..84c18ef 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -44,6 +44,17 @@
 #include "properties.hxx"
 #include "tokens.hxx"
 
+#if OSL_DEBUG_LEVEL > 0
+#include <vcl/unohelp.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/processfactory.hxx>
+#include <oox/ppt/pptimport.hxx>
+#include <oox/ppt/slidepersist.hxx>
+#endif
+
 using rtl::OUString;
 using namespace ::oox::core;
 using namespace ::com::sun::star::uno;
@@ -280,7 +291,7 @@ void BulletList::apply( const BulletList& rSource )
         maGraphic = rSource.maGraphic;
 }
 
-void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase& rFilterBase, PropertyMap& rPropMap ) const
+void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& rPropMap ) const
 {
     if( msNumberingPrefix.hasValue() )
         rPropMap[ PROP_Prefix ] = msNumberingPrefix;
@@ -296,19 +307,21 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase& rFilterBase, P
     OUString aBulletFontName;
     sal_Int16 nBulletFontPitch = 0;
     sal_Int16 nBulletFontFamily = 0;
-    if( maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, rFilterBase ) )
-    {
-        FontDescriptor aFontDesc;
-        sal_Int16 nFontSize = 0;
-        if( mnFontSize >>= nFontSize )
-            aFontDesc.Height = nFontSize;
-
-        // TODO move the to the TextFont struct.
-        aFontDesc.Name = aBulletFontName;
-        aFontDesc.Pitch = nBulletFontPitch;
-        aFontDesc.Family = nBulletFontFamily;
-        rPropMap[ PROP_BulletFont ] <<= aFontDesc;
-        rPropMap[ PROP_BulletFontName ] <<= aBulletFontName;
+    if( pFilterBase) {
+        if (maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) )
+        {
+            FontDescriptor aFontDesc;
+            sal_Int16 nFontSize = 0;
+            if( mnFontSize >>= nFontSize )
+                aFontDesc.Height = nFontSize;
+
+            // TODO move the to the TextFont struct.
+            aFontDesc.Name = aBulletFontName;
+            aFontDesc.Pitch = nBulletFontPitch;
+            aFontDesc.Family = nBulletFontFamily;
+            rPropMap[ PROP_BulletFont ] <<= aFontDesc;
+            rPropMap[ PROP_BulletFontName ] <<= aBulletFontName;
+        }
     }
     if ( msBulletChar.hasValue() )
         rPropMap[ PROP_BulletChar ] = msBulletChar;
@@ -322,8 +335,10 @@ void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase& rFilterBase, P
         rPropMap[ PROP_BulletRelSize ] = mnSize;
     if ( maStyleName.hasValue() )
         rPropMap[ PROP_CharStyleName ] <<= maStyleName;
-    if ( maBulletColorPtr->isUsed() )
-        rPropMap[ PROP_BulletColor ] <<= maBulletColorPtr->getColor( rFilterBase.getGraphicHelper() );
+    if (pFilterBase ) {
+        if ( maBulletColorPtr->isUsed() )
+            rPropMap[ PROP_BulletColor ] <<= maBulletColorPtr->getColor( pFilterBase->getGraphicHelper() );
+    }
 }
 
 TextParagraphProperties::TextParagraphProperties()
@@ -350,7 +365,7 @@ void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps
         moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
 }
 
-void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
+void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
     const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, const BulletList* pMasterBuList, sal_Bool bApplyBulletMap, float fCharacterSize ) const
 {
     PropertySet aPropSet( xPropSet );
@@ -364,7 +379,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase& r
     if ( nNumberingType == NumberingType::NUMBER_NONE )
         aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, -1 );
 
-    maBulletList.pushToPropMap( rFilterBase, rioBulletMap );
+    maBulletList.pushToPropMap( pFilterBase, rioBulletMap );
 
     if ( maParaTopMargin.bHasValue )
         aPropSet.setProperty( PROP_ParaTopMargin, maParaTopMargin.toMargin( getCharHeightPoints( 18.0 ) ) );
@@ -414,7 +429,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase& r
         }
     }
     if ( noParaLeftMargin )
-        aPropSet.setProperty( PROP_ParaLeftMargin, *noParaLeftMargin );
+        aPropSet.setProperty( PROP_ParaLeftMargin, 0 /**noParaLeftMargin*/ );
     if ( noFirstLineIndentation )
         aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation );
 }
@@ -424,6 +439,30 @@ float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
     return maTextCharacterProperties.getCharHeightPoints( fDefault );
 }
 
+
+#if OSL_DEBUG_LEVEL > 0
+
+void TextParagraphProperties::dump()
+{
+    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 );
+    Reference< ::com::sun::star::text::XText > xText( xShape, UNO_QUERY );
+
+    ppt::SlidePersist::mxDebugPage->add( xShape );
+
+    PropertyMap emptyMap;
+
+    const OUString sText = CREATE_OUSTRING("debug");
+    xText->setString( sText );
+    Reference< ::com::sun::star::text::XTextCursor > xStart( xText->createTextCursor(), UNO_QUERY );
+    Reference< ::com::sun::star::text::XTextRange > xRange( xStart, UNO_QUERY );
+    xStart->gotoEnd( sal_True );
+    Reference< XPropertySet > xPropSet( xRange, UNO_QUERY );
+    pushToPropSet( NULL, xPropSet, emptyMap, NULL, false, 0 );
+    PropertySet pSet( xPropSet );
+    pSet.dump();
+}
+#endif
 } }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx
index 9f01e8c..272df30 100644
--- a/oox/source/ppt/customshowlistcontext.cxx
+++ b/oox/source/ppt/customshowlistcontext.cxx
@@ -26,7 +26,7 @@
  *
  ************************************************************************/
 
-#include "customshowlistcontext.hxx"
+#include "oox/ppt/customshowlistcontext.hxx"
 #include "oox/core/namespaces.hxx"
 #include "tokens.hxx"
 
diff --git a/oox/source/ppt/customshowlistcontext.hxx b/oox/source/ppt/customshowlistcontext.hxx
deleted file mode 100644
index 1603096..0000000
--- a/oox/source/ppt/customshowlistcontext.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#ifndef OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
-#define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
-
-#include "oox/core/contexthandler.hxx"
-#include <vector>
-
-namespace oox { namespace ppt {
-
-
-    struct CustomShow
-    {
-        ::rtl::OUString				maName;
-        ::rtl::OUString				mnId;
-        std::vector< rtl::OUString >maSldLst;
-    };
-
-    /** CT_ */
-    class CustomShowListContext : public ::oox::core::ContextHandler
-    {
-        std::vector< CustomShow >& mrCustomShowList;
-
-    public:
-        CustomShowListContext( ::oox::core::ContextHandler& rParent,
-                std::vector< CustomShow >& rCustomShowList );
-
-        ~CustomShowListContext( );
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
-            createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
-                throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
-    };
-
-} }
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 1a09667..8f96e95 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -57,10 +57,17 @@ uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance(const
     return (cppu::OWeakObject*)new PowerPointImport( rSMgr );
 }
 
+#if OSL_DEBUG_LEVEL > 0
+XmlFilterBase* PowerPointImport::mpDebugFilterBase = NULL;
+#endif
+
 PowerPointImport::PowerPointImport( const uno::Reference< lang::XMultiServiceFactory > & rSMgr  )
     : XmlFilterBase( rSMgr )
     , mxChartConv( new ::oox::drawingml::chart::ChartConverter )
 {
+#if OSL_DEBUG_LEVEL > 0
+    mpDebugFilterBase = this;
+#endif
 }
 
 PowerPointImport::~PowerPointImport()
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 8c58295..803b9d3 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -75,8 +75,15 @@ SlidePersist::SlidePersist( XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool b
     */
         maOtherTextStylePtr->apply( *pDefaultTextStyle.get() );
     }
+#if OSL_DEBUG_LEVEL > 0
+    mxDebugPage = mxPage;
+#endif
 }
 
+#if OSL_DEBUG_LEVEL > 0
+        ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SlidePersist::mxDebugPage;
+#endif
+
 SlidePersist::~SlidePersist()
 {
 


More information about the Libreoffice-commits mailing list