From e46a88d536fa058931fcc65130ec742d1c115708 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Wed, 18 Feb 2009 13:14:22 +0000 Subject: CWS-TOOLING: integrate CWS mba31issues01 2009-01-28 12:14:00 +0100 mba r267052 : #i97267#: wrong license file 2009-01-28 11:52:05 +0100 mba r267048 : #i97267#: add dependency to readlicense_oo as some dicts use the OOo license files 2009-01-26 15:47:05 +0100 mba r266934 : correct mistake 2009-01-26 15:42:20 +0100 mba r266933 : #i97403#: new english dictionaries 2009-01-26 15:40:20 +0100 mba r266931 : #i97403#: new english dictionaries 2009-01-26 15:37:32 +0100 mba r266930 : #i92532#: new dictionaries and hyphenation 2009-01-26 15:36:10 +0100 mba r266929 : #i97403#: new canadian dictionaries; remove bogus dependencies 2009-01-26 15:34:38 +0100 mba r266928 : #i97403#: new canadian dictionaries 2009-01-26 09:58:18 +0100 mba r266907 : fixed warning 2009-01-26 09:53:09 +0100 mba r266906 : fixed warning 2009-01-25 20:22:32 +0100 mba r266892 : #i87495#: new property 2009-01-25 18:29:54 +0100 mba r266891 : #i96422#: new serbian dictionary 2009-01-25 00:37:28 +0100 mba r266886 : added include 2009-01-24 18:13:17 +0100 mba r266884 : CWS-TOOLING: rebase CWS mba31issues01 to trunk@266428 (milestone: DEV300:m39) 2009-01-24 11:34:07 +0100 mba r266869 : #i69705#: make nPageCnt a member 2009-01-24 11:30:44 +0100 mba r266868 : #i97490#: harmonize treatment of different protocols in hyperlinks 2009-01-24 11:16:07 +0100 mba r266867 : #i96422#: serbian dictionary 2009-01-21 17:29:33 +0100 mba r266693 : #i94743#: wrong return value after importing meta data 2009-01-16 18:49:21 +0100 mba r266451 : #i87495#: remove last change 2009-01-16 18:49:04 +0100 mba r266450 : #i87495#: remove last change 2009-01-16 18:47:43 +0100 mba r266448 : #i87495#: support for setting PaperBin via API 2009-01-16 18:36:10 +0100 mba r266446 : #i87495#: support for setting PaperBin via API 2009-01-16 18:35:53 +0100 mba r266445 : #i87495#: support for setting PaperBin via API 2009-01-16 18:34:56 +0100 mba r266444 : #159083#: set additional printoptions before printing 2009-01-16 17:00:48 +0100 mba r266437 : #159083#: always create printhelper 2009-01-16 15:39:41 +0100 mba r266427 : prevent adding of OOo licence file 2009-01-15 14:47:08 +0100 mba r266374 : #i84010#: check for missing clipboarddoc 2008-12-05 18:11:04 +0100 mba r264913 : #i92871#: update of swedish dictionary 2008-12-05 18:08:41 +0100 mba r264912 : #i92871#: update of swedish dictionary 2008-12-03 14:56:16 +0100 mba r264788 : #i69705#: nPageCnt must be a member variable 2008-12-03 14:55:40 +0100 mba r264787 : #i69705#: nPageCnt must be a member variable 2008-12-03 12:13:52 +0100 mba r264765 : #i96422#: serbian dictionaries 2008-12-03 12:13:36 +0100 mba r264764 : #i96422#: serbian dictionaries 2008-12-03 11:59:10 +0100 mba r264763 : #i96422#: serbian dictionaries 2008-12-03 11:26:19 +0100 mba r264757 : #i94562#: australian dictionary 2008-12-03 11:22:39 +0100 mba r264756 : #i94562#: australian dictionary; #i88025#: canadian spell checking 2008-12-03 11:21:03 +0100 mba r264755 : #i94562#: australian dictionary 2008-12-03 11:20:00 +0100 mba r264754 : #i94562#: australian dictionary 2008-12-03 10:56:29 +0100 mba r264751 : #i75458#: added optional service 2008-12-03 10:39:54 +0100 mba r264750 : #i96058#: missing parenthesis --- sfx2/source/appl/appopen.cxx | 129 ++++++++++++++++++++++++++++----------- sfx2/source/bastyp/sfxhtml.cxx | 2 + sfx2/source/doc/printhelper.cxx | 22 ++++++- sfx2/source/doc/sfxbasemodel.cxx | 5 ++ 4 files changed, 121 insertions(+), 37 deletions(-) diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 42102e1bee29..93da3dd5e48b 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -52,11 +52,14 @@ #include #include #include +#include #include #include #include #include +#include +#include #include #include @@ -116,6 +119,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::system; using namespace ::com::sun::star::task; +using namespace ::com::sun::star::container; using namespace ::cppu; using namespace ::sfx2; @@ -1120,12 +1124,18 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) const SfxFilter* pFilter = rMatcher.GetFilter4EA( aTypeName ); if ( !pFilter || !( pFilter->IsOwnFormat() )) { - // hyperlink does not link to known type => special handling (http, ftp) browser and (file) OS + // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY ); if ( xSystemShellExecute.is() ) { - if ( aINetProtocol == INET_PROT_FTP || + if ( aINetProtocol == INET_PROT_MAILTO ) + { + // don't dispatch mailto hyperlink to desktop dispatcher + rReq.RemoveItem( SID_TARGETNAME ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_self") ) ); + } + else if ( aINetProtocol == INET_PROT_FTP || aINetProtocol == INET_PROT_HTTP || aINetProtocol == INET_PROT_HTTPS ) { @@ -1150,56 +1160,105 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) return; } - else if ( aINetProtocol == INET_PROT_FILE ) + else { - BOOL bLoadInternal = FALSE; + // check for "internal" protocols that should not be forwarded to the system + Sequence < ::rtl::OUString > aProtocols(2); - // security reservation: => we have to check the referer before executing - if (SFX_APP()->IsSecureURL(rtl::OUString(), &aReferer)) - { - ::rtl::OUString aURLString( aURL.Complete ); + // add special protocols that always should be treated as internal + aProtocols[0] = ::rtl::OUString::createFromAscii("private:*"); + aProtocols[1] = ::rtl::OUString::createFromAscii("vnd.sun.star.*"); - try + try + { + // get registered protocol handlers from configuration + Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), + ::rtl::OUString::createFromAscii("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); + if ( xAccess.is() ) { - // give os this file - xSystemShellExecute->execute( aURLString, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); + Sequence < ::rtl::OUString > aNames = xAccess->getElementNames(); + for ( sal_Int32 nName = 0; nName < aNames.getLength(); nName ++) + { + Reference < XPropertySet > xSet; + Any aRet = xAccess->getByName( aNames[nName] ); + aRet >>= xSet; + if ( xSet.is() ) + { + // copy protocols + aRet = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("Protocols") ); + Sequence < ::rtl::OUString > aTmp; + aRet >>= aTmp; + + // todo: add operator+= to SequenceAsVector class and use SequenceAsVector for aProtocols + sal_Int32 nLength = aProtocols.getLength(); + aProtocols.realloc( nLength+aTmp.getLength() ); + for ( sal_Int32 n=0; nGetTopWindow(); - ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); + bFound = sal_True; + break; } - catch ( ::com::sun::star::system::SystemShellExecuteException& ) + } + + if ( !bFound ) + { + BOOL bLoadInternal = FALSE; + + // security reservation: => we have to check the referer before executing + if (SFX_APP()->IsSecureURL(rtl::OUString(), &aReferer)) { - if ( !pFilter ) + ::rtl::OUString aURLString( aURL.Complete ); + + try + { + // give os this file + xSystemShellExecute->execute( aURLString, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); + } + catch ( ::com::sun::star::lang::IllegalArgumentException& ) { vos::OGuard aGuard( Application::GetSolarMutex() ); Window *pWindow = SFX_APP()->GetTopWindow(); ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); } - else + catch ( ::com::sun::star::system::SystemShellExecuteException& ) { - rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); - bLoadInternal = TRUE; + if ( !pFilter ) + { + vos::OGuard aGuard( Application::GetSolarMutex() ); + Window *pWindow = SFX_APP()->GetTopWindow(); + ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); + } + else + { + rReq.RemoveItem( SID_TARGETNAME ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); + bLoadInternal = TRUE; + } } } - } - else - { - SfxErrorContext aCtx( ERRCTX_SFX_OPENDOC, aURL.Complete ); - ErrorHandler::HandleError( ERRCODE_IO_ACCESSDENIED ); - } + else + { + SfxErrorContext aCtx( ERRCTX_SFX_OPENDOC, aURL.Complete ); + ErrorHandler::HandleError( ERRCODE_IO_ACCESSDENIED ); + } - if ( !bLoadInternal ) - return; - } - else if ( aINetProtocol == INET_PROT_MAILTO ) - { - // don't dispatch mailto hyperlink to desktop dispatcher - rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_self") ) ); + if ( !bLoadInternal ) + return; + } } } } diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 1e0378bbd988..1bad9adc53aa 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -373,6 +373,7 @@ BOOL SfxHTMLParser::ParseMetaOptions( case HTML_META_CHANGEDBY: if (i_xDocProps.is()) { i_xDocProps->setModifiedBy( aContent ); + bChanged = TRUE; } break; @@ -403,6 +404,7 @@ BOOL SfxHTMLParser::ParseMetaOptions( case HTML_META_CONTENT_TYPE: if( aContent.Len() ) rEnc = GetEncodingByMIME( aContent ); + bChanged = TRUE; break; case HTML_META_NONE: diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 51d63d301ffc..07d218fcd690 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -303,7 +303,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperFormat-Property? - if ( rProp.Name.compareToAscii( "PaperFormat" ) == 0 ) + else if ( rProp.Name.compareToAscii( "PaperFormat" ) == 0 ) { if ( ( rProp.Value >>= nPaperFormat ) == sal_False ) { @@ -320,7 +320,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > } // PaperSize-Property? - if ( rProp.Name.compareToAscii( "PaperSize" ) == 0 ) + else if ( rProp.Name.compareToAscii( "PaperSize" ) == 0 ) { awt::Size aTempSize ; if ( ( rProp.Value >>= aTempSize ) == sal_False ) @@ -332,6 +332,24 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > aSetPaperSize = impl_Size_Struct2Object(aTempSize); } } + + // PrinterTray-Property + else if ( rProp.Name.compareToAscii( "PrinterPaperTray" ) == 0 ) + { + rtl::OUString aTmp; + if ( ( rProp.Value >>= aTmp ) == sal_False ) + throw ::com::sun::star::lang::IllegalArgumentException(); + USHORT nCount = pPrinter->GetPaperBinCount(); + for (USHORT nBin=0; nBinGetPaperBinName(nBin) ); + if ( aName == aTmp ) + { + pPrinter->SetPaperBin(nBin); + break; + } + } + } } //os 12.11.98: die PaperSize darf nur gesetzt werden, wenn tatsaechlich diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 09dc93f53f36..5501b153e99c 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2410,6 +2410,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , } else if ( SFX_EVENT_LOADFINISHED == pNamedHint->GetEventId() ) { + impl_getPrintHelper(); ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() ); } else if ( SFX_EVENT_SAVEASDOCDONE == pNamedHint->GetEventId() ) @@ -2423,6 +2424,10 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , addTitle_Impl( aArgs, aTitle ); attachResource( m_pData->m_pObjectShell->GetMedium()->GetName(), aArgs ); } + else if ( SFX_EVENT_DOCCREATED == pNamedHint->GetEventId() ) + { + impl_getPrintHelper(); + } postEvent_Impl( pNamedHint->GetEventId() ); } -- cgit