diff options
20 files changed, 478 insertions, 536 deletions
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java index 9c1d6ea47411..8846c3995f56 100644 --- a/connectivity/qa/connectivity/tools/DbaseDatabase.java +++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java @@ -65,7 +65,8 @@ public class DbaseDatabase extends AbstractDatabase private void createDBDocument() throws Exception { final File documentFile = File.createTempFile("dbase", ".odb"); - documentFile.deleteOnExit(); + if ( documentFile.exists() ) + documentFile.delete(); final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator ); subPath.mkdir(); //subPath.deleteOnExit(); diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java index d27816cf4b7e..593a5ad95981 100644 --- a/connectivity/qa/connectivity/tools/HsqlDatabase.java +++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java @@ -71,7 +71,8 @@ public class HsqlDatabase extends AbstractDatabase private void createDBDocument() throws Exception { final File documentFile = File.createTempFile("testdb", ".odb"); - documentFile.deleteOnExit(); + if ( documentFile.exists() ) + documentFile.delete(); m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile); m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface( diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx index b3cbb4ae67c7..4c3f3db8b754 100644 --- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx +++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx @@ -145,6 +145,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ } } + ::connectivity::ODatabaseMetaDataResultSet::ORows aTypeInfoRows; while( xRet->next() ) { ::connectivity::ODatabaseMetaDataResultSet::ORow aRow; @@ -169,8 +170,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ else ++aIter; } - m_aTypeInfoRows.push_back(aRow); + aTypeInfoRows.push_back(aRow); } + m_aTypeInfoRows = aTypeInfoRows; } } ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo); diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk index 9b4b05868cd2..00f76ddeb8fd 100644 --- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk +++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk @@ -30,37 +30,35 @@ #************************************************************************* CALL_CDECL=TRUE -#mozilla specific stuff. -MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT) -MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla -#End of mozilla specific stuff. - PRJ=..$/..$/..$/.. PRJINC=..$/..$/.. PRJNAME=connectivity TARGET=mozbootstrap -USE_DEFFILE=TRUE -ENABLE_EXCEPTIONS=TRUE -VISIBILITY_HIDDEN=TRUE - .IF "$(OS)" == "OS2" all: @echo " Not building under OS/2" .ENDIF # --- Settings ---------------------------------- -.IF "$(DBGUTIL_OJ)"!="" -ENVCFLAGS+=/FR$(SLO)$/ -.ENDIF +USE_DEFFILE=TRUE +ENABLE_EXCEPTIONS=TRUE +VISIBILITY_HIDDEN=TRUE + +# --- begin of mozilla specific stuff +MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT) +MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla +# --- end of mozilla specific stuff .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/version.mk +.INCLUDE : ../makefile_mozab.mk + +INCPRE += -I../mozillasrc -#mozilla specific stuff. # --- Files ------------------------------------- SLOFILES += \ @@ -93,95 +91,6 @@ SLOFILES += \ $(SLO)$/MNSProfileDirServiceProvider.obj .ENDIF -CDEFS += -DMOZILLA_INTERNAL_API - -.IF "$(GUI)"=="UNX" -.IF "$(COMNAME)"=="sunpro5" -CFLAGS += -features=tmplife -#This flag is needed to build mozilla 1.7 code -.ENDIF # "$(COMNAME)"=="sunpro5" -.ENDIF - -MOZINC = . -I.. -I..$/mozillasrc -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \ - -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \ - -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \ - -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \ - -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \ - -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\ - -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content - -.IF "$(GUI)" == "WNT" -.IF "$(COM)" == "GCC" -INCPOST += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL -CFLAGSCXX += \ - -fno-rtti -Wall -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -.ELSE -.IF "$(DBG_LEVEL)" == "0" -INCPRE += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \ - -UDEBUG -CFLAGS += -GR- -W3 -Gy -MD -UDEBUG -.ELSE -INCPRE += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \ - -UDEBUG -CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG -.IF "$(CCNUMVER)" >= "001399999999" -CDEFS += -D_STL_NOFORCE_MANIFEST -.ENDIF -.ENDIF -.ENDIF -.ENDIF -.IF "$(GUI)" == "UNX" -INCPOST += $(MOZINC) -CDEFS+= -DMOZILLA_CLIENT \ - -DXP_UNIX -.IF "$(OS)" == "LINUX" -CFLAGS += -fPIC -g -CDEFS+= -DOJI - -CFLAGSCXX += \ - -fno-rtti -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -pthread -CDEFS += -DTRACING -.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX" -CFLAGS += -fPIC -CFLAGSCXX += \ - -fno-rtti -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -Wno-deprecated -CDEFS += -DTRACING -.ENDIF - -SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR) - -.ENDIF # MACOSX - # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk index 677e605096c4..76161dc32119 100644 --- a/connectivity/source/drivers/mozab/makefile.mk +++ b/connectivity/source/drivers/mozab/makefile.mk @@ -43,38 +43,28 @@ all: @echo " see http://www.mozilla.org/issues/show_bug.cgi?id=91209" .ENDIF -#mozilla specific stuff. +# --- begin of mozilla specific stuff MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT) MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla .IF "$(OS)"=="WNT" -.IF "$(USE_SHELL)"=="4nt" -MOZ_EMBED_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/embed_base_s.lib 2>NUL ) -MOZ_REG_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/mozreg_s.lib 2>NUL ) -.ELSE #"$(USE_SHELL)"=="4nt" -MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib ) -MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib ) -.ENDIF + MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib ) + MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib ) -.IF X"$(MOZ_EMBED_LIB)"=="X" -MOZ_EMBED_LIB := $(MOZ_LIB)$/baseembed_s.lib -.ENDIF -.IF X"$(MOZ_REG_LIB)" == "X" -MOZ_REG_LIB := $(MOZ_LIB)$/mozreg.lib -.ENDIF -.ENDIF + MOZ_EMBED_LIB *:= $(MOZ_LIB)$/baseembed_s.lib + MOZ_REG_LIB *:= $(MOZ_LIB)$/mozreg.lib + + .IF "$(COM)"=="GCC" + MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core + .ELSE + LIB += $(MOZ_LIB) + MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib + .ENDIF -.IF "$(OS)"=="WNT" -.IF "$(COM)"=="GCC" -MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core -.ELSE -LIB += $(MOZ_LIB) -MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib -.ENDIF .ELSE "$(OS)"=="WNT" -MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s + MOZ_LIB_XPCOM = -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s .ENDIF -#End of mozilla specific stuff. +# --- end of mozilla specific stuff USE_DEFFILE=TRUE ENABLE_EXCEPTIONS=TRUE @@ -87,10 +77,6 @@ COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs # --- Settings ---------------------------------- -.IF "$(DBGUTIL_OJ)"!="" -ENVCFLAGS+=/FR$(SLO)$/ -.ENDIF - .INCLUDE : $(PRJ)$/makefile.pmk .INCLUDE : $(PRJ)$/version.mk @@ -121,7 +107,6 @@ DEF1NAME= $(SHL1TARGET) DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \ $(SLB)$/$(TARGET).lib DEFLIB1NAME=$(TARGET) -#DEF1EXPORTFILE= exports.dxp # --- Files ------------------------------------- @@ -165,6 +150,7 @@ DEPOBJFILES=$(SLO2FILES) # --- MOZAB BASE Library ----------------------------------- SHL2VERSIONMAP= $(TARGET2).map +SHL2NOCHECK=TRUE SHL2TARGET= $(TARGET2)$(DLLPOSTFIX) SHL2OBJS=$(SLO2FILES) SHL2STDLIBS=\ diff --git a/connectivity/source/drivers/mozab/makefile_mozab.mk b/connectivity/source/drivers/mozab/makefile_mozab.mk new file mode 100644 index 000000000000..28b56ec2a84a --- /dev/null +++ b/connectivity/source/drivers/mozab/makefile_mozab.mk @@ -0,0 +1,128 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# 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. +# +#************************************************************************* + +CDEFS += -DMOZILLA_INTERNAL_API + +.IF "$(GUI)"=="UNX" + .IF "$(COMNAME)"=="sunpro5" + CFLAGS += -features=tmplife + #This flag is needed to build mozilla 1.7 code + .ENDIF # "$(COMNAME)"=="sunpro5" +.ENDIF + +MOZINC = . \ + -I.. \ + -I$(MOZ_INC) \ + -I$(MOZ_INC)$/nspr \ + -I$(MOZ_INC)$/xpcom \ + -I$(MOZ_INC)$/string \ + -I$(MOZ_INC)$/rdf \ + -I$(MOZ_INC)$/msgbase \ + -I$(MOZ_INC)$/addrbook \ + -I$(MOZ_INC)$/mork \ + -I$(MOZ_INC)$/locale \ + -I$(MOZ_INC)$/pref \ + -I$(MOZ_INC)$/mime \ + -I$(MOZ_INC)$/chrome \ + -I$(MOZ_INC)$/necko \ + -I$(MOZ_INC)$/intl \ + -I$(MOZ_INC)$/profile \ + -I$(MOZ_INC)$/embed_base \ + -I$(MOZ_INC)$/mozldap \ + -I$(MOZ_INC)$/uconv \ + -I$(MOZ_INC)$/xpcom_obsolete \ + -I$(MOZ_INC)$/content + +.IF "$(GUI)" == "WNT" + CDEFS += \ + -DMOZILLA_CLIENT \ + -DXP_PC \ + -DXP_WIN \ + -DXP_WIN32 \ + -DOJI \ + -DWIN32 \ + -D_X86_ \ + -D_WINDOWS \ + -DMOZ_XUL \ + -DMOZ_REFLOW_PERF \ + -DMOZ_REFLOW_PERF_DSP + .IF "$(COM)" == "GCC" + INCPOST += $(MOZINC) + CFLAGSCXX += \ + -fno-rtti \ + -Wall \ + -Wconversion \ + -Wpointer-arith \ + -Wcast-align \ + -Woverloaded-virtual \ + -Wsynth \ + -Wno-long-long + .ELSE # .IF "$(COM)" == "GCC" + INCPRE += $(MOZINC) + .IF "$(DBG_LEVEL)" != "0" + .IF "$(CCNUMVER)" >= "001399999999" + CDEFS += -D_STL_NOFORCE_MANIFEST + .ENDIF # .IF "$(CCNUMVER)" >= "001399999999" + .ENDIF # .IF "$(DBG_LEVEL)" != "0" + .ENDIF # .IF "$(COM)" == "GCC" +.ENDIF # .IF "$(GUI)" == "WNT" + +.IF "$(GUI)" == "UNX" + INCPOST += $(MOZINC) + CDEFS+= -DMOZILLA_CLIENT \ + -DXP_UNIX + .IF "$(OS)" == "LINUX" + CFLAGS += -fPIC -g + CDEFS += -DOJI + CFLAGSCXX += \ + -fno-rtti \ + -Wconversion \ + -Wpointer-arith \ + -Wcast-align \ + -Woverloaded-virtual \ + -Wsynth \ + -Wno-long-long \ + -pthread + CDEFS += -DTRACING + .ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX" + CFLAGS += -fPIC + CFLAGSCXX += \ + -fno-rtti \ + -Wconversion \ + -Wpointer-arith \ + -Wcast-align \ + -Woverloaded-virtual \ + -Wsynth \ + -Wno-long-long \ + -Wno-deprecated + CDEFS += -DTRACING + .ENDIF # "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX" + + SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR) + +.ENDIF # "$(GUI)" == "UNX" + diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk index e31d4c7e412b..1e5b39e0f140 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk +++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk @@ -40,16 +40,12 @@ PRJINC=..$/..$/.. PRJNAME=connectivity TARGET=mozabsrc +# --- Settings ---------------------------------- + USE_DEFFILE=TRUE ENABLE_EXCEPTIONS=TRUE VISIBILITY_HIDDEN=TRUE -# --- Settings ---------------------------------- -.IF "$(DBGUTIL_OJ)"!="" -ENVCFLAGS+=/FR$(SLO)$/ -.ENDIF - - .INCLUDE : settings.mk .IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || "$(OS)" == "OS2" @@ -61,8 +57,10 @@ dummy: .INCLUDE : $(PRJ)$/version.mk +.INCLUDE : ../makefile_mozab.mk + +INCPRE += -I../bootstrap -#mozilla specific stuff. # --- Files ------------------------------------- SLOFILES = \ @@ -74,98 +72,9 @@ SLOFILES = \ $(SLO)$/MNSMozabProxy.obj \ $(SLO)$/MNSTerminateListener.obj \ $(SLO)$/MLdapAttributeMap.obj \ - - -CDEFS += -DMOZILLA_INTERNAL_API -.IF "$(GUI)"=="UNX" -.IF "$(COMNAME)"=="sunpro5" -CFLAGS += -features=tmplife -#This flag is needed to build mozilla 1.7 code -.ENDIF # "$(COMNAME)"=="sunpro5" .ENDIF -MOZINC = . -I.. -I..$/bootstrap -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \ - -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \ - -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \ - -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \ - -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \ - -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\ - -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content - -.IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" -INCPOST += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL -CFLAGSCXX += \ - -fno-rtti -Wall -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -.ELSE -.IF "$(DBG_LEVEL)" == "0" -INCPRE += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \ - -UDEBUG -CFLAGS += -GR- -W3 -Gy -MD -UDEBUG -.ELSE -INCPRE += $(MOZINC) -CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \ - -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \ - -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \ - -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \ - -DOJI -DWIN32 -D_X86_ -D_WINDOWS \ - -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \ - -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \ - -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \ - -UDEBUG -CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG -.IF "$(CCNUMVER)" >= "001399999999" -CDEFS += -D_STL_NOFORCE_MANIFEST -.ENDIF -.ENDIF -.ENDIF -.ENDIF -.IF "$(GUI)" == "UNX" -INCPOST += $(MOZINC) -CDEFS+= -DMOZILLA_CLIENT \ - -DXP_UNIX -.IF "$(OS)" == "LINUX" -CFLAGS += -fPIC -g -CDEFS+= -DOJI - -CFLAGSCXX += \ - -fno-rtti -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -pthread -CDEFS += -DTRACING -.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX" -CFLAGS += -fPIC -CFLAGSCXX += \ - -fno-rtti -Wconversion -Wpointer-arith \ - -Wcast-align -Woverloaded-virtual -Wsynth \ - -Wno-long-long -Wno-deprecated -CDEFS += -DTRACING -.ENDIF -.ENDIF - -SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR) - -.ENDIF # MACOSX - # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 93a5a28dd46d..7e9f3bc3791f 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -83,6 +83,7 @@ #include <rtl/process.h> #include <comphelper/processfactory.hxx> +#include <comphelper/namedvaluecollection.hxx> #include "docholder.hxx" #include "commonembobj.hxx" @@ -1025,20 +1026,14 @@ sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace ) if ( xDoc.is() ) { // load new document in to the frame - uno::Reference< frame::XComponentLoader > xComponentLoader( m_xFrame, uno::UNO_QUERY ); - if( !xComponentLoader.is() ) - throw uno::RuntimeException(); + uno::Reference< frame::XComponentLoader > xComponentLoader( m_xFrame, uno::UNO_QUERY_THROW ); - uno::Sequence< beans::PropertyValue > aArgs( bInPlace ? 3 : 2 ); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "Model" ); - aArgs[0].Value <<= m_xComponent; - aArgs[1].Name = ::rtl::OUString::createFromAscii( "ReadOnly" ); - aArgs[1].Value <<= m_bReadOnly; + ::comphelper::NamedValueCollection aArgs; + aArgs.put( "Model", m_xComponent ); + aArgs.put( "ReadOnly", m_bReadOnly ); + //aArgs.put( "Hidden", sal_True ); if ( bInPlace ) - { - aArgs[2].Name = ::rtl::OUString::createFromAscii( "PluginMode" ); - aArgs[2].Value <<= sal_Int16(1); - } + aArgs.put( "PluginMode", sal_Int16(1) ); ::rtl::OUString sUrl; uno::Reference< lang::XServiceInfo> xServiceInfo(xDoc,uno::UNO_QUERY); if ( xServiceInfo.is() @@ -1055,7 +1050,7 @@ sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace ) xComponentLoader->loadComponentFromURL( sUrl, rtl::OUString::createFromAscii( "_self" ), 0, - aArgs ); + aArgs.getPropertyValues() ); return sal_True; } diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx index 7a48fad1f84c..d026c1b0f04c 100644 --- a/framework/inc/macros/registration.hxx +++ b/framework/inc/macros/registration.hxx @@ -139,7 +139,7 @@ ________________________________________________________________________________ // define helper to get information about service environment //***************************************************************************************************************** #define COMPONENTGETIMPLEMENTATIONENVIRONMENT \ - extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \ + extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \ uno_Environment** ) \ { \ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; \ @@ -150,7 +150,7 @@ ________________________________________________________________________________ // define registration of service //***************************************************************************************************************** #define COMPONENTWRITEINFO( INFOS ) \ - extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \ + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \ void* pRegistryKey ) \ { \ LOG_REGISTRATION_WRITEINFO( "\t[start]\n" ) \ @@ -185,7 +185,7 @@ ________________________________________________________________________________ // define method to instanciate new services //***************************************************************************************************************** #define COMPONENTGETFACTORY( IFFACTORIES ) \ - extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \ + extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \ void* pServiceManager , \ void* /*pRegistryKey*/ ) \ { \ diff --git a/framework/inc/properties.h b/framework/inc/properties.h index d09fde5a5fc4..d2619cd9ee87 100644 --- a/framework/inc/properties.h +++ b/framework/inc/properties.h @@ -193,25 +193,26 @@ namespace framework{ //_______________________________________________ /** properties for "LayoutManager" class */ -#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser" -#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars" -#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility" -#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI" -#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount" +#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser" +#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars" +#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility" +#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI" +#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount" +#define LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE "PreserveContentSize" #define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER ) #define LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS ) #define LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY ) #define LAYOUTMANAGER_PROPNAME_HIDECURRENTUI ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI ) #define LAYOUTMANAGER_PROPNAME_LOCKCOUNT ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT ) +#define LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE ) #define LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER 0 #define LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS 1 #define LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY 2 #define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3 #define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4 - -#define LAYOUTMANAGER_PROPCOUNT 5 +#define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5 //_______________________________________________ /** properties for "UICommandDescription" class */ @@ -271,7 +272,7 @@ namespace framework{ #define TABWINDOWSERVICE_PROPNAME_WINDOW ::rtl::OUString::createFromAscii( TABWINDOWSERVICE_PROPNAME_ASCII_WINDOW ) #define TABWINDOWSERVICE_PROPHANDLE_WINDOW 0 -#define TABWINDOWSERVICE_PROPCOUNT 1
+#define TABWINDOWSERVICE_PROPCOUNT 1 //_______________________________________________ /** properties of tabreg service */ diff --git a/framework/inc/services.h b/framework/inc/services.h index e9f3e1bfe3ce..70f4f8fde9a2 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -127,6 +127,7 @@ namespace framework{ #define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" ) #define SERVICENAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.ui.dialogs.TabContainerWindow" ) #define SERVICENAME_WINDOWCONTENTFACTORYMANAGER DECLARE_ASCII("com.sun.star.ui.WindowContentFactoryManager" ) +#define SERVICENAME_DISPLAYACCESS DECLARE_ASCII("com.sun.star.awt.DisplayAccess" ) //_________________________________________________________________________________________________________________ // used implementationnames by framework diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 86dec1a938bf..8c412e5d6237 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -69,6 +69,7 @@ #include <com/sun/star/ui/XUIElementFactory.hpp> #include <com/sun/star/frame/XInplaceLayout.hpp> #include <com/sun/star/ui/DockingArea.hpp> +#include <com/sun/star/awt/XTopWindow2.hpp> #include <com/sun/star/awt/XDockableWindow.hpp> #include <com/sun/star/awt/XDockableWindowListener.hpp> #include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp> @@ -78,8 +79,9 @@ // other includes //_________________________________________________________________________________________________________________ #include <cppuhelper/propshlp.hxx> +#include <cppuhelper/implbase9.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <cppuhelper/weak.hxx> +#include <comphelper/propertycontainer.hxx> #include <vcl/wintypes.hxx> #include <svtools/miscopt.hxx> #include <vcl/toolbox.hxx> @@ -89,22 +91,23 @@ class MenuBar; namespace framework { class GlobalSettings; - class LayoutManager : public css::lang::XTypeProvider , - public css::lang::XServiceInfo , - public ::com::sun::star::frame::XLayoutManager , - public css::awt::XWindowListener , - public css::frame::XFrameActionListener , - public ::com::sun::star::ui::XUIConfigurationListener , - public ::com::sun::star::frame::XInplaceLayout , - public css::awt::XDockableWindowListener , - public ::com::sun::star::frame::XMenuBarMergingAcceptor, - public css::frame::XLayoutManagerEventBroadcaster , + typedef ::cppu::WeakImplHelper9 < ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::frame::XLayoutManager + , ::com::sun::star::awt::XWindowListener + , ::com::sun::star::frame::XFrameActionListener + , ::com::sun::star::ui::XUIConfigurationListener + , ::com::sun::star::frame::XInplaceLayout + , ::com::sun::star::awt::XDockableWindowListener + , ::com::sun::star::frame::XMenuBarMergingAcceptor + , ::com::sun::star::frame::XLayoutManagerEventBroadcaster + > LayoutManager_Base; + typedef ::comphelper::OPropertyContainer LayoutManager_PBase; + class LayoutManager : public LayoutManager_Base , // base classes // Order is neccessary for right initialization! private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses. public ::cppu::OBroadcastHelper , - public ::cppu::OPropertySetHelper , // => XPropertySet / XFastPropertySet / XMultiPropertySet - public ::cppu::OWeakObject // => XWeak, XInterface + public LayoutManager_PBase { public: enum { DOCKINGAREAS_COUNT = 4 }; @@ -388,6 +391,7 @@ namespace framework // layouting methods sal_Bool implts_compareRectangles( const ::com::sun::star::awt::Rectangle& rRect1, const ::com::sun::star::awt::Rectangle& rRect2 ); + sal_Bool implts_resizeContainerWindow( const ::com::sun::star::awt::Size& rContainerSize, const ::com::sun::star::awt::Point& rComponentPos ); ::Size implts_getTopBottomDockingAreaSizes(); ::Size implts_getContainerWindowOutputSize(); ::com::sun::star::awt::Rectangle implts_getDockingAreaWindowSizes(); @@ -399,7 +403,8 @@ namespace framework void implts_findNextDockingPos( ::com::sun::star::ui::DockingArea DockingArea, const ::Size& aUIElementSize, ::Point& rVirtualPos, ::Point& rPixelPos ); ::com::sun::star::awt::Rectangle implts_calcDockingAreaSizes(); void implts_setDockingAreaWindowSizes( const com::sun::star::awt::Rectangle& rBorderSpace ); - sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace ); + sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize ); + void implts_doLayout_notify( sal_Bool bOuterResize ); // internal methods to control status/progress bar ::Size implts_getStatusBarSize(); @@ -449,15 +454,15 @@ namespace framework virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException); - static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor(); - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; /** reference to factory, which has created this instance. */ css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; + css::uno::Reference< css::container::XIndexAccess > m_xDisplayAccess; css::uno::Reference< css::frame::XFrame > m_xFrame; css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr; css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr; css::uno::WeakReference< css::frame::XModel > m_xModel; css::uno::Reference< css::awt::XWindow > m_xContainerWindow; + css::uno::Reference< css::awt::XTopWindow2 > m_xContainerTopWindow; css::uno::Reference< css::awt::XWindow > m_xDockAreaWindows[DOCKINGAREAS_COUNT]; sal_Int32 m_nLockCount; UIElementVector m_aUIElements; @@ -474,6 +479,7 @@ namespace framework bool m_bStoreWindowState; bool m_bHideCurrentUI; bool m_bGlobalSettings; + bool m_bPreserveContentSize; DockingOperation m_eDockOperation; UIElement m_aDockUIElement; css::awt::Rectangle m_aDockingArea; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 9c3c85008569..01934dfb47df 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -67,17 +67,13 @@ #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/XSystemDependentMenuPeer.hpp> -#ifndef _COM_SUN_STAR_LANG_XYSTEMDEPENDENT_HPP_ #include <com/sun/star/lang/SystemDependent.hpp> -#endif #include <com/sun/star/awt/VclWindowPeerAttribute.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/XDevice.hpp> #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp> #include <com/sun/star/awt/XTopWindow.hpp> -#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGER_HPP_ #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> -#endif #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/container/XNameReplace.hpp> @@ -92,18 +88,18 @@ // other includes //_________________________________________________________________________________________________________________ #include <svtools/imgdef.hxx> +#include <tools/diagnose_ex.h> #include <vcl/window.hxx> #include <vcl/wrkwin.hxx> #include <vcl/dockingarea.hxx> #include <vcl/svapp.hxx> #include <vcl/i18nhelp.hxx> #include <vcl/wall.hxx> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif #include <toolkit/awt/vclxwindow.hxx> #include <toolkit/awt/vclxmenu.hxx> #include <comphelper/mediadescriptor.hxx> +#include <comphelper/uno3.hxx> #include <rtl/logfile.hxx> #include <unotools/cmdoptions.hxx> @@ -354,40 +350,8 @@ static void impl_setDockingWindowVisibility( const css::uno::Reference< css::lan //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XINTERFACE_14 ( LayoutManager , - OWeakObject , - DIRECT_INTERFACE( css::lang::XTypeProvider ), - DIRECT_INTERFACE( css::lang::XServiceInfo ), - DIRECT_INTERFACE( ::com::sun::star::frame::XLayoutManager ), - DIRECT_INTERFACE( css::awt::XWindowListener ), - DIRECT_INTERFACE( css::frame::XFrameActionListener ), - DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfigurationListener ), - DIRECT_INTERFACE( ::com::sun::star::frame::XInplaceLayout ), - DIRECT_INTERFACE( css::awt::XDockableWindowListener ), - DIRECT_INTERFACE( ::com::sun::star::frame::XMenuBarMergingAcceptor ), - DIRECT_INTERFACE( css::frame::XLayoutManagerEventBroadcaster ), - DERIVED_INTERFACE( css::lang::XEventListener, css::frame::XFrameActionListener ), - DIRECT_INTERFACE( ::com::sun::star::beans::XMultiPropertySet ), - DIRECT_INTERFACE( ::com::sun::star::beans::XFastPropertySet ), - DIRECT_INTERFACE( ::com::sun::star::beans::XPropertySet ) - ) - -DEFINE_XTYPEPROVIDER_14 ( LayoutManager , - css::lang::XTypeProvider , - css::lang::XServiceInfo , - ::com::sun::star::frame::XLayoutManager , - css::awt::XWindowListener , - css::frame::XFrameActionListener , - css::lang::XEventListener , - ::com::sun::star::ui::XUIConfigurationListener , - ::com::sun::star::frame::XInplaceLayout , - css::awt::XDockableWindowListener , - ::com::sun::star::frame::XMenuBarMergingAcceptor , - css::frame::XLayoutManagerEventBroadcaster , - ::com::sun::star::beans::XMultiPropertySet , - ::com::sun::star::beans::XFastPropertySet , - ::com::sun::star::beans::XPropertySet - ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase ) +IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase ) DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager , ::cppu::OWeakObject , @@ -398,15 +362,14 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager DEFINE_INIT_SERVICE ( LayoutManager, {} ) -LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) : - ThreadHelpBase( &Application::GetSolarMutex() ) +LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) + : LayoutManager_Base ( ) + , ThreadHelpBase ( &Application::GetSolarMutex() ) , ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() ) - , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) - , ::cppu::OWeakObject ( ) + , LayoutManager_PBase ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) ) , m_xSMGR( xServiceManager ) - , m_xURLTransformer( Reference< XURLTransformer >( xServiceManager->createInstance( - SERVICENAME_URLTRANSFORMER), - UNO_QUERY )) + , m_xURLTransformer( xServiceManager->createInstance( SERVICENAME_URLTRANSFORMER ), UNO_QUERY ) + , m_xDisplayAccess( xServiceManager->createInstance( SERVICENAME_DISPLAYACCESS ), UNO_QUERY ) , m_nLockCount( 0 ) , m_bActive( sal_False ) , m_bInplaceMenuSet( sal_False ) @@ -421,6 +384,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM , m_bStoreWindowState( sal_False ) , m_bHideCurrentUI( false ) , m_bGlobalSettings( sal_False ) + , m_bPreserveContentSize( false ) , m_eDockOperation( DOCKOP_ON_COLROW ) , m_pInplaceMenuBar( NULL ) , m_xModuleManager( Reference< XModuleManager >( @@ -462,6 +426,15 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM m_aAsyncLayoutTimer.SetTimeout( 50 ); m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) ); + + + registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) ); + registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, css::beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) ); + registerProperty( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY, &m_nLockCount, getCppuType( &m_nLockCount ) ); + registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, css::beans::PropertyAttribute::TRANSIENT, &m_bMenuBarCloser, ::getCppuType( &m_bMenuBarCloser ) ); + const sal_Bool bRefreshVisibility = sal_False; + registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, css::beans::PropertyAttribute::TRANSIENT, ::getCppuType( &bRefreshVisibility ), &bRefreshVisibility ); + registerProperty( LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE, LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, css::beans::PropertyAttribute::TRANSIENT, &m_bPreserveContentSize, ::getCppuType( &m_bPreserveContentSize ) ); } LayoutManager::~LayoutManager() @@ -3240,7 +3213,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible ) if ( bSetVisible ) { implts_createNonContextSensitiveToolBars(); - doLayout(); + implts_doLayout_notify( sal_False ); } else { @@ -3516,7 +3489,7 @@ sal_Bool LayoutManager::implts_showProgressBar() if ( !pWindow->IsVisible() ) { pWindow->Show(); - doLayout(); + implts_doLayout_notify( sal_False ); } return sal_True; } @@ -3557,7 +3530,7 @@ sal_Bool LayoutManager::implts_hideProgressBar() ( bHideStatusBar || bInternalStatusBar )) { pWindow->Hide(); - doLayout(); + implts_doLayout_notify( sal_False ); return sal_True; } @@ -3829,6 +3802,7 @@ throw ( RuntimeException ) { m_aDockingArea = css::awt::Rectangle(); m_xContainerWindow = m_xDockingAreaAcceptor->getContainerWindow(); + m_xContainerTopWindow.set( m_xContainerWindow, UNO_QUERY ); m_xContainerWindow->addWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); // we always must keep a connection to the window of our frame for resize events @@ -3913,7 +3887,7 @@ throw ( RuntimeException ) implts_createNonContextSensitiveToolBars(); } implts_sortUIElements(); - implts_doLayout( sal_True ); + implts_doLayout( sal_True, sal_False ); } } @@ -5477,26 +5451,33 @@ throw (RuntimeException) implts_notifyListeners( css::frame::LayoutManagerEvents::UNLOCK, a ); if ( bDoLayout ) - doLayout(); + implts_doLayout_notify( sal_True ); } void SAL_CALL LayoutManager::doLayout() throw (RuntimeException) { - sal_Bool bLayouted = implts_doLayout( sal_False ); + implts_doLayout_notify( sal_True ); +} +void LayoutManager::implts_doLayout_notify( sal_Bool bOuterResize ) +{ + sal_Bool bLayouted = implts_doLayout( sal_False, bOuterResize ); if ( bLayouted ) implts_notifyListeners( css::frame::LayoutManagerEvents::LAYOUT, Any() ); } -sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace ) +sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize ) { RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::LayoutManager::implts_doLayout" ); sal_Bool bNoLock( sal_False ); css::awt::Rectangle aCurrBorderSpace; Reference< css::awt::XWindow > xContainerWindow; + Reference< css::awt::XTopWindow2 > xContainerTopWindow; + Reference< css::awt::XWindow > xComponentWindow; Reference< XDockingAreaAcceptor > xDockingAreaAcceptor; + bool bPreserveContentSize( false ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ ReadGuard aReadLock( m_aLock ); @@ -5507,8 +5488,11 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace ) bNoLock = ( m_nLockCount == 0 ); xContainerWindow = m_xContainerWindow; + xContainerTopWindow = m_xContainerTopWindow; + xComponentWindow = m_xFrame->getComponentWindow(); xDockingAreaAcceptor = m_xDockingAreaAcceptor; aCurrBorderSpace = m_aDockingArea; + bPreserveContentSize = m_bPreserveContentSize; aReadLock.unlock(); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ @@ -5516,7 +5500,8 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace ) if ( bNoLock && xDockingAreaAcceptor.is() && - xContainerWindow.is() ) + xContainerWindow.is() && + xComponentWindow.is() ) { bLayouted = sal_True; @@ -5532,11 +5517,44 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace ) if ( !bEqual || bForceRequestBorderSpace || bMustDoLayout ) { - bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace ); - if ( bGotRequestedBorderSpace ) + // we always resize the content window (instead of the complete container window) if we're not set up + // to (attempt to) preserve the content window's size + if ( bOuterResize && !bPreserveContentSize ) + bOuterResize = sal_False; + + // maximized windows can resized their content window only, not their container window + if ( bOuterResize && xContainerTopWindow.is() && xContainerTopWindow->getIsMaximized() ) + bOuterResize = sal_False; + + // if the component window does not have a size (yet), then we can't use it to calc the container + // window size + css::awt::Rectangle aComponentRect = xComponentWindow->getPosSize(); + if ( bOuterResize && ( aComponentRect.Width == 0 ) && ( aComponentRect.Height == 0 ) ) + bOuterResize = sal_False; + + bGotRequestedBorderSpace = sal_False; + if ( bOuterResize ) { - xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace ); + Reference< awt::XDevice > xDevice( xContainerWindow, uno::UNO_QUERY ); + awt::DeviceInfo aContainerInfo = xDevice->getInfo(); + awt::Size aRequestedSize( aComponentRect.Width + aContainerInfo.LeftInset + aContainerInfo.RightInset + aBorderSpace.X + aBorderSpace.Width, + aComponentRect.Height + aContainerInfo.TopInset + aContainerInfo.BottomInset + aBorderSpace.Y + aBorderSpace.Height ); + awt::Point aComponentPos( aBorderSpace.X, aBorderSpace.Y ); + + bGotRequestedBorderSpace = implts_resizeContainerWindow( aRequestedSize, aComponentPos ); + } + + // if we did not do an container window resize, or it failed, then use the DockingAcceptor as usual + if ( !bGotRequestedBorderSpace ) + { + bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace ); + if ( bGotRequestedBorderSpace ) + xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace ); + } + + if ( bGotRequestedBorderSpace ) + { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ aWriteGuard.lock(); m_aDockingArea = aBorderSpace; @@ -5603,6 +5621,52 @@ sal_Bool LayoutManager::implts_compareRectangles( const css::awt::Rectangle& rRe ( rRect1.Height == rRect2.Height )); } +sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSize, + const awt::Point& rComponentPos ) +{ + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + ReadGuard aReadLock( m_aLock ); + Reference< awt::XWindow > xContainerWindow = m_xContainerWindow; + Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow; + Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow(); + Reference< container::XIndexAccess > xDisplayAccess = m_xDisplayAccess; + aReadLock.unlock(); + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + + // calculate the maximum size we have for the container window + awt::Rectangle aWorkArea; + try + { + sal_Int32 nDisplay = xContainerTopWindow->getDisplay(); + Reference< beans::XPropertySet > xDisplayInfo( xDisplayAccess->getByIndex( nDisplay ), UNO_QUERY_THROW ); + OSL_VERIFY( xDisplayInfo->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WorkArea" ) ) ) >>= aWorkArea ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + if ( ( aWorkArea.Width > 0 ) && ( aWorkArea.Height > 0 ) ) + { + if ( ( rContainerSize.Width > aWorkArea.Width ) + || ( rContainerSize.Height > aWorkArea.Height ) + ) + return sal_False; + // Strictly, this is not correct. If we have a multi-screen display (css.awt.DisplayAccess.MultiDisplay == true), + // the the "effective work area" would be much larger than the work area of a single display, since we could in theory + // position the container window across multiple screens. + // However, this should suffice as a heuristics here ... (nobody really wants to check whethere the different screens are + // stacked horizontally or vertically, whether their work areas can really be combined, or are separated by non-work-areas, + // and the like ... right?) + } + + // resize our container window + xContainerWindow->setPosSize( 0, 0, rContainerSize.Width, rContainerSize.Height, css::awt::PosSize::SIZE ); + // position the component window + xComponentWindow->setPosSize( rComponentPos.X, rComponentPos.Y, 0, 0, css::awt::PosSize::POS ); + return sal_True; +} + void SAL_CALL LayoutManager::setVisible( sal_Bool bVisible ) throw (::com::sun::star::uno::RuntimeException) { @@ -7028,7 +7092,7 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG ) aReadLock.unlock(); implts_setDockingAreaWindowSizes( aDockingArea ); - implts_doLayout( sal_True ); + implts_doLayout( sal_True, sal_False ); return 0; } @@ -7079,7 +7143,8 @@ throw ( RuntimeException ) /* SAFE AREA ----------------------------------------------------------------------------------------------- */ implts_reset( sal_True ); - implts_doLayout( sal_True ); + implts_doLayout( sal_True, sal_False ); + implts_doLayout( sal_True, sal_True ); } else if (( aEvent.Action == FrameAction_FRAME_UI_ACTIVATED ) || ( aEvent.Action == FrameAction_FRAME_UI_DEACTIVATING )) @@ -7106,7 +7171,6 @@ throw ( RuntimeException ) // SAFE AREA ----------------------------------------------------------------------------------------------- implts_reset( sal_False ); - } } @@ -7148,6 +7212,7 @@ throw( RuntimeException ) } m_xInplaceMenuBar.clear(); m_xContainerWindow.clear(); + m_xContainerTopWindow.clear(); implts_destroyDockingAreaWindows(); if ( m_xModuleCfgMgr.is() ) @@ -7198,6 +7263,7 @@ throw( RuntimeException ) } m_xInplaceMenuBar.clear(); m_xContainerWindow.clear(); + m_xContainerTopWindow.clear(); } else if ( rEvent.Source == Reference< XInterface >( m_xDocCfgMgr, UNO_QUERY )) { @@ -7412,65 +7478,21 @@ sal_Bool SAL_CALL LayoutManager::convertFastPropertyValue( Any& aConverted sal_Int32 nHandle , const Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException ) { - // Initialize state with FALSE !!! - // (Handle can be invalid) - sal_Bool bReturn = sal_False; - - switch( nHandle ) - { - case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER : - bReturn = PropHelper::willPropertyBeChanged( - com::sun::star::uno::makeAny(m_bMenuBarCloser), - aValue, - aOldValue, - aConvertedValue); - break; - case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS: - bReturn = PropHelper::willPropertyBeChanged( - com::sun::star::uno::makeAny(m_bAutomaticToolbars), - aValue, - aOldValue, - aConvertedValue); - break; - case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY: - bReturn = PropHelper::willPropertyBeChanged( - com::sun::star::uno::makeAny(sal_False), - aValue, - aOldValue, - aConvertedValue); - break; - case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI: - bReturn = PropHelper::willPropertyBeChanged( - com::sun::star::uno::makeAny(m_bHideCurrentUI), - aValue, - aOldValue, - aConvertedValue); - break; - } - - // Return state of operation. - return bReturn ; + return LayoutManager_PBase::convertFastPropertyValue( aConvertedValue, aOldValue, nHandle, aValue ); } void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception ) { + if ( nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY ) + LayoutManager_PBase::setFastPropertyValue_NoBroadcast( nHandle, aValue ); + switch( nHandle ) { case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER: - { - sal_Bool bCloserState = sal_False; - aValue >>= bCloserState; - implts_setMenuBarCloser( bCloserState ); - break; - } - case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS: - { - sal_Bool bValue = sal_Bool(); - if ( aValue >>= bValue ) - m_bAutomaticToolbars = bValue; + implts_updateMenuBarClose(); break; - } + case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY: { sal_Bool bValue = sal_Bool(); @@ -7478,40 +7500,17 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 implts_refreshContextToolbarsVisibility(); break; } + case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI: - { - sal_Bool bValue = sal_Bool(); - if ( aValue >>= bValue ) - { - m_bHideCurrentUI = bValue; - implts_setCurrentUIVisibility( !bValue ); - } + implts_setCurrentUIVisibility( !m_bHideCurrentUI ); break; - } } } void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aValue , sal_Int32 nHandle ) const { - switch( nHandle ) - { - case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER: - aValue <<= m_bMenuBarCloser; - break; - case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS: - aValue <<= m_bAutomaticToolbars; - break; - case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY: - aValue <<= sal_False; - break; - case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI: - aValue <<= m_bHideCurrentUI; - break; - case LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT: - aValue <<= m_nLockCount; - break; - } + LayoutManager_PBase::getFastPropertyValue( aValue, nHandle ); } ::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper() @@ -7530,9 +7529,9 @@ void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aVa if( pInfoHelper == NULL ) { // Define static member to give structure of properties to baseclass "OPropertySetHelper". - // "impl_getStaticPropertyDescriptor" is a non exported and static funtion, who will define a static propertytable. - // "sal_True" say: Table is sorted by name. - static ::cppu::OPropertyArrayHelper aInfoHelper( impl_getStaticPropertyDescriptor(), sal_True ); + uno::Sequence< beans::Property > aProperties; + describeProperties( aProperties ); + static ::cppu::OPropertyArrayHelper aInfoHelper( aProperties, sal_True ); pInfoHelper = &aInfoHelper; } } @@ -7564,28 +7563,5 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA return (*pInfo); } -const com::sun::star::uno::Sequence< com::sun::star::beans::Property > LayoutManager::impl_getStaticPropertyDescriptor() -{ - // Create a new static property array to initialize sequence! - // Table of all predefined properties of this class. Its used from OPropertySetHelper-class! - // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!! - // It's necessary for methods of OPropertySetHelper. - // ATTENTION: - // YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!! - - static const com::sun::star::beans::Property pProperties[] = - { - com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, ::getCppuType((const sal_Int32*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT|com::sun::star::beans::PropertyAttribute::READONLY ), - com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ), - com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ) - }; - // Use it to initialize sequence! - static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, LAYOUTMANAGER_PROPCOUNT ); - // Return static "PropertyDescriptor" - return lPropertyDescriptor; -} - } // namespace framework diff --git a/framework/source/layoutmanager/makefile.mk b/framework/source/layoutmanager/makefile.mk index b9b6bcf248ff..3af616971ad7 100644 --- a/framework/source/layoutmanager/makefile.mk +++ b/framework/source/layoutmanager/makefile.mk @@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS= TRUE .INCLUDE : settings.mk +VISIBILITY_HIDDEN = TRUE + # --- Generate ----------------------------------------------------- SLOFILES= \ diff --git a/framework/source/register/makefile.mk b/framework/source/register/makefile.mk index 1e15c55bd23a..7d7f00e94512 100644 --- a/framework/source/register/makefile.mk +++ b/framework/source/register/makefile.mk @@ -40,6 +40,8 @@ LIBTARGET= NO .INCLUDE : settings.mk +VISIBILITY_HIDDEN = TRUE + # --- Generate ----------------------------------------------------- SLOFILES= \ diff --git a/framework/source/xml/menuconfiguration.cxx b/framework/source/xml/menuconfiguration.cxx index 7b0520219ef6..dcaf354891f6 100644 --- a/framework/source/xml/menuconfiguration.cxx +++ b/framework/source/xml/menuconfiguration.cxx @@ -44,10 +44,6 @@ #include <xml/saxnamespacefilter.hxx> #include <services.h> -#ifndef _FRAMEWORK_SERVICES_LAYOUTMANAGER_HXX_ -#include <services/layoutmanager.hxx> -#endif - #ifndef _FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_ #include <uielement/rootitemcontainer.hxx> #endif diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 54ccd29a7dd7..2951ac3ef4a3 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -81,6 +81,7 @@ #include <vos/mutex.hxx> #include <osl/mutex.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/sequence.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/helper/convert.hxx> @@ -706,6 +707,29 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ; pActFrame->Enable( TRUE ); pActFrame->GetDispatcher()->Lock( FALSE ); + + if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL ) + && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + ) + { + SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame(); + if ( !pViewFrm->GetFrame()->IsInPlace() ) + { + // for outplace embedded objects, we want the layout manager to keep the content window + // size constant, if possible + try + { + uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xLayouterProps( + xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW ); + xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } } } } diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index 9fb9eeb773dd..5c3acad950e6 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -33,71 +33,74 @@ // include ----------------------------------------------------------- #include <svl/solar.hrc> -// in solar.hrc -//#define HID_FORMS_START (HID_LIB_START+4000) -//#define HID_FORMS_END (HID_LIB_START+4999) - // Help-Ids -------------------------------------------------------------- -/* -#define HID_DLG_DBINFO (HID_FORMS_START + 0) -#define HID_FM_DLG_PARAM (HID_FORM_DLG_START + 27) -#define HID_SEARCH_SINGLEFIELD (HID_FORM_DLG_START + 12) -#define HID_TP_XFORMS_BINDING (HID_FM_OTHER_START + 47) -#define HID_TP_XFORMS_INSTANCE (HID_FM_OTHER_START + 45) -#define HID_TP_XFORMS_SUBMISSION (HID_FM_OTHER_START + 46) -*/ -// insgesamt 200 -#define HID_FM_OTHER_START (HID_FORMS_START + 300) -#define HID_CONTROLS_DATE_N_TIME (HID_FORM_DLG_START + 26) -#define HID_DATA_NAVIGATOR_WIN (HID_FM_OTHER_START + 39) -#define HID_DLG_DBMSG (HID_FORMS_START + 1) -#define HID_FIELD_SEL (HID_FM_OTHER_START + 2) -#define HID_FIELD_SEL_WIN (HID_FM_OTHER_START + 3) -#define HID_FILTER_NAVIGATOR (HID_FM_OTHER_START + 4) -#define HID_FILTER_NAVIGATOR_WIN (HID_FM_OTHER_START + 5) -#define HID_FORM_DLG_START (HID_FORMS_START + 400) -#define HID_FORM_NAVIGATOR (HID_FM_OTHER_START + 0) -#define HID_FORM_NAVIGATOR_WIN (HID_FM_OTHER_START + 1) -#define HID_GRID_NUMBEROFRECORDS (HID_FORM_DLG_START + 34) -#define HID_GRID_TRAVEL_ABSOLUTE (HID_FORM_DLG_START + 33) -#define HID_GRID_TRAVEL_FIRST (HID_FORM_DLG_START + 28) -#define HID_GRID_TRAVEL_LAST (HID_FORM_DLG_START + 31) -#define HID_GRID_TRAVEL_NEW (HID_FORM_DLG_START + 32) -#define HID_GRID_TRAVEL_NEXT (HID_FORM_DLG_START + 30) -#define HID_GRID_TRAVEL_PREV (HID_FORM_DLG_START + 29) -#define HID_MN_XFORMS_INSTANCES_ADD (HID_FM_OTHER_START + 51) -#define HID_MN_XFORMS_INSTANCES_EDIT (HID_FM_OTHER_START + 52) -#define HID_MN_XFORMS_INSTANCES_REMOVE (HID_FM_OTHER_START + 53) -#define HID_MN_XFORMS_MODELS_ADD (HID_FM_OTHER_START + 48) -#define HID_MN_XFORMS_MODELS_EDIT (HID_FM_OTHER_START + 49) -#define HID_MN_XFORMS_MODELS_REMOVE (HID_FM_OTHER_START + 50) -#define HID_MN_XFORMS_SHOW_DETAILS (HID_FM_OTHER_START + 54) -#define HID_XFORMS_ADDCONDITION_DLG (HID_FM_OTHER_START + 41) -#define HID_XFORMS_ADDDATAITEM_DLG (HID_FM_OTHER_START + 40) -#define HID_XFORMS_ADDINSTANCE_DLG (HID_FM_OTHER_START + 67) -#define HID_XFORMS_ADDMODEL_DLG (HID_FM_OTHER_START + 66) -#define HID_XFORMS_ADDSUBMISSION_DLG (HID_FM_OTHER_START + 65) -#define HID_XFORMS_INSTANCES_MENUBTN (HID_FM_OTHER_START + 64) -#define HID_XFORMS_ITEMS_LIST (HID_FM_OTHER_START + 61) -#define HID_XFORMS_MANAGENAMESPACE_DLG (HID_FM_OTHER_START + 44) -#define HID_XFORMS_MID_INSERT_CONTROL (HID_FM_OTHER_START + 68) -#define HID_XFORMS_MODELS_LIST (HID_FM_OTHER_START + 62) -#define HID_XFORMS_MODELS_MENUBTN (HID_FM_OTHER_START + 63) -#define HID_XFORMS_NAMESPACEITEM_DLG (HID_FM_OTHER_START + 42) -#define HID_XFORMS_NAMESPACEITEM_LIST (HID_FM_OTHER_START + 43) -#define HID_XFORMS_TAB_CONTROL (HID_FM_OTHER_START + 69) -#define HID_XFORMS_TOOLBOX (HID_FM_OTHER_START + 55) -#define HID_XFORMS_TOOLBOX_ITEM_ADD (HID_FM_OTHER_START + 56) -#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE (HID_FM_OTHER_START + 58) -#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT (HID_FM_OTHER_START + 57) -#define HID_XFORMS_TOOLBOX_ITEM_EDIT (HID_FM_OTHER_START + 59) -#define HID_XFORMS_TOOLBOX_ITEM_REMOVE (HID_FM_OTHER_START + 60) -#define UID_ABSOLUTE_RECORD_WINDOW (HID_FORM_DLG_START + 38) -#define UID_FORMPROPBROWSER_FRAME (HID_FORM_DLG_START + 37) - -// if you add a new define here, please adjust the overflow check -// at the end of the file!! - +#define HID_DLG_DBMSG ( HID_FORMS_START + 1) +#define HID_FORM_NAVIGATOR ( HID_FORMS_START + 2) +#define HID_FORM_NAVIGATOR_WIN ( HID_FORMS_START + 3) +#define HID_FIELD_SEL ( HID_FORMS_START + 4) +#define HID_FIELD_SEL_WIN ( HID_FORMS_START + 5) +#define HID_FILTER_NAVIGATOR ( HID_FORMS_START + 6) +#define HID_FILTER_NAVIGATOR_WIN ( HID_FORMS_START + 7) +#define HID_FM_DLG_SEARCH ( HID_FORMS_START + 8) +#define HID_SEARCH_TEXT ( HID_FORMS_START + 9) +#define HID_SEARCH_ALLFIELDS ( HID_FORMS_START + 10) +//#define HID_SEARCH_SINGLEFIELD ( HID_FORMS_START + 11) +#define HID_SEARCH_FIELDSELECTION ( HID_FORMS_START + 12) +#define HID_SEARCH_POSITION ( HID_FORMS_START + 13) +#define HID_SEARCH_FORMATTER ( HID_FORMS_START + 14) +#define HID_SEARCH_CASE ( HID_FORMS_START + 15) +#define HID_SEARCH_BACKWARD ( HID_FORMS_START + 16) +#define HID_SEARCH_STARTOVER ( HID_FORMS_START + 17) +#define HID_SEARCH_WILDCARD ( HID_FORMS_START + 18) +#define HID_SEARCH_REGULAR ( HID_FORMS_START + 19) +#define HID_SEARCH_APPROX ( HID_FORMS_START + 20) +#define HID_SEARCH_APPROXSETTINGS ( HID_FORMS_START + 21) +#define HID_SEARCH_BTN_SEARCH ( HID_FORMS_START + 22) +#define HID_SEARCH_BTN_CLOSE ( HID_FORMS_START + 23) +#define HID_CONTROLS_DATE_N_TIME ( HID_FORMS_START + 24) +#define HID_GRID_TRAVEL_FIRST ( HID_FORMS_START + 25) +#define HID_GRID_TRAVEL_PREV ( HID_FORMS_START + 26) +#define HID_GRID_TRAVEL_NEXT ( HID_FORMS_START + 27) +#define HID_GRID_TRAVEL_LAST ( HID_FORMS_START + 28) +#define HID_GRID_TRAVEL_NEW ( HID_FORMS_START + 29) +#define HID_GRID_TRAVEL_ABSOLUTE ( HID_FORMS_START + 30) +#define HID_GRID_NUMBEROFRECORDS ( HID_FORMS_START + 31) +#define UID_SEARCH_RECORDSTATUS ( HID_FORMS_START + 32) +#define UID_FORMPROPBROWSER_FRAME ( HID_FORMS_START + 33) +#define UID_ABSOLUTE_RECORD_WINDOW ( HID_FORMS_START + 34) +#define HID_DATA_NAVIGATOR_WIN ( HID_FORMS_START + 35) +#define HID_XFORMS_ADDDATAITEM_DLG ( HID_FORMS_START + 36) +#define HID_XFORMS_ADDCONDITION_DLG ( HID_FORMS_START + 37) +#define HID_XFORMS_NAMESPACEITEM_DLG ( HID_FORMS_START + 38) +#define HID_XFORMS_NAMESPACEITEM_LIST ( HID_FORMS_START + 39) +#define HID_XFORMS_MANAGENAMESPACE_DLG ( HID_FORMS_START + 40) +//#define HID_TP_XFORMS_INSTANCE ( HID_FORMS_START + 41) +//#define HID_TP_XFORMS_SUBMISSION ( HID_FORMS_START + 42) +//#define HID_TP_XFORMS_BINDING ( HID_FORMS_START + 43) +#define HID_MN_XFORMS_MODELS_ADD ( HID_FORMS_START + 44) +#define HID_MN_XFORMS_MODELS_EDIT ( HID_FORMS_START + 45) +#define HID_MN_XFORMS_MODELS_REMOVE ( HID_FORMS_START + 46) +#define HID_MN_XFORMS_INSTANCES_ADD ( HID_FORMS_START + 47) +#define HID_MN_XFORMS_INSTANCES_EDIT ( HID_FORMS_START + 48) +#define HID_MN_XFORMS_INSTANCES_REMOVE ( HID_FORMS_START + 49) +#define HID_MN_XFORMS_SHOW_DETAILS ( HID_FORMS_START + 50) +#define HID_XFORMS_TOOLBOX ( HID_FORMS_START + 51) +#define HID_XFORMS_TOOLBOX_ITEM_ADD ( HID_FORMS_START + 52) +#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT ( HID_FORMS_START + 53) +#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE ( HID_FORMS_START + 54) +#define HID_XFORMS_TOOLBOX_ITEM_EDIT ( HID_FORMS_START + 55) +#define HID_XFORMS_TOOLBOX_ITEM_REMOVE ( HID_FORMS_START + 56) +#define HID_XFORMS_ITEMS_LIST ( HID_FORMS_START + 57) +#define HID_XFORMS_MODELS_LIST ( HID_FORMS_START + 58) +#define HID_XFORMS_MODELS_MENUBTN ( HID_FORMS_START + 59) +#define HID_XFORMS_INSTANCES_MENUBTN ( HID_FORMS_START + 60) +#define HID_XFORMS_ADDSUBMISSION_DLG ( HID_FORMS_START + 61) +#define HID_XFORMS_ADDMODEL_DLG ( HID_FORMS_START + 62) +#define HID_XFORMS_ADDINSTANCE_DLG ( HID_FORMS_START + 63) +#define HID_XFORMS_MID_INSERT_CONTROL ( HID_FORMS_START + 64) +#define HID_XFORMS_TAB_CONTROL ( HID_FORMS_START + 65) + // if you add a new define here, please adjust the overflow check + // at the end of the file!! // ----------------------------------------------------------------------- // "Uberlaufpr"ufung ----------------------------------------------------- diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index 766c2dd2483f..7e2476e6f054 100644 --- a/xmloff/source/forms/gridcolumnproptranslator.cxx +++ b/xmloff/source/forms/gridcolumnproptranslator.cxx @@ -235,9 +235,15 @@ namespace xmloff } //-------------------------------------------------------------------- - void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) + void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - Sequence< ::rtl::OUString > aNames( &aPropertyName, 1 ); + // we implement this by delegating it to setPropertyValues, which is to ignore unknown properties. On the other hand, our + // contract requires us to throw a UnknownPropertyException for unknown properties, so check this first. + + if ( !getPropertySetInfo()->hasPropertyByName( _rPropertyName ) ) + throw UnknownPropertyException( _rPropertyName, *this ); + + Sequence< ::rtl::OUString > aNames( &_rPropertyName, 1 ); Sequence< Any > aValues( &aValue, 1 ); setPropertyValues( aNames, aValues ); } diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index c41d54bb00ed..2d3d1620afe1 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -30,34 +30,29 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/style/XStyle.hpp> + +#include "XMLTextPropertySetContext.hxx" +#include "xmlnmspe.hxx" +#include "xmloff/XMLEventsImportContext.hxx" +#include "xmloff/attrlist.hxx" +#include "xmloff/families.hxx" +#include "xmloff/txtprmap.hxx" +#include "xmloff/txtstyli.hxx" +#include "xmloff/xmlimp.hxx" +#include "xmloff/xmltkmap.hxx" +#include "xmloff/xmltoken.hxx" +#include "xmloff/xmluconv.hxx" + +#include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/ParagraphStyleCategory.hpp> -#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP -#include <com/sun/star/document/XEventsSupplier.hpp> -#endif -#include <com/sun/star/beans/XMultiPropertySet.hpp> -#include "xmlnmspe.hxx" -#include <xmloff/xmltoken.hxx> -#ifndef _XMLOFF_FAMILIES_HXX -#include <xmloff/families.hxx> -#endif -#include "XMLTextPropertySetContext.hxx" -#include <xmloff/xmltkmap.hxx> -#include <xmloff/xmlimp.hxx> -#include <xmloff/xmluconv.hxx> - -#ifndef _XMLOFF_TXTPRMAP_HXX -#include <xmloff/txtprmap.hxx> -#endif -#ifndef _XMLOFF_TXTSTYLI_HXX -#include <xmloff/txtstyli.hxx> -#endif -#include <xmloff/attrlist.hxx> -#include <xmloff/XMLEventsImportContext.hxx> +#include <com/sun/star/style/XStyle.hpp> + #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> // STL includes #include <algorithm> @@ -464,6 +459,9 @@ void XMLTextStyleContext::FillPropertySet( { -1, -1 } }; + // get property set info + Reference< XPropertySetInfo > xInfo( rPropSet->getPropertySetInfo(), UNO_SET_THROW ); + bool bAutomatic = false; if( ((SvXMLStylesContext *)GetStyles())->IsAutomaticStyle() && ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) @@ -476,11 +474,15 @@ void XMLTextStyleContext::FillPropertySet( OUString( RTL_CONSTASCII_USTRINGPARAM("ParaAutoStyleName") ); try { - rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) ); + if ( xInfo->hasPropertyByName( sAutoProp ) ) + rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) ); + else + bAutomatic = false; } catch( const RuntimeException& ) { throw; } catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); bAutomatic = false; } } @@ -499,9 +501,6 @@ void XMLTextStyleContext::FillPropertySet( bHasCombinedCharactersLetter = bVal; } - // get property set info - Reference< XPropertySetInfo > xInfo; - // keep-together: the application default is different from // the file format default. Hence, if we always set this // value; if we didn't find one, we'll set to false, the file @@ -534,9 +533,6 @@ void XMLTextStyleContext::FillPropertySet( // check for StarBats and StarMath fonts - if (!xInfo.is()) - xInfo.set(rPropSet->getPropertySetInfo()); - // iterate over aContextIDs entries 3..6 for ( sal_Int32 i = 3; i < 7; i++ ) { @@ -572,8 +568,6 @@ void XMLTextStyleContext::FillPropertySet( // set property OUString rPropertyName( rPropMapper->GetEntryAPIName(nMapperIndex) ); - if( !xInfo.is() ) - xInfo = rPropSet->getPropertySetInfo(); if ( xInfo->hasPropertyByName( rPropertyName ) ) { rPropSet->setPropertyValue( rPropertyName, aAny ); |