From 49357140beef3b2b3d0b22fa4eea8bf9add73eda Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Wed, 15 Aug 2012 21:03:38 +0200 Subject: Fixed line breaks in notes export. Change-Id: If3db4dea84448e9d7ee26d797a25f7e4aa4d5941 --- .../impressremote/AboutDialogBuilder.java | 1 - sd/source/ui/remotecontrol/ImagePreparer.cxx | 26 +++++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java b/android/sdremote/src/org/libreoffice/impressremote/AboutDialogBuilder.java index 4825e6e1066b..e05ef48bcb18 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 4ce1e3f4cf2b..0ea63027828d 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 xText (xServiceName, UNO_QUERY); if (xText.is()) { - aRet += xText->getString(); + aRet.append(xText->getString()); + aRet.append("
"); } } 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("
"); } } } } } } + // Replace all newlines with 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{ -- cgit