summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-01-25 18:35:57 +0100
committerMathias Bauer <mba@openoffice.org>2011-01-25 18:35:57 +0100
commit9fa0a785088feeaf3cf4bb502ef8f2e4ec1b1152 (patch)
treec2c38071b41c9d03c6e49599f86950e1a19969c5 /sfx2
parent80fa6e0c97fc50fee714f3a7dc75d11d2180877b (diff)
parentd646413d464dc5d6518f87daa8538cd0c600797f (diff)
CWS gnumake3: resync to m98
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/AllLangResTarget_sfx2.mk3
-rwxr-xr-xsfx2/Library_sfx.mk20
-rw-r--r--sfx2/inc/frmload.hxx2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx1
-rw-r--r--sfx2/inc/sfx2/objsh.hxx11
-rw-r--r--sfx2/inc/sfx2/sfxbasecontroller.hxx3
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx31
-rw-r--r--sfx2/prj/build.lst3
-rw-r--r--sfx2/qa/cppunit/makefile.mk86
-rw-r--r--sfx2/qa/unoapi/makefile.mk48
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/config/config.hrc41
-rw-r--r--sfx2/source/config/config.src35
-rw-r--r--sfx2/source/config/evntconf.cxx3
-rw-r--r--sfx2/source/doc/doctempl.cxx4
-rw-r--r--sfx2/source/doc/docvor.cxx18
-rw-r--r--sfx2/source/doc/objcont.cxx50
-rw-r--r--sfx2/source/doc/objxtor.cxx25
-rwxr-xr-xsfx2/source/doc/printhelper.cxx8
-rw-r--r--sfx2/source/view/frmload.cxx40
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx10
21 files changed, 216 insertions, 228 deletions
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk
index 04f184370a39..c49fd42cd96e 100644
--- a/sfx2/AllLangResTarget_sfx2.mk
+++ b/sfx2/AllLangResTarget_sfx2.mk
@@ -63,8 +63,11 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\
sfx2/source/dialog/passwd.src \
sfx2/source/dialog/printopt.src \
sfx2/source/dialog/recfloat.src \
+ sfx2/source/dialog/securitypage.src \
sfx2/source/dialog/srchdlg.src \
+ sfx2/source/dialog/taskpane.src \
sfx2/source/dialog/templdlg.src \
+ sfx2/source/dialog/titledockwin.src \
sfx2/source/dialog/versdlg.src \
sfx2/source/doc/doc.src \
sfx2/source/doc/doctdlg.src \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index cb3f2959e48d..8cf9640bfdf0 100755
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -283,6 +283,25 @@ $(eval $(call gb_Library_add_cxxobjects,sfx,\
, $(gb_LinkTarget_EXCEPTIONFLAGS) -nologo -UPRECOMPILED_HEADERS \
))
+ifneq ($(USE_MINGW),)
+$(eval $(call gb_Library_add_linked_libs,sfx,\
+ mingwthrd \
+ $(gb_MINGW_LIBSTDCPP) \
+ mingw32 \
+ $(gb_MINGW_LIBGCC) \
+ uwinapi \
+ moldname \
+ mingwex \
+ advapi32 \
+ gdi32 \
+ kernel32 \
+ msvcrt \
+ ole32 \
+ shell32 \
+ user32 \
+ uuid \
+))
+else
$(eval $(call gb_Library_add_linked_libs,sfx,\
advapi32 \
gdi32 \
@@ -295,6 +314,7 @@ $(eval $(call gb_Library_add_linked_libs,sfx,\
uuid \
uwinapi \
))
+endif
else
$(eval $(call gb_Library_add_cxxobjects,sfx,\
sfx2/source/appl/shutdowniconw32 \
diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx
index b03bdd724c20..74c5a1ff35d1 100644
--- a/sfx2/inc/frmload.hxx
+++ b/sfx2/inc/frmload.hxx
@@ -113,7 +113,7 @@ private:
const ::rtl::OUString& i_rFactoryURL
) const;
- SfxObjectShellLock impl_findObjectShell(
+ SfxObjectShellRef impl_findObjectShell(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument
) const;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 35656202650f..f2253a8f2b67 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -75,7 +75,6 @@ class SvStringsDtor;
#define OWEAKOBJECT ::cppu::OWeakObject
#define REFERENCE ::com::sun::star::uno::Reference
#define XINTERFACE ::com::sun::star::uno::XInterface
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define EXCEPTION ::com::sun::star::uno::Exception
#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
#define ANY ::com::sun::star::uno::Any
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 9473ac126bd7..3e696369c7a3 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -158,11 +158,6 @@ typedef sal_uInt32 SfxObjectShellFlags;
//--------------------------------------------------------------------
-#define SEQUENCE ::com::sun::star::uno::Sequence
-#define OUSTRING ::rtl::OUString
-
-//--------------------------------------------------------------------
-
#define HIDDENINFORMATION_RECORDEDCHANGES 0x0001
#define HIDDENINFORMATION_NOTES 0x0002
#define HIDDENINFORMATION_DOCUMENTVERSIONS 0x0004
@@ -209,6 +204,7 @@ class SFX2_DLLPUBLIC SfxObjectShell :
public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier
{
friend struct ModifyBlocker_Impl;
+friend class SfxObjectShellLock;
private:
struct SfxObjectShell_Impl* pImp; // interne Daten
@@ -617,7 +613,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel() const;
// Nur uebergangsweise fuer die Applikationen !!!
- virtual SEQUENCE< OUSTRING > GetEventNames();
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > GetEventNames();
Window* GetDialogParent( SfxMedium* pMedium=0 );
String UpdateTitle( SfxMedium* pMed=NULL, USHORT nDocViewNo=0 );
@@ -831,7 +827,6 @@ public:
//#endif
//--------------------------------------------------------------------
-
#ifndef SFX_DECL_OBJECTSHELL_DEFINED
#define SFX_DECL_OBJECTSHELL_DEFINED
SV_DECL_REF(SfxObjectShell)
@@ -840,8 +835,6 @@ SV_DECL_LOCK(SfxObjectShell)
SV_IMPL_LOCK(SfxObjectShell)
SV_IMPL_REF(SfxObjectShell)
-SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& rName, BOOL bWriting );
-
//#if 0 // _SOLAR__PRIVATE
//--------------------------------------------------------------------
class AutoReloadTimer_Impl : public Timer
diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx
index ca30d243bbac..de01f1965d74 100644
--- a/sfx2/inc/sfx2/sfxbasecontroller.hxx
+++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx
@@ -66,7 +66,6 @@
// Some defines to write better code :-)
#define REFERENCE ::com::sun::star::uno::Reference
#define ANY ::com::sun::star::uno::Any
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define XDISPATCH ::com::sun::star::frame::XDispatch
#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor
#define XMODEL ::com::sun::star::frame::XModel
@@ -304,7 +303,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
//____________________________________________________________________________________________________
// XControllerBorder
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 26122419e661..d0978ebc1e5f 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -161,7 +161,6 @@
#define EVENTOBJECT ::com::sun::star::lang::EventObject
#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue
#define REFERENCE ::com::sun::star::uno::Reference
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define MUTEX ::osl::Mutex
#define OUSTRING ::rtl::OUString
#define UNOTYPE ::com::sun::star::uno::Type
@@ -385,7 +384,7 @@ public:
@onerror A RuntimeException is thrown.
*/
- virtual SEQUENCE< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ;
/**___________________________________________________________________________________________________
@short get implementation id
@@ -401,7 +400,7 @@ public:
@onerror A RuntimeException is thrown.
*/
- virtual SEQUENCE< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ;
//____________________________________________________________________________________________________
@@ -580,7 +579,7 @@ public:
*/
virtual sal_Bool SAL_CALL attachResource( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& aArgs )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aArgs )
throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@@ -611,7 +610,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< PROPERTYVALUE > SAL_CALL getArgs() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getArgs() throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -861,7 +860,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< PROPERTYVALUE > SAL_CALL getPrinter() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getPrinter() throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -876,7 +875,7 @@ public:
@onerror -
*/
- virtual void SAL_CALL setPrinter( const SEQUENCE< PROPERTYVALUE >& seqPrinter )
+ virtual void SAL_CALL setPrinter( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqPrinter )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -891,14 +890,14 @@ public:
@onerror -
*/
- virtual void SAL_CALL print( const SEQUENCE< PROPERTYVALUE >& seqOptions )
+ virtual void SAL_CALL print( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqOptions )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
// XStorable2
//____________________________________________________________________________________________________
- virtual void SAL_CALL storeSelf( const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ virtual void SAL_CALL storeSelf( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
@@ -979,7 +978,7 @@ public:
*/
virtual void SAL_CALL storeAsURL( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) ;
/**___________________________________________________________________________________________________
@@ -996,7 +995,7 @@ public:
*/
virtual void SAL_CALL storeToURL( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
@@ -1037,7 +1036,7 @@ public:
@onerror -
*/
- virtual void SAL_CALL load( const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ virtual void SAL_CALL load( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::frame::DoubleInitializationException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException,
@@ -1058,7 +1057,7 @@ public:
//____________________________________________________________________________________________________
virtual void SAL_CALL loadFromStorage( const REFERENCE< XSTORAGE >& xStorage,
- const SEQUENCE< PROPERTYVALUE >& aMediaDescriptor )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor )
throw ( ILLEGALARGUMENTEXCEPTION,
DOUBLEINITIALIZATIONEXCEPTION,
IOEXCEPTION,
@@ -1066,7 +1065,7 @@ public:
RUNTIMEEXCEPTION );
virtual void SAL_CALL storeToStorage( const REFERENCE< XSTORAGE >& xStorage,
- const SEQUENCE< PROPERTYVALUE >& aMediaDescriptor )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor )
throw ( ILLEGALARGUMENTEXCEPTION,
IOEXCEPTION,
EXCEPTION,
@@ -1164,7 +1163,7 @@ public:
*/
- virtual SEQUENCE< DATAFLAVOR > SAL_CALL getTransferDataFlavors()
+ virtual ::com::sun::star::uno::Sequence< DATAFLAVOR > SAL_CALL getTransferDataFlavors()
throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@@ -1544,7 +1543,7 @@ private:
SAL_DLLPRIVATE ::rtl::OUString GetMediumFilterName_Impl();
SAL_DLLPRIVATE void impl_store( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments ,
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ,
sal_Bool bSaveTo ) ;
SAL_DLLPRIVATE void postEvent_Impl( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >() );
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index f8fddef145a6..76f87fa844c8 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,7 +1,8 @@
sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
sf sfx2 usr1 - all sf_mkout NULL
sf sfx2\prj nmake - all sf_prj NULL
-
+sf sfx2\qa\cppunit nmake - all sf_qa_cppunit NULL
+sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL
# fails on unxsoli4
# sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
new file mode 100644
index 000000000000..b53a04ec43f9
--- /dev/null
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -0,0 +1,86 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ=../..
+PRJNAME=sfx2
+TARGET=qa_cppunit
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+DLLPRE = # no leading "lib" on .so files
+
+# --- Libs ---------------------------------------------------------
+
+SHL1OBJS= \
+ $(SLO)/test_metadatable.obj \
+
+
+SHL1STDLIBS= \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VCLLIB) \
+ $(SFXLIB) \
+
+
+SHL1TARGET= test_metadatable
+SHL1RPATH = NONE
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP= version.map
+
+# --- All object files ---------------------------------------------
+
+SLOFILES= \
+ $(SHL1OBJS) \
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
+.END
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..ea91ba4d1c44
--- /dev/null
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 7071ee2ba140..bfac68da85d3 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -368,6 +368,8 @@ SfxApplication::SfxApplication()
SfxApplication::~SfxApplication()
{
+ OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" );
+
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
SfxModule::DestroyModules_Impl();
diff --git a/sfx2/source/config/config.hrc b/sfx2/source/config/config.hrc
deleted file mode 100644
index 582a2972f913..000000000000
--- a/sfx2/source/config/config.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef _SFX_CONFIG_HRC
-#define _SFX_CONFIG_HRC
-
-#include <sfx2/sfx.hrc>
-
-// #defines *****************************************************************
-
-#define BTN_OK 2
-#define BTN_CANCEL 3
-#define FT_OK 4
-#define FT_CANCEL 5
-
-#endif
-
diff --git a/sfx2/source/config/config.src b/sfx2/source/config/config.src
deleted file mode 100644
index cb3259e09ad0..000000000000
--- a/sfx2/source/config/config.src
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-//#include "config.hrc"
-//#include "sfxlocal.hrc"
-#include <sfx2/sfx.hrc>
-
-String STR_FILTERNAME_CFG
-{
- Text [ en-US ] = "Configuration" ;
-};
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 185ec0626c51..59c56cc291a7 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -34,7 +34,7 @@
#include <basic/sbmod.hxx>
#include <tools/urlobj.hxx>
#include <basic/sbx.hxx>
- #include <sot/storage.hxx>
+#include <sot/storage.hxx>
#include <unotools/securityoptions.hxx>
#include <rtl/ustring.h>
@@ -47,7 +47,6 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dispatch.hxx>
-#include "config.hrc"
#include "sfx2/sfxresid.hxx"
#include "eventsupplier.hxx"
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index f5ea04e5e08d..f962542aac10 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -137,7 +137,11 @@ namespace DocTempl {
class DocTempl_EntryData_Impl
{
RegionData_Impl* mpParent;
+
+ // the following member must be SfxObjectShellLock since it controlls that SfxObjectShell lifetime by design
+ // and users of this class expect it to be so.
SfxObjectShellLock mxObjShell;
+
OUString maTitle;
OUString maOwnURL;
OUString maTargetURL;
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 6367f2a65d76..c017a5779cdd 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -546,6 +546,9 @@ BOOL SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return SvTreeListBox::Select(pEntry,bSelect);
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
GetObjectShell(aPath)->TriggerHelpPI(
aPath[nLevel+1], aPath[nLevel+2], aPath[nLevel+3]);
return SvTreeListBox::Select(pEntry,bSelect);
@@ -691,10 +694,12 @@ BOOL SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
BOOL bRemovedFromSource = FALSE;
Path aSource(pSourceBox, pSource);
Path aTarget(this, pTarget);
- SfxObjectShellRef aSourceDoc =
- ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
+ SfxObjectShellRef aSourceDoc = ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
SfxObjectShellRef aTargetDoc = GetObjectShell(aTarget);
+
const USHORT nSLevel =
((SfxOrganizeListBox_Impl *)pSourceBox)->GetDocLevel();
const USHORT nTLevel = GetDocLevel();
@@ -1210,6 +1215,9 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry )
{
const USHORT nDocLevel = GetDocLevel();
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = GetObjectShell(aPath);
if(aRef.Is())
{
@@ -1887,6 +1895,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if(!QueryDelete_Impl(pDialog, STR_DELETE_TEMPLATE, pFocusBox->GetEntryText(pEntry)))
return 1;
Path aPath(pFocusBox, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell(aPath);
if(aRef.Is() &&
aRef->Remove(aPath[1+pFocusBox->GetDocLevel()],
@@ -1953,6 +1964,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if ( !pEntry )
return 1;
Path aPath( pFocusBox, pEntry );
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell( aPath );
if ( aRef.Is() )
{
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 91f5842c1fb7..4aea842e44e9 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1088,60 +1088,10 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
//REPLACE pInfo->Save(xDocStor);
}
}
-/*
- SfxConfigManager *pCfgMgr = SFX_CFGMANAGER();
- {
- SfxConfigManager *pTemplCfg = new SfxConfigManager(aTemplStor, pCfgMgr);
- SetConfigManager(pTemplCfg);
- SetTemplateConfig(TRUE);
-
- // Falls der gerade zerst"orte CfgMgr des Dokuments der
- // aktive war, pCfgMgr lieber neu holen
- pCfgMgr = SFX_CFGMANAGER();
-
- // ggf. den neuen ConfigManager aktivieren
- if ( this == SfxObjectShell::Current() )
- pTemplCfg->Activate(pCfgMgr);
- }
-*/
- // Template und Template-DocInfo werden nicht mehr gebraucht
-// delete pTemplInfo;
}
}
}
-SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& aTargetURL, BOOL bForWriting )
-{
- // check for own format
- SfxObjectShellRef xDoc;
- StreamMode nMode = bForWriting ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY;
- SfxMedium *pMed = new SfxMedium( aTargetURL, nMode, FALSE, 0 );
- const SfxFilter* pFilter = NULL;
- pMed->UseInteractionHandler(TRUE);
- if( SFX_APP()->GetFilterMatcher().GuessFilter( *pMed, &pFilter ) == ERRCODE_NONE && pFilter && pFilter->IsOwnFormat() )
- {
- // create document
- xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_ORGANIZER );
- if ( xDoc.Is() )
- {
- // partially load, so don't use DoLoad!
- xDoc->DoInitNew(0);
- // TODO/LATER: make sure that we don't use binary templates!
- if( xDoc->LoadFrom( *pMed ) )
- {
- // connect to storage, abandon temp. storage
- xDoc->DoSaveCompleted( pMed );
- }
- else
- xDoc.Clear();
- }
- }
- else
- delete pMed;
-
- return xDoc;
-}
-
sal_Bool SfxObjectShell::IsHelpDocument() const
{
const SfxFilter* pFilter = GetMedium()->GetFilter();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 693911f0404c..a5141662fa3d 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -172,12 +172,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
SfxObjectShell::SetCurrentComponent( Reference< XInterface >() );
}
- if ( mpDoc->Get_Impl()->bHiddenLockedByAPI )
- {
- mpDoc->Get_Impl()->bHiddenLockedByAPI = FALSE;
- mpDoc->OwnerLock(FALSE);
- }
- else if ( !mpDoc->Get_Impl()->bClosing )
+ if ( !mpDoc->Get_Impl()->bClosing )
// GCC stuerzt ab, wenn schon im dtor, also vorher Flag abfragen
mpDoc->DoClose();
}
@@ -835,22 +830,6 @@ void SfxObjectShell::InitBasicManager_Impl()
}
//--------------------------------------------------------------------
-#if 0 //(mba)
-SotObjectRef SfxObjectShell::CreateAggObj( const SotFactory* pFact )
-{
- // SvDispatch?
- SotFactory* pDispFact = SvDispatch::ClassFactory();
- if( pFact == pDispFact )
- return( (SfxShellObject*)GetSbxObject() );
-
- // sonst unbekannte Aggregation
- DBG_ERROR("unkekannte Factory");
- SotObjectRef aSvObjectRef;
- return aSvObjectRef;
-}
-#endif
-
-//--------------------------------------------------------------------
sal_uInt16 SfxObjectShell::Count()
{
@@ -873,7 +852,7 @@ SfxObjectShell* SfxObjectShell::GetObjectShell()
//--------------------------------------------------------------------
-SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames()
+uno::Sequence< ::rtl::OUString > SfxObjectShell::GetEventNames()
{
static uno::Sequence< ::rtl::OUString >* pEventNameContainer = NULL;
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 1dc2423bcdaf..d088f6981f49 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -344,7 +344,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
// Name-Property?
if ( rProp.Name.compareToAscii( "Name" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if ( ( rProp.Value >>= sTemp ) == sal_False )
throw ::com::sun::star::lang::IllegalArgumentException();
@@ -618,9 +618,9 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
if ( rProp.Name.compareToAscii( "FileName" ) == 0 )
{
// unpack th URL and check for a valid and well known protocol
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if (
- ( rProp.Value.getValueType()!=::getCppuType((const OUSTRING*)0)) ||
+ ( rProp.Value.getValueType()!=::getCppuType((const ::rtl::OUString*)0)) ||
(!(rProp.Value>>=sTemp))
)
{
@@ -717,7 +717,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// Pages-Property
else if ( rProp.Name.compareToAscii( "Pages" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if( rProp.Value >>= sTemp )
{
aCheckedArgs[nProps].Name = rProp.Name;
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index a4707f03d364..4dbb8a3c640e 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -263,25 +263,6 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo
}
// --------------------------------------------------------------------------------------------------------------------
-void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const
-{
- const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False );
- if ( !bHidden )
- return;
-
- const SfxViewFrame* pExistingViewFrame = SfxViewFrame::GetFirst( &i_rDocument );
- if ( pExistingViewFrame )
- return;
-
- // the document is to be loaded hidden, and it is not yet displayed in any other frame
- // To prevent it from being closed when the loader returns, increase its OwnerLock
- // (the OwnerLock is normally increased by every frame in which the document is displayed, and by this loader)
- i_rDocument.RestoreNoDelete();
- i_rDocument.OwnerLock( TRUE );
- i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE;
-}
-
-// --------------------------------------------------------------------------------------------------------------------
void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) const
{
const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() );
@@ -331,7 +312,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti
}
// --------------------------------------------------------------------------------------------------------------------
-SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
+SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
{
for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) )
{
@@ -635,15 +616,12 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// tell the doc its (current) load args.
impl_removeLoaderArguments( aDescriptor );
xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() );
- // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could
- // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs)
- // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document
- // might have a mode other than the one passed to the loader, and we always overwrite the former with
- // the latter.
}
// get the SfxObjectShell (still needed at the moment)
- const SfxObjectShellLock xDoc = impl_findObjectShell( xModel );
+ // SfxObjectShellRef is used here ( instead of ...Lock ) since the model is closed below if necessary
+ // SfxObjectShellLock would be even dangerous here, since the lifetime control should be done outside in case of success
+ const SfxObjectShellRef xDoc = impl_findObjectShell( xModel );
ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" );
// ensure the ID of the to-be-created view is in the descriptor, if possible
@@ -651,16 +629,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
- // if the document is created hidden, prevent it from being deleted until it is shown or disposed
- impl_lockHiddenDocument( *xDoc, aDescriptor );
- // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef,
- // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter
- // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the
- // object is closed (DoClose). The impl_lockHiddenDocument is to prevent exactly that premature
- // closing. However, a *Ref object wouldn't close, anyway. And in case of unsuccessfull loading, the
- // code at the very end of this method cares for closing the XModel, which should also close the
- // ObjectShell.
-
// plug the document into the frame
impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName );
bLoadSuccess = sal_True;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index b8ad1cfc61f7..8fd223279372 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -734,7 +734,7 @@ ANY SfxBaseController::getViewData() throw( ::com::sun::star::uno::RuntimeExcept
if ( m_pData->m_pViewShell )
{
m_pData->m_pViewShell->WriteUserData( sData1 ) ;
- OUSTRING sData( sData1 );
+ ::rtl::OUString sData( sData1 );
aAny <<= sData ;
}
@@ -750,7 +750,7 @@ void SAL_CALL SfxBaseController::restoreViewData( const ANY& aValue ) throw( ::c
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pData->m_pViewShell )
{
- OUSTRING sData;
+ ::rtl::OUString sData;
aValue >>= sData ;
m_pData->m_pViewShell->ReadUserData( sData ) ;
}
@@ -781,7 +781,7 @@ REFERENCE< XMODEL > SAL_CALL SfxBaseController::getModel() throw( ::com::sun::st
//________________________________________________________________________________________________________
REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& aURL ,
- const OUSTRING& sTargetFrameName,
+ const ::rtl::OUString& sTargetFrameName,
sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -938,12 +938,12 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU
// SfxBaseController -> XDispatchProvider
//________________________________________________________________________________________________________
-SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
+uno::Sequence< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const uno::Sequence< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
{
// Create return list - which must have same size then the given descriptor
// It's not allowed to pack it!
sal_Int32 nCount = seqDescripts.getLength();
- SEQUENCE< REFERENCE< XDISPATCH > > lDispatcher( nCount );
+ uno::Sequence< REFERENCE< XDISPATCH > > lDispatcher( nCount );
for( sal_Int32 i=0; i<nCount; ++i )
{