summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/source/tools/lngconvex/makefile.mk6
-rw-r--r--shell/source/unix/exec/shellexec.cxx5
-rw-r--r--shell/source/unix/exec/syssh.xml1
-rw-r--r--shell/source/win32/SysShExec.cxx118
-rw-r--r--shell/source/win32/shlxthandler/makefile.mk15
-rw-r--r--shell/source/win32/shlxthandler/shlxthdl.cxx63
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx6
7 files changed, 148 insertions, 66 deletions
diff --git a/shell/source/tools/lngconvex/makefile.mk b/shell/source/tools/lngconvex/makefile.mk
index ce70bce73a6f..4b8b6e30724d 100644
--- a/shell/source/tools/lngconvex/makefile.mk
+++ b/shell/source/tools/lngconvex/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: tra $ $Date: 2002-08-26 10:50:02 $
+# last change: $Author: hr $ $Date: 2003-03-27 11:16:07 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -74,7 +74,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-CFLAGS+=/Ob0 /D_NTSDK
+CFLAGS+=-Ob0 -D_NTSDK
APP1TARGET=$(TARGET)
APP1OBJS=$(OBJ)$/$(TARGET).obj\
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index 1d2c731c49bb..caebb917673d 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shellexec.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: hr $ $Date: 2002-02-21 15:20:23 $
+ * last change: $Author: hr $ $Date: 2003-03-27 11:16:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,7 +97,6 @@
#include <errno.h>
#include <unistd.h>
-#include <string.h>
//------------------------------------------------------------------------
// namespace directives
diff --git a/shell/source/unix/exec/syssh.xml b/shell/source/unix/exec/syssh.xml
index e1d0ba1ec557..af9691e4d2f9 100644
--- a/shell/source/unix/exec/syssh.xml
+++ b/shell/source/unix/exec/syssh.xml
@@ -25,7 +25,6 @@
<type> com.sun.star.uno.TypeClass </type>
<type> com.sun.star.uno.XWeak </type>
<type> com.sun.star.uno.XAggregation </type>
- <type> com.sun.star.uno.XComponentContext </type>
<type> com.sun.star.registry.XRegistryKey </type>
<type> com.sun.star.container.XSet </type>
<type> com.sun.star.container.XNameAccess </type>
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index d1295301a092..654b648e5baa 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SysShExec.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: hro $ $Date: 2002-08-14 15:17:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 11:16:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,7 +71,9 @@
#include "SysShExec.hxx"
#endif
-#include <osl/file.h>
+#ifndef _OSL_FILE_HXX_
+#include <osl/file.hxx>
+#endif
#ifndef _COM_SUN_STAR_SYS_SHELL_SYSTEMSHELLEXECUTEFLAGS_HPP_
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
@@ -219,6 +221,76 @@ namespace // private
#define E_UNKNOWN_EXEC_ERROR -1
+ //-----------------------------------------
+ //-----------------------------------------
+
+ bool is_system_path(const OUString& path_or_uri)
+ {
+ OUString url;
+ osl::FileBase::RC rc = osl::FileBase::getFileURLFromSystemPath(path_or_uri, url);
+ return (rc == osl::FileBase::E_None);
+ }
+
+ //-----------------------------------------
+ // trying to identify a jump mark
+ //-----------------------------------------
+
+ const OUString JUMP_MARK_HTM = OUString::createFromAscii(".htm#");
+ const OUString JUMP_MARK_HTML = OUString::createFromAscii(".html#");
+ const sal_Unicode HASH_MARK = (sal_Unicode)'#';
+
+ bool has_jump_mark(const OUString& system_path, sal_Int32* jmp_mark_start = NULL)
+ {
+ sal_Int32 jmp_mark = std::max<int>(
+ system_path.lastIndexOf(JUMP_MARK_HTM),
+ system_path.lastIndexOf(JUMP_MARK_HTML));
+
+ if (jmp_mark_start)
+ *jmp_mark_start = jmp_mark;
+
+ return (jmp_mark > -1);
+ }
+
+ //-----------------------------------------
+ //-----------------------------------------
+
+ bool is_existing_file(const OUString& file_name)
+ {
+ OSL_ASSERT(is_system_path(file_name));
+
+ bool exist = false;
+
+ OUString file_url;
+ osl::FileBase::RC rc = osl::FileBase::getFileURLFromSystemPath(file_name, file_url);
+
+ if (osl::FileBase::E_None == rc)
+ {
+ osl::DirectoryItem dir_item;
+ rc = osl::DirectoryItem::get(file_url, dir_item);
+ exist = (osl::FileBase::E_None == rc);
+ }
+ return exist;
+ }
+
+ //-------------------------------------------------
+ // Jump marks in file urls are illegal.
+ //-------------------------------------------------
+
+ void remove_jump_mark(OUString* p_command)
+ {
+ OSL_PRECOND(p_command, "invalid parameter");
+
+ sal_Int32 pos;
+ if (has_jump_mark(*p_command, &pos))
+ {
+ const sal_Unicode* p_jmp_mark = p_command->getStr() + pos;
+ while (*p_jmp_mark && (*p_jmp_mark != HASH_MARK))
+ p_jmp_mark++;
+
+ *p_command = OUString(p_command->getStr(), p_jmp_mark - p_command->getStr());
+ }
+ }
+
} // end namespace
//-----------------------------------------------------------------------------------------
@@ -238,47 +310,59 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
throw (IllegalArgumentException, SystemShellExecuteException, RuntimeException)
{
// parameter checking
- if ( !aCommand.getLength( ) )
+ if (0 == aCommand.getLength())
throw IllegalArgumentException(
OUString::createFromAscii( "Empty command" ),
static_cast< XSystemShellExecute* >( this ),
1 );
- if ( !( nFlags >= DEFAULTS && nFlags <= NO_SYSTEM_ERROR_MESSAGE ) )
+ if (!(nFlags >= DEFAULTS && nFlags <= NO_SYSTEM_ERROR_MESSAGE))
throw IllegalArgumentException(
OUString::createFromAscii( "Invalid Flags specified" ),
static_cast< XSystemShellExecute* >( this ),
3 );
+ /* #i4789#; jump mark detection on system paths
+ if the given command is a system path (not http or
+ other uri schemes) and seems to have a jump mark
+ and names no existing file (remeber the jump mark
+ sign '#' is a valid file name character we remove
+ the jump mark, else ShellExecuteEx fails */
+ OUString preprocessed_command(aCommand);
+ if (is_system_path(preprocessed_command) &&
+ has_jump_mark(preprocessed_command) &&
+ !is_existing_file(preprocessed_command))
+ remove_jump_mark(&preprocessed_command);
+
SHELLEXECUTEINFOW sei;
- ZeroMemory( &sei, sizeof( sei ) );
+ ZeroMemory(&sei, sizeof( sei));
- sei.cbSize = sizeof( sei );
- sei.lpFile = aCommand.getStr();
+ sei.cbSize = sizeof(sei);
+ sei.lpFile = preprocessed_command.getStr();
sei.lpParameters = aParameter.getStr();
sei.nShow = SW_SHOWNORMAL;
- if ( NO_SYSTEM_ERROR_MESSAGE & nFlags )
+ if (NO_SYSTEM_ERROR_MESSAGE & nFlags)
sei.fMask = SEE_MASK_FLAG_NO_UI;
SetLastError( 0 );
- sal_Bool bRet = ShellExecuteExW( &sei );
+ sal_Bool bRet = ShellExecuteExW(&sei);
- if ( !bRet && (nFlags & NO_SYSTEM_ERROR_MESSAGE) )
+ if (!bRet && (nFlags & NO_SYSTEM_ERROR_MESSAGE))
{
// ShellExecuteEx fails to set an error code
// we return osl_File_E_INVAL
- sal_Int32 psxErr = GetLastError( );
- if ( ERROR_SUCCESS == psxErr )
+ sal_Int32 psxErr = GetLastError();
+ if (ERROR_SUCCESS == psxErr)
psxErr = E_UNKNOWN_EXEC_ERROR;
else
- psxErr = MapError( psxErr );
+ psxErr = MapError(psxErr);
throw SystemShellExecuteException(
- OUString::createFromAscii( "Error executing command" ),
- static_cast< XSystemShellExecute* >( this ),
- psxErr );
+ OUString::createFromAscii("Error executing command"),
+ static_cast< XSystemShellExecute* >(this),
+ psxErr);
}
}
diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk
index e07894556522..b3b58db380a1 100644
--- a/shell/source/win32/shlxthandler/makefile.mk
+++ b/shell/source/win32/shlxthandler/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: tra $ $Date: 2002-12-06 15:38:15 $
+# last change: $Author: hr $ $Date: 2003-03-27 11:16:13 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -82,11 +82,11 @@ TARGETTYPE=CUI
# set ISOLATION_AWARE_ENABLE for activating
# the Windows XP visual styles
-#/D_WINXPSDK set this for a Win2000/WinXP Platform SDK
-#/DBUILD_SOSL for extended functionality (Infotip and
+#-D_WINXPSDK set this for a Win2000/WinXP Platform SDK
+#-DBUILD_SOSL for extended functionality (Infotip and
# Column Handler)
-CFLAGS+=/DISOLATION_AWARE_ENABLED /DWIN32_LEAN_AND_MEAN /DXML_UNICODE /D_NTSDK /DUNICODE
+CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
# --- Files --------------------------------------------------------
@@ -108,7 +108,10 @@ SLOFILES=$(SLO)$/classfactory.obj\
$(SLO)$/ziparchv.obj\
$(SLO)$/zipexcptn.obj\
$(SLO)$/metaaccessor.obj\
- $(SLO)$/utilities.obj
+ $(SLO)$/utilities.obj\
+ $(SLO)$/listviewbuilder.obj\
+ $(SLO)$/document_statistic.obj\
+ $(SLO)$/iso8601_converter.obj
SHL1TARGET=$(TARGET)
diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx
index c1c9f32f822a..f69f55bb377f 100644
--- a/shell/source/win32/shlxthandler/shlxthdl.cxx
+++ b/shell/source/win32/shlxthandler/shlxthdl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shlxthdl.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2002-08-26 10:53:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 11:16:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,6 +87,7 @@
#include "utilities.hxx"
#endif
+#include <tchar.h>
#include <string>
#include <shlobj.h>
@@ -167,8 +168,6 @@ namespace /* private */
return DeleteRegistryKey(HKEY_CLASSES_ROOT, tmp.c_str()) ? S_OK : E_FAIL;
}
-#ifdef _WINXPSDK
-
//---------------------------
//
//---------------------------
@@ -203,8 +202,6 @@ namespace /* private */
return UnregisterComComponent(CLSID_COLUMN_HANDLER);
}
-#endif
-
//---------------------------
//
//---------------------------
@@ -376,42 +373,53 @@ namespace /* private */
extern "C" STDAPI DllRegisterServer()
{
- char ModuleFileName[MAX_PATH];
+ TCHAR ModuleFileName[MAX_PATH];
- GetModuleFileNameA(
- GetModuleHandleA(MODULE_NAME_A),
+ GetModuleFileName(
+ GetModuleHandle(MODULE_NAME),
ModuleFileName,
sizeof(ModuleFileName));
HRESULT hr = S_OK;
-#if defined(_WINXPSDK) && (BUILD_SOSL)
+/*
- // register column handler
+// register column handler
+#ifdef UNICODE
+ if (FAILED(RegisterColumnHandler(WStringToString(ModuleFileName))))
+ hr = E_FAIL;
+#else
if (FAILED(RegisterColumnHandler(ModuleFileName)))
hr = E_FAIL;
+#endif
ApproveShellExtension(
CLSID_COLUMN_HANDLER,
COLUMN_HANDLER_DESCRIPTIVE_NAME);
-#endif
-
-#if defined(BUILD_SOSL)
-
- // register info tip control
+// register info tip control
+#ifdef UNICODE
+ if (FAILED(RegisterInfotipHandler(WStringToString(ModuleFileName))))
+ hr = E_FAIL;
+#else
if (FAILED(RegisterInfotipHandler(ModuleFileName)))
hr = E_FAIL;
+#endif
ApproveShellExtension(
CLSID_INFOTIP_HANDLER,
INFOTIP_HANDLER_DESCRIPTIVE_NAME);
-#endif
+*/
- // register property sheet handler
+// register property sheet handler
+#ifdef UNICODE
+ if (FAILED(RegisterPropSheetHandler(WStringToString(ModuleFileName).c_str())))
+ hr = E_FAIL;
+#else
if (FAILED(RegisterPropSheetHandler(ModuleFileName)))
hr = E_FAIL;
+#endif
ApproveShellExtension(
CLSID_PROPERTYSHEET_HANDLER,
@@ -432,23 +440,18 @@ extern "C" STDAPI DllUnregisterServer()
{
HRESULT hr = S_OK;
-#if defined(_WINXPSDK) && (BUILD_SOSL)
-
+/*
if (FAILED(UnregisterColumnHandler()))
hr = E_FAIL;
UnapproveShellExtension(CLSID_COLUMN_HANDLER);
-#endif
-
-#if defined (BUILD_SOSL)
-
if (FAILED(UnregisterInfotipHandler()))
hr = E_FAIL;
UnapproveShellExtension(CLSID_INFOTIP_HANDLER);
-#endif
+*/
if (FAILED(UnregisterPropSheetHandler()))
hr = E_FAIL;
@@ -470,15 +473,7 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)
{
*ppv = 0;
- if ((rclsid != CLSID_INFOTIP_HANDLER) &&
-
-#ifdef _WINXPSDK
-
- (rclsid != CLSID_COLUMN_HANDLER) &&
-
-#endif
-
- (rclsid != CLSID_PROPERTYSHEET_HANDLER))
+ if ((rclsid != CLSID_INFOTIP_HANDLER) && (rclsid != CLSID_COLUMN_HANDLER) && (rclsid != CLSID_PROPERTYSHEET_HANDLER))
return CLASS_E_CLASSNOTAVAILABLE;
if ((riid != IID_IUnknown) && (riid != IID_IClassFactory))
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index 9c08f46b1ab6..3b364a43a40e 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: smplmailclient.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: tra $ $Date: 2002-02-19 14:11:50 $
+ * last change: $Author: hr $ $Date: 2003-03-27 11:16:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -405,6 +405,8 @@ void CSmplMailClient::initRecipientList(
ULONG ulRecipClass,
size_t& nPos )
{
+ OSL_PRECOND( nPos < m_RecipientList.size( ), "Wrong index" );
+
for( sal_Int32 i = 0; i < aRecipList.getLength( ); i++ )
{
m_RecipsSmtpAddressList.push_back(