[Libreoffice-commits] .: android/sdremote sd/source

Andrzej J.R. Hunt ajrhunt at kemper.freedesktop.org
Wed Aug 15 12:05:09 PDT 2012


 android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java |    1 
 sd/source/ui/remotecontrol/ImagePreparer.cxx                               |   26 +++++-----
 2 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 49357140beef3b2b3d0b22fa4eea8bf9add73eda
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Wed Aug 15 21:03:38 2012 +0200

    Fixed line breaks in notes export.
    
    Change-Id: If3db4dea84448e9d7ee26d797a25f7e4aa4d5941

diff --git a/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java b/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java
index 4825e6e..e05ef48 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java
@@ -23,7 +23,6 @@ public class AboutDialogBuilder extends AlertDialog.Builder {
         View aLayout = aInflater.inflate(R.layout.dialog_about, null);
 
         setView(aLayout);
-        //        setContentView(R.layout.dialog_about);
 
         //        setTitle(R.string.about);
         setPositiveButton(
diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx
index 4ce1e3f..0ea6302 100644
--- a/sd/source/ui/remotecontrol/ImagePreparer.cxx
+++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx
@@ -68,7 +68,6 @@ ImagePreparer::~ImagePreparer()
 
 void ImagePreparer::execute()
 {
-    fprintf( stderr, "ImagePreparer running\n" );
     sal_uInt32 aSlides = xController->getSlideCount();
     for ( sal_uInt32 i = 0; i < aSlides; i++ )
     {
@@ -78,7 +77,6 @@ void ImagePreparer::execute()
         }
         sendPreview( i );
     }
-    fprintf( stderr, "Preparing slide notes\n" );
     for ( sal_uInt32 i = 0; i < aSlides; i++ )
     {
         if ( !xController->isRunning() ) // stopped/disposed of.
@@ -273,7 +271,7 @@ OString ImagePreparer::notesToHtml( sal_uInt32 aSlideNumber )
 // Code copied from sdremote/source/presenter/PresenterNotesView.cxx
 OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
 {
-    OUString aRet("");
+    OUStringBuffer aRet;
 
     if ( !xController->isRunning() )
         return "";
@@ -312,7 +310,8 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
                 uno::Reference<text::XTextRange> xText (xServiceName, UNO_QUERY);
                 if (xText.is())
                 {
-                    aRet += xText->getString();
+                    aRet.append(xText->getString());
+                    aRet.append("<br/>");
                 }
             }
             else
@@ -328,15 +327,25 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
                             xIndexAccess->getByIndex(nIndex), UNO_QUERY);
                         if (xText.is())
                         {
-                            aRet += xText->getString();
+                            aRet.append(xText->getString());
+                            aRet.append("<br/>");
                         }
                     }
                 }
             }
         }
     }
+    // Replace all newlines with <br\> tags
+    for ( sal_Int32 i = 0; i < aRet.getLength(); i++ )
+    {
+        if ( aRet[i] == '\n' )
+        {
+            aRet[i]=  '<';
+            aRet.insert( i+1, "br/>" );
+        }
+    }
     return OUStringToOString(
-        aRet, RTL_TEXTENCODING_UTF8 );
+        aRet.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
 }
 
 sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl )
@@ -382,11 +391,6 @@ sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl
         }
     }
 
-    if (xExporter.is())
-        fprintf( stderr, "Is!\n" );
-    else
-        fprintf( stderr, "Isn't\n" );
-
     if ( xExporter.is() )
     {
         try{


More information about the Libreoffice-commits mailing list