Kaydet (Commit) 49357140 authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Fixed line breaks in notes export.

Change-Id: If3db4dea84448e9d7ee26d797a25f7e4aa4d5941
üst 50d89530
...@@ -23,7 +23,6 @@ public class AboutDialogBuilder extends AlertDialog.Builder { ...@@ -23,7 +23,6 @@ public class AboutDialogBuilder extends AlertDialog.Builder {
View aLayout = aInflater.inflate(R.layout.dialog_about, null); View aLayout = aInflater.inflate(R.layout.dialog_about, null);
setView(aLayout); setView(aLayout);
// setContentView(R.layout.dialog_about);
// setTitle(R.string.about); // setTitle(R.string.about);
setPositiveButton( setPositiveButton(
......
...@@ -68,7 +68,6 @@ ImagePreparer::~ImagePreparer() ...@@ -68,7 +68,6 @@ ImagePreparer::~ImagePreparer()
void ImagePreparer::execute() void ImagePreparer::execute()
{ {
fprintf( stderr, "ImagePreparer running\n" );
sal_uInt32 aSlides = xController->getSlideCount(); sal_uInt32 aSlides = xController->getSlideCount();
for ( sal_uInt32 i = 0; i < aSlides; i++ ) for ( sal_uInt32 i = 0; i < aSlides; i++ )
{ {
...@@ -78,7 +77,6 @@ void ImagePreparer::execute() ...@@ -78,7 +77,6 @@ void ImagePreparer::execute()
} }
sendPreview( i ); sendPreview( i );
} }
fprintf( stderr, "Preparing slide notes\n" );
for ( sal_uInt32 i = 0; i < aSlides; i++ ) for ( sal_uInt32 i = 0; i < aSlides; i++ )
{ {
if ( !xController->isRunning() ) // stopped/disposed of. if ( !xController->isRunning() ) // stopped/disposed of.
...@@ -273,7 +271,7 @@ OString ImagePreparer::notesToHtml( sal_uInt32 aSlideNumber ) ...@@ -273,7 +271,7 @@ OString ImagePreparer::notesToHtml( sal_uInt32 aSlideNumber )
// Code copied from sdremote/source/presenter/PresenterNotesView.cxx // Code copied from sdremote/source/presenter/PresenterNotesView.cxx
OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber ) OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
{ {
OUString aRet(""); OUStringBuffer aRet;
if ( !xController->isRunning() ) if ( !xController->isRunning() )
return ""; return "";
...@@ -312,7 +310,8 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber ) ...@@ -312,7 +310,8 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
uno::Reference<text::XTextRange> xText (xServiceName, UNO_QUERY); uno::Reference<text::XTextRange> xText (xServiceName, UNO_QUERY);
if (xText.is()) if (xText.is())
{ {
aRet += xText->getString(); aRet.append(xText->getString());
aRet.append("<br/>");
} }
} }
else else
...@@ -328,15 +327,25 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber ) ...@@ -328,15 +327,25 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
xIndexAccess->getByIndex(nIndex), UNO_QUERY); xIndexAccess->getByIndex(nIndex), UNO_QUERY);
if (xText.is()) 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( return OUStringToOString(
aRet, RTL_TEXTENCODING_UTF8 ); aRet.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
} }
sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl ) sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl )
...@@ -382,11 +391,6 @@ 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() ) if ( xExporter.is() )
{ {
try{ try{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment