Kaydet (Commit) 99d76d79 authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

MWS_SRX644: migrate branch mws_srx644 -> HEAD

üst 71c36ff5
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# #
# $RCSfile: makefile.mk,v $ # $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 # The Contents of this file are made available subject to the terms of
# either of the following licenses # either of the following licenses
...@@ -74,7 +74,7 @@ ENABLE_EXCEPTIONS=TRUE ...@@ -74,7 +74,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------------------------- # --- Files --------------------------------------------------------
CFLAGS+=/Ob0 /D_NTSDK CFLAGS+=-Ob0 -D_NTSDK
APP1TARGET=$(TARGET) APP1TARGET=$(TARGET)
APP1OBJS=$(OBJ)$/$(TARGET).obj\ APP1OBJS=$(OBJ)$/$(TARGET).obj\
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: shellexec.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// namespace directives // namespace directives
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<type> com.sun.star.uno.TypeClass </type> <type> com.sun.star.uno.TypeClass </type>
<type> com.sun.star.uno.XWeak </type> <type> com.sun.star.uno.XWeak </type>
<type> com.sun.star.uno.XAggregation </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.registry.XRegistryKey </type>
<type> com.sun.star.container.XSet </type> <type> com.sun.star.container.XSet </type>
<type> com.sun.star.container.XNameAccess </type> <type> com.sun.star.container.XNameAccess </type>
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: SysShExec.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
#include "SysShExec.hxx" #include "SysShExec.hxx"
#endif #endif
#include <osl/file.h> #ifndef _OSL_FILE_HXX_
#include <osl/file.hxx>
#endif
#ifndef _COM_SUN_STAR_SYS_SHELL_SYSTEMSHELLEXECUTEFLAGS_HPP_ #ifndef _COM_SUN_STAR_SYS_SHELL_SYSTEMSHELLEXECUTEFLAGS_HPP_
#include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
...@@ -219,6 +221,76 @@ namespace // private ...@@ -219,6 +221,76 @@ namespace // private
#define E_UNKNOWN_EXEC_ERROR -1 #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 } // end namespace
//----------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------
...@@ -238,47 +310,59 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa ...@@ -238,47 +310,59 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
throw (IllegalArgumentException, SystemShellExecuteException, RuntimeException) throw (IllegalArgumentException, SystemShellExecuteException, RuntimeException)
{ {
// parameter checking // parameter checking
if ( !aCommand.getLength( ) ) if (0 == aCommand.getLength())
throw IllegalArgumentException( throw IllegalArgumentException(
OUString::createFromAscii( "Empty command" ), OUString::createFromAscii( "Empty command" ),
static_cast< XSystemShellExecute* >( this ), static_cast< XSystemShellExecute* >( this ),
1 ); 1 );
if ( !( nFlags >= DEFAULTS && nFlags <= NO_SYSTEM_ERROR_MESSAGE ) ) if (!(nFlags >= DEFAULTS && nFlags <= NO_SYSTEM_ERROR_MESSAGE))
throw IllegalArgumentException( throw IllegalArgumentException(
OUString::createFromAscii( "Invalid Flags specified" ), OUString::createFromAscii( "Invalid Flags specified" ),
static_cast< XSystemShellExecute* >( this ), static_cast< XSystemShellExecute* >( this ),
3 ); 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; SHELLEXECUTEINFOW sei;
ZeroMemory( &sei, sizeof( sei ) ); ZeroMemory(&sei, sizeof( sei));
sei.cbSize = sizeof( sei ); sei.cbSize = sizeof(sei);
sei.lpFile = aCommand.getStr(); sei.lpFile = preprocessed_command.getStr();
sei.lpParameters = aParameter.getStr(); sei.lpParameters = aParameter.getStr();
sei.nShow = SW_SHOWNORMAL; sei.nShow = SW_SHOWNORMAL;
if ( NO_SYSTEM_ERROR_MESSAGE & nFlags ) if (NO_SYSTEM_ERROR_MESSAGE & nFlags)
sei.fMask = SEE_MASK_FLAG_NO_UI; sei.fMask = SEE_MASK_FLAG_NO_UI;
SetLastError( 0 ); 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 // ShellExecuteEx fails to set an error code
// we return osl_File_E_INVAL // we return osl_File_E_INVAL
sal_Int32 psxErr = GetLastError( ); sal_Int32 psxErr = GetLastError();
if ( ERROR_SUCCESS == psxErr ) if (ERROR_SUCCESS == psxErr)
psxErr = E_UNKNOWN_EXEC_ERROR; psxErr = E_UNKNOWN_EXEC_ERROR;
else else
psxErr = MapError( psxErr ); psxErr = MapError(psxErr);
throw SystemShellExecuteException( throw SystemShellExecuteException(
OUString::createFromAscii( "Error executing command" ), OUString::createFromAscii("Error executing command"),
static_cast< XSystemShellExecute* >( this ), static_cast< XSystemShellExecute* >(this),
psxErr ); psxErr);
} }
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# #
# $RCSfile: makefile.mk,v $ # $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 # The Contents of this file are made available subject to the terms of
# either of the following licenses # either of the following licenses
...@@ -82,11 +82,11 @@ TARGETTYPE=CUI ...@@ -82,11 +82,11 @@ TARGETTYPE=CUI
# set ISOLATION_AWARE_ENABLE for activating # set ISOLATION_AWARE_ENABLE for activating
# the Windows XP visual styles # the Windows XP visual styles
#/D_WINXPSDK set this for a Win2000/WinXP Platform SDK #-D_WINXPSDK set this for a Win2000/WinXP Platform SDK
#/DBUILD_SOSL for extended functionality (Infotip and #-DBUILD_SOSL for extended functionality (Infotip and
# Column Handler) # 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 -------------------------------------------------------- # --- Files --------------------------------------------------------
...@@ -108,7 +108,10 @@ SLOFILES=$(SLO)$/classfactory.obj\ ...@@ -108,7 +108,10 @@ SLOFILES=$(SLO)$/classfactory.obj\
$(SLO)$/ziparchv.obj\ $(SLO)$/ziparchv.obj\
$(SLO)$/zipexcptn.obj\ $(SLO)$/zipexcptn.obj\
$(SLO)$/metaaccessor.obj\ $(SLO)$/metaaccessor.obj\
$(SLO)$/utilities.obj $(SLO)$/utilities.obj\
$(SLO)$/listviewbuilder.obj\
$(SLO)$/document_statistic.obj\
$(SLO)$/iso8601_converter.obj
SHL1TARGET=$(TARGET) SHL1TARGET=$(TARGET)
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: shlxthdl.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
#include "utilities.hxx" #include "utilities.hxx"
#endif #endif
#include <tchar.h>
#include <string> #include <string>
#include <shlobj.h> #include <shlobj.h>
...@@ -167,8 +168,6 @@ namespace /* private */ ...@@ -167,8 +168,6 @@ namespace /* private */
return DeleteRegistryKey(HKEY_CLASSES_ROOT, tmp.c_str()) ? S_OK : E_FAIL; return DeleteRegistryKey(HKEY_CLASSES_ROOT, tmp.c_str()) ? S_OK : E_FAIL;
} }
#ifdef _WINXPSDK
//--------------------------- //---------------------------
// //
//--------------------------- //---------------------------
...@@ -203,8 +202,6 @@ namespace /* private */ ...@@ -203,8 +202,6 @@ namespace /* private */
return UnregisterComComponent(CLSID_COLUMN_HANDLER); return UnregisterComComponent(CLSID_COLUMN_HANDLER);
} }
#endif
//--------------------------- //---------------------------
// //
//--------------------------- //---------------------------
...@@ -376,42 +373,53 @@ namespace /* private */ ...@@ -376,42 +373,53 @@ namespace /* private */
extern "C" STDAPI DllRegisterServer() extern "C" STDAPI DllRegisterServer()
{ {
char ModuleFileName[MAX_PATH]; TCHAR ModuleFileName[MAX_PATH];
GetModuleFileNameA( GetModuleFileName(
GetModuleHandleA(MODULE_NAME_A), GetModuleHandle(MODULE_NAME),
ModuleFileName, ModuleFileName,
sizeof(ModuleFileName)); sizeof(ModuleFileName));
HRESULT hr = S_OK; 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))) if (FAILED(RegisterColumnHandler(ModuleFileName)))
hr = E_FAIL; hr = E_FAIL;
#endif
ApproveShellExtension( ApproveShellExtension(
CLSID_COLUMN_HANDLER, CLSID_COLUMN_HANDLER,
COLUMN_HANDLER_DESCRIPTIVE_NAME); COLUMN_HANDLER_DESCRIPTIVE_NAME);
#endif // register info tip control
#ifdef UNICODE
#if defined(BUILD_SOSL) if (FAILED(RegisterInfotipHandler(WStringToString(ModuleFileName))))
hr = E_FAIL;
// register info tip control #else
if (FAILED(RegisterInfotipHandler(ModuleFileName))) if (FAILED(RegisterInfotipHandler(ModuleFileName)))
hr = E_FAIL; hr = E_FAIL;
#endif
ApproveShellExtension( ApproveShellExtension(
CLSID_INFOTIP_HANDLER, CLSID_INFOTIP_HANDLER,
INFOTIP_HANDLER_DESCRIPTIVE_NAME); 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))) if (FAILED(RegisterPropSheetHandler(ModuleFileName)))
hr = E_FAIL; hr = E_FAIL;
#endif
ApproveShellExtension( ApproveShellExtension(
CLSID_PROPERTYSHEET_HANDLER, CLSID_PROPERTYSHEET_HANDLER,
...@@ -432,23 +440,18 @@ extern "C" STDAPI DllUnregisterServer() ...@@ -432,23 +440,18 @@ extern "C" STDAPI DllUnregisterServer()
{ {
HRESULT hr = S_OK; HRESULT hr = S_OK;
#if defined(_WINXPSDK) && (BUILD_SOSL) /*
if (FAILED(UnregisterColumnHandler())) if (FAILED(UnregisterColumnHandler()))
hr = E_FAIL; hr = E_FAIL;
UnapproveShellExtension(CLSID_COLUMN_HANDLER); UnapproveShellExtension(CLSID_COLUMN_HANDLER);
#endif
#if defined (BUILD_SOSL)
if (FAILED(UnregisterInfotipHandler())) if (FAILED(UnregisterInfotipHandler()))
hr = E_FAIL; hr = E_FAIL;
UnapproveShellExtension(CLSID_INFOTIP_HANDLER); UnapproveShellExtension(CLSID_INFOTIP_HANDLER);
#endif */
if (FAILED(UnregisterPropSheetHandler())) if (FAILED(UnregisterPropSheetHandler()))
hr = E_FAIL; hr = E_FAIL;
...@@ -470,15 +473,7 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) ...@@ -470,15 +473,7 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)
{ {
*ppv = 0; *ppv = 0;
if ((rclsid != CLSID_INFOTIP_HANDLER) && if ((rclsid != CLSID_INFOTIP_HANDLER) && (rclsid != CLSID_COLUMN_HANDLER) && (rclsid != CLSID_PROPERTYSHEET_HANDLER))
#ifdef _WINXPSDK
(rclsid != CLSID_COLUMN_HANDLER) &&
#endif
(rclsid != CLSID_PROPERTYSHEET_HANDLER))
return CLASS_E_CLASSNOTAVAILABLE; return CLASS_E_CLASSNOTAVAILABLE;
if ((riid != IID_IUnknown) && (riid != IID_IClassFactory)) if ((riid != IID_IUnknown) && (riid != IID_IClassFactory))
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: smplmailclient.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -405,6 +405,8 @@ void CSmplMailClient::initRecipientList( ...@@ -405,6 +405,8 @@ void CSmplMailClient::initRecipientList(
ULONG ulRecipClass, ULONG ulRecipClass,
size_t& nPos ) size_t& nPos )
{ {
OSL_PRECOND( nPos < m_RecipientList.size( ), "Wrong index" );
for( sal_Int32 i = 0; i < aRecipList.getLength( ); i++ ) for( sal_Int32 i = 0; i < aRecipList.getLength( ); i++ )
{ {
m_RecipsSmtpAddressList.push_back( m_RecipsSmtpAddressList.push_back(
......
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