[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - shell/source

2014-09-18 Thread Andras Timar
 shell/source/win32/zipfile/zipfile.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6b2b496cc5d6009151ae6d38d5d39cc5f536794e
Author: Andras Timar andras.ti...@collabora.com
Date:   Thu Sep 18 00:46:16 2014 +0200

bnc#887307 ODF files not showing up on Windows search

Under Windows 7, ODF and OpenOffice.org 1.1 files were not found,
when the folder containing them was not indexed, and full text
search was switched on. The problem did not occur under Windows 8.

Apparently there is a bug in Windows 7, reading beyond the end of a
BufferStream resulted in 0 bytes read. So we take care not to read
beyond the end of stream.

Change-Id: Id01b08922121dabbb7b49c54f8ef11cb0e4ac413
(cherry picked from commit ae4c836b49a8ac41312f855e24f20b0b050fcbd4)
Reviewed-on: https://gerrit.libreoffice.org/11497
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/shell/source/win32/zipfile/zipfile.cxx 
b/shell/source/win32/zipfile/zipfile.cxx
index 270fbe1..5dcc02a 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -304,7 +304,7 @@ static bool findCentralDirectoryEnd(StreamInterface *stream)
 
 try
 {
-for (long nOffset = nLength - BLOCK_SIZE;
+for (long nOffset = nLength - BLOCK_SIZE - 4;
  nOffset  0; nOffset -= BLOCK_SIZE)
 {
 if (findSignatureAtOffset(stream, nOffset))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - shell/source

2014-09-18 Thread Stephan Bergmann
 shell/source/cmdmail/cmdmailsuppl.cxx |   90 --
 1 file changed, 65 insertions(+), 25 deletions(-)

New commits:
commit 2b52c8686dcd3fcb95146466e0a8703e8df3cbab
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Feb 10 11:20:12 2014 +0100

Properly encode cmd line for popen

Change-Id: I1f7799920b6732a6cd128143dfa7ce282bad25c6
Signed-off-by: Michael Meeks michael.me...@collabora.com

diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx 
b/shell/source/cmdmail/cmdmailsuppl.cxx
index 5b1b403..7730f05 100644
--- a/shell/source/cmdmail/cmdmailsuppl.cxx
+++ b/shell/source/cmdmail/cmdmailsuppl.cxx
@@ -109,6 +109,47 @@ Reference XSimpleMailMessage  SAL_CALL 
CmdMailSuppl::createSimpleMailMessage(
 // XSimpleMailClient
 //
 
+namespace {
+
+void appendShellWord(OStringBuffer  buffer, OUString const  word, bool 
strict)
+{
+OString sys;
+if (!word.convertToString(
+sys, osl_getThreadTextEncoding(),
+(strict
+ ? (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)
+ : OUSTRING_TO_OSTRING_CVTFLAGS)))
+{
+throw css::uno::Exception(
+(Could not convert \ + word + \ to encoding #
+ + OUString::number(osl_getThreadTextEncoding())),
+css::uno::Referencecss::uno::XInterface());
+}
+buffer.append('\'');
+for (sal_Int32 i = 0; i != sys.getLength(); ++i) {
+char c = sys[i];
+switch (c) {
+case 0:
+if (strict) {
+throw css::uno::Exception(
+Could not convert word containing NUL, \ + word + \,
+css::uno::Referencecss::uno::XInterface());
+}
+break;
+case '\'':
+buffer.append('\\'');
+break;
+default:
+buffer.append(c);
+break;
+}
+}
+buffer.append('\'');
+}
+
+}
+
 void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference 
XSimpleMailMessage  xSimpleMailMessage, sal_Int32 /*aFlag*/ )
 throw (IllegalArgumentException, Exception, RuntimeException)
 {
@@ -135,7 +176,8 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference XSimpleMailM
 static_cast  XSimpleMailClient *  (this));
 }
 
-OStringBuffer aBuffer(\ + OUStringToOString(aProgram, 
osl_getThreadTextEncoding()) + \ );
+OStringBuffer aBuffer;
+appendShellWord(aBuffer, aProgram, true);
 
 try
 {
@@ -171,12 +213,12 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference XSimpleMailM
 // make sure we have a system path
 FileBase::getSystemPathFromFileURL( aMailer, aMailer );
 
-aBuffer.append(--mailclient  + OUStringToOString( aMailer, 
osl_getThreadTextEncoding() ) +
-);
+aBuffer.append( --mailclient );
+appendShellWord(aBuffer, aMailer, true);
 }
 #ifdef MACOSX
 else
-aBuffer.append(--mailclient Mail );
+aBuffer.append( --mailclient Mail);
 #endif
 }
 
@@ -196,26 +238,28 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference XSimpleMailM
 rtl::OUString sBody = xMessage-getBody();
 if ( sBody.getLength()  0 )
 {
-aBuffer.append(--body \);
-aBuffer.append(OUStringToOString(sBody, 
osl_getThreadTextEncoding()));
-aBuffer.append(\ );
+aBuffer.append( --body );
+appendShellWord(aBuffer, sBody, false);
 }
 }
 
+// Convert from, to, etc. in a best-effort rather than a strict way to the
+// system encoding, based on the assumption that the relevant address parts
+// of those strings are ASCII anyway and any problematic characters are 
only
+// in the human-readable, informational-only parts:
+
 // Append originator if set in the message
 if ( !xSimpleMailMessage-getOriginator().isEmpty() )
 {
-aBuffer.append(--from \ +
-OUStringToOString(xSimpleMailMessage-getOriginator(), 
osl_getThreadTextEncoding()) +
-   \ );
+aBuffer.append( --from );
+appendShellWord(aBuffer, xSimpleMailMessage-getOriginator(), false);
 }
 
 // Append receipient if set in the message
 if ( !xSimpleMailMessage-getRecipient().isEmpty() )
 {
-aBuffer.append(--to \ +
-   OUStringToOString(xSimpleMailMessage-getRecipient(), 
osl_getThreadTextEncoding()) +
-   \ );
+aBuffer.append( --to );
+appendShellWord(aBuffer, xSimpleMailMessage-getRecipient(), false);
 }
 
 // Append carbon copy receipients set in the message
@@ -223,9 +267,8 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference XSimpleMailM
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - shell/source

2014-02-10 Thread Stephan Bergmann
 0 files changed

New commits:
commit 89f0535dbf3409468cbbda078720b11fa08f9759
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Feb 10 10:11:45 2014 +0100

instdir/program/senddoc lacks executable mode bits

(but appears OK in true installation sets)

Change-Id: I1c044409b97bd3121509a2185dfac89298312954
(cherry picked from commit 46e63b70d99eab31758afd3abf29c2237b9248de)
Reviewed-on: https://gerrit.libreoffice.org/7967
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
old mode 100644
new mode 100755
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits