diff options
147 files changed, 1321 insertions, 767 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 544b0f177eaa..6b844a772e03 100755 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -781,6 +781,15 @@ void BasicFrame::Resize() } } +Rectangle BasicFrame::GetInnerRect() const +{ + Rectangle aRect( Point(0,0), GetOutputSizePixel() ); + aRect.Bottom() = pStatus->GetPosPixel().Y()-1; + if( aRect.Bottom() < 0 ) // sanity check + aRect.Bottom() = 0; + return aRect; +} + void BasicFrame::Move() { Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index af1b95714683..3ef46edc2cb1 100755 --- a/basic/source/app/app.hxx +++ b/basic/source/app/app.hxx @@ -182,6 +182,7 @@ public: void SetAppMode( const String &aNewMode ){ aAppMode = aNewMode; UpdateTitle(); } String GenRealString( const String &aResString ); + Rectangle GetInnerRect() const; }; diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx index d2f8869fd7d8..fc6d5ecfa548 100755 --- a/basic/source/app/appwin.cxx +++ b/basic/source/app/appwin.cxx @@ -120,14 +120,8 @@ void AppWin::Maximize() pFrame->nMaximizedWindows++; nWinState = TT_WIN_STATE_MAX; } - sal_Int32 nTitleHeight; - { - sal_Int32 nDummy1, nDummy2, nDummy3; - pFrame->GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); - } - Size aSize = pFrame->GetOutputSizePixel(); - aSize.Height() -= nTitleHeight; + Size aSize = pFrame->GetInnerRect().GetSize(); aSize.Height() -= 2; aSize.Width() -= 2; SetSizePixel( aSize ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index bd73970b118e..2ac89b548598 100755 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -2070,7 +2070,7 @@ ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String c sCall += ']'; SbxVariable* pRet = pMethod->GetParent()->Execute( sCall ); - if ( pRet ) + if ( pRet && ( pRet != pMethod ) ) *i_retValue = *pRet; return SbxBase::GetError(); } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 4ee2cbf5b9af..7e7304b6ce76 100755..100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -36,6 +36,7 @@ #include <svl/brdcst.hxx> #include <tools/shl.hxx> #include <basic/sbx.hxx> +#include "sbdiagnose.hxx" #include "sb.hxx" #include <sbjsmeth.hxx> #include "sbjsmod.hxx" @@ -1215,6 +1216,10 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth ) GlobalRunDeInit(); +#ifdef DBG_UTIL + ResetCapturedAssertions(); +#endif + // VBA always ensures screenupdating is enabled after completing if ( mbVBACompat ) VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) ); diff --git a/basic/source/inc/sbdiagnose.hxx b/basic/source/inc/sbdiagnose.hxx new file mode 100644 index 000000000000..065efdb183e1 --- /dev/null +++ b/basic/source/inc/sbdiagnose.hxx @@ -0,0 +1,34 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2011 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef BASIC_SBDIAGNOSE_HXX +#define BASIC_SBDIAGNOSE_HXX + +#ifdef DBG_UTIL +void ResetCapturedAssertions(); +#endif + +#endif // BASIC_SBDIAGNOSE_HXX diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index b2f48bd0ab1a..1a417e99c284 100755 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -37,6 +37,7 @@ #include "basic/sbx.hxx" #include "basic/sbxvar.hxx" +#include "runtime.hxx" #include "osl/thread.h" #include "rtl/ref.hxx" #include "rtl/string.hxx" @@ -263,9 +264,15 @@ SbError marshal( std::vector< char > & blob, std::size_t offset, MarshalData & data) { OSL_ASSERT(variable != 0); - if ((variable->GetFlags() & SBX_REFERENCE) == 0) { - if ((variable->GetType() & SbxARRAY) == 0) { - switch (variable->GetType()) { + + SbxDataType eVarType = variable->GetType(); + bool bByVal = (variable->GetFlags() & SBX_REFERENCE) == 0; + if( !bByVal && !SbiRuntime::isVBAEnabled() && eVarType == SbxSTRING ) + bByVal = true; + + if (bByVal) { + if ((eVarType & SbxARRAY) == 0) { + switch (eVarType) { case SbxINTEGER: add(blob, variable->GetInteger(), outer ? 4 : 2, offset); break; @@ -314,8 +321,8 @@ SbError marshal( } } } else { - if ((variable->GetType() & SbxARRAY) == 0) { - switch (variable->GetType()) { + if ((eVarType & SbxARRAY) == 0) { + switch (eVarType) { case SbxINTEGER: case SbxLONG: case SbxSINGLE: diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk index 29969416caab..80066425e3c1 100755 --- a/basic/source/runtime/makefile.mk +++ b/basic/source/runtime/makefile.mk @@ -53,7 +53,8 @@ SLOFILES= \ $(SLO)$/methods.obj \ $(SLO)$/methods1.obj\ $(SLO)$/props.obj \ - $(SLO)$/ddectrl.obj + $(SLO)$/ddectrl.obj \ + $(SLO)$/sbdiagnose.obj .IF "$(GUI)$(CPU)" == "WNTI" SLOFILES+= \ diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx index c129d997ca9d..ea83f89fdd36 100755 --- a/basic/source/runtime/rtlproto.hxx +++ b/basic/source/runtime/rtlproto.hxx @@ -359,6 +359,7 @@ extern RTLFUNC(CDateToIso); extern RTLFUNC(CDateFromIso); extern RTLFUNC(CompatibilityMode); extern RTLFUNC(CDec); +extern RTLFUNC(CaptureAssertions); extern RTLFUNC(Partition); // Fong diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx new file mode 100644 index 000000000000..97bfb0a00814 --- /dev/null +++ b/basic/source/runtime/sbdiagnose.cxx @@ -0,0 +1,134 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2011 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_basic.hxx" + +#include "rtlproto.hxx" +#include "sbdiagnose.hxx" + +#include "basic/sbstar.hxx" + +#include <tools/debug.hxx> +#include <comphelper/flagguard.hxx> + +#ifdef DBG_UTIL + +static DbgChannelId nRestoreChannelId = 0; +static DbgChannelId nAssertionChannelId = 0; +static StarBASICRef xAssertionChannelBasic; +static String sCaptureFunctionName; +static bool bReportingAssertion = false; + +void ResetCapturedAssertions() +{ + if ( nRestoreChannelId != 0 ) + { + DBG_INSTOUTERROR( nRestoreChannelId ); + } + nRestoreChannelId = 0; + xAssertionChannelBasic = NULL; + sCaptureFunctionName = String(); + bReportingAssertion = false; +} + +void DbgReportAssertion( const sal_Char* i_assertionMessage ) +{ + if ( !xAssertionChannelBasic ) + { + ResetCapturedAssertions(); + return; + } + + // prevent infinite recursion + if ( bReportingAssertion ) + return; + ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true ); + + SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) ); + SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING ); + xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) ); + xArguments->Put( xMessageText, 1 ); + + ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments ); + if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 ) + ResetCapturedAssertions(); +} + +#endif + +/// capture assertions, route them to the given given Basic function +RTLFUNC(CaptureAssertions) +{ + (void)bWrite; + + // need exactly one argument + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + +#ifdef DBG_UTIL + DBG_TESTSOLARMUTEX(); + + String const sFunctionName = rPar.Get(1)->GetString(); + if ( sFunctionName.Len() == 0 ) + { + ResetCapturedAssertions(); + return; + } + + if ( nAssertionChannelId == 0 ) + { + // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API? + // A named channel would mean it would appear in the nonpro-debug-options dialog + nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion ); + } + + DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut(); + if ( nCurrentChannelId != nAssertionChannelId ) + { + // remember the current channel + nRestoreChannelId = nCurrentChannelId; + + // set the new channel + DBG_INSTOUTERROR( nAssertionChannelId ); + + // ensure OSL assertions are captured, too + DbgData aData( *DbgGetData() ); + aData.bHookOSLAssert = sal_True; + DbgUpdateOslHook( &aData ); + } + + xAssertionChannelBasic = pBasic; + sCaptureFunctionName = sFunctionName; +#else + (void)pBasic; + (void)rPar; + (void)bWrite; +#endif +} + diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 5576c1619f6a..966e6a63df45 100755 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -188,6 +188,8 @@ static Methods aMethods[] = { { "number", SbxDOUBLE, 0,NULL,0 }, { "CreateObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateObject ),0 }, { "class", SbxSTRING, 0,NULL,0 }, +{ "CaptureAssertions", SbxNULL, 1 | _FUNCTION, RTLNAME(CaptureAssertions), 0 }, + { "methodName", SbxSTRING, 0, NULL, 0 }, { "CreateUnoListener",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 }, { "prefix", SbxSTRING, 0,NULL,0 }, { "typename", SbxSTRING, 0,NULL,0 }, diff --git a/desktop/os2/source/applauncher/makefile.mk b/desktop/os2/source/applauncher/makefile.mk index bf71b57c2fdf..7eec8aee9c23 100755 --- a/desktop/os2/source/applauncher/makefile.mk +++ b/desktop/os2/source/applauncher/makefile.mk @@ -47,7 +47,7 @@ OBJFILES= \ $(OBJ)$/sbase.obj \ $(OBJ)$/smath.obj \ $(OBJ)$/officeloader.obj \ - $(OBJ)$/quickstart.obj + $(OBJ)$/os2quickstart.obj APP1TARGET=swriter APP1NOSAL=TRUE @@ -106,13 +106,13 @@ APP7OBJS = \ $(OBJ)$/launcher.obj\ $(OBJ)$/officeloader.obj -APP8TARGET=quickstart +APP8TARGET=os2quickstart APP8NOSAL=TRUE APP8LINKRES=$(MISC)$/$(TARGET)8.res APP8ICON=$(SOLARRESDIR)$/icons$/ooo-main-app.ico APP8OBJS = \ $(OBJ)$/launcher.obj\ - $(OBJ)$/quickstart.obj + $(OBJ)$/os2quickstart.obj # --- Targets ------------------------------------------------------ diff --git a/desktop/os2/source/applauncher/quickstart.cxx b/desktop/os2/source/applauncher/os2quickstart.cxx index b67389272f77..b67389272f77 100755 --- a/desktop/os2/source/applauncher/quickstart.cxx +++ b/desktop/os2/source/applauncher/os2quickstart.cxx diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 26e9e046535b..68991684d92a 100755 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -17,6 +17,9 @@ dt desktop\win32\source\guistdio nmake - w dt_guistdio dt_inc N dt desktop\win32\source\applauncher nmake - w dt_applauncher dt_inc NULL dt desktop\win32\source\applauncher\ooo nmake - w dt_applauncher_ooo dt_applauncher.w dt_inc NULL dt desktop\win32\source\rebase nmake - w dt_rebase dt_inc NULL +dt desktop\win32\source\QuickStart nmake - w dt_win32_quickstart NULL +dt desktop\win32\source\QuickStart\so nmake - w dt_win32_quickstart_so dt_win32_quickstart.w NULL + dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL dt desktop\unx\source nmake - u dt_uwrapper dt_inc NULL @@ -37,8 +40,8 @@ dt desktop\source\deployment\registry\configuration nmake - all dt_dp_registry_c dt desktop\source\deployment\registry\help nmake - all dt_dp_registry_help dt_inc NULL dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_executable dt_inc NULL dt desktop\scripts nmake - u dt_scripts dt_inc NULL +dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_uwrapper.u dt_usplash.u dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w dt_win32_quickstart_so.w dt_zipintro NULL dt desktop\zipintro nmake - all dt_zipintro NULL -dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_uwrapper.u dt_usplash.u dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w dt_zipintro NULL dt desktop\registry\data\org\openoffice\Office nmake - all sn_regconfig NULL dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL dt desktop\source\registration\com\sun\star\servicetag nmake - all sn_svctag NULL diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index bb18fe3ff945..cb4fa0617293 100755 --- a/desktop/prj/d.lst +++ b/desktop/prj/d.lst @@ -32,7 +32,7 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms ..\%__SRC%\bin\swriter.exe %_DEST%\bin%_EXT%\swriter.exe ..\%__SRC%\bin\sbase.exe %_DEST%\bin%_EXT%\sbase.exe ..\%__SRC%\bin\sweb.exe %_DEST%\bin%_EXT%\sweb.exe -..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe +..\%__SRC%\bin\os2quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe ..\%__SRC%\bin\so\scalc.exe %_DEST%\bin%_EXT%\so\scalc.exe ..\%__SRC%\bin\so\sdraw.exe %_DEST%\bin%_EXT%\so\sdraw.exe ..\%__SRC%\bin\so\simpress.exe %_DEST%\bin%_EXT%\so\simpress.exe @@ -41,6 +41,11 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms ..\%__SRC%\bin\so\sbase.exe %_DEST%\bin%_EXT%\so\sbase.exe ..\%__SRC%\bin\so\sweb.exe %_DEST%\bin%_EXT%\so\sweb.exe +..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe +..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe +..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe +..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe + ..\%__SRC%\misc\soffice.exe.manifest %_DEST%\bin%_EXT%\soffice.exe.manifest ..\%__SRC%\misc\soffice.bin.manifest %_DEST%\bin%_EXT%\soffice.bin.manifest ..\%__SRC%\bin\wrp*.dll %_DEST%\bin%_EXT%\wrp*.dll diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 8442aa4d87cf..6058c22c9a89 100755 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1620,7 +1620,8 @@ int Desktop::Main() // there is no other instance using our data files from a remote host RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" ); m_pLockfile = new Lockfile; - if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) { + if ( !pCmdLineArgs->IsHeadless() && !pCmdLineArgs->IsInvisible() && + !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) { // Lockfile exists, and user clicked 'no' return EXIT_FAILURE; } @@ -1769,7 +1770,7 @@ int Desktop::Main() if ( !pExecGlobals->bRestartRequested ) { - if ((!pCmdLineArgs->WantsToLoadDocument() ) && + if ((!pCmdLineArgs->WantsToLoadDocument() && !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsHeadless() ) && (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && (!bExistsRecoveryData ) && (!bExistsSessionData ) && @@ -2097,9 +2098,9 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r // unfortunately this broke the QUARTZ behavior which is to always run // in quickstart mode since Mac applications do not usually quit // when the last document closes - //#ifndef QUARTZ + #ifndef QUARTZ if ( bQuickstart ) - //#endif + #endif { Sequence< Any > aSeq( 1 ); aSeq[0] <<= bQuickstart; @@ -3173,6 +3174,7 @@ void Desktop::OpenSplashScreen() sal_Bool bVisible = sal_False; // Show intro only if this is normal start (e.g. no server, no quickstart, no printing ) if ( !pCmdLine->IsInvisible() && + !pCmdLine->IsHeadless() && !pCmdLine->IsQuickstart() && !pCmdLine->IsMinimized() && !pCmdLine->IsNoLogo() && diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index 84f3e0ec6444..84f3e0ec6444 100755..100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index a82b69439b60..2c790d047520 100755 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -64,6 +64,7 @@ #include "com/sun/star/ucb/UnsupportedCommandException.hpp" #include "boost/bind.hpp" #include "tools/urlobj.hxx" +#include "unotools/tempfile.hxx" #include "osl/file.hxx" #include <vector> @@ -637,21 +638,12 @@ OUString PackageManagerImpl::insertToActivationLayer( ::ucbhelper::Content sourceContent(sourceContent_); Reference<XCommandEnvironment> xCmdEnv( sourceContent.getCommandEnvironment() ); - OUString destFolder, tempEntry; - if (::osl::File::createTempFile( - m_activePackages_expanded.getLength() == 0 - ? 0 : &m_activePackages_expanded, - 0, &tempEntry ) != ::osl::File::E_None) - throw RuntimeException( - OUSTR("::osl::File::createTempFile() failed!"), 0 ); - if (m_activePackages_expanded.getLength() == 0) { - destFolder = tempEntry; - } - else { - tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); - // tweak user|share to macrofied url: - destFolder = makeURL( m_activePackages, tempEntry ); - } + + String baseDir(m_activePackages_expanded); + ::utl::TempFile aTemp(&baseDir, sal_False); + OUString tempEntry = aTemp.GetURL(); + tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1); + OUString destFolder = makeURL( m_activePackages, tempEntry); destFolder += OUSTR("_"); // prepare activation folder: diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 06b8b68c6f68..6de731f76e75 100755..100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -46,6 +46,7 @@ #include "com/sun/star/beans/StringPair.hpp" #include "com/sun/star/sdbc/XResultSet.hpp" #include "com/sun/star/sdbc/XRow.hpp" +#include "unotools/tempfile.hxx" using namespace ::dp_misc; @@ -226,42 +227,43 @@ OUString PackageRegistryBackend::createFolder( OUString const & relUrl, Reference<ucb::XCommandEnvironment> const & xCmdEnv) { - OUString sDataFolder = makeURL(getCachePath(), relUrl); + const OUString sDataFolder = makeURL(getCachePath(), relUrl); //make sure the folder exist ucbhelper::Content dataContent; ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv); - OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder); - - OUString tempEntry; - if (::osl::File::createTempFile( - &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None) - throw RuntimeException( - OUSTR("::osl::File::createTempFile() failed!"), 0 ); - tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); - OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_"); - ::ucbhelper::Content destFolderContent; - dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv ); - - return destFolder; + const OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder); + const String baseDir(sDataFolder); + const ::utl::TempFile aTemp(&baseDir, sal_True); + const OUString url = aTemp.GetURL(); + return sDataFolder + url.copy(url.lastIndexOf('/')); } +//folderURL can have the extension .tmp or .tmp_ +//Before OOo 3.4 the created a tmp file with osl_createTempFile and +//then created a Folder with a same name and a trailing '_' +//If the folderURL has no '_' then there is no corresponding tmp file. void PackageRegistryBackend::deleteTempFolder( OUString const & folderUrl) { - OSL_ASSERT(folderUrl.getLength() - && folderUrl[folderUrl.getLength() - 1] == '_'); - if (folderUrl.getLength() - && folderUrl[folderUrl.getLength() - 1] == '_') + if (folderUrl.getLength()) { - const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1); erase_path( folderUrl, Reference<XCommandEnvironment>(), false /* no throw: ignore errors */ ); - erase_path( tempFile, Reference<XCommandEnvironment>(), - false /* no throw: ignore errors */ ); + + if (folderUrl[folderUrl.getLength() - 1] == '_') + { + const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1); + erase_path( tempFile, Reference<XCommandEnvironment>(), + false /* no throw: ignore errors */ ); + } } } +//usedFolders can contain folder names which have the extension .tmp or .tmp_ +//Before OOo 3.4 we created a tmp file with osl_createTempFile and +//then created a Folder with a same name and a trailing '_' +//If the folderURL has no '_' then there is no corresponding tmp file. void PackageRegistryBackend::deleteUnusedFolders( OUString const & relUrl, ::std::list< OUString> const & usedFolders) @@ -274,7 +276,7 @@ void PackageRegistryBackend::deleteUnusedFolders( Reference<sdbc::XResultSet> xResultSet( tempFolder.createCursor( Sequence<OUString>( &StrTitle::get(), 1 ), - ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); + ::ucbhelper::INCLUDE_FOLDERS_ONLY ) ); // get all temp directories: ::std::vector<OUString> tempEntries; @@ -294,14 +296,10 @@ void PackageRegistryBackend::deleteUnusedFolders( for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos ) { - //usedFolders contains the urls to the folders which have - //a trailing underscore - const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_"); - - if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) == + if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) == usedFolders.end()) { - deleteTempFolder(tempFolderName); + deleteTempFolder(tempEntries[pos]); } } } diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index f7ad8cb8c5a9..becfc14d254d 100755 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -92,7 +92,10 @@ css::uno::Reference<css::xml::dom::XDocument> BackendDb::getDocument() ::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item); if (err == ::osl::File::E_None) { - m_doc = xDocBuilder->parseURI(m_urlDb); + ::ucbhelper::Content descContent( + m_urlDb, css::uno::Reference<css::ucb::XCommandEnvironment>()); + Reference<css::io::XInputStream> xIn = descContent.openStream(); + m_doc = xDocBuilder->parse(xIn); } else if (err == ::osl::File::E_NOENT) { diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc index 5412f5fb2f6d..be7469563968 100755 --- a/desktop/util/ooverinfo.rc +++ b/desktop/util/ooverinfo.rc @@ -86,7 +86,7 @@ VS_VERSION_INFO versioninfo 15 ICON "icons\\oasis-formula.ico" 16 ICON "icons\\oasis-web-template.ico" 17 ICON "icons\\empty-document.ico" -18 ICON "icons\\ooo-configuration.ico" +18 ICON "icons\\empty-document.ico" 19 ICON "icons\\ooo3_open.ico" 20 ICON "icons\\empty-document.ico" 21 ICON "icons\\ooo3_writer_app.ico" diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc index 17af6818551e..caacb294122d 100755 --- a/desktop/util/ooverinfo2.rc +++ b/desktop/util/ooverinfo2.rc @@ -50,7 +50,7 @@ ICON 14 "icons/oasis-database.ico" ICON 15 "icons/oasis-formula.ico" ICON 16 "icons/oasis-web-template.ico" ICON 17 "icons/empty-document.ico" -ICON 18 "icons/ooo-configuration.ico" +ICON 18 "icons/empty-document.ico" ICON 19 "icons/ooo-open.ico" ICON 20 "icons/empty-document.ico" ICON 21 "icons/ooo-writer-app.ico" diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc index 7fce1e773a14..f24dff55169e 100755..100644 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -91,8 +91,8 @@ VS_VERSION_INFO versioninfo 15 ICON "icons\\oasis-formula.ico" 16 ICON "icons\\oasis-web-template.ico" 17 ICON "icons\\empty-document.ico" -18 ICON "icons\\so8-configuration.ico" -19 ICON "icons\\so9_open.ico" +18 ICON "icons\\empty-document.ico" +19 ICON "icons\\so9_main_app.ico" 20 ICON "icons\\empty-document.ico" 21 ICON "icons\\so9_writer_app.ico" 22 ICON "icons\\so9_calc_app.ico" diff --git a/sysui/source/win32/QuickStart/OOQuickStart.rc b/desktop/win32/source/QuickStart/OOQuickStart.rc index 0dc4dab256b6..9baf7e864f5f 100755 --- a/sysui/source/win32/QuickStart/OOQuickStart.rc +++ b/desktop/win32/source/QuickStart/OOQuickStart.rc @@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" -IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" -IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" -ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico" +ICON_ACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico" +IDI_QUICKSTART ICON DISCARDABLE "icons/ooo3_main_app.ico" +IDI_SMALL ICON DISCARDABLE "icons/ooo3_main_app.ico" +ICON_INACTIVE ICON DISCARDABLE "icons/ooo3_main_app.ico" ///////////////////////////////////////////////////////////////////////////// diff --git a/sysui/source/win32/QuickStart/QuickStart.cpp b/desktop/win32/source/QuickStart/QuickStart.cpp index 999701da985a..999701da985a 100755 --- a/sysui/source/win32/QuickStart/QuickStart.cpp +++ b/desktop/win32/source/QuickStart/QuickStart.cpp diff --git a/sysui/source/win32/QuickStart/QuickStart.h b/desktop/win32/source/QuickStart/QuickStart.h index b61a04075e08..b61a04075e08 100755 --- a/sysui/source/win32/QuickStart/QuickStart.h +++ b/desktop/win32/source/QuickStart/QuickStart.h diff --git a/sysui/source/win32/QuickStart/StdAfx.h b/desktop/win32/source/QuickStart/StdAfx.h index f5277a01332c..f5277a01332c 100755 --- a/sysui/source/win32/QuickStart/StdAfx.h +++ b/desktop/win32/source/QuickStart/StdAfx.h diff --git a/sysui/source/win32/QuickStart/makefile.mk b/desktop/win32/source/QuickStart/makefile.mk index 41242d849dfb..41242d849dfb 100755..100644 --- a/sysui/source/win32/QuickStart/makefile.mk +++ b/desktop/win32/source/QuickStart/makefile.mk diff --git a/sysui/source/win32/QuickStart/resource.h b/desktop/win32/source/QuickStart/resource.h index dc4a70ab5193..dc4a70ab5193 100755 --- a/sysui/source/win32/QuickStart/resource.h +++ b/desktop/win32/source/QuickStart/resource.h diff --git a/sysui/source/win32/QuickStart/so/QuickStart.rc b/desktop/win32/source/QuickStart/so/QuickStart.rc index c48dc2358d0d..732904dc745a 100755 --- a/sysui/source/win32/QuickStart/so/QuickStart.rc +++ b/desktop/win32/source/QuickStart/so/QuickStart.rc @@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" -IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" -IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" -ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico" +ICON_ACTIVE ICON DISCARDABLE "icons/so9_main_app.ico" +IDI_QUICKSTART ICON DISCARDABLE "icons/so9_main_app.ico" +IDI_SMALL ICON DISCARDABLE "icons/so9_main_app.ico" +ICON_INACTIVE ICON DISCARDABLE "icons/so9_main_app.ico" ///////////////////////////////////////////////////////////////////////////// diff --git a/sysui/source/win32/QuickStart/so/makefile.mk b/desktop/win32/source/QuickStart/so/makefile.mk index 6c7897232576..50154c7d50b2 100755 --- a/sysui/source/win32/QuickStart/so/makefile.mk +++ b/desktop/win32/source/QuickStart/so/makefile.mk @@ -41,6 +41,8 @@ UWINAPILIB = # --- Resources ---------------------------------------------------- +.IF "$(LINK_SO)"=="TRUE" + RCFILES=QuickStart.rc INCPRE=.. @@ -68,6 +70,8 @@ APP1STDLIBS+=$(SHELL32LIB)\ APP1NOSVRES=$(RES)$/$(TARGET).res +.ENDIF # "$(LINK_SO)"=="TRUE" + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk index f0f5743f38a1..d08309bbed24 100755 --- a/desktop/win32/source/applauncher/makefile.mk +++ b/desktop/win32/source/applauncher/makefile.mk @@ -53,6 +53,7 @@ OBJFILES= \ $(OBJ)$/sweb.obj # SO launcher +.IF "$(LINK_SO)"=="TRUE" .IF "$(BUILD_SPECIAL)"!="" APP1DEPN= $(APP1RES) verinfo.rc APP1TARGET=so$/swriter @@ -139,7 +140,8 @@ APP7VERINFO=verinfo.rc APP7PRODUCTDEF+=-DRES_APP_NAME=sweb -.ENDIF # "$(BUILD_SPECIAL)"!="" +.ENDIF # "$(BUILD_SPECIAL)"!="" +.ENDIF # "$(LINK_SO)"=="TRUE" # --- Targets ------------------------------------------------------ diff --git a/desktop/win32/source/guiloader/makefile.mk b/desktop/win32/source/guiloader/makefile.mk index 5bb1c523ff19..7912471fba13 100755 --- a/desktop/win32/source/guiloader/makefile.mk +++ b/desktop/win32/source/guiloader/makefile.mk @@ -48,14 +48,16 @@ APP1OBJS=\ $(SOLARLIBDIR)$/pathutils-obj.obj STDLIB1=$(SHLWAPILIB) +.IF "$(LINK_SO)"=="TRUE" APP2TARGET=so$/guiloader APP2NOSAL=TRUE -APP2ICON=$(SOLARRESDIR)$/icons/so8-main-app.ico +APP2ICON=$(SOLARRESDIR)$/icons/so9_main_app.ico APP2OBJS=\ $(OBJ)$/extendloaderenvironment.obj \ $(OBJ)$/genericloader.obj \ $(SOLARLIBDIR)$/pathutils-obj.obj STDLIB2=$(SHLWAPILIB) +.ENDIF # "$(LINK_SO)"=="TRUE" # --- Targets ------------------------------------------------------ diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx index 6db7858d27ba..3aac10a7bd90 100755 --- a/editeng/inc/editeng/fontitem.hxx +++ b/editeng/inc/editeng/fontitem.hxx @@ -82,30 +82,23 @@ public: String &rText, const IntlWrapper * = 0 ) const; // Access methods: - inline String &GetFamilyName() { return aFamilyName; } + void SetFamilyName( const String& rFamilyName ) { aFamilyName = rFamilyName; } inline const String &GetFamilyName() const { return aFamilyName; } - inline String &GetStyleName() { return aStyleName; } + void SetStyleName(const String &rStyleName ) { aStyleName = rStyleName; } inline const String &GetStyleName() const { return aStyleName; } - inline FontFamily &GetFamily() { return eFamily; } + void SetFamily( FontFamily _eFamily ) { eFamily = _eFamily; } inline FontFamily GetFamily() const { return eFamily; } - inline FontPitch &GetPitch() { return ePitch; } + void SetPitch(FontPitch _ePitch ) { ePitch = _ePitch; } inline FontPitch GetPitch() const { return ePitch; } - inline rtl_TextEncoding &GetCharSet() { return eTextEncoding; } + void SetCharSet(rtl_TextEncoding _eEncoding) { eTextEncoding = _eEncoding; } + inline rtl_TextEncoding GetCharSet() const { return eTextEncoding; } - inline SvxFontItem& operator=(const SvxFontItem& rFont) - { - aFamilyName = rFont.GetFamilyName(); - aStyleName = rFont.GetStyleName(); - eFamily = rFont.GetFamily(); - ePitch = rFont.GetPitch(); - eTextEncoding = rFont.GetCharSet(); - return *this; - } + SvxFontItem& operator=(const SvxFontItem& rFont); static void EnableStoreUnicodeNames( sal_Bool bEnable ); diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx index d2a40e185bc3..0659b737949a 100755 --- a/editeng/inc/editeng/svxacorr.hxx +++ b/editeng/inc/editeng/svxacorr.hxx @@ -82,6 +82,7 @@ public: virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0; virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0; virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0; + virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0; virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) = 0; diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 99eacb52f5f0..4a3c4cfe29db 100755 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1424,7 +1424,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) if ( hConv ) { SvxFontItem aNewFontItem( rFontItem ); - aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv ); + aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) ); pC->GetAttribs().Remove( nAttr ); XEditAttribute* pNewAttr = CreateAttrib( aNewFontItem, pAttr->GetStart(), pAttr->GetEnd() ); @@ -1455,7 +1455,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) if ( hConv ) { SvxFontItem aNewFontItem( rFontItem ); - aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv ); + aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) ); pC->GetParaAttribs().Put( aNewFontItem ); for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ ) diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index ba4cd3012a3c..e7d8538f7765 100755 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -581,8 +581,13 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt ) sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt ) { + return ReplaceRange( nPos, rTxt.Len(), rTxt ); +} + +sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt ) +{ // Actually a Replace introduce => corresponds to UNDO - sal_uInt16 nEnd = nPos+rTxt.Len(); + sal_uInt16 nEnd = nPos+nSourceLength; if ( nEnd > pCurNode->Len() ) nEnd = pCurNode->Len(); diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index ad490ecd737a..112276627367 100755 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -159,6 +159,7 @@ public: virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd ); virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt ); virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt ); + virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ); virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index c4bbd3879600..871b34ebbffa 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1614,11 +1614,11 @@ void ImpEditEngine::SetLanguageAndFont( { // set new font attribute SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId ); - aFontItem.GetFamilyName() = pFont->GetName(); - aFontItem.GetFamily() = pFont->GetFamily(); - aFontItem.GetStyleName() = pFont->GetStyleName(); - aFontItem.GetPitch() = pFont->GetPitch(); - aFontItem.GetCharSet() = pFont->GetCharSet(); + aFontItem.SetFamilyName( pFont->GetName()); + aFontItem.SetFamily( pFont->GetFamily()); + aFontItem.SetStyleName( pFont->GetStyleName()); + aFontItem.SetPitch( pFont->GetPitch()); + aFontItem.SetCharSet( pFont->GetCharSet() ); aNewSet.Put( aFontItem ); } diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 931c58214fbd..623e978b3065 100755 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -275,11 +275,11 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, { // set new font attribute SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId ); - aFontItem.GetFamilyName() = pFont->GetName(); - aFontItem.GetFamily() = pFont->GetFamily(); - aFontItem.GetStyleName() = pFont->GetStyleName(); - aFontItem.GetPitch() = pFont->GetPitch(); - aFontItem.GetCharSet() = pFont->GetCharSet(); + aFontItem.SetFamilyName( pFont->GetName()); + aFontItem.SetFamily( pFont->GetFamily()); + aFontItem.SetStyleName( pFont->GetStyleName()); + aFontItem.SetPitch( pFont->GetPitch()); + aFontItem.SetCharSet(pFont->GetCharSet()); aNewSet.Put( aFontItem ); } diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 23a3ce8f3c80..dc272096cbd1 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -376,6 +376,8 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat ) { + if (& rFormat == this) { return *this; } + SetNumberingType(rFormat.GetNumberingType()); eNumAdjust = rFormat.eNumAdjust ; nInclUpperLevels = rFormat.nInclUpperLevels ; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index ac2e0fd530d3..f4f03f739130 100644..100755 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -256,6 +256,16 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName, } // ----------------------------------------------------------------------- +SvxFontItem& SvxFontItem::operator=(const SvxFontItem& rFont) +{ + aFamilyName = rFont.GetFamilyName(); + aStyleName = rFont.GetStyleName(); + eFamily = rFont.GetFamily(); + ePitch = rFont.GetPitch(); + eTextEncoding = rFont.GetCharSet(); + return *this; +} +// ----------------------------------------------------------------------- bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { @@ -3712,11 +3722,11 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo aOutTypeArr[ n ].nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0 ) ); SvxFontItem* pItem = aItemArr[ n ]; - pItem->GetFamily() = aFont.GetFamily(); - pItem->GetFamilyName() = aFont.GetName(); - pItem->GetStyleName().Erase(); - pItem->GetPitch() = aFont.GetPitch(); - pItem->GetCharSet() = aFont.GetCharSet(); + pItem->SetFamily( aFont.GetFamily() ); + pItem->SetFamilyName( aFont.GetName() ); + pItem->SetStyleName( String() ); + pItem->SetPitch( aFont.GetPitch()); + pItem->SetCharSet(aFont.GetCharSet()); } } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 5fbaea20b9eb..94390c112410 100644..100755 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/i18n/UnicodeType.hdl> #include <unotools/collatorwrapper.hxx> #include <com/sun/star/i18n/CollatorOptions.hpp> +#include <com/sun/star/i18n/UnicodeScript.hpp> #include <unotools/localedatawrapper.hxx> #include <unotools/transliterationwrapper.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -141,6 +142,41 @@ inline int IsUpperLetter( sal_Int32 nCharType ) 0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType); } +bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt, + xub_StrLen nStt, xub_StrLen nEnd ) +{ + for( ; nStt < nEnd; ++nStt ) + { +#if OSL_DEBUG_LEVEL > 1 + sal_Int32 nCharType; + sal_Int32 nChType; + nCharType = rCC.getCharacterType( rTxt, nStt ); + nChType = rCC.getType( rTxt, nStt ); +#endif + short nScript = rCC.getScript( rTxt, nStt ); + switch( nScript ) + { + case ::com::sun::star::i18n::UnicodeScript_kCJKRadicalsSupplement: + case ::com::sun::star::i18n::UnicodeScript_kHangulJamo: + case ::com::sun::star::i18n::UnicodeScript_kCJKSymbolPunctuation: + case ::com::sun::star::i18n::UnicodeScript_kHiragana: + case ::com::sun::star::i18n::UnicodeScript_kKatakana: + case ::com::sun::star::i18n::UnicodeScript_kHangulCompatibilityJamo: + case ::com::sun::star::i18n::UnicodeScript_kEnclosedCJKLetterMonth: + case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibility: + case ::com::sun::star::i18n::UnicodeScript_k_CJKUnifiedIdeographsExtensionA: + case ::com::sun::star::i18n::UnicodeScript_kCJKUnifiedIdeograph: + case ::com::sun::star::i18n::UnicodeScript_kHangulSyllable: + case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibilityIdeograph: + case ::com::sun::star::i18n::UnicodeScript_kHalfwidthFullwidthForm: + return true; + default: ; //do nothing + } + + } + return false; +} + sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt, xub_StrLen nStt, xub_StrLen nEnd ) { @@ -455,7 +491,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, sal_Unicode cSave = rTxt.GetChar( nSttPos ); String sChar( cSave ); rCC.toLower( sChar ); - if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar )) + if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar )) { if( SaveWordWrdSttLst & nFlags ) rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave ); @@ -886,7 +922,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, String sChar( *pWordStt ); rCC.toUpper( sChar ); return sChar != *pWordStt && - rDoc.Replace( xub_StrLen( pWordStt - pStart ), sChar ); + rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar ); } aText = *pPrevPara; @@ -1061,7 +1097,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() ); String sChar( cSave ); rCC.toUpper( sChar ); - sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ); + sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ); // Parahaps someone wants to have the word if( bRet && SaveWordCplSttLst & nFlags ) @@ -1323,6 +1359,7 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, eLang = MsLangId::getSystemLanguage(); CharClass& rCC = GetCharClass( eLang ); + // no symbol characters if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos )) break; diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx index cdd528d44900..fc41fdaf2d85 100755 --- a/editeng/source/uno/unofdesc.cxx +++ b/editeng/source/uno/unofdesc.cxx @@ -90,11 +90,11 @@ void SvxUnoFontDescriptor::FillItemSet( const awt::FontDescriptor& rDesc, SfxIte { SvxFontItem aFontItem( EE_CHAR_FONTINFO ); - aFontItem.GetFamilyName()= rDesc.Name; - aFontItem.GetStyleName() = rDesc.StyleName; - aFontItem.GetFamily() = (FontFamily)rDesc.Family; - aFontItem.GetCharSet() = rDesc.CharSet; - aFontItem.GetPitch() = (FontPitch)rDesc.Pitch; + aFontItem.SetFamilyName( rDesc.Name); + aFontItem.SetStyleName( rDesc.StyleName); + aFontItem.SetFamily( (FontFamily)rDesc.Family); + aFontItem.SetCharSet( rDesc.CharSet ); + aFontItem.SetPitch( (FontPitch)rDesc.Pitch); rSet.Put(aFontItem); } diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx index be65a5e54041..009c4210ce32 100755 --- a/framework/inc/services/substitutepathvars.hxx +++ b/framework/inc/services/substitutepathvars.hxx @@ -37,7 +37,7 @@ #include <boost/unordered_map.hpp> //_________________________________________________________________________________________________________________ -// my own includes +// my own includes //_________________________________________________________________________________________________________________ #include <threadhelp/threadhelpbase.hxx> #include <macros/generic.hxx> @@ -47,7 +47,7 @@ #include <stdtypes.h> //_________________________________________________________________________________________________________________ -// interface includes +// interface includes //_________________________________________________________________________________________________________________ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> @@ -55,7 +55,7 @@ #include <com/sun/star/util/XStringSubstitution.hpp> //_________________________________________________________________________________________________________________ -// other includes +// other includes //_________________________________________________________________________________________________________________ #include <cppuhelper/implbase2.hxx> #include <rtl/ustring.hxx> @@ -69,24 +69,24 @@ namespace framework // Must be zero value based enum EnvironmentType { - ET_HOST = 0 , - ET_YPDOMAIN , - ET_DNSDOMAIN , - ET_NTDOMAIN , - ET_OS , - ET_UNKNOWN , - ET_COUNT + ET_HOST = 0 , + ET_YPDOMAIN , + ET_DNSDOMAIN , + ET_NTDOMAIN , + ET_OS , + ET_UNKNOWN , + ET_COUNT }; // Must be zero value based enum OperatingSystem { - OS_WINDOWS = 0, - OS_UNIX , - OS_SOLARIS , - OS_LINUX , - OS_UNKNOWN , - OS_COUNT + OS_WINDOWS = 0, + OS_UNIX , + OS_SOLARIS , + OS_LINUX , + OS_UNKNOWN , + OS_COUNT }; struct SubstituteRule @@ -98,19 +98,20 @@ struct SubstituteRule EnvironmentType aType ) : aSubstVariable( aVarName ), aSubstValue( aValue ), aEnvValue( aVal ), aEnvType( aType ) {} - rtl::OUString aSubstVariable; - rtl::OUString aSubstValue; - com::sun::star::uno::Any aEnvValue; - EnvironmentType aEnvType; + rtl::OUString aSubstVariable; + rtl::OUString aSubstValue; + com::sun::star::uno::Any aEnvValue; + EnvironmentType aEnvType; }; struct SubstitutePathNotify { SubstitutePathNotify() {}; + const com::sun::star::uno::Sequence<rtl::OUString> aPropertyNames; }; -class SubstituteVariables : public ::boost::unordered_map< ::rtl::OUString, +class SubstituteVariables : public ::boost::unordered_map< ::rtl::OUString, SubstituteRule, OUStringHashCode, ::std::equal_to< ::rtl::OUString > > @@ -132,45 +133,45 @@ class SubstitutePathVariables_Impl : public utl::ConfigItem static OperatingSystem GetOperatingSystemFromString( const rtl::OUString& ); static EnvironmentType GetEnvTypeFromString( const rtl::OUString& ); - void GetSharePointsRules( SubstituteVariables& aSubstVarMap ); + void GetSharePointsRules( SubstituteVariables& aSubstVarMap ); /** is called from the ConfigManager before application ends or from the PropertyChangeListener if the sub tree broadcasts changes. */ - virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); - virtual void Commit(); - - private: - // Wrapper methods for low-level functions - OperatingSystem GetOperatingSystem(); - const rtl::OUString& GetYPDomainName(); - const rtl::OUString& GetDNSDomainName(); - const rtl::OUString& GetNTDomainName(); - const rtl::OUString& GetHostName(); - - sal_Bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ); - - void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq ); - void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName, - const rtl::OUString& aSharePointNodeName, - SubstituteRuleVector& aRuleSet ); - - // Stored values for domains and host - sal_Bool m_bYPDomainRetrieved; - rtl::OUString m_aYPDomain; - sal_Bool m_bDNSDomainRetrieved; - rtl::OUString m_aDNSDomain; - sal_Bool m_bNTDomainRetrieved; - rtl::OUString m_aNTDomain; - sal_Bool m_bHostRetrieved; - rtl::OUString m_aHost; - sal_Bool m_bOSRetrieved; - OperatingSystem m_eOSType; - - Link m_aListenerNotify; - const rtl::OUString m_aSharePointsNodeName; - const rtl::OUString m_aDirPropertyName; - const rtl::OUString m_aEnvPropertyName; - const rtl::OUString m_aLevelSep; + virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); + virtual void Commit(); + + private: + // Wrapper methods for low-level functions + OperatingSystem GetOperatingSystem(); + const rtl::OUString& GetYPDomainName(); + const rtl::OUString& GetDNSDomainName(); + const rtl::OUString& GetNTDomainName(); + const rtl::OUString& GetHostName(); + + bool FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ); + + void ReadSharePointsFromConfiguration( com::sun::star::uno::Sequence< rtl::OUString >& aSharePointsSeq ); + void ReadSharePointRuleSetFromConfiguration( const rtl::OUString& aSharePointName, + const rtl::OUString& aSharePointNodeName, + SubstituteRuleVector& aRuleSet ); + + // Stored values for domains and host + bool m_bYPDomainRetrieved; + rtl::OUString m_aYPDomain; + bool m_bDNSDomainRetrieved; + rtl::OUString m_aDNSDomain; + bool m_bNTDomainRetrieved; + rtl::OUString m_aNTDomain; + bool m_bHostRetrieved; + rtl::OUString m_aHost; + bool m_bOSRetrieved; + OperatingSystem m_eOSType; + + Link m_aListenerNotify; + const rtl::OUString m_aSharePointsNodeName; + const rtl::OUString m_aDirPropertyName; + const rtl::OUString m_aEnvPropertyName; + const rtl::OUString m_aLevelSep; }; enum PreDefVariable @@ -234,8 +235,8 @@ struct ReSubstUserVarOrder typedef std::list< ReSubstFixedVarOrder > ReSubstFixedVarOrderVector; typedef std::list< ReSubstUserVarOrder > ReSubstUserVarOrderVector; -class SubstitutePathVariables : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses. - public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo> +class SubstitutePathVariables : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses. + public ::cppu::WeakImplHelper2< ::com::sun::star::util::XStringSubstitution, css::lang::XServiceInfo > { friend class SubstitutePathVariables_Impl; @@ -254,51 +255,51 @@ class SubstitutePathVariables : private ThreadHelpBase virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - protected: - DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* ); - - void SetPredefinedPathVariables( PredefinedPathVariables& ); - rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const; - - // Special case (transient) values can change during runtime! - // Don't store them in the pre defined struct - rtl::OUString GetWorkPath() const; - rtl::OUString GetWorkVariableValue() const; - rtl::OUString GetPathVariableValue() const; - - rtl::OUString GetHomeVariableValue() const; - - // XStringSubstitution implementation methods - rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, sal_Bool bSustRequired ) - throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText ) - throw (::com::sun::star::uno::RuntimeException); - ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable ) - throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - - private: - class VarNameToIndexMap : public boost::unordered_map< ::rtl::OUString, - PreDefVariable, - OUStringHashCode, - ::std::equal_to< ::rtl::OUString > > - { - inline void free() + protected: + DECL_LINK( implts_ConfigurationNotify, SubstitutePathNotify* ); + + void SetPredefinedPathVariables( PredefinedPathVariables& ); + rtl::OUString ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const; + + // Special case (transient) values can change during runtime! + // Don't store them in the pre defined struct + rtl::OUString GetWorkPath() const; + rtl::OUString GetWorkVariableValue() const; + rtl::OUString GetPathVariableValue() const; + + rtl::OUString GetHomeVariableValue() const; + + // XStringSubstitution implementation methods + rtl::OUString impl_substituteVariable( const ::rtl::OUString& aText, bool bSustRequired ) + throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + rtl::OUString impl_reSubstituteVariables( const ::rtl::OUString& aText ) + throw (::com::sun::star::uno::RuntimeException); + ::rtl::OUString impl_getSubstituteVariableValue( const ::rtl::OUString& variable ) + throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + private: + class VarNameToIndexMap : public boost::unordered_map< ::rtl::OUString, + PreDefVariable, + OUStringHashCode, + ::std::equal_to< ::rtl::OUString > > { - VarNameToIndexMap().swap( *this ); - } - }; - - // heavy used string - const rtl::OUString m_aVarStart; - const rtl::OUString m_aVarEnd; - - VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access - SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name! - PredefinedPathVariables m_aPreDefVars; // All predefined variables - SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration - ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) - ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + inline void free() + { + VarNameToIndexMap().swap( *this ); + } + }; + + // heavy used string + const rtl::OUString m_aVarStart; + const rtl::OUString m_aVarEnd; + + VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access + SubstituteVariables m_aSubstVarMap; // Active rule set map indexed by variable name! + PredefinedPathVariables m_aPreDefVars; // All predefined variables + SubstitutePathVariables_Impl m_aImpl; // Implementation class that access the configuration + ReSubstFixedVarOrderVector m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) + ReSubstUserVarOrderVector m_aReSubstUserVarOrder; // To speed up resubstitution user variables + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; }; } diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java index aeea9907e6bc..e936fbf6ccad 100755 --- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java +++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java @@ -63,20 +63,20 @@ public class PathSubstitutionTest /** * Create an array with all substitution variables */ - @Before private void initialize() + @Before public void initialize() { substVars = new VariableContainer(); - substVars.add("$(prog)", false, true); - substVars.add("$(inst)", false, true); - substVars.add("$(user)", false, true); - substVars.add("$(work)", false, true); - substVars.add("$(home)", false, true); - substVars.add("$(temp)", false, true); + substVars.add("$(prog)", true, true); + substVars.add("$(inst)", true, true); + substVars.add("$(user)", true, true); + substVars.add("$(work)", true, true); + substVars.add("$(home)", true, true); + substVars.add("$(temp)", true, true); substVars.add("$(lang)", false, false); substVars.add("$(langid)", false, false); substVars.add("$(vlang)", false, false); // path won't resubstitute - substVars.add("$(path)", false, false); + substVars.add("$(path)", true, false); } /** @@ -106,8 +106,6 @@ public class PathSubstitutionTest return; } -// initialize(); - for (int i = 0; i < substVars.size(); i++) { String var = substVars.getVariable(i); @@ -148,6 +146,12 @@ public class PathSubstitutionTest //in middle of text works substString = "file:///starting/" + var + "/path"; + String sCanSubstAllPos; + if (substVars.onlySubstituteAtBegin(i)) + sCanSubstAllPos = "NO"; + else + sCanSubstAllPos = "YES"; + System.out.println("Variable can substitute within string: "+sCanSubstAllPos); System.out.println("Substitute '" + substString + "'"); newValue = oObj.substituteVariables(substString, false); System.out.println("Return value '" + newValue + "'"); diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk new file mode 100644 index 000000000000..38a6cf7cced8 --- /dev/null +++ b/framework/qa/unoapi/makefile.mk @@ -0,0 +1,48 @@ +#************************************************************************* +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +#***********************************************************************/ + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ = ../.. +PRJNAME = framework +TARGET = qa_unoapi + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/framework/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk + +ALLTAR : javatest + +.END diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 729b84481681..14f6dc954588 100755 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -397,7 +397,7 @@ void BackingWindow::prepareRecentFileMenu() void BackingWindow::initBackground() { - SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() ); + SetBackground(); bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode(); if( bDark ) @@ -705,36 +705,39 @@ void BackingWindow::layoutButton( void BackingWindow::Paint( const Rectangle& ) { + Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() ); + Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); + Rectangle aBmpRect(maControlRect); + aBmpRect.Left() -= nShadowLeft; + aBmpRect.Top() -= nShadowTop; + aBmpRect.Right() += nShadowRight; + aBmpRect.Bottom() += nShadowBottom; + aClip.Exclude( aBmpRect ); + Push( PUSH_CLIPREGION ); + IntersectClipRegion( aClip ); + DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack ); + Pop(); + + VirtualDevice aDev( *this ); + aDev.EnableRTL( IsRTLEnabled() ); + aDev.SetOutputSizePixel( aBmpRect.GetSize() ); + Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() ); + aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); // draw bitmap - if( GetSettings().GetLayoutRTL() ) + Point aTL( 0, 0 ); + aDev.DrawBitmapEx( aTL, maBackgroundLeft ); + aTL.X() += maBackgroundLeft.GetSizePixel().Width(); + if( !!maBackgroundMiddle ) { - Point aTL( maControlRect.TopLeft() ); - aTL.X() -= nShadowRight; - aTL.Y() -= nShadowTop; - DrawBitmapEx( aTL, maBackgroundLeft ); - aTL.X() += maBackgroundLeft.GetSizePixel().Width(); - if( !!maBackgroundMiddle ) - { - DrawBitmapEx( aTL, maBackgroundMiddle ); - aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); - } - DrawBitmapEx( aTL, maBackgroundRight ); - } - else - { - Point aTL( maControlRect.TopLeft() ); - aTL.X() -= nShadowLeft; - aTL.Y() -= nShadowTop; - DrawBitmapEx( aTL, maBackgroundLeft ); - aTL.X() += maBackgroundLeft.GetSizePixel().Width(); - if( !!maBackgroundMiddle ) - { - DrawBitmapEx( aTL, maBackgroundMiddle ); - aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); - } - DrawBitmapEx( aTL, maBackgroundRight ); + aDev.DrawBitmapEx( aTL, maBackgroundMiddle ); + aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); } + aDev.DrawBitmapEx( aTL, maBackgroundRight ); + + DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(), + Point( 0, 0 ), aBmpRect.GetSize(), + aDev ); } long BackingWindow::Notify( NotifyEvent& rNEvt ) diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 9c881abbdc51..757818aa4c17 100755 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -30,7 +30,7 @@ #include "precompiled_framework.hxx" //_________________________________________________________________________________________________________________ -// my own includes +// my own includes //_________________________________________________________________________________________________________________ #include "services/substitutepathvars.hxx" #include <threadhelp/resetableguard.hxx> @@ -38,12 +38,12 @@ #include "services.h" //_________________________________________________________________________________________________________________ -// interface includes +// interface includes //_________________________________________________________________________________________________________________ #include <com/sun/star/beans/XPropertySet.hpp> //_________________________________________________________________________________________________________________ -// includes of other projects +// includes of other projects //_________________________________________________________________________________________________________________ #include <unotools/configitem.hxx> #include <unotools/localfilehelper.hxx> @@ -68,64 +68,65 @@ #include <string.h> //_________________________________________________________________________________________________________________ -// Defines +// Defines //_________________________________________________________________________________________________________________ // -#define STRPOS_NOTFOUND (sal_Int32)-1 +#define STRPOS_NOTFOUND (sal_Int32)-1 -#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val )) +#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val )) -#define SEARCHPATH_DELIMITER ';' +#define SEARCHPATH_DELIMITER ';' // Variable start/end characters -#define SIGN_STARTVARIABLE ASCII_STR("$(") -#define SIGN_ENDVARIABLE ASCII_STR(")") +#define SIGN_STARTVARIABLE ASCII_STR("$(") +#define SIGN_ENDVARIABLE ASCII_STR(")") // Length of SUBSTITUTE_... to replace it with real values. -#define REPLACELENGTH_INST 7 -#define REPLACELENGTH_PROG 7 -#define REPLACELENGTH_USER 7 -#define REPLACELENGTH_WORK 7 -#define REPLACELENGTH_HOME 7 -#define REPLACELENGTH_TEMP 7 -#define REPLACELENGTH_PATH 7 +#define REPLACELENGTH_INST 7 +#define REPLACELENGTH_PROG 7 +#define REPLACELENGTH_USER 7 +#define REPLACELENGTH_WORK 7 +#define REPLACELENGTH_HOME 7 +#define REPLACELENGTH_TEMP 7 +#define REPLACELENGTH_PATH 7 #define REPLACELENGTH_INSTPATH 11 #define REPLACELENGTH_PROGPATH 11 #define REPLACELENGTH_USERPATH 11 #define REPLACELENGTH_INSTURL 10 #define REPLACELENGTH_PROGURL 10 #define REPLACELENGTH_USERURL 10 -#define REPLACELENGTH_PATH 7 -#define REPLACELENGTH_LANG 7 -#define REPLACELENGTH_LANGID 9 -#define REPLACELENGTH_VLANG 8 +#define REPLACELENGTH_PATH 7 +#define REPLACELENGTH_LANG 7 +#define REPLACELENGTH_LANGID 9 +#define REPLACELENGTH_VLANG 8 #define REPLACELENGTH_WORKDIRURL 13 // New variable of hierachy service (#i32656#) #define REPLACELENGTH_BASEINSTURL 14 #define REPLACELENGTH_USERDATAURL 14 // Name of the pre defined path variables -#define VARIABLE_INST "$(inst)" -#define VARIABLE_PROG "$(prog)" -#define VARIABLE_USER "$(user)" -#define VARIABLE_WORK "$(work)" -#define VARIABLE_HOME "$(home)" -#define VARIABLE_TEMP "$(temp)" -#define VARIABLE_PATH "$(path)" -#define VARIABLE_LANG "$(lang)" -#define VARIABLE_LANGID "$(langid)" -#define VARIABLE_VLANG "$(vlang)" -#define VARIABLE_INSTPATH "$(instpath)" -#define VARIABLE_PROGPATH "$(progpath)" -#define VARIABLE_USERPATH "$(userpath)" -#define VARIABLE_INSTURL "$(insturl)" -#define VARIABLE_PROGURL "$(progurl)" -#define VARIABLE_USERURL "$(userurl)" -#define VARIABLE_WORKDIRURL "$(workdirurl)" +#define VARIABLE_INST "$(inst)" +#define VARIABLE_PROG "$(prog)" +#define VARIABLE_USER "$(user)" +#define VARIABLE_WORK "$(work)" +#define VARIABLE_HOME "$(home)" +#define VARIABLE_TEMP "$(temp)" +#define VARIABLE_PATH "$(path)" +#define VARIABLE_LANG "$(lang)" +#define VARIABLE_LANGID "$(langid)" +#define VARIABLE_VLANG "$(vlang)" +#define VARIABLE_INSTPATH "$(instpath)" +#define VARIABLE_PROGPATH "$(progpath)" +#define VARIABLE_USERPATH "$(userpath)" +#define VARIABLE_INSTURL "$(insturl)" +#define VARIABLE_PROGURL "$(progurl)" +#define VARIABLE_USERURL "$(userurl)" +#define VARIABLE_WORKDIRURL "$(workdirurl)" // New variable of hierachy service (#i32656#) -#define VARIABLE_BASEINSTURL "$(baseinsturl)" -#define VARIABLE_USERDATAURL "$(userdataurl)" +#define VARIABLE_BASEINSTURL "$(baseinsturl)" +#define VARIABLE_USERDATAURL "$(userdataurl)" +#define VARIABLE_BRANDBASEURL "$(brandbaseurl)" using namespace com::sun::star::uno; using namespace com::sun::star::beans; @@ -134,7 +135,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; //_________________________________________________________________________________________________________________ -// Namespace +// Namespace //_________________________________________________________________________________________________________________ // @@ -146,6 +147,7 @@ struct FixedVariable const char* pVarName; PreDefVariable nEnumValue; int nStrLen; + bool bAbsPath; }; struct TableEntry @@ -159,11 +161,11 @@ struct TableEntry // of the string static TableEntry aOSTable[OS_COUNT] = { - { "WINDOWS" , 7 }, - { "UNIX" , 4 }, - { "SOLARIS" , 7 }, - { "LINUX" , 5 }, - { "" , 0 } // unknown + { "WINDOWS" , 7 }, + { "UNIX" , 4 }, + { "SOLARIS" , 7 }, + { "LINUX" , 5 }, + { "" , 0 } // unknown }; // Table with valid environment variables @@ -171,12 +173,12 @@ static TableEntry aOSTable[OS_COUNT] = // the length of the string. static TableEntry aEnvTable[ET_COUNT] = { - { "HOST" , 4 }, - { "YPDOMAIN" , 8 }, - { "DNSDOMAIN" , 9 }, - { "NTDOMAIN" , 8 }, - { "OS" , 2 }, - { "" , 0 } // unknown + { "HOST" , 4 }, + { "YPDOMAIN" , 8 }, + { "DNSDOMAIN" , 9 }, + { "NTDOMAIN" , 8 }, + { "OS" , 2 }, + { "" , 0 } // unknown }; // Priority table for the environment types. Lower numbers define @@ -184,43 +186,42 @@ static TableEntry aEnvTable[ET_COUNT] = // that the first match wins!! static sal_Int16 aEnvPrioTable[ET_COUNT] = { - 1, // ET_HOST - 2, // ET_IPDOMAIN - 2, // ET_DNSDOMAIN - 2, // ET_NTDOMAIN - 3, // ET_OS - 99, // ET_UNKNOWN + 1, // ET_HOST + 2, // ET_IPDOMAIN + 2, // ET_DNSDOMAIN + 2, // ET_NTDOMAIN + 3, // ET_OS + 99, // ET_UNKNOWN }; // Table with all fixed/predefined variables supported. static FixedVariable aFixedVarTable[] = { - { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST }, - { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG }, - { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER }, - { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK }, // Special variable (transient)! - { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME }, - { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP }, - { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH }, - { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG }, - { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID }, - { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG }, - { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH }, - { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH }, - { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH }, - { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL }, - { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL }, - { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL }, - { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL }, // Special variable (transient) and don't use for resubstitution! + { VARIABLE_INST, PREDEFVAR_INST, REPLACELENGTH_INST, true }, + { VARIABLE_PROG, PREDEFVAR_PROG, REPLACELENGTH_PROG, true }, + { VARIABLE_USER, PREDEFVAR_USER, REPLACELENGTH_USER, true }, + { VARIABLE_WORK, PREDEFVAR_WORK, REPLACELENGTH_WORK, true }, // Special variable (transient)! + { VARIABLE_HOME, PREDEFVAR_HOME, REPLACELENGTH_HOME, true }, + { VARIABLE_TEMP, PREDEFVAR_TEMP, REPLACELENGTH_TEMP, true }, + { VARIABLE_PATH, PREDEFVAR_PATH, REPLACELENGTH_PATH, true }, + { VARIABLE_LANG, PREDEFVAR_LANG, REPLACELENGTH_LANG, false }, + { VARIABLE_LANGID, PREDEFVAR_LANGID, REPLACELENGTH_LANGID, false }, + { VARIABLE_VLANG, PREDEFVAR_VLANG, REPLACELENGTH_VLANG, false }, + { VARIABLE_INSTPATH, PREDEFVAR_INSTPATH, REPLACELENGTH_INSTPATH, true }, + { VARIABLE_PROGPATH, PREDEFVAR_PROGPATH, REPLACELENGTH_PROGPATH, true }, + { VARIABLE_USERPATH, PREDEFVAR_USERPATH, REPLACELENGTH_USERPATH, true }, + { VARIABLE_INSTURL, PREDEFVAR_INSTURL, REPLACELENGTH_INSTURL, true }, + { VARIABLE_PROGURL, PREDEFVAR_PROGURL, REPLACELENGTH_PROGURL, true }, + { VARIABLE_USERURL, PREDEFVAR_USERURL, REPLACELENGTH_USERURL, true }, + { VARIABLE_WORKDIRURL, PREDEFVAR_WORKDIRURL, REPLACELENGTH_WORKDIRURL,true }, // Special variable (transient) and don't use for resubstitution! // New variable of hierachy service (#i32656#) - { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL }, - { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL }, - { "$(brandbaseurl)", PREDEFVAR_BRANDBASEURL, - RTL_CONSTASCII_LENGTH("$(brandbaseurl)") } + { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL,true }, + { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL,true }, + { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true } }; //_________________________________________________________________________________________________________________ -// Implementation helper classes +// Implementation helper classes //_________________________________________________________________________________________________________________ // @@ -248,11 +249,11 @@ EnvironmentType SubstitutePathVariables_Impl::GetEnvTypeFromString( const rtl::O SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link& aNotifyLink ) : utl::ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Substitution" ))), - m_bYPDomainRetrieved( sal_False ), - m_bDNSDomainRetrieved( sal_False ), - m_bNTDomainRetrieved( sal_False ), - m_bHostRetrieved( sal_False ), - m_bOSRetrieved( sal_False ), + m_bYPDomainRetrieved( false ), + m_bDNSDomainRetrieved( false ), + m_bNTDomainRetrieved( false ), + m_bHostRetrieved( false ), + m_bOSRetrieved( false ), m_aListenerNotify( aNotifyLink ), m_aSharePointsNodeName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SharePoints" ))), m_aDirPropertyName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/Directory" ))), @@ -298,10 +299,9 @@ void SubstitutePathVariables_Impl::GetSharePointsRules( SubstituteVariables& aSu // We have found an active rule aActiveRule.aSubstVariable = aSharePointNames[ nSharePoints ]; aSubstVarMap.insert( SubstituteVariables::value_type( - aActiveRule.aSubstVariable, aActiveRule )); + aActiveRule.aSubstVariable, aActiveRule )); } } - ++nSharePoints; } } @@ -318,7 +318,7 @@ void SubstitutePathVariables_Impl::Commit() //_________________________________________________________________________________________________________________ -// private methods +// private methods //_________________________________________________________________________________________________________________ // @@ -403,18 +403,19 @@ const rtl::OUString& SubstitutePathVariables_Impl::GetHostName() return m_aHost; } -sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ) +bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule ) { - sal_Bool bResult = sal_False; + bool bResult = sal_False; if ( !aRuleSet.empty() ) { - sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ]; const sal_uInt32 nCount = aRuleSet.size(); + + sal_Int16 nPrioCurrentRule = aEnvPrioTable[ ET_UNKNOWN ]; for ( sal_uInt32 nIndex = 0; nIndex < nCount; nIndex++ ) { const SubstituteRule& aRule = aRuleSet[nIndex]; - EnvironmentType eEnvType = aRule.aEnvType; + EnvironmentType eEnvType = aRule.aEnvType; // Check if environment type has a higher priority than current one! if ( nPrioCurrentRule > aEnvPrioTable[eEnvType] ) @@ -429,13 +430,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector aHostStr = aHostStr.toAsciiLowerCase(); // Pattern match if domain environment match - WildCard aPattern(aHostStr); - sal_Bool bMatch = aPattern.Matches(aHost); + WildCard aPattern(aHostStr); + bool bMatch = aPattern.Matches(aHost); if ( bMatch ) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; @@ -458,13 +459,13 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector aDomain = GetNTDomainName(); // Pattern match if domain environment match - WildCard aPattern(aDomainStr); - sal_Bool bMatch = aPattern.Matches(aDomain); + WildCard aPattern(aDomainStr); + bool bMatch = aPattern.Matches(aDomain); if ( bMatch ) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; @@ -477,24 +478,24 @@ sal_Bool SubstitutePathVariables_Impl::FilterRuleSet( const SubstituteRuleVector sal_Int16 nValue = 0; aRule.aEnvValue >>= nValue; - sal_Bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS ); + bool bUnix = ( eOSType == OS_LINUX ) || ( eOSType == OS_SOLARIS ); OperatingSystem eRuleOSType = (OperatingSystem)nValue; // Match if OS identical or rule is set to UNIX and OS is LINUX/SOLARIS! if (( eRuleOSType == eOSType ) || ( eRuleOSType == OS_UNIX && bUnix )) { - aActiveRule = aRule; - bResult = sal_True; - nPrioCurrentRule = aEnvPrioTable[eEnvType]; + aActiveRule = aRule; + bResult = true; + nPrioCurrentRule = aEnvPrioTable[eEnvType]; } } break; - case ET_UNKNOWN: // nothing to do - break; + case ET_UNKNOWN: // nothing to do + break; - default: - break; + default: + break; } } } @@ -510,9 +511,9 @@ void SubstitutePathVariables_Impl::ReadSharePointsFromConfiguration( Sequence< r } void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( - const rtl::OUString& aSharePointName, - const rtl::OUString& aSharePointNodeName, - SubstituteRuleVector& rRuleSet ) + const rtl::OUString& aSharePointName, + const rtl::OUString& aSharePointNodeName, + SubstituteRuleVector& rRuleSet ) { Sequence< rtl::OUString > aSharePointMappingsNodeNames = GetNodeNames( aSharePointNodeName, utl::CONFIG_NAME_LOCAL_PATH ); @@ -565,7 +566,7 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( } // Decode the environment and optional the operatng system settings - Any aEnvValue; + Any aEnvValue; EnvironmentType eEnvType = GetEnvTypeFromString( aEnvUsed ); if ( eEnvType == ET_OS ) { @@ -584,13 +585,12 @@ void SubstitutePathVariables_Impl::ReadSharePointRuleSetFromConfiguration( } //***************************************************************************************************************** -// XInterface, XTypeProvider, XServiceInfo +// XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables , - ::cppu::OWeakObject , - SERVICENAME_SUBSTITUTEPATHVARIABLES , - IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES - ) +DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( SubstitutePathVariables , + ::cppu::OWeakObject , + SERVICENAME_SUBSTITUTEPATHVARIABLES , + IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES ) DEFINE_INIT_SERVICE ( SubstitutePathVariables, {} ) @@ -622,16 +622,15 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService // Sort predefined/fixed variable to path length for ( i = 0; i < PREDEFVAR_COUNT; i++ ) { - if (( i != PREDEFVAR_WORKDIRURL ) && - ( i != PREDEFVAR_PATH )) + if (( i != PREDEFVAR_WORKDIRURL ) && ( i != PREDEFVAR_PATH )) { // Special path variables, don't include into automatic resubstituion search! // $(workdirurl) is not allowed to resubstitute! This variable is the value of path settings entry // and it could be possible that it will be resubstituted by itself!! // Example: WORK_PATH=c:\test, $(workdirurl)=WORK_PATH => WORK_PATH=$(workdirurl) and this cannot be substituted! ReSubstFixedVarOrder aFixedVar; - aFixedVar.eVariable = aFixedVarTable[i].nEnumValue; - aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength(); + aFixedVar.eVariable = aFixedVarTable[i].nEnumValue; + aFixedVar.nVarValueLength = m_aPreDefVars.m_FixedVar[(sal_Int32)aFixedVar.eVariable].getLength(); m_aReSubstFixedVarOrder.push_back( aFixedVar ); } } @@ -646,8 +645,8 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XMultiService aStrBuffer.append( m_aVarStart ); aStrBuffer.append( pIter->second.aSubstVariable ); aStrBuffer.append( m_aVarEnd ); - aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear(); - aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength(); + aUserOrderVar.aVarName = aStrBuffer.makeStringAndClear(); + aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength(); m_aReSubstUserVarOrder.push_back( aUserOrderVar ); } m_aReSubstUserVarOrder.sort(); @@ -683,7 +682,7 @@ throw ( NoSuchElementException, RuntimeException ) } //_________________________________________________________________________________________________________________ -// protected methods +// protected methods //_________________________________________________________________________________________________________________ // @@ -698,7 +697,7 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" ); - String aResult; + String aResult; rtl::OUString aTemp; osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp ); @@ -714,7 +713,7 @@ rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& rtl::OUString SubstitutePathVariables::GetWorkPath() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::GetWorkPath" ); - rtl::OUString aWorkPath; + rtl::OUString aWorkPath; try { @@ -754,7 +753,7 @@ rtl::OUString SubstitutePathVariables::GetWorkVariableValue() const { } - // fallback to $HOME in case platform dependend config layer does not return + // fallback to $HOME in case platform dependend config layer does not return // an usuable work dir value. if (aWorkPath.getLength() < 1) { @@ -788,7 +787,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const rtl::OUString aPathList( pEnv, strlen( pEnv ), gsl_getSystemTextEncoding() ); rtl::OUStringBuffer aPathStrBuffer( aPathList.getLength() * PATH_EXTEND_FACTOR / 100 ); - sal_Bool bAppendSep = sal_False; + bool bAppendSep = false; sal_Int32 nToken = 0; do { @@ -799,7 +798,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const if ( bAppendSep ) aPathStrBuffer.appendAscii( ";" ); // Office uses ';' as path separator aPathStrBuffer.append( aTmp ); - bAppendSep = sal_True; + bAppendSep = true; } } while(nToken>=0); @@ -810,7 +809,7 @@ rtl::OUString SubstitutePathVariables::GetPathVariableValue() const return aRetStr; } -rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, sal_Bool bSubstRequired ) +rtl::OUString SubstitutePathVariables::impl_substituteVariable( const ::rtl::OUString& rText, bool bSubstRequired ) throw ( NoSuchElementException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::impl_substituteVariable" ); @@ -826,9 +825,9 @@ throw ( NoSuchElementException, RuntimeException ) // Search for first occure of "$(...". sal_Int32 nDepth = 0; sal_Int32 bSubstitutionCompleted = sal_False; - sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string + sal_Int32 nPosition = aWorkText.indexOf( m_aVarStart ); // = first position of "$(" in string sal_Int32 nLength = 0; // = count of letters from "$(" to ")" in string - sal_Bool bVarNotSubstituted = sal_False; + bool bVarNotSubstituted = false; // Have we found any variable like "$(...)"? if ( nPosition != STRPOS_NOTFOUND ) @@ -841,17 +840,17 @@ throw ( NoSuchElementException, RuntimeException ) } // Is there something to replace ? - sal_Bool bWorkRetrieved = sal_False; - sal_Bool bWorkDirURLRetrieved = sal_False; + bool bWorkRetrieved = false; + bool bWorkDirURLRetrieved = false; while ( !bSubstitutionCompleted && nDepth < nMaxRecursiveDepth ) { while ( ( nPosition != STRPOS_NOTFOUND ) && ( nLength > 3 ) ) // "$(" ")" { // YES; Get the next variable for replace. - sal_Int32 nReplaceLength = 0; - rtl::OUString aReplacement; - rtl::OUString aSubString = aWorkText.copy( nPosition, nLength ); - rtl::OUString aSubVarString; + sal_Int32 nReplaceLength = 0; + rtl::OUString aReplacement; + rtl::OUString aSubString = aWorkText.copy( nPosition, nLength ); + rtl::OUString aSubVarString; // Path variables are not case sensitive! aSubVarString = aSubString.toAsciiLowerCase(); @@ -866,17 +865,24 @@ throw ( NoSuchElementException, RuntimeException ) { // Transient value, retrieve it again m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkVariableValue(); - bWorkRetrieved = sal_True; + bWorkRetrieved = true; } else if ( nIndex == PREDEFVAR_WORKDIRURL && !bWorkDirURLRetrieved ) { // Transient value, retrieve it again m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ] = GetWorkPath(); - bWorkDirURLRetrieved = sal_True; + bWorkDirURLRetrieved = true; } - aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ]; - nReplaceLength = nLength; + // Check preconditions to substitue path variables. + // 1. A path variable can only be substituted if it follows a SEARCHPATH_DELIMITER ';'! + // 2. It's located exactly at the start of the string being substituted! + if (( aFixedVarTable[ int( nIndex ) ].bAbsPath && (( nPosition == 0 ) || (( nPosition > 0 ) && ( aWorkText[nPosition-1] == ';')))) || + ( !aFixedVarTable[ int( nIndex ) ].bAbsPath )) + { + aReplacement = m_aPreDefVars.m_FixedVar[ (PreDefVariable)nIndex ]; + nReplaceLength = nLength; + } } else { @@ -885,7 +891,7 @@ throw ( NoSuchElementException, RuntimeException ) SubstituteVariables::const_iterator pIter = m_aSubstVarMap.find( aVarName ); if ( pIter != m_aSubstVarMap.end() ) { - // found! + // Found. aReplacement = pIter->second.aSubstValue; nReplaceLength = nLength; } @@ -900,7 +906,7 @@ throw ( NoSuchElementException, RuntimeException ) else { // Variable not known - bVarNotSubstituted = sal_False; + bVarNotSubstituted = false; nPosition += nLength; } @@ -1032,8 +1038,8 @@ throw ( RuntimeException ) } // Due to a recursive definition this code must exchange variables with variables! - sal_Bool bResubstitutionCompleted = sal_False; - sal_Bool bVariableFound = sal_False; + bool bResubstitutionCompleted = false; + bool bVariableFound = false; // Get transient predefined path variable $(work) value before starting resubstitution m_aPreDefVars.m_FixedVar[ PREDEFVAR_WORK ] = GetWorkVariableValue(); @@ -1047,7 +1053,7 @@ throw ( RuntimeException ) sal_Int32 nPos = aURL.indexOf( aValue ); if ( nPos >= 0 ) { - sal_Bool bMatch = sal_True; + bool bMatch = true; if ( pIterFixed->eVariable == PREDEFVAR_LANG || pIterFixed->eVariable == PREDEFVAR_LANGID || pIterFixed->eVariable == PREDEFVAR_VLANG ) @@ -1073,7 +1079,7 @@ throw ( RuntimeException ) aStrBuffer.append( m_aPreDefVars.m_FixedVarNames[ (sal_Int32)pIterFixed->eVariable ] ); // Get the variable name for struct var name array! aStrBuffer.append( aURL.copy( nPos + aValue.getLength(), ( aURL.getLength() - ( nPos + aValue.getLength() )) )); aURL = aStrBuffer.makeStringAndClear(); - bVariableFound = sal_True; // Resubstitution not finished yet! + bVariableFound = true; // Resubstitution not finished yet! break; } } @@ -1094,12 +1100,12 @@ throw ( RuntimeException ) aStrBuffer.append( m_aVarEnd ); aStrBuffer.append( aURL.copy( nPos + aVarValue.getLength(), ( aURL.getLength() - ( nPos + aVarValue.getLength() )) )); aURL = aStrBuffer.makeStringAndClear(); - bVariableFound = sal_True; // Resubstitution not finished yet! + bVariableFound = true; // Resubstitution not finished yet! } } if ( !bVariableFound ) - bResubstitutionCompleted = sal_True; + bResubstitutionCompleted = true; else bVariableFound = sal_False; // Next resubstitution } @@ -1165,7 +1171,7 @@ throw ( NoSuchElementException, RuntimeException ) void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariables& aPreDefPathVariables ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::SetPredefinedPathVariables" ); - Any aAny; + Any aAny; ::rtl::OUString aOfficePath; ::rtl::OUString aUserPath; ::rtl::OUString aTmp; @@ -1185,12 +1191,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable } aState = utl::Bootstrap::locateUserData( sVal ); + //There can be the valid case that there is no user installation. For example, "unopkg sync" + //is currently (OOo3.4) run as part of the setup. Then no user installation is required. + //Therefore we do not assert here. if( aState == ::utl::Bootstrap::PATH_EXISTS ) { aPreDefPathVariables.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal ); } - // We use to have a LOG_ERROR here in an else branch, but that - // always fired in some unit tests, and if you then just ignored - // it, nothing bad happened, so it seems fairly pointless. // Set $(inst), $(instpath), $(insturl) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ]; @@ -1207,14 +1213,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable // Detect the program directory // Set $(prog), $(progpath), $(progurl) INetURLObject aProgObj( - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] ); - if ( !aProgObj.HasError() && - aProgObj.insertName( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) ) + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ] ); + if ( !aProgObj.HasError() && aProgObj.insertName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("program")) ) ) { - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE); - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; - aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::NO_DECODE); + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; + aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROG ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_PROGPATH ]; } // Detect the language type of the current office @@ -1230,7 +1234,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable // Set $(lang) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_LANG ] = ConvertOSLtoUCBURL( - rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) )); + rtl::OUString::createFromAscii( ResMgr::GetLang( aPreDefPathVariables.m_eLanguageType, 0 ) )); + // Set $(vlang) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_VLANG ] = aLocaleStr; @@ -1255,7 +1260,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable aPreDefPathVariables.m_FixedVar[ PREDEFVAR_TEMP ] = ConvertOSLtoUCBURL( aTmp ); aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR")); + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR")); rtl::Bootstrap::expandMacros( aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL]); } diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu index 00030d71bf9b..a51ff5b244c8 100755 --- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu @@ -14,6 +14,8 @@ <value> <!-- Matrox G550 - blank display on 2nd head --> 4139 9511 260313131 1 5 13 1 1320 + <!-- Matrox G550 - blank display (single head?) --> + 4139 9511 255987755 1 6 12 1 1930 <!-- Matrox G400 - random crashes --> 4139 1317 54005803 4 5 12 1 1200 <!-- Mobility Radeon M6 16MB - blank screen 1st slide on internal LCD --> diff --git a/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java new file mode 100644 index 000000000000..fffb78523798 --- /dev/null +++ b/scripting/java/com/sun/star/script/framework/provider/SwingInvocation.java @@ -0,0 +1,44 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package com.sun.star.script.framework.provider; + +import javax.swing.SwingUtilities; + +// On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call +// SwingUtilities.invokeLater always on a fresh thread to avoid that problem +// (also, the current thread must not wait for that fresh thread to terminate, +// as that would cause a deadlock if this thread is the AppKit thread): +public final class SwingInvocation { + public static void invoke(final Runnable doRun) { + new Thread("SwingInvocation") { + public void run() { SwingUtilities.invokeLater(doRun); } + }.start(); + } + + private SwingInvocation() {} +} diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index ece0d0bdd8b6..cbbcfc34f78f 100755 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -47,6 +47,7 @@ import java.util.HashMap; import com.sun.star.script.provider.XScriptContext; import com.sun.star.script.framework.provider.ScriptEditor; +import com.sun.star.script.framework.provider.SwingInvocation; import com.sun.star.script.framework.container.ScriptMetaData; import com.sun.star.script.framework.provider.ClassLoaderFactory; @@ -128,7 +129,9 @@ public class ScriptEditorForBeanShell */ public static ScriptEditorForBeanShell getEditor(URL url) { - return (ScriptEditorForBeanShell)BEING_EDITED.get(url); + synchronized (BEING_EDITED) { + return (ScriptEditorForBeanShell)BEING_EDITED.get(url); + } } /** @@ -194,8 +197,7 @@ public class ScriptEditorForBeanShell * @param context The context in which to execute the script * */ - public void edit(XScriptContext context, ScriptMetaData entry) { - + public void edit(final XScriptContext context, ScriptMetaData entry) { if (entry != null ) { try { ClassLoader cl = null; @@ -205,26 +207,30 @@ public class ScriptEditorForBeanShell catch (Exception ignore) // TODO re-examine error handling { } + final ClassLoader theCl = cl; String sUrl = entry.getParcelLocation(); if ( !sUrl.endsWith( "/" ) ) { sUrl += "/"; } sUrl += entry.getLanguageName(); - URL url = entry.getSourceURL(); - - // check if there is already an editing session for this script - if (BEING_EDITED.containsKey(url)) - { - ScriptEditorForBeanShell editor = - (ScriptEditorForBeanShell) BEING_EDITED.get(url); - - editor.frame.toFront(); - } - else - { - new ScriptEditorForBeanShell(context, cl, url); - } + final URL url = entry.getSourceURL(); + SwingInvocation.invoke( + new Runnable() { + public void run() { + ScriptEditorForBeanShell editor; + synchronized (BEING_EDITED) { + editor = (ScriptEditorForBeanShell) + BEING_EDITED.get(url); + if (editor == null) { + editor = new ScriptEditorForBeanShell( + context, theCl, url); + BEING_EDITED.put(url, editor); + } + } + editor.frame.toFront(); + } + }); } catch (IOException ioe) { showErrorMessage( "Error loading file: " + ioe.getMessage() ); @@ -269,8 +275,6 @@ public class ScriptEditorForBeanShell this.model.setView(this.view); initUI(); frame.show(); - - BEING_EDITED.put(url, this); } private void showErrorMessage(String message) { @@ -384,7 +388,7 @@ public class ScriptEditorForBeanShell private void shutdown() { - if (BEING_EDITED.containsKey(scriptURL)) { + synchronized (BEING_EDITED) { BEING_EDITED.remove(scriptURL); } } diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 4adbbc3a10d3..e7f08c628420 100755 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -36,6 +36,7 @@ import org.mozilla.javascript.tools.debugger.ScopeProvider; import com.sun.star.script.provider.XScriptContext; import com.sun.star.script.framework.container.ScriptMetaData; import com.sun.star.script.framework.provider.ScriptEditor; +import com.sun.star.script.framework.provider.SwingInvocation; import com.sun.star.script.framework.log.LogUtils; import java.io.InputStream; @@ -45,7 +46,6 @@ import java.net.URL; import java.util.Map; import java.util.HashMap; -import javax.swing.SwingUtilities; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -117,7 +117,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor */ public static ScriptEditorForJavaScript getEditor(URL url) { - return (ScriptEditorForJavaScript)BEING_EDITED.get(url); + synchronized (BEING_EDITED) { + return (ScriptEditorForJavaScript)BEING_EDITED.get(url); + } } /** @@ -187,31 +189,25 @@ public class ScriptEditorForJavaScript implements ScriptEditor sUrl += "/"; } sUrl += entry.getLanguageName(); - URL url = entry.getSourceURL(); - - // check if there is already an editing session for this script - //if (BEING_EDITED.containsKey(url)) - if ( rhinoWindow != null ) - { - ScriptEditorForJavaScript editor = - (ScriptEditorForJavaScript) BEING_EDITED.get(url); - if ( editor == null ) - { - editor = new ScriptEditorForJavaScript( context, url ); - editor.edit( context, entry ); - } - else - { - rhinoWindow.showScriptWindow( url ); - } - } - else - { - ScriptEditorForJavaScript editor = - new ScriptEditorForJavaScript( context, url ); - - } - rhinoWindow.toFront(); + final URL url = entry.getSourceURL(); + SwingInvocation.invoke( + new Runnable() { + public void run() { + synchronized (BEING_EDITED) { + ScriptEditorForJavaScript editor = + (ScriptEditorForJavaScript) BEING_EDITED.get( + url); + if (editor == null) { + editor = new ScriptEditorForJavaScript( + context, url); + BEING_EDITED.put(url, editor); + } + } + assert rhinoWindow != null; + rhinoWindow.showScriptWindow(url); + rhinoWindow.toFront(); + } + }); } catch ( IOException e ) { @@ -234,11 +230,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor this.scriptURL = url; - synchronized( ScriptEditorForJavaScript.class ) - { - BEING_EDITED.put(url, this); - } - } /** @@ -274,13 +265,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor } final Main sdb = new Main("Rhino JavaScript Debugger"); - swingInvoke(new Runnable() { - public void run() { - sdb.pack(); - sdb.setSize(640, 640); - sdb.setVisible(true); - } - }); + sdb.pack(); + sdb.setSize(640, 640); + sdb.setVisible(true); sdb.setExitAction(new Runnable() { public void run() { sdb.clearAllBreakpoints(); @@ -306,18 +293,6 @@ public class ScriptEditorForJavaScript implements ScriptEditor } } - private static void swingInvoke(Runnable f) { - if (SwingUtilities.isEventDispatchThread()) { - f.run(); - return; - } - try { - SwingUtilities.invokeAndWait(f); - } catch (Exception exc) { - LogUtils.DEBUG( LogUtils.getTrace( exc ) ); - } - } - private void shutdown() { // dereference Rhino Debugger window diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index 88da2166f8e7..4dcd035fd49f 100755 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -35,6 +35,7 @@ #include <sfx2/imgdef.hxx> #include <sal/types.h> #include <tools/fldunit.hxx> +#include <com/sun/star/uno/Reference.hxx> class ImageList; @@ -57,6 +58,9 @@ class SfxStbCtrlFactArr_Impl; class SfxTabPage; class Window; +namespace com { namespace sun { namespace star { namespace frame { + class XFrame; +} } } } //==================================================================== class SFX2_DLLPUBLIC SfxModule : public SfxShell @@ -96,6 +100,14 @@ public: static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL ); static FieldUnit GetCurrentFieldUnit(); + /** retrieves the field unit of the module belonging to the document displayed in the given frame + + Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to + the document in this frame, then this module's field unit. + + Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned. + */ + static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame ); FieldUnit GetFieldUnit() const; SAL_DLLPRIVATE static SfxModuleArr_Impl& GetModules_Impl(); diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk new file mode 100755 index 000000000000..ea91ba4d1c44 --- /dev/null +++ b/sfx2/qa/unoapi/makefile.mk @@ -0,0 +1,48 @@ +#************************************************************************* +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +#***********************************************************************/ + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ = ../.. +PRJNAME = sfx2 +TARGET = qa_unoapi + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/sfx2/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk + +ALLTAR : javatest + +.END diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 1a92d59ea464..62e7f0547808 100755 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -49,6 +49,7 @@ #include <svl/intitem.hxx> #include "sfx2/taskpane.hxx" #include <tools/diagnose_ex.h> +#include <rtl/strbuf.hxx> #define SfxModule #include "sfxslots.hxx" @@ -399,6 +400,39 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame ) return pSh ? pSh->GetModule() : 0; } +FieldUnit SfxModule::GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame ) +{ + ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FUNIT_100TH_MM ); + + // find SfxViewFrame for the given XFrame + SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(); + while ( pViewFrame != NULL ) + { + if ( pViewFrame->GetFrame().GetFrameInterface() == i_frame ) + break; + pViewFrame = SfxViewFrame::GetNext( *pViewFrame ); + } + ENSURE_OR_RETURN( pViewFrame != NULL, "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", FUNIT_100TH_MM ); + + // find the module + SfxModule const * pModule = GetActiveModule( pViewFrame ); + ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM ); + + SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC ); + if ( pItem == NULL ) + { +#if OSL_DEBUG_LEVEL > 0 + ::rtl::OStringBuffer message; + message.append( "SfxModule::GetFieldUnit: no metric item in the module implemented by '" ); + message.append( typeid( *pModule ).name() ); + message.append( "'!" ); + OSL_ENSURE( false, message.makeStringAndClear().getStr() ); +#endif + return FUNIT_100TH_MM; + } + return (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); +} + FieldUnit SfxModule::GetCurrentFieldUnit() { FieldUnit eUnit = FUNIT_INCH; diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index e4862ae470e7..82e6afe883f5 100755 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1183,7 +1183,6 @@ void SAL_CALL SfxDocumentMetaData::init( m_isInitialized = false; m_xDoc = i_xDoc; - m_xDoc->normalize(); // select nodes for standard meta data stuff xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")), @@ -1210,24 +1209,49 @@ void SAL_CALL SfxDocumentMetaData::init( if (!m_xParent.is()) { // all this create/append stuff may throw DOMException try { - css::uno::Reference<css::xml::dom::XElement> xRElem( - i_xDoc->createElementNS( + css::uno::Reference<css::xml::dom::XElement> xRElem; + css::uno::Reference<css::xml::dom::XNode> xNode( + i_xDoc->getFirstChild()); + while (xNode.is()) { + if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType()) + { + if (xNode->getNamespaceURI().equalsAscii(s_nsODF) && + xNode->getLocalName().equalsAscii("document-meta")) + { + xRElem.set(xNode, css::uno::UNO_QUERY_THROW); + break; + } + else + { + OSL_TRACE("SfxDocumentMetaData::init(): " + "deleting unexpected root element: %s", + ::rtl::OUStringToOString(xNode->getLocalName(), + RTL_TEXTENCODING_UTF8).getStr()); + i_xDoc->removeChild(xNode); + xNode = i_xDoc->getFirstChild(); // start over + } + } else { + xNode = xNode->getNextSibling(); + } + } + if (!xRElem.is()) { + xRElem = i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-meta")))); - css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, - css::uno::UNO_QUERY_THROW); - // NB: the following is a _bad_idea_ with our DOM implementation - // do _not_ create attributes with xmlns prefix! + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-meta"))); + css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, + css::uno::UNO_QUERY_THROW); + i_xDoc->appendChild(xRNode); + } xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:version")), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1.0"))); - i_xDoc->appendChild(xRNode); + // does not exist, otherwise m_xParent would not be null css::uno::Reference<css::xml::dom::XNode> xParent ( i_xDoc->createElementNS( ::rtl::OUString::createFromAscii(s_nsODF), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:meta"))), css::uno::UNO_QUERY_THROW); - xRNode->appendChild(xParent); + xRElem->appendChild(xParent); m_xParent = xParent; } catch (css::xml::dom::DOMException & e) { css::uno::Any a(e); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index fc6856fdb083..5802606fb635 100755 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -938,11 +938,6 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp lcl_UpdateAppBasicDocVars( _rxComponent ); pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) ); } - -#if OSL_DEBUG_LEVEL > 0 - const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void"; - OSL_TRACE( "current component is a %s\n", pComponentImplName ); -#endif } Reference< XInterface > SfxObjectShell::GetCurrentComponent() diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4c02651073c2..3974e8aeeb81 100755 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -81,13 +81,15 @@ class SfxPrinterController : public vcl::PrinterController, public SfxListener sal_Bool m_bOrigStatus; sal_Bool m_bNeedsChange; sal_Bool m_bApi; + sal_Bool m_bTempPrinter; util::DateTime m_aLastPrinted; ::rtl::OUString m_aLastPrintedBy; Sequence< beans::PropertyValue > getMergedOptions() const; const Any& getSelectionObject() const; public: - SfxPrinterController( const Any& i_rComplete, + SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter, + const Any& i_rComplete, const Any& i_rSelection, const Any& i_rViewProp, const Reference< view::XRenderable >& i_xRender, @@ -106,7 +108,8 @@ public: virtual void jobFinished( com::sun::star::view::PrintableState ); }; -SfxPrinterController::SfxPrinterController( const Any& i_rComplete, +SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter, + const Any& i_rComplete, const Any& i_rSelection, const Any& i_rViewProp, const Reference< view::XRenderable >& i_xRender, @@ -114,7 +117,8 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, SfxViewShell* pView, const uno::Sequence< beans::PropertyValue >& rProps ) - : maCompleteSelection( i_rComplete ) + : PrinterController( i_rPrinter) + , maCompleteSelection( i_rComplete ) , maSelection( i_rSelection ) , mxRenderable( i_xRender ) , mpLastPrinter( NULL ) @@ -123,6 +127,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, , m_bOrigStatus( sal_False ) , m_bNeedsChange( sal_False ) , m_bApi(i_bApi) + , m_bTempPrinter( i_rPrinter.get() != NULL ) { if ( mpViewShell ) { @@ -192,15 +197,19 @@ SfxPrinterController::~SfxPrinterController() const Any& SfxPrinterController::getSelectionObject() const { + const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) ); + if( pVal ) + { + sal_Bool bSel = sal_False; + pVal->Value >>= bSel; + return bSel ? maSelection : maCompleteSelection; + } + sal_Int32 nChoice = 0; - sal_Bool bSel = sal_False; - const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) ); + pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) ); if( pVal ) pVal->Value >>= nChoice; - pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) ); - if( pVal ) - pVal->Value >>= bSel; - return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection; + return (nChoice > 1) ? maSelection : maCompleteSelection; } Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const @@ -308,6 +317,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt { if ( mpObjectShell ) { + bool bCopyJobSetup = false; mpObjectShell->Broadcast( SfxPrintingHint( nState ) ); switch ( nState ) { @@ -335,6 +345,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt rBind.Invalidate( SID_PRINTDOC ); rBind.Invalidate( SID_PRINTDOCDIRECT ); rBind.Invalidate( SID_SETUPPRINTER ); + bCopyJobSetup = ! m_bTempPrinter; break; } @@ -342,6 +353,27 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt break; } + if( bCopyJobSetup && mpViewShell ) + { + // #i114306# + // Note: this possibly creates a printer that gets immediately replaced + // by a new one. The reason for this is that otherwise we would not get + // the printer's SfxItemSet here to copy. Awkward, but at the moment there is no + // other way here to get the item set. + SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_True); + if( pDocPrt ) + { + if( pDocPrt->GetName() == getPrinter()->GetName() ) + pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() ); + else + { + SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() ); + pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() ); + mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); + } + } + } + if ( m_bNeedsChange ) mpObjectShell->EnableSetModified( m_bOrigStatus ); @@ -558,8 +590,23 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro aSelection <<= GetObjectShell()->GetModel(); Any aComplete( makeAny( GetObjectShell()->GetModel() ) ); Any aViewProp( makeAny( xController ) ); + boost::shared_ptr<Printer> aPrt; - boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete, + const beans::PropertyValue* pVal = rProps.getConstArray(); + for( sal_Int32 i = 0; i < rProps.getLength(); i++ ) + { + if( pVal[i].Name.equalsAscii( "PrinterName" ) ) + { + rtl::OUString aPrinterName; + pVal[i].Value >>= aPrinterName; + aPrt.reset( new Printer( aPrinterName ) ); + break; + } + } + + boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( + aPrt, + aComplete, aSelection, aViewProp, GetRenderable(), @@ -677,10 +724,18 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) } } } - sal_Int32 nLen = aProps.getLength(); - aProps.realloc( nLen + 1 ); - aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ); - aProps[nLen].Value = makeAny( bSelection ); + // HACK: writer sets the SID_SELECTION item when printing directly and expects + // to get only the selection document in that case (see getSelectionObject) + // however it also reacts to the PrintContent property. We need this distinction here, too, + // else one of the combinations print / print direct and selection / all will not work. + // it would be better if writer handled this internally + if( nId == SID_PRINTDOCDIRECT ) + { + sal_Int32 nLen = aProps.getLength(); + aProps.realloc( nLen + 1 ); + aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ); + aProps[nLen].Value = makeAny( bSelection ); + } ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) ); diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 116e9c91e3d5..c067eaee336c 100755 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -68,6 +68,7 @@ #include <comphelper/property.hxx> #include <comphelper/uno3.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -90,7 +91,9 @@ typedef cppu::WeakImplHelper1< XScriptListener > ScriptEventListener_BASE; class ScriptEventListenerWrapper : public ScriptEventListener_BASE { public: - ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel) + ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) + :m_rModel( _rModel ) + ,m_attemptedListenerCreation( false ) { } @@ -100,7 +103,7 @@ public: // XScriptListener virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { m_vbaListener->firing( evt ); @@ -109,7 +112,7 @@ public: virtual Any SAL_CALL approveFiring(const ScriptEvent& evt) throw( com::sun::star::reflection::InvocationTargetException, RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { return m_vbaListener->approveFiring( evt ); @@ -118,61 +121,32 @@ public: } private: - void setModel() + void attemptListenerCreation() { - if ( !m_vbaListener.is() ) - { - Reference < XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - if ( xProps.is() ) - { - Reference< XComponentContext > xCtx( xProps->getPropertyValue( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY ); - if ( xCtx.is() ) - { - Reference< XMultiComponentFactory > xMFac( - xCtx->getServiceManager(), UNO_QUERY ); - - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - Reference< XMultiServiceFactory > xDocFac; - if ( xObjSh.Is() ) - xDocFac.set( xObjSh->GetModel(), UNO_QUERY ); + if ( m_attemptedListenerCreation ) + return; + m_attemptedListenerCreation = true; - if ( xMFac.is() ) - { - m_vbaListener.set( xMFac->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "ooo.vba.EventListener" ) ), xCtx ), - UNO_QUERY_THROW ); - } - } - } + try + { + ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW ); + Reference< XPropertySet > const xListenerProps( xScriptListener, UNO_QUERY_THROW ); + // SfxObjectShellRef is good here since the model controls the lifetime of the shell + SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell(); + ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" ); + xListenerProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), makeAny( xObjectShell->GetModel() ) ); + + m_vbaListener = xScriptListener; } - Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY ); - if ( xProps.is() ) + catch( Exception const & ) { - try - { - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - if ( xObjSh.Is() && m_vbaListener.is() ) - { - Any aVal; - aVal <<= xObjSh->GetModel(); - xProps->setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), - aVal ); - } - } - catch( Exception& ) - { - //swallow any errors - } + DBG_UNHANDLED_EXCEPTION(); } } - FmFormModel* pModel; - Reference< XScriptListener > m_vbaListener; + FmFormModel& m_rModel; + Reference< XScriptListener > m_vbaListener; + bool m_attemptedListenerCreation; }; diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx index 7e3d62dcd66b..0c7946900171 100755 --- a/svx/source/mnuctrls/fntctl.cxx +++ b/svx/source/mnuctrls/fntctl.cxx @@ -149,7 +149,7 @@ void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint ) IMPL_LINK_INLINE_START( SvxFontMenuControl, MenuSelect, FontNameMenu *, pMen ) { SvxFontItem aItem( GetId() ); - aItem.GetFamilyName() = pMen->GetCurName(); + aItem.SetFamilyName(pMen->GetCurName()); GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aItem, 0L ); return 0; } diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 3b5bca6b777e..8be9399aa843 100755 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -77,7 +77,7 @@ String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal ) { // Applikations-Metrik besorgen und setzen - FieldUnit eOutUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eOutUnit = SfxModule::GetModuleFieldUnit( getFrameInterface() ); FieldUnit eInUnit = FUNIT_100TH_MM; String sMetric; diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 40ff18e2628b..3db4a25fd613 100755 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -1251,9 +1251,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) case ITEM_XCOLOR: break; case ITEM_COLOR: break; case ITEM_FONT: { - ((SvxFontItem*)pNewItem)->GetFamily()=FAMILY_DONTKNOW; - ((SvxFontItem*)pNewItem)->GetFamilyName()=aNewText; - ((SvxFontItem*)pNewItem)->GetStyleName().Erase(); + ((SvxFontItem*)pNewItem)->SetFamily( FAMILY_DONTKNOW ); + ((SvxFontItem*)pNewItem)->SetFamilyName(aNewText); + ((SvxFontItem*)pNewItem)->SetStyleName( String() ); } break; case ITEM_FONTHEIGHT: { sal_uIntPtr nHgt=0; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 5857a75d1b11..594f116ae545 100755 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -837,11 +837,11 @@ void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFo aOutTypeArr[ n ].nFntType, aOutTypeArr[ n ].nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0 )); SvxFontItem* pI = aItemArr[ n ]; - pI->GetFamily() = aFnt.GetFamily(); - pI->GetFamilyName() = aFnt.GetName(); - pI->GetStyleName().Erase(); - pI->GetPitch() = aFnt.GetPitch(); - pI->GetCharSet() = aFnt.GetCharSet(); + pI->SetFamily( aFnt.GetFamily()); + pI->SetFamilyName( aFnt.GetName()); + pI->SetStyleName( String() ); + pI->SetPitch( aFnt.GetPitch()); + pI->SetCharSet( aFnt.GetCharSet() ); } } @@ -855,29 +855,29 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt // get DEFAULTFONT_LATIN_TEXT and set at pool as dynamic default Font aFont(OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItem.GetFamily() = aFont.GetFamily(); - aSvxFontItem.GetFamilyName() = aFont.GetName(); - aSvxFontItem.GetStyleName().Erase(); - aSvxFontItem.GetPitch() = aFont.GetPitch(); - aSvxFontItem.GetCharSet() = aFont.GetCharSet(); + aSvxFontItem.SetFamily(aFont.GetFamily()); + aSvxFontItem.SetFamilyName(aFont.GetName()); + aSvxFontItem.SetStyleName(String()); + aSvxFontItem.SetPitch( aFont.GetPitch()); + aSvxFontItem.SetCharSet( aFont.GetCharSet() ); pItemPool->SetPoolDefaultItem(aSvxFontItem); // get DEFAULTFONT_CJK_TEXT and set at pool as dynamic default Font aFontCJK(OutputDevice::GetDefaultFont(DEFAULTFONT_CJK_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItemCJK.GetFamily() = aFontCJK.GetFamily(); - aSvxFontItemCJK.GetFamilyName() = aFontCJK.GetName(); - aSvxFontItemCJK.GetStyleName().Erase(); - aSvxFontItemCJK.GetPitch() = aFontCJK.GetPitch(); - aSvxFontItemCJK.GetCharSet() = aFontCJK.GetCharSet(); + aSvxFontItemCJK.SetFamily( aFontCJK.GetFamily()); + aSvxFontItemCJK.SetFamilyName(aFontCJK.GetName()); + aSvxFontItemCJK.SetStyleName(String()); + aSvxFontItemCJK.SetPitch( aFontCJK.GetPitch()); + aSvxFontItemCJK.SetCharSet( aFontCJK.GetCharSet()); pItemPool->SetPoolDefaultItem(aSvxFontItemCJK); // get DEFAULTFONT_CTL_TEXT and set at pool as dynamic default Font aFontCTL(OutputDevice::GetDefaultFont(DEFAULTFONT_CTL_TEXT, nLanguage, DEFAULTFONT_FLAGS_ONLYONE, 0)); - aSvxFontItemCTL.GetFamily() = aFontCTL.GetFamily(); - aSvxFontItemCTL.GetFamilyName() = aFontCTL.GetName(); - aSvxFontItemCTL.GetStyleName().Erase(); - aSvxFontItemCTL.GetPitch() = aFontCTL.GetPitch(); - aSvxFontItemCTL.GetCharSet() = aFontCTL.GetCharSet(); + aSvxFontItemCTL.SetFamily(aFontCTL.GetFamily()); + aSvxFontItemCTL.SetFamilyName(aFontCTL.GetName()); + aSvxFontItemCTL.SetStyleName(String()); + aSvxFontItemCTL.SetPitch( aFontCTL.GetPitch() ); + aSvxFontItemCTL.SetCharSet( aFontCTL.GetCharSet()); pItemPool->SetPoolDefaultItem(aSvxFontItemCTL); // set dynamic FontHeight defaults diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index f5beb6660b8b..e7fe6fd333bf 100755 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -468,7 +468,7 @@ SvxMetricField::SvxMetricField( SetLast( 5000 ); SetFirst( 0 ); - eDlgUnit = SfxModule::GetCurrentFieldUnit(); + eDlgUnit = SfxModule::GetModuleFieldUnit( mxFrame ); SetFieldUnit( *this, eDlgUnit, sal_False ); Show(); } @@ -552,7 +552,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit ) void SvxMetricField::RefreshDlgUnit() { - FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eTmpUnit = SfxModule::GetModuleFieldUnit( mxFrame ); if ( eDlgUnit != eTmpUnit ) { eDlgUnit = eTmpUnit; diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk index ac32cdbe453b..ce5b0b70b636 100755 --- a/sysui/desktop/icons/makefile.mk +++ b/sysui/desktop/icons/makefile.mk @@ -127,69 +127,6 @@ all: \ $(MISC)$/ooo11-math-doc.ico \ $(MISC)$/ooo11-writer-doc.ico \ $(MISC)$/ooo11-writer-tem.ico \ - $(MISC)$/so8-base-app.ico \ - $(MISC)$/so8-base-doc.ico \ - $(MISC)$/so8-calc-app.ico \ - $(MISC)$/so8-calc-doc.ico \ - $(MISC)$/so8-calc-tem.ico \ - $(MISC)$/so8-chart-doc.ico \ - $(MISC)$/so8-configuration.ico \ - $(MISC)$/so8-draw-app.ico \ - $(MISC)$/so8-draw-doc.ico \ - $(MISC)$/so8-draw-tem.ico \ - $(MISC)$/so8-empty-doc.ico \ - $(MISC)$/so8-empty-tem.ico \ - $(MISC)$/so8-image-doc.ico \ - $(MISC)$/so8-impress-app.ico \ - $(MISC)$/so8-impress-doc.ico \ - $(MISC)$/so8-impress-tem.ico \ - $(MISC)$/so8-macro-doc.ico \ - $(MISC)$/so8-main-app.ico \ - $(MISC)$/so8-master-doc.ico \ - $(MISC)$/so8-math-app.ico \ - $(MISC)$/so8-math-doc.ico \ - $(MISC)$/so8-open.ico \ - $(MISC)$/so8-printer.ico \ - $(MISC)$/so8-web-doc.ico \ - $(MISC)$/so8-writer-app.ico \ - $(MISC)$/so8-writer-doc.ico \ - $(MISC)$/so8-writer-tem.ico \ - $(MISC)$/so9_empty_tem.ico \ - $(MISC)$/so9_math_app.ico \ - $(MISC)$/so9_global_doc.ico \ - $(MISC)$/so9_main_app.ico \ - $(MISC)$/so9_empty_doc.ico \ - $(MISC)$/so9_math_doc.ico \ - $(MISC)$/so9_base_app.ico \ - $(MISC)$/so9_html_doc.ico \ - $(MISC)$/so9_impress_doc.ico \ - $(MISC)$/so9_draw_tem.ico \ - $(MISC)$/so9_writer_tem.ico \ - $(MISC)$/so9_impress_app.ico \ - $(MISC)$/so9_calc_tem.ico \ - $(MISC)$/so9_base_doc.ico \ - $(MISC)$/so9_macro_doc.ico \ - $(MISC)$/so9_calc_doc.ico \ - $(MISC)$/so9_draw_doc.ico \ - $(MISC)$/so9_writer_doc.ico \ - $(MISC)$/so9_calc_app.ico \ - $(MISC)$/so9_impress_tem.ico \ - $(MISC)$/so9_chart_doc.ico \ - $(MISC)$/so9_writer_app.ico \ - $(MISC)$/so9_draw_app.ico \ - $(MISC)$/so9_open.ico \ - $(MISC)$/so7-base-doc.ico \ - $(MISC)$/so7-calc-doc.ico \ - $(MISC)$/so7-calc-tem.ico \ - $(MISC)$/so7-chart-doc.ico \ - $(MISC)$/so7-draw-doc.ico \ - $(MISC)$/so7-draw-tem.ico \ - $(MISC)$/so7-impress-doc.ico \ - $(MISC)$/so7-impress-tem.ico \ - $(MISC)$/so7-master-doc.ico \ - $(MISC)$/so7-math-doc.ico \ - $(MISC)$/so7-writer-doc.ico \ - $(MISC)$/so7-writer-tem.ico \ $(MISC)$/oxt-extension.ico $(MISC)$/%.ico: %.ico diff --git a/sysui/desktop/icons/so7-base-doc.ico b/sysui/desktop/icons/so7-base-doc.ico Binary files differdeleted file mode 100755 index e4beab7270e1..000000000000 --- a/sysui/desktop/icons/so7-base-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-calc-doc.ico b/sysui/desktop/icons/so7-calc-doc.ico Binary files differdeleted file mode 100755 index 8b34fc606c5d..000000000000 --- a/sysui/desktop/icons/so7-calc-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-calc-tem.ico b/sysui/desktop/icons/so7-calc-tem.ico Binary files differdeleted file mode 100755 index d074a214a90b..000000000000 --- a/sysui/desktop/icons/so7-calc-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-chart-doc.ico b/sysui/desktop/icons/so7-chart-doc.ico Binary files differdeleted file mode 100755 index bdc613fb30e2..000000000000 --- a/sysui/desktop/icons/so7-chart-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-draw-doc.ico b/sysui/desktop/icons/so7-draw-doc.ico Binary files differdeleted file mode 100755 index c2881862053a..000000000000 --- a/sysui/desktop/icons/so7-draw-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-draw-tem.ico b/sysui/desktop/icons/so7-draw-tem.ico Binary files differdeleted file mode 100755 index 8d713d0f470e..000000000000 --- a/sysui/desktop/icons/so7-draw-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-impress-doc.ico b/sysui/desktop/icons/so7-impress-doc.ico Binary files differdeleted file mode 100755 index a8f9518e624b..000000000000 --- a/sysui/desktop/icons/so7-impress-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-impress-tem.ico b/sysui/desktop/icons/so7-impress-tem.ico Binary files differdeleted file mode 100755 index ac140b269242..000000000000 --- a/sysui/desktop/icons/so7-impress-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-master-doc.ico b/sysui/desktop/icons/so7-master-doc.ico Binary files differdeleted file mode 100755 index 1c3068715990..000000000000 --- a/sysui/desktop/icons/so7-master-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-math-doc.ico b/sysui/desktop/icons/so7-math-doc.ico Binary files differdeleted file mode 100755 index d1cd9bd4c6bd..000000000000 --- a/sysui/desktop/icons/so7-math-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-writer-doc.ico b/sysui/desktop/icons/so7-writer-doc.ico Binary files differdeleted file mode 100755 index b8eb3df20564..000000000000 --- a/sysui/desktop/icons/so7-writer-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so7-writer-tem.ico b/sysui/desktop/icons/so7-writer-tem.ico Binary files differdeleted file mode 100755 index 318cce4bc9a7..000000000000 --- a/sysui/desktop/icons/so7-writer-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-base-app.ico b/sysui/desktop/icons/so8-base-app.ico Binary files differdeleted file mode 100755 index 4a22d3529614..000000000000 --- a/sysui/desktop/icons/so8-base-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-base-doc.ico b/sysui/desktop/icons/so8-base-doc.ico Binary files differdeleted file mode 100755 index bcddbf957630..000000000000 --- a/sysui/desktop/icons/so8-base-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-calc-app.ico b/sysui/desktop/icons/so8-calc-app.ico Binary files differdeleted file mode 100755 index a28cab56157b..000000000000 --- a/sysui/desktop/icons/so8-calc-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-calc-doc.ico b/sysui/desktop/icons/so8-calc-doc.ico Binary files differdeleted file mode 100755 index 5f293dd82c30..000000000000 --- a/sysui/desktop/icons/so8-calc-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-calc-tem.ico b/sysui/desktop/icons/so8-calc-tem.ico Binary files differdeleted file mode 100755 index 98bf90678573..000000000000 --- a/sysui/desktop/icons/so8-calc-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-chart-doc.ico b/sysui/desktop/icons/so8-chart-doc.ico Binary files differdeleted file mode 100755 index 01ff8365434b..000000000000 --- a/sysui/desktop/icons/so8-chart-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-configuration.ico b/sysui/desktop/icons/so8-configuration.ico Binary files differdeleted file mode 100755 index 57f3b6701b30..000000000000 --- a/sysui/desktop/icons/so8-configuration.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-draw-app.ico b/sysui/desktop/icons/so8-draw-app.ico Binary files differdeleted file mode 100755 index 6003ccb3d7c3..000000000000 --- a/sysui/desktop/icons/so8-draw-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-draw-doc.ico b/sysui/desktop/icons/so8-draw-doc.ico Binary files differdeleted file mode 100755 index f4f169bd6fb5..000000000000 --- a/sysui/desktop/icons/so8-draw-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-draw-tem.ico b/sysui/desktop/icons/so8-draw-tem.ico Binary files differdeleted file mode 100755 index d3f63c38dbe0..000000000000 --- a/sysui/desktop/icons/so8-draw-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-empty-doc.ico b/sysui/desktop/icons/so8-empty-doc.ico Binary files differdeleted file mode 100755 index b71d2b939ca7..000000000000 --- a/sysui/desktop/icons/so8-empty-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-empty-tem.ico b/sysui/desktop/icons/so8-empty-tem.ico Binary files differdeleted file mode 100755 index 9368b0a81aef..000000000000 --- a/sysui/desktop/icons/so8-empty-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-image-doc.ico b/sysui/desktop/icons/so8-image-doc.ico Binary files differdeleted file mode 100755 index 11b4f0f6c718..000000000000 --- a/sysui/desktop/icons/so8-image-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-impress-app.ico b/sysui/desktop/icons/so8-impress-app.ico Binary files differdeleted file mode 100755 index 8fae43dab26d..000000000000 --- a/sysui/desktop/icons/so8-impress-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-impress-doc.ico b/sysui/desktop/icons/so8-impress-doc.ico Binary files differdeleted file mode 100755 index 9a91f89f2900..000000000000 --- a/sysui/desktop/icons/so8-impress-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-impress-tem.ico b/sysui/desktop/icons/so8-impress-tem.ico Binary files differdeleted file mode 100755 index f84f813f992c..000000000000 --- a/sysui/desktop/icons/so8-impress-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-macro-doc.ico b/sysui/desktop/icons/so8-macro-doc.ico Binary files differdeleted file mode 100755 index f3742e1274e7..000000000000 --- a/sysui/desktop/icons/so8-macro-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-main-app.ico b/sysui/desktop/icons/so8-main-app.ico Binary files differdeleted file mode 100755 index aa044ad9c702..000000000000 --- a/sysui/desktop/icons/so8-main-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-master-doc.ico b/sysui/desktop/icons/so8-master-doc.ico Binary files differdeleted file mode 100755 index 27a1d2f61c49..000000000000 --- a/sysui/desktop/icons/so8-master-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-math-app.ico b/sysui/desktop/icons/so8-math-app.ico Binary files differdeleted file mode 100755 index 956c259c756a..000000000000 --- a/sysui/desktop/icons/so8-math-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-math-doc.ico b/sysui/desktop/icons/so8-math-doc.ico Binary files differdeleted file mode 100755 index e7b88449999f..000000000000 --- a/sysui/desktop/icons/so8-math-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-open.ico b/sysui/desktop/icons/so8-open.ico Binary files differdeleted file mode 100755 index b77a741b338f..000000000000 --- a/sysui/desktop/icons/so8-open.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-printer.ico b/sysui/desktop/icons/so8-printer.ico Binary files differdeleted file mode 100755 index 25e61f8de5d5..000000000000 --- a/sysui/desktop/icons/so8-printer.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-web-doc.ico b/sysui/desktop/icons/so8-web-doc.ico Binary files differdeleted file mode 100755 index 12eeb63cffb2..000000000000 --- a/sysui/desktop/icons/so8-web-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-writer-app.ico b/sysui/desktop/icons/so8-writer-app.ico Binary files differdeleted file mode 100755 index 15f7f92d4b45..000000000000 --- a/sysui/desktop/icons/so8-writer-app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-writer-doc.ico b/sysui/desktop/icons/so8-writer-doc.ico Binary files differdeleted file mode 100755 index da774be1d3ac..000000000000 --- a/sysui/desktop/icons/so8-writer-doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so8-writer-tem.ico b/sysui/desktop/icons/so8-writer-tem.ico Binary files differdeleted file mode 100755 index 1bdb86c8090f..000000000000 --- a/sysui/desktop/icons/so8-writer-tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_base_app.ico b/sysui/desktop/icons/so9_base_app.ico Binary files differdeleted file mode 100755 index 56a323c07e61..000000000000 --- a/sysui/desktop/icons/so9_base_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_base_doc.ico b/sysui/desktop/icons/so9_base_doc.ico Binary files differdeleted file mode 100755 index 8cc1d4433c2c..000000000000 --- a/sysui/desktop/icons/so9_base_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_calc_app.ico b/sysui/desktop/icons/so9_calc_app.ico Binary files differdeleted file mode 100755 index 81e6948d3971..000000000000 --- a/sysui/desktop/icons/so9_calc_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_calc_doc.ico b/sysui/desktop/icons/so9_calc_doc.ico Binary files differdeleted file mode 100755 index 2b9e514cb97b..000000000000 --- a/sysui/desktop/icons/so9_calc_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_calc_tem.ico b/sysui/desktop/icons/so9_calc_tem.ico Binary files differdeleted file mode 100755 index 17f4823c4374..000000000000 --- a/sysui/desktop/icons/so9_calc_tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_chart_doc.ico b/sysui/desktop/icons/so9_chart_doc.ico Binary files differdeleted file mode 100755 index b116c81903b3..000000000000 --- a/sysui/desktop/icons/so9_chart_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_draw_app.ico b/sysui/desktop/icons/so9_draw_app.ico Binary files differdeleted file mode 100755 index a2c108ad6fe2..000000000000 --- a/sysui/desktop/icons/so9_draw_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_draw_doc.ico b/sysui/desktop/icons/so9_draw_doc.ico Binary files differdeleted file mode 100755 index 51f95046709a..000000000000 --- a/sysui/desktop/icons/so9_draw_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_draw_tem.ico b/sysui/desktop/icons/so9_draw_tem.ico Binary files differdeleted file mode 100755 index e4b341175bff..000000000000 --- a/sysui/desktop/icons/so9_draw_tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_empty_doc.ico b/sysui/desktop/icons/so9_empty_doc.ico Binary files differdeleted file mode 100755 index a3970775e3ed..000000000000 --- a/sysui/desktop/icons/so9_empty_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_empty_tem.ico b/sysui/desktop/icons/so9_empty_tem.ico Binary files differdeleted file mode 100755 index 1b0088b80277..000000000000 --- a/sysui/desktop/icons/so9_empty_tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_global_doc.ico b/sysui/desktop/icons/so9_global_doc.ico Binary files differdeleted file mode 100755 index ea4ccb383956..000000000000 --- a/sysui/desktop/icons/so9_global_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_html_doc.ico b/sysui/desktop/icons/so9_html_doc.ico Binary files differdeleted file mode 100755 index 4e5b8bc99c07..000000000000 --- a/sysui/desktop/icons/so9_html_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_impress_app.ico b/sysui/desktop/icons/so9_impress_app.ico Binary files differdeleted file mode 100755 index 0fe4cea9f267..000000000000 --- a/sysui/desktop/icons/so9_impress_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_impress_doc.ico b/sysui/desktop/icons/so9_impress_doc.ico Binary files differdeleted file mode 100755 index 5258a8b6aa4c..000000000000 --- a/sysui/desktop/icons/so9_impress_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_impress_tem.ico b/sysui/desktop/icons/so9_impress_tem.ico Binary files differdeleted file mode 100755 index dcdbddb3b654..000000000000 --- a/sysui/desktop/icons/so9_impress_tem.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_macro_doc.ico b/sysui/desktop/icons/so9_macro_doc.ico Binary files differdeleted file mode 100755 index cd004015e63f..000000000000 --- a/sysui/desktop/icons/so9_macro_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_main_app.ico b/sysui/desktop/icons/so9_main_app.ico Binary files differdeleted file mode 100755 index 197b924d3369..000000000000 --- a/sysui/desktop/icons/so9_main_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_math_app.ico b/sysui/desktop/icons/so9_math_app.ico Binary files differdeleted file mode 100755 index 4d947c2e593d..000000000000 --- a/sysui/desktop/icons/so9_math_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_math_doc.ico b/sysui/desktop/icons/so9_math_doc.ico Binary files differdeleted file mode 100755 index 622ae939d23a..000000000000 --- a/sysui/desktop/icons/so9_math_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico Binary files differdeleted file mode 100755 index 90f193d80dd9..000000000000 --- a/sysui/desktop/icons/so9_open.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_writer_app.ico b/sysui/desktop/icons/so9_writer_app.ico Binary files differdeleted file mode 100755 index 2df20830d9d2..000000000000 --- a/sysui/desktop/icons/so9_writer_app.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_writer_doc.ico b/sysui/desktop/icons/so9_writer_doc.ico Binary files differdeleted file mode 100755 index b0cf11a993c9..000000000000 --- a/sysui/desktop/icons/so9_writer_doc.ico +++ /dev/null diff --git a/sysui/desktop/icons/so9_writer_tem.ico b/sysui/desktop/icons/so9_writer_tem.ico Binary files differdeleted file mode 100755 index 2e62a1934646..000000000000 --- a/sysui/desktop/icons/so9_writer_tem.ico +++ /dev/null diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst index b5f26eb936b9..097cae97ed29 100755 --- a/sysui/prj/build.lst +++ b/sysui/prj/build.lst @@ -1,6 +1,6 @@ su sysui : L10N:l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL -su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL -su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL +#su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL +#su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL su sysui\desktop\icons nmake - w su_iconsw NULL su sysui\desktop\os2 nmake - p su_iconsw NULL su sysui\desktop\macosx nmake - u su_dtmacosx su_dtshare.u NULL @@ -16,4 +16,4 @@ su sysui\desktop\debian nmake - u su_dtdebian su_dtshare.u su sysui\desktop\slackware nmake - u su_dtslackware su_dtshare.u NULL su sysui\desktop\solaris nmake - u su_dtsolaris su_dtshare.u NULL su sysui\desktop\util nmake - u su_desktop su_dtredhat.u su_dtsuse.u su_dtmdk.u su_dtfreedesktop.u su_dtdebian.u su_dtslackware.u NULL -su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_win32_quickstart_so.w su_iconsw.w NULL +su sysui\util nmake - all su_util su_dtsolaris.u su_desktop.u su_iconsw.w NULL diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst index c6019cea9a43..918ee8bcbc8f 100755 --- a/sysui/prj/d.lst +++ b/sysui/prj/d.lst @@ -15,10 +15,6 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg ..\%__SRC%\bin\pkg\*.tar.gz %_DEST%\bin%_EXT%\desktop-integration\pkg\*.tar.gz ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll -..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\quickstart.exe -..\%__SRC%\bin\quickstart.exe %_DEST%\bin%_EXT%\install_quickstart.exe -..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe -..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe ..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index cfa4c67496e3..0b58d6050768 100755 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -131,7 +131,11 @@ OfficeDocumentsManager::OfficeDocumentsManager( // virtual OfficeDocumentsManager::~OfficeDocumentsManager() { - OSL_ENSURE( m_aDocs.empty(), "document list not empty!" ); + //OSL_ENSURE( m_aDocs.empty(), "document list not empty!" ); + // no need to assert this: Normal shutdown of OOo could already trigger it, since the order in which + // objects are actually released/destroyed upon shutdown is not defined. And when we arrive *here*, + // OOo *is* shutting down currently, since we're held by the TDOC provider, which is disposed + // upon shutdown. } //========================================================================= @@ -424,8 +428,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( ++it; } - OSL_ENSURE( it != m_aDocs.end(), - "TitleChanged event notified for unknown document!" ); +// OSL_ENSURE( it != m_aDocs.end(), +// "TitleChanged event notified for unknown document!" ); + // TODO: re-enable this assertion. It has been disabled for now, since it breaks the assertion-free smoketest, + // and the fix is more difficult than what can be done now. + // The problem is that at the moment, when you close a SFX-based document via API, it will first + // fire the notifyClosing event, which will make the OfficeDocumentsManager remove the doc from its list. + // Then, it will notify an OnTitleChanged, then an OnUnload. Documents closed via call the notifyClosing + // *after* OnUnload and all other On* events. + // In agreement with MBA, the implementation for SfxBaseModel::Close should be changed to also send notifyClosing + // as last event. When this happens, the assertion here must be enabled, again. + // There is no bug for this, yet - IZ is currently down due to the Kenai migration. + // 2011-02-23 / frank.schoenheit@sun.com } } } diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java index bd09982daa3e..abb866804b43 100755 --- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java +++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java @@ -40,6 +40,14 @@ import java.io.IOException; import java.util.Date; import java.util.zip.ZipOutputStream; +/** + When this tool is used with long path names on Windows, that is paths which start + with \\?\, then the caller must make sure that the path is unique. This is achieved + by removing '.' and '..' from the path. Paths which are created by + osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because + lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene + module. + */ public class HelpIndexer extends WeakBase implements XServiceInfo, XInvocation { diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 6ae161656bbc..eb0ca7e6d886 100755 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -419,9 +419,6 @@ rtl::OUString Databases::getInstallPathAsSystemPath() return m_aInstallDirectoryAsSystemPath; } - - - rtl::OUString Databases::getInstallPathAsURL() { osl::MutexGuard aGuard( m_aMutex ); @@ -645,28 +642,24 @@ Db* Databases::getBerkeley( const rtl::OUString& Database, { Db* table = new Db(); - rtl::OUString fileNameOU; + rtl::OUString fileURL; if( pExtensionPath ) - { - rtl::OUString aExpandedURL = expandURL( *pExtensionPath ); - aExpandedURL += Language + dbFileName; - osl::FileBase::getSystemPathFromFileURL( aExpandedURL, fileNameOU ); - } + fileURL = expandURL(*pExtensionPath) + Language + dbFileName; else - fileNameOU = getInstallPathAsSystemPath() + key; - + fileURL = getInstallPathAsURL() + key; - rtl::OString fileName( fileNameOU.getStr(),fileNameOU.getLength(),osl_getThreadTextEncoding() ); - - rtl::OUString fileNameDBHelp( fileNameOU ); + rtl::OUString fileNameDBHelp( fileURL ); + //Extensions always use the new format if( pExtensionPath != NULL ) fileNameDBHelp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_" )); + //SimpleFileAccess takes file URLs as arguments!!! Using filenames works accidentally but + //fails for example when using long path names on Windows (starting with \\?\) if( m_xSFA->exists( fileNameDBHelp ) ) { DBHelp* pDBHelp = new DBHelp( fileNameDBHelp, m_xSFA ); table->setDBHelp( pDBHelp ); } - else if( table->open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + else if( table->open( 0,fileURL, DB_BTREE,DB_RDONLY,0644 ) ) { table->close( 0 ); delete table; @@ -944,17 +937,13 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database, std::vector<KeywordInfo::KeywordElement> aVector; KeyDataBaseFileIterator aDbFileIt( m_xContext, *this, Database, Language ); - rtl::OUString fileNameOU; + rtl::OUString fileURL; bool bExtension = false; - while( (fileNameOU = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 ) + while( (fileURL = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 ) { - rtl::OString fileName( fileNameOU.getStr(), - fileNameOU.getLength(), - osl_getThreadTextEncoding() ); - Db table; - rtl::OUString fileNameDBHelp( fileNameOU ); + rtl::OUString fileNameDBHelp( fileURL ); if( bExtension ) fileNameDBHelp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_" )); if( m_xSFA->exists( fileNameDBHelp ) ) @@ -1001,7 +990,7 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database, } } - else if( 0 == table.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + else if( 0 == table.open( 0,fileURL,DB_BTREE,DB_RDONLY,0644 ) ) { Db* idmap = getBerkeley( Database,Language ); @@ -1853,6 +1842,7 @@ Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xP //=================================================================== // class KeyDataBaseFileIterator +//returns a file URL rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) { rtl::OUString aRetFile; @@ -1863,7 +1853,7 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) { case INITIAL_MODULE: aRetFile = - m_rDatabases.getInstallPathAsSystemPath() + + m_rDatabases.getInstallPathAsURL() + m_rDatabases.processLang( m_aLanguage ) + aSlash + m_aInitialModule + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".key" )); @@ -1921,16 +1911,14 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) return aRetFile; } +//Returns a file URL, that does not contain macros rtl::OUString KeyDataBaseFileIterator::implGetDbFileFromPackage ( Reference< deployment::XPackage > xPackage ) { rtl::OUString aExpandedURL = implGetFileFromPackage( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".key" )), xPackage ); - rtl::OUString aRetFile; - osl::FileBase::getSystemPathFromFileURL( aExpandedURL, aRetFile ); - - return aRetFile; + return aExpandedURL; } diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index c9708fbaca9f..eeb6d006b2f5 100755 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -509,7 +509,7 @@ namespace chelp { Databases& rDatabases, const rtl::OUString& aInitialModule, const rtl::OUString& aLanguage ) : ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage ) {} - + //Returns a file URL rtl::OUString nextDbFile( bool& o_rbExtension ); private: diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx index 3bb5a68fd75d..1dd3178865e2 100755 --- a/xmlhelp/source/cxxhelp/provider/db.cxx +++ b/xmlhelp/source/cxxhelp/provider/db.cxx @@ -36,6 +36,8 @@ #include "com/sun/star/io/XSeekable.hpp" +#include "osl/file.hxx" +#include "osl/thread.hxx" using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::io; @@ -100,11 +102,11 @@ void DBHelp::createHashMap( bool bOptimizeForPerformance ) m_pStringToValPosMap = new StringToValPosMap(); } - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { Sequence< sal_Int8 > aData; - sal_Int32 nSize = m_xSFA->getSize( m_aFileName ); + sal_Int32 nSize = m_xSFA->getSize( m_aFileURL ); sal_Int32 nRead = xIn->readBytes( aData, nSize ); const char* pData = (const char*)aData.getConstArray(); @@ -183,7 +185,7 @@ bool DBHelp::getValueForKey( const rtl::OString& rKey, DBData& rValue ) int iValuePos = rValPair.first; int nValueLen = rValPair.second; - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { Reference< XSeekable > xXSeekable( xIn, UNO_QUERY ); @@ -231,9 +233,9 @@ bool DBHelp::startIteration( void ) { bool bSuccess = false; - sal_Int32 nSize = m_xSFA->getSize( m_aFileName ); + sal_Int32 nSize = m_xSFA->getSize( m_aFileURL ); - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { m_nItRead = xIn->readBytes( m_aItData, nSize ); @@ -314,6 +316,19 @@ int Db::open(DB_TXN *txnid, return db_internal::check_error( err,"Db::open" ); } +int Db::open(DB_TXN *txnid, + ::rtl::OUString const & fileURL, + DBTYPE type, + u_int32_t flags, + int mode) +{ + ::rtl::OUString ouPath; + ::osl::FileBase::getSystemPathFromFileURL(fileURL, ouPath); + const ::rtl::OString sPath = ::rtl::OUStringToOString(ouPath, osl_getThreadTextEncoding()); + return open(txnid, sPath.getStr(), 0, type, flags, mode); +} + + int Db::get(DB_TXN *txnid, Dbt *key, Dbt *data, u_int32_t flags) { diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index f36b880af27d..b34aa4a34600 100755 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -117,7 +117,7 @@ namespace berkeleydbproxy { class DBHelp { - rtl::OUString m_aFileName; + rtl::OUString m_aFileURL; StringToDataMap* m_pStringToDataMap; StringToValPosMap* m_pStringToValPosMap; com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > @@ -132,16 +132,21 @@ namespace berkeleydbproxy { bool implReadLenAndData( const char* pData, int& riPos, DBData& rValue ); public: - DBHelp( const rtl::OUString& rFileName, + //DBHelp must get a fileURL which can then directly be used by simple file access. + //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails + //for example when using long file paths on Windows, which start with "\\?\" + DBHelp( const rtl::OUString& rFileURL, com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > xSFA ) - : m_aFileName( rFileName ) + : m_aFileURL( rFileURL ) , m_pStringToDataMap( NULL ) , m_pStringToValPosMap( NULL ) , m_xSFA( xSFA ) , m_pItData( NULL ) , m_nItRead( -1 ) , m_iItPos( -1 ) - {} + { + OSL_ASSERT(!rFileURL.compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:")), 5)); + } ~DBHelp() { releaseHashMap(); } @@ -179,6 +184,12 @@ namespace berkeleydbproxy { u_int32_t flags, int mode); + int open(DB_TXN *txnid, + ::rtl::OUString const & fileURL, + DBTYPE type, + u_int32_t flags, + int mode); + int get(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 05e090be09dd..d8619e9b2b61 100755 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -604,24 +604,20 @@ OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) return aResult.makeStringAndClear(); } -OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xLabelSeq ) +void lcl_getLabelStringSequence( Sequence< OUString >& rOutLabels, const Reference< chart2::data::XDataSequence > & xLabelSeq ) { - Sequence< OUString > aLabels; - uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xLabelSeq, uno::UNO_QUERY ); if( xTextualDataSequence.is()) { - aLabels = xTextualDataSequence->getTextualData(); + rOutLabels = xTextualDataSequence->getTextualData(); } else if( xLabelSeq.is()) { Sequence< uno::Any > aAnies( xLabelSeq->getData()); - aLabels.realloc( aAnies.getLength()); + rOutLabels.realloc( aAnies.getLength()); for( sal_Int32 i=0; i<aAnies.getLength(); ++i ) - aAnies[i] >>= aLabels[i]; + aAnies[i] >>= rOutLabels[i]; } - - return lcl_flattenStringSequence( aLabels ); } sal_Int32 lcl_getMaxSequenceLength( @@ -641,46 +637,96 @@ sal_Int32 lcl_getMaxSequenceLength( return nResult; } -double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence > & xSeq, sal_Int32 nIndex ) +uno::Sequence< rtl::OUString > lcl_DataSequenceToStringSequence( + const uno::Reference< chart2::data::XDataSequence >& xDataSequence ) { - double fResult = 0.0; - ::rtl::math::setNan( &fResult ); - Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY ); - if( xNumSeq.is()) + uno::Sequence< rtl::OUString > aResult; + if(!xDataSequence.is()) + return aResult; + + uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY ); + if( xTextualDataSequence.is() ) { - Sequence< double > aValues( xNumSeq->getNumericalData()); - if( nIndex < aValues.getLength() ) - fResult = aValues[nIndex]; + aResult = xTextualDataSequence->getTextualData(); } else { - Sequence< uno::Any > aAnies( xSeq->getData()); - if( nIndex < aAnies.getLength() ) - aAnies[nIndex] >>= fResult; + uno::Sequence< uno::Any > aValues = xDataSequence->getData(); + aResult.realloc(aValues.getLength()); + + for(sal_Int32 nN=aValues.getLength();nN--;) + aValues[nN] >>= aResult[nN]; } - return fResult; -} + return aResult; +} ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) { double fNan = 0.0; ::rtl::math::setNan( &fNan ); ::std::vector< double > aResult; + if(!xSeq.is()) + return aResult; + uno::Sequence< double > aValuesSequence; Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY ); - if( xNumSeq.is()) + if( xNumSeq.is() ) { - Sequence< double > aValues( xNumSeq->getNumericalData()); - ::std::copy( aValues.getConstArray(), aValues.getConstArray() + aValues.getLength(), - ::std::back_inserter( aResult )); + aValuesSequence = xNumSeq->getNumericalData(); } - else if( xSeq.is()) + else { - Sequence< uno::Any > aAnies( xSeq->getData()); - aResult.resize( aAnies.getLength(), fNan ); + Sequence< uno::Any > aAnies( xSeq->getData() ); + aValuesSequence.realloc( aAnies.getLength() ); for( sal_Int32 i=0; i<aAnies.getLength(); ++i ) - aAnies[i] >>= aResult[i]; + aAnies[i] >>= aValuesSequence[i]; + } + + //special handling for x-values (if x-values do point to categories, indices are used instead ) + Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY ); + if( xProp.is() ) + { + OUString aRole; + xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Role") ) ) >>= aRole; + if( aRole.match( OUString( RTL_CONSTASCII_USTRINGPARAM( "values-x") ) ) ) + { + //lcl_clearIfNoValuesButTextIsContained - replace by indices if the values are not appropriate + bool bHasValue=false; + bool bHasText=false; + sal_Int32 nCount = aValuesSequence.getLength(); + for( sal_Int32 j = 0; j < nCount; ++j ) + { + if( !::rtl::math::isNan( aValuesSequence[j] ) ) + { + bHasValue=true; + break; + } + } + if(!bHasValue) + { + //no double value is countained + //is there any text? + uno::Sequence< rtl::OUString > aStrings( lcl_DataSequenceToStringSequence( xSeq ) ); + sal_Int32 nTextCount = aStrings.getLength(); + for( sal_Int32 j = 0; j < nTextCount; ++j ) + { + if( aStrings[j].getLength() ) + { + bHasText=true; + break; + } + } + } + if( !bHasValue && bHasText ) + { + for( sal_Int32 j = 0; j < nCount; ++j ) + aValuesSequence[j] = j+1; + } + } } + + ::std::copy( aValuesSequence.getConstArray(), aValuesSequence.getConstArray() + aValuesSequence.getLength(), + ::std::back_inserter( aResult )); return aResult; } @@ -805,15 +851,20 @@ lcl_TableData lcl_getDataForLocalTable( Sequence< OUString > aSimpleCategories; if( xAnyDescriptionAccess.is() ) { + //categories if( bSeriesFromColumns ) + { aSimpleCategories = xAnyDescriptionAccess->getRowDescriptions(); + aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions(); + } else + { aSimpleCategories = xAnyDescriptionAccess->getColumnDescriptions(); - - aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions(); - aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions(); + aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions(); + } } + //series values and series labels SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size(); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin()); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end()); @@ -858,19 +909,25 @@ lcl_TableData lcl_getDataForLocalTable( // iterate over all sequences size_t nSeqIdx = 0; + Sequence< Sequence< OUString > > aComplexLabels(nNumSequences); for( ; aIt != aEnd; ++aIt, ++nSeqIdx ) { OUString aRange; + Sequence< OUString >& rCurrentComplexLabel = aComplexLabels[nSeqIdx]; if( aIt->first.is()) { - rLabels[nSeqIdx] = lcl_getLabelString( aIt->first ); + lcl_getLabelStringSequence( rCurrentComplexLabel, aIt->first ); + rLabels[nSeqIdx] = lcl_flattenStringSequence( rCurrentComplexLabel ); aRange = aIt->first->getSourceRangeRepresentation(); if( xRangeConversion.is()) aRange = xRangeConversion->convertRangeToXML( aRange ); } else if( aIt->second.is()) - rLabels[nSeqIdx] = lcl_flattenStringSequence( + { + rCurrentComplexLabel.realloc(1); + rLabels[nSeqIdx] = rCurrentComplexLabel[0] = lcl_flattenStringSequence( aIt->second->generateLabel( chart2::data::LabelOrigin_SHORT_SIDE )); + } if( bSeriesFromColumns ) aResult.aColumnDescriptions_Ranges.push_back( aRange ); else @@ -898,6 +955,16 @@ lcl_TableData lcl_getDataForLocalTable( if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) ) aResult.aHiddenColumns.push_back(nSeqIdx); } + Sequence< Sequence< Any > >& rComplexAnyLabels = bSeriesFromColumns ? aResult.aComplexColumnDescriptions : aResult.aComplexRowDescriptions;//#i116544# + rComplexAnyLabels.realloc(aComplexLabels.getLength()); + for( sal_Int32 nN=0; nN<aComplexLabels.getLength();nN++ ) + { + Sequence< OUString >& rSource = aComplexLabels[nN]; + Sequence< Any >& rTarget = rComplexAnyLabels[nN]; + rTarget.realloc( rSource.getLength() ); + for( sal_Int32 i=0; i<rSource.getLength(); i++ ) + rTarget[i] = uno::makeAny( rSource[i] ); + } } catch( uno::Exception & rEx ) { @@ -1765,7 +1832,7 @@ void SchXMLExportHelper_Impl::exportTable() for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin()) ; aRowIt != aData.aDataInRows.end() - ; aRowIt++, nC++, aRowDescriptionsIter++ ) + ; ++aRowIt, ++nC ) { SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True ); @@ -1803,8 +1870,10 @@ void SchXMLExportHelper_Impl::exportTable() if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) { // remind the original range to allow a correct re-association when copying via clipboard - SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ ); + SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter ); + ++aRowDescriptions_RangeIter; } + ++aRowDescriptionsIter; } } diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index d9fd9fdf5e53..db606730354f 100755 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -422,7 +422,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib // values Reference< chart2::data::XDataSequence > xSeq; - if( bHasRange ) + if( bHasRange && m_aSeriesRange.getLength() ) xSeq = SchXMLTools::CreateDataSequence( m_aSeriesRange, mxNewDoc ); Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY ); @@ -441,7 +441,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq )); // label - if( bHasLabelRange ) + if( bHasLabelRange && m_aSeriesLabelRange.getLength() ) { Reference< chart2::data::XDataSequence > xLabelSequence = SchXMLTools::CreateDataSequence( m_aSeriesLabelRange, mxNewDoc ); @@ -580,6 +580,11 @@ void SchXMLSeries2Context::EndElement() aDomainInfos.push_back( aDomainInfo ); m_rGlobalSeriesImportInfo.nCurrentDataIndex++; } + else if( m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() ) + { + DomainInfo aDomainInfo( OUString::createFromAscii("values-y"), m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress, m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex ) ; + aDomainInfos.push_back( aDomainInfo ); + } } if( bDeleteSeries ) diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 1158cc7487ee..cfe5553b6c56 100755 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -416,7 +416,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence( OSL_FAIL( "could not create data sequence" ); } - if( !xRet.is() && !xChartDoc->hasInternalDataProvider() ) + if( !xRet.is() && !xChartDoc->hasInternalDataProvider() && rRange.getLength() ) { //#i103911# switch to internal data in case the parent cannot provide the requested data xChartDoc->createInternalDataProvider( sal_True /* bCloneExistingData */ ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index eac3025029ea..03659c39b2dd 100755 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -116,8 +116,8 @@ using namespace ::xmloff::token; sal_Char const sXML_1_1[] = "1.1"; sal_Char const sXML_1_2[] = "1.2"; -const sal_Char s_grddl_xsl[] = - "http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl"; +// #i115030#: the XSLT is not finished, and not available via HTTP +const sal_Char s_grddl_xsl[] = "http://FIXME"; #define LOGFILE_AUTHOR "mb93740" @@ -1260,7 +1260,7 @@ void SvXMLExport::SetBodyAttributes() } static void -lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode) +lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 /*nExportMode*/) { // check version >= 1.2 switch (rExport.getDefaultVersion()) { @@ -1269,11 +1269,14 @@ lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode) default: break; } + // #i115030#: disabled +#if 0 if (EXPORT_SETTINGS != nExportMode) // meta, content, styles { rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, OUString(RTL_CONSTASCII_USTRINGPARAM(s_grddl_xsl)) ); } +#endif } sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 13facc11a411..c3f66197a403 100755 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -694,7 +694,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) ) { if( aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape && aShapeInfo.meShapeType != XmlShapeTypePresPageShape && - aShapeInfo.meShapeType != XmlShapeTypeHandoutShape ) + aShapeInfo.meShapeType != XmlShapeTypeHandoutShape && aShapeInfo.meShapeType != XmlShapeTypeDrawChartShape ) try { diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 8e4ead1ccf51..6ff60f002d39 100755 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -291,15 +291,25 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sTmp.append( nLevel + 1 ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() ); // #i110694#: no style-name on list-level-style-image - if ((sTextStyleName.getLength() > 0) && (NumberingType::BITMAP != eType)) + // #i116149#: neither prefix/suffix + if (NumberingType::BITMAP != eType) { - GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, - GetExport().EncodeStyleName( sTextStyleName ) ); + if (sTextStyleName.getLength() > 0) + { + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, + GetExport().EncodeStyleName( sTextStyleName ) ); + } + if (sPrefix.getLength() > 0) + { + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, + sPrefix ); + } + if (sSuffix.getLength() > 0) + { + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, + sSuffix ); + } } - if( sPrefix.getLength() > 0 ) - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sPrefix ); - if( sSuffix.getLength() > 0 ) - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sSuffix ); enum XMLTokenEnum eElem = XML_LIST_LEVEL_STYLE_NUMBER; if( NumberingType::CHAR_SPECIAL == eType ) diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index bc870bad0f05..1d6d5a518249 100755 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -491,6 +491,22 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( nCount++; } + if (bBullet && sSuffix.getLength()) + { + sal_uInt16 const nVersion(GetImport().getGeneratorVersion()); + sal_Int32 nUPD; + sal_Int32 nBuildId; + if (GetImport().getBuildIds(nUPD, nBuildId) + && ( (SvXMLImport::OOo_1x == nVersion) + || (SvXMLImport::OOo_2x == nVersion) + || (310 == nUPD) || (320 == nUPD) || (330 == nUPD) + || ((300 == nUPD) && (nBuildId <= 9573)))) + { + // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars + sSuffix = ::rtl::OUString(); // clear it + } + } + Sequence<beans::PropertyValue> aPropSeq( nCount ); if( nCount > 0 ) { diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx index 59ffede601f7..1b14c1fb9665 100755 --- a/xmloff/source/text/XMLAutoTextEventExport.cxx +++ b/xmloff/source/text/XMLAutoTextEventExport.cxx @@ -210,6 +210,9 @@ void XMLAutoTextEventExport::addNamespaces() GetAttrList().AddAttribute( GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_OOO ), GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_OOO ) ); + GetAttrList().AddAttribute( + GetNamespaceMap().GetAttrNameByIndex( XML_NAMESPACE_XLINK ), + GetNamespaceMap().GetNameByIndex( XML_NAMESPACE_XLINK ) ); } void XMLAutoTextEventExport::exportEvents() diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 219c421b4fea..a430339fcadd 100755 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -1031,7 +1031,8 @@ sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML( { rValue >>= rStrExpValue; - return sal_True; + // #i114107# attribute of type "character": export only if length is 1 + return (1 == rStrExpValue.getLength()) ? sal_True : sal_False; } XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl() diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx b/xmloff/source/transform/PropertyActionsOOo.cxx index 885b69f98578..ca369de2334c 100755 --- a/xmloff/source/transform/PropertyActionsOOo.cxx +++ b/xmloff/source/transform/PropertyActionsOOo.cxx @@ -648,6 +648,8 @@ XMLTransformerActionInit aTextPropertyOOoAttrActionTable[] = NO_PARAMS }, /* #i113645# */ { XML_NAMESPACE_STYLE, XML_TEXT_OVERLINE_COLOR, XML_ATACTION_REMOVE, NO_PARAMS }, /* #i113645# */ + { XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_ATACTION_REMOVE, + NO_PARAMS }, /* #i116555# */ { XML_NAMESPACE_OFFICE, XML_TOKEN_INVALID, XML_ATACTION_EOT, NO_PARAMS } }; |