diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-15 21:03:38 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-15 21:05:00 +0200 |
commit | 49357140beef3b2b3d0b22fa4eea8bf9add73eda (patch) | |
tree | 885945b36d4d37fef6529ba47517f58c94874156 /sd/source/ui/remotecontrol/ImagePreparer.cxx | |
parent | 50d89530eee57afb890e2e65aac8a5b0f93a74a3 (diff) |
Fixed line breaks in notes export.
Change-Id: If3db4dea84448e9d7ee26d797a25f7e4aa4d5941
Diffstat (limited to 'sd/source/ui/remotecontrol/ImagePreparer.cxx')
-rw-r--r-- | sd/source/ui/remotecontrol/ImagePreparer.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
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<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{ |