diff options
39 files changed, 632 insertions, 381 deletions
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx index 08dd21a88aa5..7b7feb0e9ebe 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -73,7 +73,6 @@ public: void PutSuperClass( const SotFactory * ); virtual void * CreateInstance( SotObject ** ppObj = NULL ) const; void * CastAndAddRef( SotObject * ) const; - void * AggCastAndAddRef( SotObject * ) const; BOOL Is( const SotFactory * pSuperClass ) const; const SotFactory * GetSuper( USHORT nPos ) const diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index db2ac3b30ffc..563c90d89a54 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -381,22 +381,17 @@ SotFactory * ClassName::pFactory = NULL; \ #pragma warning(disable: 4250) #endif -class SvAggregateMemberList; struct IUnknown; class SOT_DLLPUBLIC SotObject : virtual public SvRefBase { friend class SotFactory; friend class SvObject; - SvAggregateMemberList * pAggList; // fuer Aggregation, erstes ist das MainObj USHORT nStrongLockCount; USHORT nOwnerLockCount; BOOL bOwner:1, bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist bInClose:1; // TRUE, im DoClose - void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( ULONG ); - void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: #else @@ -414,25 +409,10 @@ public: virtual IUnknown * GetInterface( const SvGlobalName & ); BOOL Owner() const { return bOwner; } - BOOL IsSvObject() const; - - // Methoden fuer die Aggregation (siehe OLE2-Spec) - BOOL ShouldDelete(); - virtual void QueryDelete(); - SvAggregateMemberList & GetAggList(); - void AddInterface( SotObject * ); - void AddInterface( SotFactory * ); - virtual SotObjectRef CreateAggObj( const SotFactory * ); - void * AggCast( const SotFactory * pFact ); - void * CastAndAddRef( const SotFactory * pFact ); - SotObject * GetMainObj() const; - - // !!! Read the Manual !!! - virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose ); - void Lock( BOOL bLock ) - { - FuzzyLock( bLock, TRUE, TRUE ); - } + + void* CastAndAddRef( const SotFactory * pFact ); + + USHORT Lock( BOOL bLock ); // affects nStrongLockCount USHORT GetOwnerLockCount() const { return nOwnerLockCount; } USHORT GetStrongLockCount() const { return nStrongLockCount; } @@ -450,18 +430,6 @@ private: //==================class SotObjectRef====================================== SV_IMPL_REF(SotObject) -inline SotObjectRef::SotObjectRef( SotObject * pObjP, SvCastEnum ) -{ - if( pObjP ) - { - pObj = (SotObject *)pObjP->AggCast( SotObject::ClassFactory() ); - if( pObj ) - pObj->AddRef(); - } - else - pObj = NULL; -} - //==================class SotObject*List==================================== SV_DECL_REF_LIST(SotObject,SotObject*) SV_IMPL_REF_LIST(SotObject,SotObject*) diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx index ae03032e286e..a6728627ef2c 100644 --- a/sot/inc/sot/sotref.hxx +++ b/sot/inc/sot/sotref.hxx @@ -33,14 +33,12 @@ #endif //======================================================================== -enum SvCastEnum { SV_AGGREGATION_CAST }; #ifndef SVT_DECL_SOTOBJECT_DEFINED #define SVT_DECL_SOTOBJECT_DEFINED class SotObject; class SotObjectRef { PRV_SV_DECL_REF(SotObject) - inline SotObjectRef( SotObject * pObjP, SvCastEnum ); }; #endif @@ -52,7 +50,6 @@ class ClassName##Ref \ PRV_SV_DECL_REF(ClassName) \ inline ClassName##Ref( const SotObjectRef & ); \ inline ClassName##Ref( SotObject * pObjP ); \ - inline ClassName##Ref( SotObject * pObjP, SvCastEnum ); \ }; #define SO2_IMPL_REF(ClassName) \ @@ -64,12 +61,9 @@ inline ClassName##Ref::ClassName##Ref( const SotObjectRef & r ) \ inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \ { \ pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( pObjP );\ -} \ -inline ClassName##Ref::ClassName##Ref( SotObject * pObjP, SvCastEnum ) \ -{ \ - pObj = (ClassName *)ClassName::ClassFactory()->AggCastAndAddRef( pObjP );\ } + #define SO2_DECL_IMPL_REF(ClassName) \ SO2_DECL_REF(ClassName) \ SO2_IMPL_REF(ClassName) diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index ca753265b082..3c034a980578 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -344,45 +344,6 @@ void * SotFactory::CastAndAddRef return pObj ? pObj->CastAndAddRef( this ) : NULL; } -//========================================================================= -void * SotFactory::AggCastAndAddRef -( - SotObject * pObj /* Das Objekt von dem der Typ gepr"uft wird. */ -) const -/* [Beschreibung] - - Ist eine Optimierung, damit die Ref-Klassen k"urzer implementiert - werden k"onnen. pObj wird auf den Typ der Factory gecastet. - In c++ (wenn es immer erlaubt w"are) w"urde der void * wie im - Beispiel gebildet. - Factory der Klasse SvPersist. - void * p = (void *)(SvPersist *)pObj; - Hinzu kommt noch, dass ein Objekt aus meheren c++ Objekten - zusammengesetzt sein kann. Diese Methode sucht nach einem - passenden Objekt. - - [R"uckgabewert] - - void *, NULL, pObj war NULL oder das Objekt war nicht vom Typ - der Factory. - Ansonsten wird pObj zuerst auf den Typ der Factory - gecastet und dann auf void *. - - [Querverweise] - - <SvObject::AggCast> -*/ -{ - void * pRet = NULL; - if( pObj ) - { - pRet = pObj->AggCast( this ); - if( pRet ) - pObj->AddRef(); - } - return pRet; -} - /************************************************************************* |* SotFactory::Is() |* diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 9af1b441b37a..70792a325d31 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -35,10 +35,6 @@ #include <sot/factory.hxx> #include <sot/agg.hxx> -/************** class SvAggregateMemberList *****************************/ -/************************************************************************/ -PRV_SV_IMPL_OWNER_LIST(SvAggregateMemberList,SvAggregate); - /************** class SotObject ******************************************/ class SotObjectFactory : public SotFactory { @@ -84,8 +80,7 @@ void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) |* Beschreibung *************************************************************************/ SotObject::SotObject() - : pAggList ( NULL ) - , nStrongLockCount( 0 ) + : nStrongLockCount( 0 ) , nOwnerLockCount( 0 ) , bOwner ( TRUE ) , bSVObject ( FALSE ) @@ -119,246 +114,11 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & ) } /************************************************************************* -|* SotObject::IsSvClass() -|* -|* Beschreibung -*************************************************************************/ -BOOL SotObject::IsSvObject() const -{ - return Owner() || bSVObject; -} - -/************************************************************************* -|* SotObject::QueryDelete() -|* -|* Beschreibung: Bei allen aggregierten Objekte muss der RefCount auf -|* 0 gehen, damit das Gesammt-Objekt zerstoert wird. Das -|* zerst�ren von Teilen ist verboten. Da der Aggregator -|* (oder Cast-Verwalter) den Zaehler der aggregierten -|* Objekte um 1 erhoeht, muss dies bei der Berechnung -|* des 0-RefCounts beruecksichtigt werden. -*************************************************************************/ -BOOL SotObject::ShouldDelete() -{ - if( !pAggList ) - return TRUE; - - SvAggregate & rMO = pAggList->GetObject( 0 ); - if( rMO.bMainObj ) - { - AddRef(); - pAggList->GetObject( 0 ).pObj->ReleaseRef(); - return FALSE; - } - - ULONG i; - for( i = 1; i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - // Groesser 1, wegen AddRef() bei AddInterface - if( !rAgg.bFactory && rAgg.pObj->GetRefCount() > 1 ) - { - // den eigenen hochzaehelen - AddRef(); - // einen Aggregierten runterzaehlen - rAgg.pObj->ReleaseRef(); - return FALSE; - } - } - AddNextRef(); // rekursion stoppen - for( i = pAggList->Count() -1; i > 0; i-- ) - { - // Referenzen aufloesen - DBG_ASSERT( !pAggList->GetObject( i ).bMainObj, "main object reference is opened" ); - RemoveInterface( i ); - } - delete pAggList; - pAggList = NULL; - // und zerstoeren, dies ist unabhaengig vom RefCount - return TRUE; -} - -/************************************************************************* -|* SotObject::QueryDelete() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::QueryDelete() -{ - if( ShouldDelete() ) - SvRefBase::QueryDelete(); -} - - - -/************************************************************************* -|* SotObject::GetAggList() -|* -|* Beschreibung -*************************************************************************/ -SvAggregateMemberList & SotObject::GetAggList() -{ - if( !pAggList ) - { - pAggList = new SvAggregateMemberList( 2, 1 ); - pAggList->Append( SvAggregate() ); - } - return *pAggList; -} - - -/************************************************************************* -|* SotObject::RemoveInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::RemoveInterface( ULONG nPos ) -{ - SvAggregate & rAgg = pAggList->GetObject( nPos ); - if( !rAgg.bFactory ) - { - DBG_ASSERT( rAgg.pObj->pAggList, "no aggregation list" ); - DBG_ASSERT( rAgg.pObj->pAggList->GetObject( 0 ).pObj == this, - "not owner of aggregated object" ); - // sich selbst als Cast-Verwalter austragen - rAgg.pObj->pAggList->GetObject( 0 ) = SvAggregate(); - // Referenz aufloesen - rAgg.pObj->ReleaseRef(); - // Aus der eigenen List austragen - pAggList->Remove( nPos ); - } -} - -/************************************************************************* -|* SotObject::RemoveInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::RemoveInterface( SotObject * pObjP ) -{ - DBG_ASSERT( pObjP, "null pointer" ); - DBG_ASSERT( pAggList, "no aggregation list" ); - ULONG i; - for( i = 0; i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - if( !rAgg.bFactory && pObjP == rAgg.pObj ) - RemoveInterface( i ); - } - DBG_ASSERT( i < pAggList->Count(), "object not found" ); -} - -/************************************************************************* -|* SotObject::AddInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::AddInterface( SotObject * pObjP ) -{ - pObjP->AddRef(); // Objekt festhalten - GetAggList(); - pAggList->Append( SvAggregate( pObjP, FALSE ) ); - - // sich selbst als Typecast-Verwalter eintragen - SvAggregateMemberList & rAList = pObjP->GetAggList(); - DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); -} - -/************************************************************************* -|* SotObject::AddInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::AddInterface( SotFactory * pFactP ) -{ - GetAggList(); - pAggList->Append( SvAggregate( pFactP ) ); -} - -/************************************************************************* -|* SotObject::CreateAggObj() -|* -|* Beschreibung -*************************************************************************/ -SotObjectRef SotObject::CreateAggObj( const SotFactory * ) -{ - return SotObjectRef(); -} - - -/************************************************************************* -|* SotObject::DownAggCast() -|* -|* Beschreibung -*************************************************************************/ -void * SotObject::DownAggCast( const SotFactory * pFact ) -{ - void * pCast = NULL; - // geht den Pfad nur Richtung aggregierte Objekte - if( pAggList ) - { - for( ULONG i = 1; !pCast || i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - if( rAgg.bFactory ) - { - if( rAgg.pFact->Is( pFact ) ) - { - // On-Demand erzeugen, wenn Typ gebraucht - SotObjectRef aObj( CreateAggObj( rAgg.pFact ) ); - rAgg.bFactory = FALSE; - rAgg.pObj = aObj; - rAgg.pObj->AddRef(); - - // sich selbst als Typecast-Verwalter eintragen - SvAggregateMemberList & rAList = rAgg.pObj->GetAggList(); - DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); - } - } - if( !rAgg.bFactory ) - { - // muss der (void *) auf Klasse pFact sein - pCast = rAgg.pObj->Cast( pFact ); - if( !pCast ) - pCast = rAgg.pObj->DownAggCast( pFact ); - if( pCast ) - break; - } - } - } - return pCast; -} - -/************************************************************************* -|* SotObject::AggCast() -|* -|* Beschreibung -*************************************************************************/ -void * SotObject::AggCast( const SotFactory * pFact ) -{ - void * pCast = NULL; - if( pAggList ) - { - SvAggregate & rAgg = pAggList->GetObject( 0 ); - if( rAgg.bMainObj ) - return rAgg.pObj->AggCast( pFact ); - pCast = Cast( pFact ); - if( !pCast ) - pCast = DownAggCast( pFact ); - } - else - pCast = Cast( pFact ); - return pCast; -} - -/************************************************************************* |* SotObject::CastAndAddRef() |* |* Beschreibung *************************************************************************/ -void * SotObject::CastAndAddRef( const SotFactory * pFact ) +void* SotObject::CastAndAddRef( const SotFactory * pFact ) { void * pCast = Cast( pFact ); if( pCast ) @@ -366,49 +126,8 @@ void * SotObject::CastAndAddRef( const SotFactory * pFact ) return pCast; } -/************************************************************************* -|* SotObject::GetMainObj() -|* -|* Beschreibung -*************************************************************************/ -SotObject * SotObject::GetMainObj() const -{ - if( pAggList ) - { - if( pAggList->GetObject( 0 ).bMainObj ) - return pAggList->GetObject( 0 ).pObj->GetMainObj(); - } - return (SotObject *)this; -} - //========================================================================= -USHORT SotObject::FuzzyLock -( - BOOL bLock, /* TRUE, lock. FALSE, unlock. */ - BOOL /*bIntern*/, /* TRUE, es handelt sich um einen internen Lock. - FALSE, der Lock kam von aussen (Ole2, Ipc2) */ - BOOL bClose /* TRUE, Close aufrufen wenn letzte Lock */ -) -/* [Beschreibung] - - Erlaubte Parameterkombinationen: - ( TRUE, TRUE, * ) -> interner Lock. - ( FALSE, TRUE, TRUE ) -> interner Unlock mit Close, - wenn LockCount() == 0 - ( TRUE, FALSE, * ) -> externer Lock. - ( FALSE, FALSE, TRUE ) -> externer Unlock mit Close, - wenn LockCount() == 0 - ( FALSE, FALSE, FALSE ) -> externer Unlock - - F"ur !Owner() wird der Aufruf an das externe Objekt weitergeleitet. - F"ur diese muss das <IOleItemContainer>-Interface zur Vef"ugung stehen. - bIntern und bClose werden dann ignoriert. - Wenn der LockCount auf 0 wechselt, wird <SotObject::DoClose> - gerufen, wenn kein OwnerLock besteht. - - [Anmerkung] - -*/ +USHORT SotObject::Lock( BOOL bLock ) { SotObjectRef xHoldAlive( this ); USHORT nRet; @@ -423,8 +142,9 @@ USHORT SotObject::FuzzyLock ReleaseRef(); } - if( !nRet && bClose && !nOwnerLockCount ) + if( !nRet && !nOwnerLockCount ) DoClose(); + return nRet; } diff --git a/svl/Library_fsstorage.mk b/svl/Library_fsstorage.mk index 71c139e41c3e..4293ced781f2 100644 --- a/svl/Library_fsstorage.mk +++ b/svl/Library_fsstorage.mk @@ -67,6 +67,20 @@ $(eval $(call gb_Library_add_exception_objects,fsstorage,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,fsstorage,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Library_add_linked_libs,fsstorage,\ kernel32 \ msvcrt \ @@ -75,4 +89,5 @@ $(eval $(call gb_Library_add_linked_libs,fsstorage,\ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/svl/Library_passwordcontainer.mk b/svl/Library_passwordcontainer.mk index 7a0dbcc2babe..654f394f6176 100644 --- a/svl/Library_passwordcontainer.mk +++ b/svl/Library_passwordcontainer.mk @@ -63,6 +63,20 @@ $(eval $(call gb_Library_add_exception_objects,passwordcontainer,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ kernel32 \ msvcrt \ @@ -71,4 +85,5 @@ $(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 9d2e790f26f6..b48d13441d67 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -169,6 +169,22 @@ $(eval $(call gb_Library_add_exception_objects,svl,\ svl/source/svdde/ddewrap \ )) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,svl,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + mingwex \ + advapi32 \ + kernel32 \ + gdi32 \ + msvcrt \ + shell32 \ + user32 \ +)) +else $(eval $(call gb_Library_add_linked_libs,svl,\ advapi32 \ kernel32 \ @@ -178,6 +194,7 @@ $(eval $(call gb_Library_add_linked_libs,svl,\ user32 \ uwinapi \ )) +endif else $(eval $(call gb_Library_add_exception_objects,svl,\ svl/unx/source/svdde/ddedummy \ diff --git a/svl/prj/build.lst b/svl/prj/build.lst index b48df3a6824a..09acc768cb13 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,4 @@ sl svl : l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl usr1 - all svl_mkout NULL sl svl\prj nmake - all svl_prj NULL +sl svl\qa\complex\passwordcontainer nmake - all svl_qa_complex_passwordcontainer NULL diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk new file mode 100644 index 000000000000..625404682761 --- /dev/null +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -0,0 +1,134 @@ +#************************************************************************* +# +# 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 = svl +TARGET = qa_complex_passwordcontainer + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/passwordcontainer + +# here store only Files which contain a @Test +JAVATESTFILES = \ + PasswordContainerUnitTest.java + + +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + PasswordContainerTest.java\ + Test01.java\ + Test02.java\ + Test03.java\ + TestHelper.java\ + MasterPasswdHandler.java + + +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) + +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y + +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk + +ALLTAR : javatest + +.END + + +# +# +# +# +# PRJ = ..$/..$/.. +# TARGET = PasswordContainerUnitTest +# PRJNAME=svl +# PACKAGE = complex$/passwordcontainer +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +# +# JAVAFILES =\ +# PasswordContainerUnitTest.java\ +# PasswordContainerTest.java\ +# TestHelper.java\ +# Test01.java\ +# Test02.java\ +# Test03.java\ +# MasterPasswdHandler.java +# +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # test looks something like the.full.package.TestName +# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .INCLUDE: target.mk +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +# +# diff --git a/svtools/AllLangResTarget_svt.mk b/svtools/AllLangResTarget_svt.mk index 4576109499d8..6c13a6fcdb3f 100644 --- a/svtools/AllLangResTarget_svt.mk +++ b/svtools/AllLangResTarget_svt.mk @@ -60,6 +60,7 @@ $(eval $(call gb_SrsTarget_add_files,svt/res,\ svtools/source/dialogs/prnsetup.src \ svtools/source/dialogs/so3res.src \ svtools/source/dialogs/wizardmachine.src \ + svtools/source/filter.vcl/filter/exportdialog.src \ svtools/source/java/javaerror.src \ svtools/source/misc/ehdl.src \ svtools/source/misc/helpagent.src \ @@ -67,6 +68,7 @@ $(eval $(call gb_SrsTarget_add_files,svt/res,\ svtools/source/misc/langtab.src \ svtools/source/misc/undo.src \ svtools/source/plugapp/testtool.src \ + svtools/source/toolpanel/toolpanel.src \ )) diff --git a/svtools/Executable_bmp.mk b/svtools/Executable_bmp.mk index 7967dd80cf7b..976dbc08d28b 100644 --- a/svtools/Executable_bmp.mk +++ b/svtools/Executable_bmp.mk @@ -53,6 +53,20 @@ $(eval $(call gb_Executable_add_exception_objects,bmp,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,bmp,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,bmp,\ kernel32 \ msvcrt \ @@ -61,6 +75,7 @@ $(eval $(call gb_Executable_add_linked_libs,bmp,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,bmp,\ diff --git a/svtools/Executable_bmpsum.mk b/svtools/Executable_bmpsum.mk index 3ef2e66cf9a4..f6117e8c0875 100644 --- a/svtools/Executable_bmpsum.mk +++ b/svtools/Executable_bmpsum.mk @@ -49,6 +49,20 @@ $(eval $(call gb_Executable_add_exception_objects,bmpsum,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,bmpsum,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,bmpsum,\ kernel32 \ msvcrt \ @@ -57,6 +71,7 @@ $(eval $(call gb_Executable_add_linked_libs,bmpsum,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,bmpsum,\ diff --git a/svtools/Executable_g2g.mk b/svtools/Executable_g2g.mk index 27971a333d2c..744ab103041b 100644 --- a/svtools/Executable_g2g.mk +++ b/svtools/Executable_g2g.mk @@ -50,6 +50,20 @@ $(eval $(call gb_Executable_add_exception_objects,g2g,\ svtools/bmpmaker/g2g \ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,g2g,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,g2g,\ kernel32 \ msvcrt \ @@ -58,6 +72,7 @@ $(eval $(call gb_Executable_add_linked_libs,g2g,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,g2g,\ pthread \ diff --git a/svtools/Library_hatchwindowfactory.mk b/svtools/Library_hatchwindowfactory.mk index cc00d2df1025..5917ae92b187 100644 --- a/svtools/Library_hatchwindowfactory.mk +++ b/svtools/Library_hatchwindowfactory.mk @@ -64,6 +64,20 @@ $(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ )) endif ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ kernel32 \ msvcrt \ @@ -73,4 +87,5 @@ $(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/svtools/Library_productregistration.mk b/svtools/Library_productregistration.mk index c884b3f1b29b..61913bc8b7a6 100644 --- a/svtools/Library_productregistration.mk +++ b/svtools/Library_productregistration.mk @@ -66,6 +66,20 @@ $(eval $(call gb_Library_add_linked_libs,productregistration,\ endif ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,productregistration,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Library_add_linked_libs,productregistration,\ kernel32 \ msvcrt \ @@ -74,4 +88,5 @@ $(eval $(call gb_Library_add_linked_libs,productregistration,\ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 9cac00f89090..48af2fba6395 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -299,6 +299,25 @@ $(eval $(call gb_Library_add_linked_libs,svt,\ endif ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,svt,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + advapi32 \ + gdi32 \ + kernel32 \ + msvcrt \ + ole32 \ + oleaut32 \ + user32 \ + uuid \ +)) +else $(eval $(call gb_Library_add_linked_libs,svt,\ advapi32 \ gdi32 \ @@ -312,4 +331,5 @@ $(eval $(call gb_Library_add_linked_libs,svt,\ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index 465c3a688ada..3f9e02b26ca3 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,3 +1,3 @@ st svtools : l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk LIBXSLT:libxslt NULL st svtools\prj nmake - all st_prj NULL - +st svtools\qa\unoapi nmake - all st_qa_unoapi NULL diff --git a/svtools/qa/unoapi/makefile.mk b/svtools/qa/unoapi/makefile.mk new file mode 100644 index 000000000000..e3afb77e637a --- /dev/null +++ b/svtools/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 = svtools +TARGET = qa_unoapi + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/svtools/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/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 87585f5b2587..6ea9f05d78a1 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -523,7 +523,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, c = getChar(); // '/' entfernen // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - sal_Unicode cPeek = peekChar(); + sal_Unicode cPeek = c; while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) { getChar(); diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx index 1b84206d6696..b26f7bbf091b 100644 --- a/svtools/source/hatchwindow/hatchwindow.cxx +++ b/svtools/source/hatchwindow/hatchwindow.cxx @@ -33,6 +33,8 @@ #include "ipwin.hxx" #include <toolkit/helper/convert.hxx> +#include <vos/mutex.hxx> +#include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -50,6 +52,8 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer > const awt::Rectangle& aBounds, const awt::Size& aSize ) { + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + Window* pParent = NULL; VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( xParent ); @@ -117,7 +121,7 @@ uno::Any SAL_CALL VCLXHatchWindow::queryInterface( const uno::Type & rType ) throw( uno::RuntimeException ) { // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + // Don't use mutex or guard in this method!!! Is a method of XInterface. uno::Any aReturn( ::cppu::queryInterface( rType, static_cast< embed::XHatchWindow* >( this ) ) ); diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index 0eec027167c2..1222013372f7 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -31,6 +31,7 @@ #include "hatchwindowfactory.hxx" #include "hatchwindow.hxx" #include "cppuhelper/factory.hxx" +#include <vcl/svapp.hxx> #include "documentcloser.hxx" @@ -69,6 +70,7 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW if ( !xParent.is() ) throw lang::IllegalArgumentException(); // TODO + ::vos::OGuard aGuard( Application::GetSolarMutex() ); VCLXHatchWindow* pResult = new VCLXHatchWindow(); pResult->initializeWindow( xParent, aBounds, aHandlerSize ); return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) ); diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 3aa0016c225e..a96067f95186 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -343,6 +343,7 @@ void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObj mpImp->xListener = EmbedEventListener_Impl::Create( this ); //#i103460# + if ( IsChart() ) { ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY ); DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" ); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 90bc4899209b..6c58cb530330 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -948,8 +948,16 @@ namespace svt { namespace table //In the case that column headers are defined but data hasn't yet been set, //only column headers will be shown if(m_pModel->hasColumnHeaders()) + { if(m_nColHeaderHeightPixel>1) + { m_pDataWindow->SetSizePixel( m_rAntiImpl.GetOutputSizePixel()); + if(m_bResizingGrid) + //update column widths to fit in grid + impl_ni_updateColumnWidths(); + m_bResizingGrid = true; + } + } if(m_nColumnCount != 0) impl_ni_updateScrollbars(); } @@ -2011,8 +2019,11 @@ namespace svt { namespace table PColumnModel pColumn = m_pModel->getColumnModel(m_nCurColumn); impl_ni_getAccVisibleColWidths(); int newColWidth = m_aColumnWidthsPixel[m_nCurColumn]; + //make resize area for the separator wider + int nLeft = m_aVisibleColumnWidthsPixel[resizingColumn]-4; //subtract 1 from m_aAccColumnWidthPixel because right border should be part of the current cell - if(m_aVisibleColumnWidthsPixel[resizingColumn]-1 == rPoint.X() && pColumn->isResizable()) + int nRight = m_aVisibleColumnWidthsPixel[resizingColumn]-1; + if( rPoint.X()> nLeft && rPoint.X()<nRight && pColumn->isResizable()) aNewPointer = Pointer( POINTER_HSPLIT ); //MouseButton was pressed but not yet released, mouse is moving if(m_bResizing) @@ -2040,7 +2051,10 @@ namespace svt { namespace table m_bResizingGrid = false; m_nResizingColumn = m_nCurColumn; PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn); - if(m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-1 == rPoint.X() && pColumn->isResizable()) + //make resize area for the separator wider + int nLeft = m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-4; + int nRight = m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-1; + if(rPoint.X()> nLeft && rPoint.X()<nRight && pColumn->isResizable()) { m_pDataWindow->CaptureMouse(); m_bResizing = true; diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 2ee9ce294090..06d0377c5411 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -166,10 +166,23 @@ $(eval $(call gb_Library_add_linked_libs,tk,\ )) endif ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,tk,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + mingwex \ + kernel32 \ + msvcrt \ +)) +else $(eval $(call gb_Library_add_linked_libs,tk,\ kernel32 \ msvcrt \ uwinapi \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst index 7b6fd72c3ab0..b851421c6f8e 100644 --- a/toolkit/prj/build.lst +++ b/toolkit/prj/build.lst @@ -1,2 +1,3 @@ ti toolkit : LIBXSLT:libxslt vcl NULL ti toolkit\prj nmake - all ti_prj NULL +ti toolkit\qa\unoapi nmake - all ti_qa_unoapi NULL diff --git a/toolkit/qa/unoapi/knownissues.xcl b/toolkit/qa/unoapi/knownissues.xcl index 8df098a98c63..273b4b72dbe2 100644 --- a/toolkit/qa/unoapi/knownissues.xcl +++ b/toolkit/qa/unoapi/knownissues.xcl @@ -178,7 +178,6 @@ toolkit.UnoControlDialogModel::com::sun::star::lang::XComponent toolkit.UnoControlFileControlModel::com::sun::star::lang::XComponent toolkit.UnoControlGroupBox::com::sun::star::lang::XComponent toolkit.UnoControlContainer::com::sun::star::lang::XComponent -toolkit.MutableTreeDataModel::com::sun::star::lang::XComponent toolkit.UnoControlFixedText::com::sun::star::lang::XComponent toolkit.UnoControlListBox::com::sun::star::lang::XComponent toolkit.UnoControlCheckBoxModel::com::sun::star::lang::XComponent diff --git a/toolkit/qa/unoapi/makefile.mk b/toolkit/qa/unoapi/makefile.mk new file mode 100644 index 000000000000..9517601c3917 --- /dev/null +++ b/toolkit/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 = toolkit +TARGET = qa_unoapi + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/toolkit/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/tools/Executable_mkunroll.mk b/tools/Executable_mkunroll.mk index 6a88e48f232a..5f9753a2a88f 100644 --- a/tools/Executable_mkunroll.mk +++ b/tools/Executable_mkunroll.mk @@ -58,6 +58,20 @@ $(eval $(call gb_Executable_add_exception_objects,mkunroll,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,mkunroll,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,mkunroll,\ kernel32 \ msvcrt \ @@ -66,6 +80,7 @@ $(eval $(call gb_Executable_add_linked_libs,mkunroll,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,mkunroll,\ diff --git a/tools/Executable_rscdep.mk b/tools/Executable_rscdep.mk index d6f2c25a1763..85551407d335 100644 --- a/tools/Executable_rscdep.mk +++ b/tools/Executable_rscdep.mk @@ -55,8 +55,30 @@ $(eval $(call gb_Executable_add_exception_objects,rscdep,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +ifeq ($(HAVE_GETOPT),YES) +$(eval $(call gb_Executable_set_cxxflags,rscdep,\ + $$(CXXFLAGS) \ + -DHAVE_GETOPT \ +)) +endif +$(eval $(call gb_Executable_add_linked_libs,rscdep,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,rscdep,\ gnu_getopt \ +)) +$(eval $(call gb_Executable_add_linked_libs,rscdep,\ kernel32 \ msvcrt \ oldnames \ @@ -64,6 +86,7 @@ $(eval $(call gb_Executable_add_linked_libs,rscdep,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,rscdep,\ diff --git a/tools/Executable_so_checksum.mk b/tools/Executable_so_checksum.mk index 071f0c5bb7b0..1c0faf30b015 100644 --- a/tools/Executable_so_checksum.mk +++ b/tools/Executable_so_checksum.mk @@ -51,6 +51,20 @@ $(eval $(call gb_Executable_add_exception_objects,so_checksum,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,so_checksum,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,so_checksum,\ kernel32 \ msvcrt \ @@ -59,6 +73,7 @@ $(eval $(call gb_Executable_add_linked_libs,so_checksum,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,so_checksum,\ diff --git a/tools/Executable_sspretty.mk b/tools/Executable_sspretty.mk index 0c83b7137eea..637acf2afd0e 100644 --- a/tools/Executable_sspretty.mk +++ b/tools/Executable_sspretty.mk @@ -56,6 +56,20 @@ $(eval $(call gb_Executable_add_exception_objects,sspretty,\ )) ifeq ($(OS),WNT) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Executable_add_linked_libs,sspretty,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + kernel32 \ + msvcrt \ + user32 \ +)) +else $(eval $(call gb_Executable_add_linked_libs,sspretty,\ kernel32 \ msvcrt \ @@ -64,6 +78,7 @@ $(eval $(call gb_Executable_add_linked_libs,sspretty,\ uwinapi \ )) endif +endif ifeq ($(OS),LINUX) $(eval $(call gb_Executable_add_linked_libs,sspretty,\ diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index dde1f8f5dd92..fe91657e42f4 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -160,6 +160,25 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ tools/win/source/dll/toolsdll \ )) +ifneq ($(USE_MINGW),) +$(eval $(call gb_Library_add_linked_libs,tl,\ + mingwthrd \ + $(gb_MINGW_LIBSTDCPP) \ + mingw32 \ + $(gb_MINGW_LIBGCC) \ + uwinapi \ + moldname \ + mingwex \ + advapi32 \ + kernel32 \ + mpr \ + msvcrt \ + ole32 \ + shell32 \ + user32 \ + uuid \ +)) +else $(eval $(call gb_Library_add_linked_libs,tl,\ advapi32 \ kernel32 \ @@ -173,6 +192,7 @@ $(eval $(call gb_Library_add_linked_libs,tl,\ uwinapi \ )) endif +endif # tools/source/string/debugprint -DDEBUG -DEXCEPTIONS_OFF -DOSL_DEBUG_LEVEL=2 -DSHAREDLIB -DTOOLS_DLLIMPLEMENTATION -D_DLL_ -O0 -fno-exceptions -fpic -fvisibility=hidden -g # -DOPTIMIZE # no -DTOOLS_DLLIMPLEMENTATION on toolsdll diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index f21855d20aed..9f4c39b397e1 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1538,7 +1538,16 @@ ErrCode UcbLockBytes::Flush() const Reference <XOutputStream > xOutputStream = getOutputStream_Impl(); if ( !xOutputStream.is() ) return ERRCODE_IO_CANTWRITE; - xOutputStream->flush(); + + try + { + xOutputStream->flush(); + } + catch( Exception ) + { + return ERRCODE_IO_CANTWRITE; + } + return ERRCODE_NONE; } diff --git a/vcl/aqua/source/dtrans/service_entry.cxx b/vcl/aqua/source/dtrans/service_entry.cxx index 16308951bcfe..222b5cf40e04 100644 --- a/vcl/aqua/source/dtrans/service_entry.cxx +++ b/vcl/aqua/source/dtrans/service_entry.cxx @@ -34,6 +34,7 @@ #include "DropTarget.hxx" #include "aqua_clipboard.hxx" #include "osl/diagnose.h" +#include "vcl/svapp.hxx" using namespace ::osl; using namespace ::rtl; @@ -45,6 +46,9 @@ using namespace ::com::sun::star::datatransfer::clipboard; Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments ) { + if ( Application::IsHeadlessModeEnabled() ) + return SalInstance::CreateClipboard( i_rArguments ); + SalData* pSalData = GetSalData(); if( ! pSalData->mxClipboard.is() ) pSalData->mxClipboard = Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY); @@ -54,11 +58,17 @@ Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& Reference<XInterface> AquaSalInstance::CreateDragSource() { + if ( Application::IsHeadlessModeEnabled() ) + return SalInstance::CreateDragSource(); + return Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY); } Reference<XInterface> AquaSalInstance::CreateDropTarget() { - return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY); + if ( Application::IsHeadlessModeEnabled() ) + return SalInstance::CreateDropTarget(); + + return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY); } diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx index eb09a44f5edd..f633dbbdcdce 100644 --- a/vcl/aqua/source/gdi/salvd.cxx +++ b/vcl/aqua/source/gdi/salvd.cxx @@ -33,6 +33,7 @@ #include "salgdi.h" #include "saldata.hxx" #include "salframe.h" +#include <vcl/svapp.hxx> #include "vcl/sysdata.hxx" @@ -197,9 +198,27 @@ BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY ) pSalFrame = *GetSalData()->maFrames.begin(); if( pSalFrame ) { - NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pSalFrame->getWindow()]; - if( pNSContext ) - xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]); + // #i91990# + NSWindow* pWindow = pSalFrame->getWindow(); + if ( pWindow ) + { + NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pWindow]; + if( pNSContext ) + xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]); + } + else + { + // fall back to a bitmap context + mnBitmapDepth = 32; + const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace; + const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst; + const int nBytesPerRow = (mnBitmapDepth * nDX) / 8; + + void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY ); + mxBitmapContext = ::CGBitmapContextCreate( pRawData, nDX, nDY, + 8, nBytesPerRow, aCGColorSpace, aCGBmpInfo ); + xCGContext = mxBitmapContext; + } } } diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index 4530778c5775..17e034bd6e3d 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -191,8 +191,17 @@ void AquaSalFrame::initWindowAndView() mnStyleMask |= NSTitledWindowMask; } + // #i91990# support GUI-less (daemon) execution + @try + { mpWindow = [[SalFrameWindow alloc] initWithSalFrame: this]; mpView = [[SalFrameView alloc] initWithSalFrame: this]; + } + @catch ( id exception ) + { + return; + } + if( (mnStyle & SAL_FRAME_STYLE_TOOLTIP) ) [mpWindow setIgnoresMouseEvents: YES]; else @@ -291,6 +300,9 @@ BOOL AquaSalFrame::PostEvent( void *pData ) // ----------------------------------------------------------------------- void AquaSalFrame::SetTitle(const XubString& rTitle) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -405,6 +417,9 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect ) void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -563,6 +578,8 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); + if ( mpWindow ) + { // set normal state NSRect aStateRect = [mpWindow frame]; aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask]; @@ -599,6 +616,7 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) if( [mpWindow isZoomed] ) [mpWindow zoom: NSApp]; } + } // get new geometry UpdateFrameGeometry(); @@ -619,7 +637,7 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) if( nEvent ) CallCallback( nEvent, NULL ); - if( mbShown ) + if( mbShown && mpWindow ) { // trigger filling our backbuffer SendPaintEvent(); @@ -633,6 +651,9 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState ) BOOL AquaSalFrame::GetWindowState( SalFrameState* pState ) { + if ( !mpWindow ) + return FALSE; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -670,6 +691,9 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState ) void AquaSalFrame::SetScreenNumber(unsigned int nScreen) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -704,6 +728,9 @@ void AquaSalFrame::SetScreenNumber(unsigned int nScreen) void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -814,6 +841,9 @@ public: void AquaSalFrame::StartPresentation( BOOL bStart ) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -841,6 +871,9 @@ void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop ) void AquaSalFrame::ToTop(USHORT nFlags) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -900,6 +933,9 @@ NSCursor* AquaSalFrame::getCurrentCursor() const void AquaSalFrame::SetPointer( PointerStyle ePointerStyle ) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1198,6 +1234,9 @@ void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY ) // doesn't make the anything cleaner for now void AquaSalFrame::UpdateSettings( AllSettings& rSettings ) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1312,6 +1351,9 @@ void AquaSalFrame::Beep( SoundType eSoundType ) void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1399,6 +1441,9 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR void AquaSalFrame::GetWorkArea( Rectangle& rRect ) { + if ( !mpWindow ) + return; + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1537,11 +1582,15 @@ void AquaSalFrame::SetMenu( SalMenu* pSalMenu ) void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) { + if ( mpWindow ) + { // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); if( (mnExtStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) != (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ) [mpWindow setDocumentEdited: (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ? YES : NO]; + } + mnExtStyle = nStyle; } @@ -1572,6 +1621,11 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent ) void AquaSalFrame::UpdateFrameGeometry() { + if ( !mpWindow ) + { + return; + } + // keep in mind that view and window coordinates are lower left // whereas vcl's are upper left @@ -1644,6 +1698,11 @@ void AquaSalFrame::CaptureMouse( BOOL bCapture ) void AquaSalFrame::ResetClipRegion() { + if ( !mpWindow ) + { + return; + } + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1662,6 +1721,11 @@ void AquaSalFrame::ResetClipRegion() void AquaSalFrame::BeginSetClipRegion( ULONG nRects ) { + if ( !mpWindow ) + { + return; + } + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); @@ -1696,6 +1760,11 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight void AquaSalFrame::EndSetClipRegion() { + if ( !mpWindow ) + { + return; + } + // #i113170# may not be the main thread if called from UNO API SalData::ensureThreadAutoreleasePool(); diff --git a/vcl/source/app/sound.cxx b/vcl/source/app/sound.cxx index bac9d50dc5da..d180f2647135 100644 --- a/vcl/source/app/sound.cxx +++ b/vcl/source/app/sound.cxx @@ -38,6 +38,7 @@ #include <vcl/salframe.hxx> #include <tools/debug.hxx> #include <vcl/svdata.hxx> +#include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/salbtype.hxx> #include <vcl/sound.hxx> @@ -45,6 +46,10 @@ void Sound::Beep( SoundType eType, Window* pWindow ) { + // #i91990# + if ( Application::IsHeadlessModeEnabled() ) + return; + if( !pWindow ) { Window* pDefWindow = ImplGetDefaultWindow(); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 2c04af384c51..5a5cd11c52d9 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -556,7 +556,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if (returnVal) { - GC gc = SelectFont(); + GC gc = GetFontGC(); if( gc ) { |