[Libreoffice-commits] .: oox/source

Radek Doulík rodo at kemper.freedesktop.org
Wed Dec 8 03:09:38 PST 2010


 oox/source/export/drawingml.cxx |   17 ++++++++++++++---
 oox/source/export/shapes.cxx    |   21 ++++++++++++++++++---
 2 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit b49d4405f4a8919a1b6e194a343cd3dca9495f80
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Dec 8 12:05:24 2010 +0100

    use placeholder text in pptx export

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index d90ef29..6900a1b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -940,8 +940,18 @@ void DrawingML::WriteRun( Reference< XTextRange > rRun )
     sal_Bool bIsField = sal_False;
     OUString sText = rRun->getString();
 
-    if( sText.getLength() < 1)
-        return;
+    if( sText.getLength() < 1) {
+        Reference< XPropertySet > xPropSet( rRun, UNO_QUERY );
+
+        try {
+        if( !xPropSet.is() || !( xPropSet->getPropertyValue( S( "PlaceholderText" ) ) >>= sText ) )
+            return;
+        if( sText.getLength() < 1 )
+            return;
+        } catch (Exception e) {
+            return;
+        }
+    }
 
     if( ( sFieldType = GetFieldType( rRun, bIsField ) ) ) {
         OStringBuffer sUUID(39);
@@ -1220,7 +1230,7 @@ void DrawingML::WriteParagraph( Reference< XTextContent > rParagraph )
         Any any ( enumeration->nextElement() );
 
         if (any >>= run) {
-            if( !bPropertiesWritten && run->getString().getLength() ) {
+            if( !bPropertiesWritten ) {
                 WriteParagraphProperties( rParagraph );
                 bPropertiesWritten = TRUE;
             }
@@ -1305,6 +1315,7 @@ void DrawingML::WriteText( Reference< XShape > rXShape  )
                            XML_anchorCtr, bHorizontalCenter ? "1" : NULL,
                            XML_vert, sWritingMode,
                            FSEND );
+    //mpFS->singleElement( FSNS( XML_a, XML_lstStyle ), FSEND );
 
     Reference< XEnumerationAccess > access( xXText, UNO_QUERY );
     if( !access.is() )
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 9ae3d53..a7e6bd9 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -103,8 +103,6 @@ using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::sax_fastparser::FSHelperPtr;
 
-DBG(extern void dump_pset(Reference< XPropertySet > rXPropSet));
-
 #define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr()
 
 struct CustomShapeTypeTranslationTable
@@ -401,9 +399,26 @@ awt::Size ShapeExport::MapSize( const awt::Size& rSize ) const
 
 sal_Bool ShapeExport::NonEmptyText( Reference< XShape > xShape )
 {
+    Reference< XPropertySet > xPropSet( xShape, UNO_QUERY );
+    sal_Bool bIsEmptyPresObj = sal_False;
+    if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsEmptyPresentationObject" ) ) >>= bIsEmptyPresObj ) ) {
+        DBG(printf("empty presentation object %d, props:\n", bIsEmptyPresObj));
+        if( bIsEmptyPresObj )
+            return sal_True;
+    }
+    sal_Bool bIsPresObj = sal_False;
+    if( xPropSet.is() && ( xPropSet->getPropertyValue( S( "IsPresentationObject" ) ) >>= bIsPresObj ) ) {
+        DBG(printf("presentation object %d, props:\n", bIsPresObj));
+        if( bIsPresObj )
+            return sal_True;
+    }
+
     Reference< XSimpleText > xText( xShape, UNO_QUERY );
 
-    return ( xText.is() && xText->getString().getLength() );
+    if( xText.is() )
+        return xText->getString().getLength();
+
+    return sal_False;
 }
 
 ShapeExport& ShapeExport::WriteBezierShape( Reference< XShape > xShape, sal_Bool bClosed )


More information about the Libreoffice-commits mailing list