summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-11-27 12:39:32 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-11-27 12:39:32 +0000
commitc418aa2076a5ab2ef8bbde33ab84c302bef861a1 (patch)
treed205f66607306fa83f06924254cac893f8e5f5e5
parent921784e3a396a49ce051b2737ca65ebb23344d8c (diff)
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test 2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test 2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ... 2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in 2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs) 2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing 2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing 2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript 2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test 2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test 2009-11-03 14:25:44 +0000 fs r277324 : #i10000# 2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs 2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ... 2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM) 2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion 2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense 2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE 2009-10-21 07:08:35 +0000 fs r277075 : spare useless call 2009-10-20 21:26:31 +0000 fs r277072 : #i10000# 2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62) 2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch 2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks. 2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk) 2009-10-15 12:52:39 +0000 fs r276939 : #i10000# 2009-10-15 12:44:26 +0000 fs r276938 : #i10000# 2009-10-15 12:00:33 +0000 fs r276936 : #i10000# 2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg 2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const 2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#: introduce an option to the layout manager to preserve, if possible, the size of the content window when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing. (the option is incompatible with in-place editing, anyway) This is because such embedded objects couple the (content) window size to the VisAreaSize, in that both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize, and restores it upon next open. This, however, leads to different content window sizes when the window is closed with another toolbar set than used during opening. This patch here prevents those different content window sizes. Also, now the content window size doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content window size stays the same, and the container window size is adjusted. 2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows 2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable) 2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows 2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service 2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist 2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties 2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified 2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command 2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 12:59:17 +0000 fs r276754 : #i87693# 2009-10-07 11:19:22 +0000 fs r276752 : #i10000# 2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller) 2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion 2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release: when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing the ref count, again. This ensures that our adapter cannot create references to the dying object anymore. (A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous release/dispose/destroy pattern, namely WeakComponentImplHelperBase) 2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying 2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool) 2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked 2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails 2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet revealed some inconsistencies, in whether the objects are cached by their URL, or by their registration name. This has been changed to caching by registration name. 2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case 2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed 2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable (timing-dependent) results/failures. Instead, every test sets up a new odb file. Also, did some re-factoring, improved the cleanup code, and caught a few more errors. 2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now 2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose 2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now 2009-10-06 12:49:22 +0000 fs r276707 : typo 2009-10-06 12:49:03 +0000 fs r276706 : typo 2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class 2009-10-06 12:48:02 +0000 fs r276704 : typo 2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably 2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence 2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope 2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create 2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope 2009-10-05 09:46:17 +0000 fs r276671 : #i10000# 2009-10-05 08:43:58 +0000 fs r276664 : #i105505# release: dispose the (base classes) weak connection point before disposing ourself, and in particular before temporarily incrementing our ref count, again. This way, we prevent that a separate thread re-surrects us (using the weak connection point's queryAdapted) while we're in the process of destruction 2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release) 2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead 2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics 2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants 2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign 2009-10-04 19:53:30 +0000 fs r276657 : #105560# remove unused code thanks to cmc@openoffice.org for submitting the patch 2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc) 2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60) 2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ... 2009-10-02 10:52:24 +0000 fs r276634 : #i105505# If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized. In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl call attachResource. This ensures that the model is initialized completely, including firing the necessary events. 2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document 2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document 2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes 2009-10-01 09:12:20 +0000 fs r276582 : #i105505# 2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion 2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods 2009-09-30 06:35:59 +0000 fs r276538 : #i10000# 2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113# 2009-09-29 10:27:10 +0000 fs r276520 : #i105367# 2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles 2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc 2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE... 2009-09-28 20:53:36 +0000 fs r276503 : #i104117# cleaned up the mess with help IDs in module extensions. Formerly, extensions used to use help IDs which were declared in module svx, and vice versa. Also, help ID ranges were not respected. 2009-09-28 11:25:36 +0000 fs r276489 : typo 2009-09-28 11:25:10 +0000 fs r276488 : #i105235# 2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document) 2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar 2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double 2009-09-16 11:11:43 +0000 fs r276195 : #i105082# consolidated the sub storage handling, by delegating more functionality into the DocumentStorageAccess class. As a result, there won't be that many unnecessary commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages and DocumentStorageAccess::m_aExposedStorages) have been consolidated. This is not really part of the fix of issue 105082, but it helped reducing the calls to the storage/package implementation. 2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures) 2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved 2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error 2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS 2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models 2009-09-14 10:33:02 +0000 fs r276106 : removed dead file 2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor 2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text 2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
-rw-r--r--dbaccess/inc/documentcontroller.hxx12
-rw-r--r--dbaccess/inc/genericcontroller.hxx2
-rw-r--r--dbaccess/qa/complex/dbaccess/ApplicationController.java34
-rw-r--r--dbaccess/qa/complex/dbaccess/DatabaseDocument.java160
-rw-r--r--dbaccess/qa/complex/dbaccess/TestCase.java4
-rw-r--r--dbaccess/source/core/api/RowSet.cxx217
-rw-r--r--dbaccess/source/core/api/querydescriptor.cxx23
-rw-r--r--dbaccess/source/core/api/querydescriptor.hxx4
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx323
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.hxx18
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx134
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.hxx9
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx38
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx45
-rw-r--r--dbaccess/source/core/dataaccess/datasource.hxx36
-rw-r--r--dbaccess/source/core/dataaccess/documentcontainer.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx2
-rw-r--r--dbaccess/source/core/inc/core_resource.hrc2
-rw-r--r--dbaccess/source/core/inc/core_resource.hxx2
-rw-r--r--dbaccess/source/core/inc/sdbcoretools.hxx14
-rw-r--r--dbaccess/source/core/misc/apitools.cxx11
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx6
-rw-r--r--dbaccess/source/core/misc/sdbcoretools.cxx70
-rw-r--r--dbaccess/source/core/resource/core_resource.cxx6
-rw-r--r--dbaccess/source/core/resource/strings.src7
-rw-r--r--dbaccess/source/ext/macromigration/docinteraction.cxx12
-rw-r--r--dbaccess/source/ext/macromigration/docinteraction.hxx9
-rw-r--r--dbaccess/source/ext/macromigration/progressmixer.cxx3
-rw-r--r--dbaccess/source/inc/dsntypes.hxx3
-rw-r--r--dbaccess/source/ui/app/AppController.hxx9
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx12
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.cxx9
-rw-r--r--dbaccess/source/ui/browser/dbloader.cxx13
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx2
-rw-r--r--dbaccess/source/ui/control/listviewitems.cxx4
-rw-r--r--dbaccess/source/ui/control/opendoccontrols.cxx14
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx6
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx10
-rw-r--r--dbaccess/source/ui/dlg/dbadminsetup.src2
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx7
-rw-r--r--dbaccess/source/ui/inc/databaseobjectview.hxx12
-rw-r--r--dbaccess/source/ui/inc/dbadmin.hxx2
-rw-r--r--dbaccess/source/ui/inc/directsql.hxx3
-rw-r--r--dbaccess/source/ui/inc/dsmeta.hxx2
-rw-r--r--dbaccess/source/ui/inc/opendoccontrols.hxx2
-rw-r--r--dbaccess/source/ui/misc/databaseobjectview.cxx10
-rw-r--r--dbaccess/source/ui/misc/documentcontroller.cxx10
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx6
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx5
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx80
50 files changed, 613 insertions, 815 deletions
diff --git a/dbaccess/inc/documentcontroller.hxx b/dbaccess/inc/documentcontroller.hxx
index a16e4c645b06..2ca154625d90 100644
--- a/dbaccess/inc/documentcontroller.hxx
+++ b/dbaccess/inc/documentcontroller.hxx
@@ -72,18 +72,6 @@ namespace dbaui
Controller m_xController;
public:
- /** constructs the object, and connects the controller to the model
-
- @param _rxModel
- the model to which the controller should be connected
- @param _rxController
- the controller which should be connected to the model
- */
- ModelControllerConnector(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& _rxController
- );
-
/** connects the controller to the model
@param _rxModel
diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx
index b4570bc1215b..8464f491ff66 100644
--- a/dbaccess/inc/genericcontroller.hxx
+++ b/dbaccess/inc/genericcontroller.hxx
@@ -531,7 +531,9 @@ namespace dbaui
virtual void SAL_CALL removeMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException);
protected:
+#ifdef WNT
OGenericUnoController(); // never implemented
+#endif
};
}
diff --git a/dbaccess/qa/complex/dbaccess/ApplicationController.java b/dbaccess/qa/complex/dbaccess/ApplicationController.java
index c3661ef7ffee..df4aaa2f5cf9 100644
--- a/dbaccess/qa/complex/dbaccess/ApplicationController.java
+++ b/dbaccess/qa/complex/dbaccess/ApplicationController.java
@@ -53,7 +53,7 @@ import java.io.IOException;
/** complex test case for Base's application UI
*/
-public class ApplicationController extends complexlib.ComplexTestCase
+public class ApplicationController extends TestCase
{
private HsqlDatabase m_database;
@@ -66,22 +66,6 @@ public class ApplicationController extends complexlib.ComplexTestCase
}
// --------------------------------------------------------------------------------------------------------
- protected final XComponentContext getComponentContext()
- {
- XComponentContext context = null;
- try
- {
- final XPropertySet orbProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, getORB());
- context = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class,
- orbProps.getPropertyValue("DefaultContext"));
- }
- catch (Exception ex)
- {
- failed("could not retrieve the ComponentContext");
- }
- return context;
- }
- // --------------------------------------------------------------------------------------------------------
public String[] getTestMethodNames()
{
@@ -98,12 +82,6 @@ public class ApplicationController extends complexlib.ComplexTestCase
}
// --------------------------------------------------------------------------------------------------------
- protected final XMultiServiceFactory getORB()
- {
- return (XMultiServiceFactory) param.getMSF();
- }
-
- // --------------------------------------------------------------------------------------------------------
private void impl_closeDocument()
{
if (m_database != null)
@@ -143,15 +121,17 @@ public class ApplicationController extends complexlib.ComplexTestCase
}
// --------------------------------------------------------------------------------------------------------
- public void before() throws Exception, java.lang.Exception
+ public void before() throws java.lang.Exception
{
+ super.before();
impl_switchToDocument(null);
}
// --------------------------------------------------------------------------------------------------------
- public void after()
+ public void after() throws java.lang.Exception
{
impl_closeDocument();
+ super.after();
}
// --------------------------------------------------------------------------------------------------------
@@ -161,9 +141,7 @@ public class ApplicationController extends complexlib.ComplexTestCase
// then those changes are saved in the old document, actually
final String oldDocumentURL = m_database.getDocumentURL();
- final File documentFile = java.io.File.createTempFile(getTestObjectName(), ".odb");
- documentFile.deleteOnExit();
- final String newDocumentURL = URLHelper.getFileURLFromSystemPath(documentFile.getAbsoluteFile());
+ final String newDocumentURL = createTempFileURL();
// store the doc in a new location
final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class,
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
index 57f51895e73c..8ce063bcdb2a 100644
--- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
+++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
@@ -64,6 +64,8 @@ import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.script.provider.XScriptProviderSupplier;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdbc.XDataSource;
import com.sun.star.sdb.XFormDocumentsSupplier;
import com.sun.star.sdb.XOfficeDatabaseDocument;
import com.sun.star.sdb.XReportDocumentsSupplier;
@@ -253,6 +255,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
return new String[]
{
"testLoadable",
+ "testDocumentRevenants",
"testDocumentEvents",
"testGlobalEvents"
};
@@ -264,7 +267,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
return "DatabaseDocument";
}
- public void before()
+ // --------------------------------------------------------------------------------------------------------
+ public void before() throws java.lang.Exception
{
super.before();
@@ -292,10 +296,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- public void after()
+ public void after() throws java.lang.Exception
{
- super.after();
-
try
{
// dispose our callback factory. This will automatically remove it from our service
@@ -313,6 +315,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
e.printStackTrace(System.err);
failed("failed to close the test case");
}
+
+ super.after();
}
// --------------------------------------------------------------------------------------------------------
@@ -462,6 +466,27 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
+ private PropertyValue[] impl_getMarkerLoadArgs()
+ {
+ return new PropertyValue[]
+ {
+ new PropertyValue( "PickListEntry", 0, false, PropertyState.DIRECT_VALUE ),
+ new PropertyValue( "TestCase_Marker", 0, "Yes", PropertyState.DIRECT_VALUE )
+ };
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ private boolean impl_hasMarker( final PropertyValue[] _args )
+ {
+ for ( int i=0; i<_args.length; ++i )
+ {
+ if ( _args[i].Name.equals( "TestCase_Marker" ) && _args[i].Value.equals( "Yes" ) )
+ return true;
+ }
+ return false;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
private PropertyValue[] impl_getDefaultLoadArgs()
{
return new PropertyValue[]
@@ -505,7 +530,27 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- public void testDocumentEvents() throws Exception, IOException
+ private XModel impl_loadDocument( final String _documentURL, final PropertyValue[] _loadArgs ) throws Exception
+ {
+ final XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class,
+ getORB().createInstance("com.sun.star.frame.Desktop") );
+ return (XModel) UnoRuntime.queryInterface( XModel.class,
+ loader.loadComponentFromURL( _documentURL, _BLANK, 0, _loadArgs ) );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ private void impl_storeDocument( final XModel _document ) throws Exception, IOException
+ {
+ // store the document
+ final String documentURL = FileHelper.getOOoCompatibleFileURL( _document.getURL() );
+ final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface( XStorable.class,
+ _document );
+ storeDoc.store();
+
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ private XModel impl_createDocWithMacro( final String _libName, final String _moduleName, final String _code ) throws Exception, IOException
{
// create an empty document
XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument();
@@ -514,7 +559,90 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
final XEmbeddedScripts embeddedScripts = (XEmbeddedScripts) UnoRuntime.queryInterface(XEmbeddedScripts.class,
databaseDoc);
final XStorageBasedLibraryContainer basicLibs = embeddedScripts.getBasicLibraries();
- final XNameContainer newLib = basicLibs.createLibrary("EventHandlers");
+ final XNameContainer newLib = basicLibs.createLibrary( _libName );
+ newLib.insertByName( _moduleName, _code );
+
+ return databaseDoc;
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ /** tests various aspects of database document "revenants"
+ *
+ * Well, I do not really have a good term for this ... The point is, database documents are in real
+ * only *one* aspect of a more complex thing. The second aspect is a data source. Both, in some sense,
+ * just represent different views on the same thing. For a given database, there's at each time at most
+ * one data source, and at most one database document. Both have a independent life time, and are
+ * created when needed.
+ * In particular, a document can be closed (this is what happens when the last UI window displaying
+ * this document is closed), and then dies. Now when the other "view", the data source, still exists,
+ * the the underlying document data is not discarded, but kept alive (else the data source would die
+ * just because the document dies, which is not desired). If the document is loaded, again, then
+ * it is re-created, using the data of its previous "incarnation".
+ *
+ * This method here tests some of those aspects of a document which should survive the death of one
+ * instance and re-creation as a revenant.
+ */
+ public void testDocumentRevenants() throws Exception, IOException
+ {
+ // create an empty document
+ XModel databaseDoc = impl_createDocWithMacro( "Lib", "Module",
+ "Sub Hello\n" +
+ " MsgBox \"Hello\"\n" +
+ "End Sub\n"
+ );
+ impl_storeDocument( databaseDoc );
+ final String documentURL = databaseDoc.getURL();
+
+ // at this stage, the marker should not yet be present in the doc's args, else some of the below
+ // tests become meaningless
+ assure( "A newly created doc should not have the test case marker", !impl_hasMarker( databaseDoc.getArgs() ) );
+
+ // obtain the DataSource associated with the document. Keeping this alive
+ // ensures that the "impl data" of the document is kept alive, too, so when closing
+ // and re-opening it, this "impl data" must be re-used.
+ XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
+ ((XOfficeDatabaseDocument)UnoRuntime.queryInterface(
+ XOfficeDatabaseDocument.class, databaseDoc )).getDataSource() );
+
+ // close and reload the doc
+ impl_closeDocument(databaseDoc);
+ databaseDoc = impl_loadDocument( documentURL, impl_getMarkerLoadArgs() );
+ // since we just put the marker into the load-call, it should be present at the doc
+ assure( "The test case marker got lost.", impl_hasMarker( databaseDoc.getArgs() ) );
+
+ // The basic library should have survived
+ final XEmbeddedScripts embeddedScripts = (XEmbeddedScripts) UnoRuntime.queryInterface(XEmbeddedScripts.class,
+ databaseDoc);
+ final XStorageBasedLibraryContainer basicLibs = embeddedScripts.getBasicLibraries();
+ assure( "Baisc lib did not survive reloading a closed document", basicLibs.hasByName( "Lib" ) );
+ final XNameContainer lib = (XNameContainer)UnoRuntime.queryInterface(
+ XNameContainer.class, basicLibs.getByName( "Lib" ) );
+ assure( "Basic module did not survive reloading a closed document", lib.hasByName( "Module" ) );
+
+ // now closing the doc, and obtaining it from the data source, should preserve the marker we put into the load
+ // args
+ impl_closeDocument( databaseDoc );
+ databaseDoc = (XModel)UnoRuntime.queryInterface( XModel.class, dataSource.getDatabaseDocument() );
+ assure( "The test case marker did not survive re-retrieval of the doc from the data source.",
+ impl_hasMarker( databaseDoc.getArgs() ) );
+
+ // on the other hand, closing and regurlarly re-loading the doc *without* the marker should indeed
+ // lose it
+ impl_closeDocument( databaseDoc );
+ databaseDoc = impl_loadDocument( documentURL, impl_getDefaultLoadArgs() );
+ assure( "Reloading the document kept the old args, instead of the newly supplied ones.",
+ !impl_hasMarker( databaseDoc.getArgs() ) );
+
+ // clean up
+ impl_closeDocument( databaseDoc );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public void testDocumentEvents() throws Exception, IOException
+ {
+ // create an empty document
+ final String libName = "EventHandlers";
+ final String moduleName = "all";
final String eventHandlerCode =
"Option Explicit\n" +
"\n" +
@@ -530,10 +658,11 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
"\n" +
" oCallback.documentEventOccured( oEvent )\n" +
"End Sub\n";
- newLib.insertByName("all", eventHandlerCode);
+ XModel databaseDoc = impl_createDocWithMacro( libName, moduleName, eventHandlerCode );
+ final String documentURL = databaseDoc.getURL();
// bind the macro to the OnLoad event
- final String macroURI = "vnd.sun.star.script:EventHandlers.all.OnLoad?language=Basic&location=document";
+ final String macroURI = "vnd.sun.star.script:" + libName + "." + moduleName + ".OnLoad?language=Basic&location=document";
final XEventsSupplier eventsSupplier = (XEventsSupplier) UnoRuntime.queryInterface(XEventsSupplier.class,
databaseDoc);
eventsSupplier.getEvents().replaceByName("OnLoad", new PropertyValue[]
@@ -543,19 +672,13 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
});
// store the document, and close it
- final String documentURL = FileHelper.getOOoCompatibleFileURL(databaseDoc.getURL());
- final XStorable storeDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class,
- databaseDoc);
- storeDoc.store();
- impl_closeDocument(databaseDoc);
+ impl_storeDocument( databaseDoc );
+ impl_closeDocument( databaseDoc );
// ensure the macro security configuration is "ask the user for document macro execution"
final int oldSecurityLevel = impl_setMacroSecurityLevel(1);
// load it, again
- final XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,
- getORB().createInstance("com.sun.star.frame.Desktop"));
-
m_loadDocState = STATE_LOADING_DOC;
// expected order of states is:
// STATE_LOADING_DOC - initialized here
@@ -568,8 +691,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
final String context = "OnLoad";
impl_startObservingEvents(context);
- databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
- loader.loadComponentFromURL(documentURL, _BLANK, 0, impl_getMacroExecLoadArgs()));
+ databaseDoc = impl_loadDocument( documentURL, impl_getMacroExecLoadArgs() );
impl_stopObservingEvents(m_documentEvents, new String[]
{
"OnLoad"
@@ -789,7 +911,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
// So, wait a few seconds.
try
{
- _actualEvents.wait(5000);
+ _actualEvents.wait(20000);
}
catch (InterruptedException ex)
{
diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java
index 1051b549c8f0..40370d9aeebd 100644
--- a/dbaccess/qa/complex/dbaccess/TestCase.java
+++ b/dbaccess/qa/complex/dbaccess/TestCase.java
@@ -67,12 +67,12 @@ public abstract class TestCase extends complexlib.ComplexTestCase
}
// --------------------------------------------------------------------------------------------------------
- public void before()
+ public void before() throws java.lang.Exception
{
}
// --------------------------------------------------------------------------------------------------------
- public void after()
+ public void after() throws java.lang.Exception
{
}
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 8f84d073f83e..52670f7a9776 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -36,156 +36,55 @@
#include "sdbcoretools.hxx"
#include "SingleSelectQueryComposer.hxx"
#include "module_dba.hxx"
+#include "sdbcoretools.hxx"
+#include "CRowSetColumn.hxx"
+#include "CRowSetDataColumn.hxx"
+#include "RowSetCache.hxx"
+#include "core_resource.hrc"
+#include "core_resource.hxx"
+#include "tablecontainer.hxx"
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+/** === begin UNO includes === **/
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
+#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#endif
-#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
-#include <cppuhelper/interfacecontainer.h>
-#endif
-#ifndef _CPPUHELPER_EXC_HLP_HXX_
-#include <cppuhelper/exc_hlp.hxx>
-#endif
-#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
-#include <cppuhelper/typeprovider.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
-#include <comphelper/sequence.hxx>
-#endif
-#ifndef COMPHELPER_COMPONENTCONTEXT_HXX
-#include <comphelper/componentcontext.hxx>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XCOMPLETEDCONNECTION_HPP_
-#include <com/sun/star/sdb/XCompletedConnection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_ROWSETVETOEXCEPTION_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/sdb/ErrorCondition.hpp>
+#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/sdb/RowSetVetoException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_FETCHDIRECTION_HPP_
+#include <com/sun/star/sdb/XCompletedConnection.hpp>
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#include <com/sun/star/sdb/XQueriesSupplier.hpp>
#include <com/sun/star/sdbc/FetchDirection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_RESULTSETCONCURRENCY_HPP_
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_PRIVILEGE_HPP_
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
-#include <com/sun/star/sdb/CommandType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
#include <com/sun/star/sdbc/XDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XQUERIESSUPPLIER_HPP_
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_ROWCHANGEACTION_HPP_
-#include <com/sun/star/sdb/RowChangeAction.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_ERRORCONDITION_HPP_
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_
#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDATADEFINITIONSUPPLIER_HPP_
-#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_COMPAREBOOKMARK_HPP_
#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_XNAMINGSERVICE_HPP_
-#include <com/sun/star/uno/XNamingService.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_PRIVILEGE_HPP_
#include <com/sun/star/sdbcx/Privilege.hpp>
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
-#include <connectivity/dbtools.hxx>
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
-#include <comphelper/extract.hxx>
-#endif
-#ifndef DBACCESS_CORE_API_ROWSETCACHE_HXX
-#include "RowSetCache.hxx"
-#endif
-#if OSL_DEBUG_LEVEL > 1
-#ifndef _COM_SUN_STAR_SDBC_XDRIVERMANAGER_HPP_
-#include <com/sun/star/sdbc/XDriverManager.hpp>
-#endif
-#endif
-#ifndef _DBACORE_DATACOLUMN_HXX_
-#include "CRowSetDataColumn.hxx"
-#endif
-#ifndef DBACCESS_CORE_API_CROWSETCOLUMN_HXX
-#include "CRowSetColumn.hxx"
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_
-#include <comphelper/types.hxx>
-#endif
-#ifndef _COMPHELPER_SEQSTREAM_HXX
-#include <comphelper/seqstream.hxx>
-#endif
-#ifndef _TOOLS_DEBUG_HXX
-#include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
-#include <tools/diagnose_ex.h>
-#endif
-#ifndef _DBHELPER_DBEXCEPTION_HXX_
-#include <connectivity/dbexception.hxx>
-#endif
-#ifndef _DBA_CORE_TABLECONTAINER_HXX_
-#include "tablecontainer.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_
-#include <com/sun/star/sdb/ParametersRequest.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_
-#include <com/sun/star/sdb/ParametersRequest.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_
-#include <com/sun/star/sdb/XParametersSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
-#include <com/sun/star/container/XChild.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
+#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
+#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#endif
-#ifndef _COMPHELPER_INTERACTION_HXX_
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/extract.hxx>
#include <comphelper/interaction.hxx>
-#endif
-#ifndef _COMPHELPER_PROPERTY_HXX_
#include <comphelper/property.hxx>
-#endif
-#ifndef _UTL_CONFIGMGR_HXX_
-#include <unotools/configmgr.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/seqstream.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/types.hxx>
#include <comphelper/uno3.hxx>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_COMPAREBOOKMARK_HPP_
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
-#endif
-#ifndef _DBA_CORE_RESOURCE_HXX_
-#include "core_resource.hxx"
-#endif
-#ifndef _DBA_CORE_RESOURCE_HRC_
-#include "core_resource.hrc"
-#endif
-#ifndef _DBHELPER_DBCONVERSION_HXX_
#include <connectivity/dbconversion.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
-#include <svtools/syslocale.hxx>
-#endif
-#ifndef _RTL_LOGFILE_HXX_
+#include <connectivity/dbexception.hxx>
+#include <connectivity/dbtools.hxx>
+#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/typeprovider.hxx>
#include <rtl/logfile.hxx>
-#endif
+#include <svtools/syslocale.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <unotools/configmgr.hxx>
using namespace utl;
using namespace dbaccess;
@@ -2191,37 +2090,37 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH
if (!m_xActiveConnection.is())
{
Reference< XConnection > xNewConn;
- if (m_aDataSourceName.getLength())
+ if ( m_aDataSourceName.getLength() )
{
- // is it a file url?
- Reference< XNameAccess > xNamingContext;
- if ( m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT, xNamingContext ) )
- if (xNamingContext.is() )
+ Reference< XNameAccess > xDatabaseContext(
+ m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ),
+ UNO_QUERY_THROW );
+ try
{
- try
- {
- if(_rxHandler.is())
- {
- Reference< XCompletedConnection> xComplConn(xNamingContext->getByName(m_aDataSourceName), UNO_QUERY);
- if(xComplConn.is())
- xNewConn = xComplConn->connectWithCompletion(_rxHandler);
- }
- else
- {
- Reference< XDataSource > xDataSource(xNamingContext->getByName(m_aDataSourceName), UNO_QUERY);
- if (xDataSource.is())
- xNewConn = xDataSource->getConnection(m_aUser, m_aPassword);
- }
- }
- catch (SQLException &e)
+ Reference< XDataSource > xDataSource( xDatabaseContext->getByName( m_aDataSourceName ), UNO_QUERY_THROW );
+
+ // try connecting with the interaction handler
+ Reference< XCompletedConnection > xComplConn( xDataSource, UNO_QUERY );
+ if ( _rxHandler.is() && xComplConn.is() )
{
- throw e;
+ xNewConn = xComplConn->connectWithCompletion( _rxHandler );
}
- catch (Exception&)
+ else
{
- throw SQLException();
+ xNewConn = xDataSource->getConnection( m_aUser, m_aPassword );
}
}
+ catch ( const SQLException& e )
+ {
+ throw;
+ }
+ catch ( const Exception& e )
+ {
+ Any aError = ::cppu::getCaughtException();
+ ::rtl::OUString sMessage = ResourceManager::loadString( RID_NO_SUCH_DATA_SOURCE,
+ "$name$", m_aDataSourceName, "$error$", extractExceptionMessage( m_aContext, aError ) );
+ ::dbtools::throwGenericSQLException( sMessage, *this );
+ }
}
setActiveConnection(xNewConn);
m_bOwnConnection = sal_True;
@@ -2245,7 +2144,7 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
else
{
if ( !m_xActiveConnection.is() )
- throw SQLException(DBA_RES(RID_STR_CONNECTION_INVALID),*this,SQLSTATE_GENERAL,1000,Any() );
+ throw SQLException(DBA_RES(RID_STR_CONNECTION_INVALID),*this,SQLSTATE_GENERAL,1000,Any() );
sal_Bool bCase = sal_True;
try
diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx
index a666d250f07c..5f8c265e36df 100644
--- a/dbaccess/source/core/api/querydescriptor.cxx
+++ b/dbaccess/source/core/api/querydescriptor.cxx
@@ -89,29 +89,6 @@ OQueryDescriptor::OQueryDescriptor()
}
//--------------------------------------------------------------------------
-OQueryDescriptor::OQueryDescriptor(const Reference< XPropertySet >& _rxCommandDefinition)
- :OQueryDescriptor_Base(m_aMutex,*this)
- ,ODataSettings(m_aBHelper,sal_True)
-{
- DBG_CTOR(OQueryDescriptor,NULL);
- registerProperties();
- ODataSettings::registerPropertiesFor(this);
-
- osl_incrementInterlockedCount(&m_refCount);
-
- OSL_ENSURE(_rxCommandDefinition.is(), "OQueryDescriptor_Base::OQueryDescriptor_Base : invalid source property set !");
- try
- {
- ::comphelper::copyProperties(_rxCommandDefinition,this);
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OQueryDescriptor_Base::OQueryDescriptor_Base: caught an exception!");
- }
- osl_decrementInterlockedCount(&m_refCount);
-}
-
-//--------------------------------------------------------------------------
OQueryDescriptor::OQueryDescriptor(const OQueryDescriptor_Base& _rSource)
:OQueryDescriptor_Base(_rSource,*this)
,ODataSettings(m_aBHelper,sal_True)
diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx
index 958ef8e184aa..4d20bcc71199 100644
--- a/dbaccess/source/core/api/querydescriptor.hxx
+++ b/dbaccess/source/core/api/querydescriptor.hxx
@@ -165,10 +165,6 @@ protected:
virtual ~OQueryDescriptor();
public:
OQueryDescriptor();
- /** constructs the object with a UNO QueryDescriptor. If you use this ctor, the resulting object
- won't have any column informations (the column container will be empty)
- */
- OQueryDescriptor(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxForeignDescriptor);
OQueryDescriptor(const OQueryDescriptor_Base& _rSource);
// com::sun::star::lang::XTypeProvider
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index dd5be7a90ced..755f8f717d25 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -143,11 +143,13 @@ class DocumentStorageAccess : public ::cppu::WeakImplHelper2< XDocumentSubStor
NamedStorages m_aExposedStorages;
ODatabaseModelImpl* m_pModelImplementation;
bool m_bPropagateCommitToRoot;
+ bool m_bDisposingSubStorages;
public:
DocumentStorageAccess( ODatabaseModelImpl& _rModelImplementation )
:m_pModelImplementation( &_rModelImplementation )
,m_bPropagateCommitToRoot( true )
+ ,m_bDisposingSubStorages( false )
{
DBG_CTOR( DocumentStorageAccess, NULL );
}
@@ -161,19 +163,8 @@ protected:
public:
void dispose();
- void suspendCommitPropagation()
- {
- DBG_ASSERT( m_bPropagateCommitToRoot, "DocumentStorageAccess:: suspendCommitPropagation: already suspended" );
- m_bPropagateCommitToRoot = false;
- }
- void resumeCommitPropagation()
- {
- DBG_ASSERT( !m_bPropagateCommitToRoot, "DocumentStorageAccess:: suspendCommitPropagation: already suspended" );
- m_bPropagateCommitToRoot = true;
- }
-
// XDocumentSubStorageSupplier
- virtual Reference< XStorage > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 nMode ) throw (RuntimeException);
+ virtual Reference< XStorage > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 _nMode ) throw (RuntimeException);
virtual Sequence< ::rtl::OUString > SAL_CALL getDocumentSubStoragesNames( ) throw (IOException, RuntimeException);
// XTransactionListener
@@ -184,6 +175,32 @@ public:
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ /// disposes all storages managed by this instance
+ void disposeStorages();
+
+ /// disposes all known sub storages
+ void commitStorages() SAL_THROW(( IOException, RuntimeException ));
+
+ /// commits the dedicated "database" storage
+ bool commitEmbeddedStorage( bool _bPreventRootCommits );
+
+private:
+ /** opens the sub storage with the given name, in the given mode
+ */
+ Reference< XStorage > impl_openSubStorage_nothrow( const ::rtl::OUString& _rStorageName, sal_Int32 _nMode );
+
+ void impl_suspendCommitPropagation()
+ {
+ OSL_ENSURE( m_bPropagateCommitToRoot, "DocumentStorageAccess::impl_suspendCommitPropagation: already suspended" );
+ m_bPropagateCommitToRoot = false;
+ }
+ void impl_resumeCommitPropagation()
+ {
+ OSL_ENSURE( !m_bPropagateCommitToRoot, "DocumentStorageAccess::impl_resumeCommitPropagation: not suspended" );
+ m_bPropagateCommitToRoot = true;
+ }
+
};
//--------------------------------------------------------------------------
@@ -214,17 +231,117 @@ void DocumentStorageAccess::dispose()
}
//--------------------------------------------------------------------------
-Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 nMode ) throw (RuntimeException)
+Reference< XStorage > DocumentStorageAccess::impl_openSubStorage_nothrow( const ::rtl::OUString& _rStorageName, sal_Int32 _nDesiredMode )
+{
+ OSL_ENSURE( _rStorageName.getLength(),"ODatabaseModelImpl::impl_openSubStorage_nothrow: Invalid storage name!" );
+
+ Reference< XStorage > xStorage;
+ try
+ {
+ Reference< XStorage > xRootStorage( m_pModelImplementation->getOrCreateRootStorage() );
+ if ( xRootStorage.is() )
+ {
+ sal_Int32 nRealMode = m_pModelImplementation->m_bDocumentReadOnly ? ElementModes::READ : _nDesiredMode;
+ if ( nRealMode == ElementModes::READ )
+ {
+ Reference< XNameAccess > xSubStorageNames( xRootStorage, UNO_QUERY );
+ if ( xSubStorageNames.is() && !xSubStorageNames->hasByName( _rStorageName ) )
+ return xStorage;
+ }
+
+ xStorage = xRootStorage->openStorageElement( _rStorageName, nRealMode );
+
+ Reference< XTransactionBroadcaster > xBroad( xStorage, UNO_QUERY );
+ if ( xBroad.is() )
+ xBroad->addTransactionListener( this );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return xStorage;
+}
+
+//--------------------------------------------------------------------------
+void DocumentStorageAccess::disposeStorages()
+{
+ m_bDisposingSubStorages = true;
+
+ NamedStorages::iterator aEnd = m_aExposedStorages.end();
+ for ( NamedStorages::iterator aIter = m_aExposedStorages.begin();
+ aIter != aEnd ;
+ ++aIter
+ )
+ {
+ try
+ {
+ ::comphelper::disposeComponent( aIter->second );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ m_aExposedStorages.clear();
+
+ m_bDisposingSubStorages = false;
+}
+
+//--------------------------------------------------------------------------
+void DocumentStorageAccess::commitStorages() SAL_THROW(( IOException, RuntimeException ))
+{
+ try
+ {
+ for ( NamedStorages::const_iterator aIter = m_aExposedStorages.begin();
+ aIter != m_aExposedStorages.end();
+ ++aIter
+ )
+ {
+ m_pModelImplementation->commitStorageIfWriteable( aIter->second );
+ }
+ }
+ catch(const WrappedTargetException&)
+ {
+ // WrappedTargetException not allowed to leave
+ throw IOException();
+ }
+}
+
+//--------------------------------------------------------------------------
+bool DocumentStorageAccess::commitEmbeddedStorage( bool _bPreventRootCommits )
+{
+ if ( _bPreventRootCommits )
+ impl_suspendCommitPropagation();
+
+ bool bSuccess = false;
+ try
+ {
+ NamedStorages::const_iterator pos = m_aExposedStorages.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "database" ) ) );
+ if ( pos != m_aExposedStorages.end() )
+ bSuccess = m_pModelImplementation->commitStorageIfWriteable( pos->second );
+ }
+ catch( Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( _bPreventRootCommits )
+ impl_resumeCommitPropagation();
+
+ return bSuccess;
+
+}
+
+//--------------------------------------------------------------------------
+Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 _nDesiredMode ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
NamedStorages::iterator pos = m_aExposedStorages.find( aStorageName );
if ( pos == m_aExposedStorages.end() )
{
- Reference< XStorage > xResult = m_pModelImplementation->getStorage( aStorageName, nMode );
- Reference< XTransactionBroadcaster > xBroadcaster( xResult, UNO_QUERY );
- if ( xBroadcaster.is() )
- xBroadcaster->addTransactionListener( this );
-
+ Reference< XStorage > xResult = impl_openSubStorage_nothrow( aStorageName, _nDesiredMode );
pos = m_aExposedStorages.insert( NamedStorages::value_type( aStorageName, xResult ) ).first;
}
@@ -269,8 +386,14 @@ void SAL_CALL DocumentStorageAccess::commited( const css::lang::EventObject& aEv
if ( m_pModelImplementation && m_bPropagateCommitToRoot )
{
Reference< XStorage > xStorage( aEvent.Source, UNO_QUERY );
- if ( m_pModelImplementation->isDatabaseStorage( xStorage ) )
+
+ // check if this is the dedicated "database" sub storage
+ NamedStorages::const_iterator pos = m_aExposedStorages.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "database" ) ) );
+ if ( ( pos != m_aExposedStorages.end() )
+ && ( pos->second == xStorage )
+ )
{
+ // if so, also commit the root storage
m_pModelImplementation->commitRootStorage();
}
}
@@ -291,9 +414,10 @@ void SAL_CALL DocumentStorageAccess::reverted( const css::lang::EventObject& /*a
//--------------------------------------------------------------------------
void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& Source ) throw ( RuntimeException )
{
- ODatabaseModelImpl* pImpl = m_pModelImplementation;
- if ( pImpl )
- pImpl->disposing( Source );
+ OSL_ENSURE( Reference< XStorage >( Source.Source, UNO_QUERY ).is(), "DocumentStorageAccess::disposing: No storage? What's this?" );
+
+ if ( m_bDisposingSubStorages )
+ return;
for ( NamedStorages::iterator find = m_aExposedStorages.begin();
find != m_aExposedStorages.end();
@@ -318,7 +442,6 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >&
,m_aMutex()
,m_aMutexFacade( m_aMutex )
,m_aContainer(4)
- ,m_aStorages()
,m_aMacroMode( *this )
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_pDBContext( &_rDBContext )
@@ -333,7 +456,6 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >&
,m_bSuppressVersionColumns(sal_True)
,m_bModified(sal_False)
,m_bDocumentReadOnly(sal_False)
- ,m_bDisposingSubStorages( sal_False )
,m_pSharedConnectionManager(NULL)
,m_nControllerLockCount(0)
{
@@ -357,7 +479,6 @@ ODatabaseModelImpl::ODatabaseModelImpl(
,m_aMutex()
,m_aMutexFacade( m_aMutex )
,m_aContainer(4)
- ,m_aStorages()
,m_aMacroMode( *this )
,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
,m_pDBContext( &_rDBContext )
@@ -373,7 +494,6 @@ ODatabaseModelImpl::ODatabaseModelImpl(
,m_bSuppressVersionColumns(sal_True)
,m_bModified(sal_False)
,m_bDocumentReadOnly(sal_False)
- ,m_bDisposingSubStorages( sal_False )
,m_pSharedConnectionManager(NULL)
,m_nControllerLockCount(0)
{
@@ -506,8 +626,7 @@ namespace
try
{
- Reference< XStorage > xContainerStorage( _rModel.getStorage(
- _rModel.getObjectContainerStorageName( _eType ), ElementModes::READWRITE ) );
+ Reference< XStorage > xContainerStorage( _rModel.getStorage( _eType, ElementModes::READWRITE ) );
// note the READWRITE here: If the storage already existed before, then the OpenMode will
// be ignored, anyway.
// If the storage did not yet exist, then it will be created. If the database document
@@ -589,16 +708,9 @@ void SAL_CALL ODatabaseModelImpl::disposing( const ::com::sun::star::lang::Event
if ( bStore )
commitRootStorage();
}
- else // storage
+ else
{
- if ( !m_bDisposingSubStorages )
- {
- Reference<XStorage> xStorage(Source.Source,UNO_QUERY);
- TStorages::iterator aFind = ::std::find_if(m_aStorages.begin(),m_aStorages.end(),
- ::std::compose1(::std::bind2nd(::std::equal_to<Reference<XStorage> >(),xStorage),::std::select2nd<TStorages::value_type>()));
- if ( aFind != m_aStorages.end() )
- m_aStorages.erase(aFind);
- }
+ OSL_ENSURE( false, "ODatabaseModelImpl::disposing: where does this come from?" );
}
}
//------------------------------------------------------------------------------
@@ -662,9 +774,11 @@ void ODatabaseModelImpl::dispose()
try
{
- sal_Bool bStore = commitEmbeddedStorage();
+ sal_Bool bCouldStore = commitEmbeddedStorage( true );
+ // "true" means that committing the embedded storage should not trigger committing the root
+ // storage. This is because we are going to commit the root storage ourself, anyway
disposeStorages();
- if ( bStore )
+ if ( bCouldStore )
commitRootStorage();
impl_switchToStorage_throw( NULL );
@@ -731,27 +845,9 @@ Sequence< PropertyValue > ODatabaseModelImpl::stripLoadArguments( const ::comphe
// -----------------------------------------------------------------------------
void ODatabaseModelImpl::disposeStorages() SAL_THROW(())
{
- m_bDisposingSubStorages = sal_True;
-
- TStorages::iterator aEnd = m_aStorages.end();
- for ( TStorages::iterator aIter = m_aStorages.begin();
- aIter != aEnd ;
- ++aIter
- )
- {
- try
- {
- ::comphelper::disposeComponent( aIter->second );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- m_aStorages.clear();
-
- m_bDisposingSubStorages = sal_False;
+ getDocumentStorageAccess()->disposeStorages();
}
+
// -----------------------------------------------------------------------------
Reference< XSingleServiceFactory > ODatabaseModelImpl::createStorageFactory() const
{
@@ -849,68 +945,11 @@ Reference< XDocumentSubStorageSupplier > ODatabaseModelImpl::getDocumentSubStora
{
return getDocumentStorageAccess();
}
-// -----------------------------------------------------------------------------
-Reference<XStorage> ODatabaseModelImpl::getStorage( const ::rtl::OUString& _sStorageName, sal_Int32 _nMode )
-{
- OSL_ENSURE(_sStorageName.getLength(),"ODatabaseModelImpl::getStorage: Invalid storage name!");
- Reference<XStorage> xStorage;
- TStorages::iterator aFind = m_aStorages.find(_sStorageName);
- if ( aFind == m_aStorages.end() )
- {
- try
- {
- Reference< XStorage > xMyStorage( getOrCreateRootStorage() );
- if ( xMyStorage.is() )
- {
- sal_Int32 nMode = m_bDocumentReadOnly ? ElementModes::READ : _nMode;
- if ( nMode == ElementModes::READ )
- {
- Reference< XNameAccess > xSubStorageNames( xMyStorage, UNO_QUERY );
- if ( xSubStorageNames.is() && !xSubStorageNames->hasByName( _sStorageName ) )
- return xStorage;
- }
- xStorage = xMyStorage->openStorageElement( _sStorageName, nMode );
- Reference< XTransactionBroadcaster > xBroad( xStorage, UNO_QUERY );
- if ( xBroad.is() )
- xBroad->addTransactionListener( getDocumentStorageAccess() );
- aFind = m_aStorages.insert( TStorages::value_type( _sStorageName, xStorage ) ).first;
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- if ( aFind != m_aStorages.end() )
- xStorage = aFind->second;
-
- return xStorage;
-}
// -----------------------------------------------------------------------------
-sal_Bool ODatabaseModelImpl::commitEmbeddedStorage( sal_Bool _bPreventRootCommits )
+bool ODatabaseModelImpl::commitEmbeddedStorage( bool _bPreventRootCommits )
{
- if ( _bPreventRootCommits && m_pStorageAccess )
- m_pStorageAccess->suspendCommitPropagation();
-
- sal_Bool bStore = sal_False;
- try
- {
- TStorages::iterator aFind = m_aStorages.find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")));
- if ( aFind != m_aStorages.end() )
- bStore = commitStorageIfWriteable(aFind->second);
- }
- catch(Exception&)
- {
- OSL_ENSURE(0,"Exception Caught: Could not store embedded database!");
- }
-
- if ( _bPreventRootCommits && m_pStorageAccess )
- m_pStorageAccess->resumeCommitPropagation();
-
- return bStore;
-
+ return getDocumentStorageAccess()->commitEmbeddedStorage( _bPreventRootCommits );
}
// -----------------------------------------------------------------------------
@@ -1072,18 +1111,13 @@ oslInterlockedCount SAL_CALL ODatabaseModelImpl::release()
// -----------------------------------------------------------------------------
void ODatabaseModelImpl::commitStorages() SAL_THROW(( IOException, RuntimeException ))
{
- try
- {
- TStorages::iterator aIter = m_aStorages.begin();
- TStorages::iterator aEnd = m_aStorages.end();
- for (; aIter != aEnd ; ++aIter)
- commitStorageIfWriteable( aIter->second );
- }
- catch(const WrappedTargetException&)
- {
- // WrappedTargetException not allowed to leave
- throw IOException();
- }
+ getDocumentStorageAccess()->commitStorages();
+}
+
+// -----------------------------------------------------------------------------
+Reference< XStorage > ODatabaseModelImpl::getStorage( const ObjectType _eType, const sal_Int32 _nDesiredMode )
+{
+ return getDocumentStorageAccess()->getDocumentSubStorage( getObjectContainerStorageName( _eType ), _nDesiredMode );
}
// -----------------------------------------------------------------------------
@@ -1172,7 +1206,7 @@ TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType )
void ODatabaseModelImpl::revokeDataSource() const
{
if ( m_pDBContext && m_sDocumentURL.getLength() )
- m_pDBContext->deregisterPrivate( m_sDocumentURL );
+ m_pDBContext->revokeDatabaseDocument( *this );
}
// -----------------------------------------------------------------------------
@@ -1322,16 +1356,10 @@ Reference< XStorage > ODatabaseModelImpl::impl_switchToStorage_throw( const Refe
void ODatabaseModelImpl::switchToURL( const ::rtl::OUString& _rDocumentLocation, const ::rtl::OUString& _rDocumentURL )
{
// register at the database context, or change registration
- if ( _rDocumentURL != m_sDocumentURL )
+ const bool bURLChanged = ( _rDocumentURL != m_sDocumentURL );
+ const ::rtl::OUString sOldURL( m_sDocumentURL );
+ if ( bURLChanged )
{
- if ( m_pDBContext )
- {
- if ( m_sDocumentURL.getLength() )
- m_pDBContext->nameChangePrivate( m_sDocumentURL, _rDocumentURL );
- else
- m_pDBContext->registerPrivate( _rDocumentURL, this );
- }
-
if ( ( m_sName == m_sDocumentURL ) // our name is our old URL
|| ( !m_sName.getLength() ) // we do not have a name, yet (i.e. are not registered at the database context)
)
@@ -1348,19 +1376,14 @@ void ODatabaseModelImpl::switchToURL( const ::rtl::OUString& _rDocumentLocation,
// remember both
m_sDocFileLocation = _rDocumentLocation.getLength() ? _rDocumentLocation : _rDocumentURL;
m_sDocumentURL = _rDocumentURL;
-}
-// -----------------------------------------------------------------------------
-bool ODatabaseModelImpl::isDatabaseStorage( const Reference< XStorage >& _rxStorage ) const
-{
- TStorages::const_iterator pos = m_aStorages.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "database" ) ) );
- if ( ( pos != m_aStorages.end() )
- && ( pos->second == _rxStorage )
- )
+ if ( bURLChanged && m_pDBContext )
{
- return true;
+ if ( sOldURL.getLength() )
+ m_pDBContext->databaseDocumentURLChange( sOldURL, m_sDocumentURL );
+ else
+ m_pDBContext->registerDatabaseDocument( *this );
}
- return false;
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx
index 5a5de5782c52..f9b38be569af 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.hxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx
@@ -143,8 +143,6 @@ private:
//============================================================
//= ODatabaseModelImpl
//============================================================
-DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >,TStorages);
-
typedef ::utl::SharedUNOComponent< ::com::sun::star::embed::XStorage > SharedStorage;
class ODatabaseContext;
@@ -182,7 +180,6 @@ private:
::comphelper::SharedMutex m_aMutex;
VosMutexFacade m_aMutexFacade;
::std::vector< TContentPtr > m_aContainer; // one for each ObjectType
- TStorages m_aStorages;
::sfx2::DocumentMacroMode m_aMacroMode;
sal_Int16 m_nImposedMacroExecMode;
@@ -242,7 +239,6 @@ public:
sal_Bool m_bSuppressVersionColumns : 1;
sal_Bool m_bModified : 1;
sal_Bool m_bDocumentReadOnly : 1;
- sal_Bool m_bDisposingSubStorages;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyAccess >
m_xSettings;
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTableFilter;
@@ -267,10 +263,9 @@ public:
call.
@return <TRUE/> if the storage could be commited, otherwise <FALSE/>
*/
- sal_Bool commitEmbeddedStorage( sal_Bool _bPreventRootCommits = sal_False );
+ bool commitEmbeddedStorage( bool _bPreventRootCommits = false );
- /** commits all storages storages which have been obtained via getStorage
- */
+ /// commits all sub storages
void commitStorages()
SAL_THROW(( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ));
@@ -296,7 +291,10 @@ public:
inline ::rtl::OUString getURL() const { return m_sDocumentURL; }
inline ::rtl::OUString getDocFileLocation() const { return m_sDocFileLocation; }
- ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> getStorage(const ::rtl::OUString& _sStorageName,sal_Int32 nMode = ::com::sun::star::embed::ElementModes::READWRITE);
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ getStorage(
+ const ObjectType _eType, const sal_Int32 _nDesiredMode = ::com::sun::star::embed::ElementModes::READWRITE );
+
// helper
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >&
getNumberFormatsSupplier();
@@ -403,10 +401,6 @@ public:
*/
TContentPtr& getObjectContainer( const ObjectType _eType );
- /** determines whether the given storage is the storage of our embedded database (named "database"), if any
- */
- bool isDatabaseStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage ) const;
-
/** returns the name of the storage which is used to stored objects of the given type, if applicable
*/
static ::rtl::OUString
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 22f3aa7c5bd7..70237b67e1b1 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -372,12 +372,12 @@ Reference< XInterface > ODatabaseContext::getRegisteredObject(const rtl::OUStri
Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUString& _rName,const ::rtl::OUString& _sURL)
{
INetURLObject aURL( _sURL );
- if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
- throw NoSuchElementException(_rName, *this);
+ if ( aURL.GetProtocol() == INET_PROT_NOT_VALID )
+ throw NoSuchElementException( _rName, *this );
try
{
- ::ucbhelper::Content aContent(_sURL,Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ ::ucbhelper::Content aContent( _sURL, NULL );
if ( !aContent.isDocument() )
throw InteractiveIOException(
_sURL, *this, InteractionClassification_ERROR, IOErrorCode_NO_FILE
@@ -398,30 +398,23 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin
SQLException aError;
aError.Message = sErrorMessage;
- throw WrappedTargetException( _sURL, Reference< XNamingService >( this ), makeAny( aError ) );
+ throw WrappedTargetException( _sURL, *this, makeAny( aError ) );
}
- throw WrappedTargetException( _sURL, Reference< XNamingService >( this ), ::cppu::getCaughtException() );
+ throw WrappedTargetException( _sURL, *this, ::cppu::getCaughtException() );
}
catch( const Exception& )
{
- throw WrappedTargetException( _sURL, Reference<XNamingService>(this), ::cppu::getCaughtException() );
+ throw WrappedTargetException( _sURL, *this, ::cppu::getCaughtException() );
}
- ::rtl::Reference< ODatabaseModelImpl > pExistent;
- ObjectCache::iterator aFind = m_aDatabaseObjects.find(_sURL);
-
- if ( aFind != m_aDatabaseObjects.end() ) // we found a object registered under the URL
- { // register it under the new name
- pExistent = aFind->second;
- m_aDatabaseObjects.insert( ObjectCache::value_type( _rName, pExistent.get() ) );
- m_aDatabaseObjects.erase( aFind );
- }
+ OSL_ENSURE( m_aDatabaseObjects.find( _sURL ) == m_aDatabaseObjects.end(),
+ "ODatabaseContext::loadObjectFromURL: not intended for already-cached objects!" );
- if ( !pExistent.get() )
+ ::rtl::Reference< ODatabaseModelImpl > pModelImpl;
{
- pExistent.set( new ODatabaseModelImpl( _rName, m_aContext.getLegacyServiceFactory(), *this ) );
+ pModelImpl.set( new ODatabaseModelImpl( _rName, m_aContext.getLegacyServiceFactory(), *this ) );
- Reference< XModel > xModel( pExistent->createNewModel_deliverOwnership( false ), UNO_SET_THROW );
+ Reference< XModel > xModel( pModelImpl->createNewModel_deliverOwnership( false ), UNO_SET_THROW );
Reference< XLoadable > xLoad( xModel, UNO_QUERY_THROW );
::comphelper::NamedValueCollection aArgs;
@@ -434,11 +427,11 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin
xModel->attachResource( _sURL, aResource );
::utl::CloseableComponent aEnsureClose( xModel );
- } // if ( !pExistent.get() )
+ }
- setTransientProperties( _sURL, *pExistent );
+ setTransientProperties( _sURL, *pModelImpl );
- return pExistent->getOrCreateDataSource().get();
+ return pModelImpl->getOrCreateDataSource().get();
}
// -----------------------------------------------------------------------------
void ODatabaseContext::appendAtTerminateListener(const ODatabaseModelImpl& _rDataSourceModel)
@@ -572,6 +565,8 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl
}
else if ( m_aDatabaseObjects.find( _rModelImpl.m_sName ) != m_aDatabaseObjects.end() )
{
+ OSL_ENSURE( false, "ODatabaseContext::storeTransientProperties: a database document register by name? This shouldn't happen anymore!" );
+ // all the code should have been changed so that registration is by URL only
m_aDatasourceProperties[ _rModelImpl.m_sName ] = aRememberProps.getPropertyValues();
}
else
@@ -596,42 +591,30 @@ void SAL_CALL ODatabaseContext::removeContainerListener( const Reference< XConta
//------------------------------------------------------------------------------
void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exception, RuntimeException )
{
- MutexGuard aGuard(m_aMutex);
+ ClearableMutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed);
- Reference< XInterface > xExistent;
+ ::rtl::OUString sURL;
+ if ( !getURLForRegisteredObject( _rName, sURL ) )
+ throw NoSuchElementException( _rName, *this );
- OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory(
- m_aContext.getLegacyServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE);
- if ( aDbRegisteredNamesRoot.isValid() && aDbRegisteredNamesRoot.hasByName(_rName) )
+ if ( m_aDatabaseObjects.find( _rName ) != m_aDatabaseObjects.end() )
{
- OConfigurationNode aThisDriverSettings = aDbRegisteredNamesRoot.openNode(_rName);
- ::rtl::OUString sURL;
- aThisDriverSettings.getNodeValue(getDbLocationNodeName()) >>= sURL;
- sURL = SvtPathOptions().SubstituteVariable(sURL);
-
- if ( m_aDatabaseObjects.find( _rName ) != m_aDatabaseObjects.end() )
- {
- m_aDatasourceProperties[ sURL ] = m_aDatasourceProperties[ _rName ];
- }
-
- // check if URL is already loaded
- ObjectCacheIterator aExistent = m_aDatabaseObjects.find(sURL);
- if ( aExistent != m_aDatabaseObjects.end() )
- m_aDatabaseObjects.erase(aExistent);
- if (!aDbRegisteredNamesRoot.removeNode(_rName))
- throw Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("An unexpected und unknown error occured.")), static_cast<XNamingService*>(this));
- aDbRegisteredNamesRoot.commit();
+ OSL_ENSURE( false, "ODatabaseContext::revokeObject: a database document register by name? This shouldn't happen anymore!" );
+ // all the code should have been changed so that registration is by URL only
+ m_aDatasourceProperties[ sURL ] = m_aDatasourceProperties[ _rName ];
}
- else
- throw NoSuchElementException(_rName,*this);
+
+ OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory(
+ ::comphelper::getProcessServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE );
+ if ( !aDbRegisteredNamesRoot.removeNode( _rName ) )
+ throw Exception( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An unexpected und unknown error occured." ) ), *this );
+ aDbRegisteredNamesRoot.commit();
// notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rName), Any(), makeAny(xExistent));
- // note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
- OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
- while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent);
+ ContainerEvent aEvent( *this, makeAny( _rName ), Any(), Any() );
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
}
// ::com::sun::star::container::XElementAccess
@@ -670,9 +653,9 @@ Any ODatabaseContext::getByName(const rtl::OUString& _rName) throw( NoSuchElemen
try
{
- Reference< XInterface > xExistent = getObject(_rName);
+ Reference< XInterface > xExistent = getObject( _rName );
if ( xExistent.is() )
- return makeAny(xExistent);
+ return makeAny( xExistent );
// see whether this is an registered name
::rtl::OUString sURL;
@@ -741,36 +724,53 @@ sal_Bool ODatabaseContext::hasByName(const rtl::OUString& _rName) throw( Runtime
return aDbRegisteredNamesRoot.isValid() && aDbRegisteredNamesRoot.hasByName(_rName);
}
// -----------------------------------------------------------------------------
-Reference< XInterface > ODatabaseContext::getObject(const ::rtl::OUString& _rName)
+Reference< XInterface > ODatabaseContext::getObject( const ::rtl::OUString& _rURL )
{
- ObjectCacheIterator aFind = m_aDatabaseObjects.find(_rName);
+ ObjectCacheIterator aFind = m_aDatabaseObjects.find( _rURL );
Reference< XInterface > xExistent;
if ( aFind != m_aDatabaseObjects.end() )
xExistent = aFind->second->getOrCreateDataSource();
return xExistent;
}
// -----------------------------------------------------------------------------
-void ODatabaseContext::registerPrivate(const ::rtl::OUString& _sName
- ,const ::rtl::Reference<ODatabaseModelImpl>& _pModelImpl)
+void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl )
{
- // OSL_ENSURE(m_aDatabaseObjects.find(_sName) == m_aDatabaseObjects.end(),"Name already exists!");
- if ( m_aDatabaseObjects.find(_sName) == m_aDatabaseObjects.end() )
+ ::rtl::OUString sURL( _rModelImpl.getURL() );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "DatabaseContext: registering %s", ::rtl::OUStringToOString( sURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+#endif
+ if ( m_aDatabaseObjects.find( sURL ) == m_aDatabaseObjects.end() )
{
- m_aDatabaseObjects.insert(ObjectCache::value_type(_sName,_pModelImpl.get()));
- setTransientProperties( _sName, *_pModelImpl );
+ m_aDatabaseObjects[ sURL ] = &_rModelImpl;
+ setTransientProperties( sURL, _rModelImpl );
}
+ else
+ OSL_ENSURE( false, "ODatabaseContext::registerDatabaseDocument: already have an object registered for this URL!" );
}
// -----------------------------------------------------------------------------
-void ODatabaseContext::deregisterPrivate(const ::rtl::OUString& _sName)
+void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl )
{
- m_aDatabaseObjects.erase(_sName);
+ ::rtl::OUString sURL( _rModelImpl.getURL() );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "DatabaseContext: deregistering %s", ::rtl::OUStringToOString( sURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+#endif
+ m_aDatabaseObjects.erase( sURL );
}
// -----------------------------------------------------------------------------
-void ODatabaseContext::nameChangePrivate(const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName)
-{
- ObjectCache::iterator aFind = m_aDatabaseObjects.find(_sOldName);
- registerPrivate(_sNewName,aFind->second);
- m_aDatabaseObjects.erase(aFind);
+void ODatabaseContext::databaseDocumentURLChange( const ::rtl::OUString& _rOldURL, const ::rtl::OUString& _rNewURL )
+{
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "DatabaseContext: changing registration from %s to %s",
+ ::rtl::OUStringToOString( _rOldURL, RTL_TEXTENCODING_UTF8 ).getStr(),
+ ::rtl::OUStringToOString( _rNewURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+#endif
+ ObjectCache::iterator oldPos = m_aDatabaseObjects.find( _rOldURL );
+ ENSURE_OR_THROW( oldPos != m_aDatabaseObjects.end(), "illegal old database document URL" );
+ ObjectCache::iterator newPos = m_aDatabaseObjects.find( _rNewURL );
+ ENSURE_OR_THROW( newPos == m_aDatabaseObjects.end(), "illegal new database document URL" );
+
+ m_aDatabaseObjects[ _rNewURL ] = oldPos->second;
+ m_aDatabaseObjects.erase( oldPos );
}
// -----------------------------------------------------------------------------
sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx
index f09d54daf3f3..45e6bf5b87da 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.hxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.hxx
@@ -124,7 +124,7 @@ private:
*/
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > loadObjectFromURL(const ::rtl::OUString& _rName,const ::rtl::OUString& _sURL);
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getObject(const ::rtl::OUString& _rName);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getObject( const ::rtl::OUString& _rURL );
/** retrieves the URL for a given registration name, if any
@returns <FALSE/> if and only if there exists a registration for the given name
@@ -209,10 +209,9 @@ public:
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
- void registerPrivate(const ::rtl::OUString& _sName
- ,const ::rtl::Reference<ODatabaseModelImpl>& _pModelImpl);
- void deregisterPrivate(const ::rtl::OUString& _sName);
- void nameChangePrivate(const ::rtl::OUString& _sOldName, const ::rtl::OUString& _sNewName);
+ void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl );
+ void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl );
+ void databaseDocumentURLChange( const ::rtl::OUString& _rOldURL, const ::rtl::OUString& _rNewURL );
void storeTransientProperties( ODatabaseModelImpl& _rModelImpl);
void appendAtTerminateListener(const ODatabaseModelImpl& _rDataSourceModel);
void removeFromTerminateListener(const ODatabaseModelImpl& _rDataSourceModel);
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 00dca6ea51c0..7f74aa3a5f34 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -40,18 +40,10 @@
#include "documenteventexecutor.hxx"
#include "databasecontext.hxx"
#include "documentcontainer.hxx"
-
-#include <comphelper/documentconstants.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <comphelper/enumhelper.hxx>
-#include <comphelper/numberedcollection.hxx>
-#include <comphelper/genericpropertyset.hxx>
-#include <comphelper/property.hxx>
-#include <svtools/saveopt.hxx>
-
-#include <framework/titlehelper.hxx>
+#include "sdbcoretools.hxx"
/** === begin UNO includes === **/
+#include <com/sun/star/beans/Optional.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
@@ -71,14 +63,17 @@
/** === end UNO includes === **/
#include <comphelper/documentconstants.hxx>
-#include <comphelper/interaction.hxx>
#include <comphelper/enumhelper.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/interaction.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/numberedcollection.hxx>
+#include <comphelper/property.hxx>
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <framework/titlehelper.hxx>
+#include <svtools/saveopt.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <tools/errcode.hxx>
@@ -175,6 +170,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>&
,m_bAllowDocumentScripting( false )
{
DBG_CTOR(ODatabaseDocument,NULL);
+ OSL_TRACE( "DD: ctor: %p: %p", this, m_pImpl.get() );
osl_incrementInterlockedCount( &m_refCount );
{
@@ -201,6 +197,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>&
{
// if the previous incarnation of the DatabaseDocument already had an URL, then creating this incarnation
// here is effectively loading the document.
+ // #i105505# / 2009-10-01 / frank.schoenheit@sun.com
m_aViewMonitor.onLoadedDocument();
}
}
@@ -209,6 +206,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>&
//--------------------------------------------------------------------------
ODatabaseDocument::~ODatabaseDocument()
{
+ OSL_TRACE( "DD: dtor: %p: %p", this, m_pImpl.get() );
DBG_DTOR(ODatabaseDocument,NULL);
if ( !ODatabaseDocument_OfficeDocument::rBHelper.bInDispose && !ODatabaseDocument_OfficeDocument::rBHelper.bDisposed )
{
@@ -815,13 +813,11 @@ void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, const
throw;
}
- Exception aExcept;
- aError >>= aExcept;
-
- ::rtl::OUString sErrorMessage = ResourceManager::loadString(
+ ::rtl::OUString sErrorMessage = extractExceptionMessage( m_pImpl->m_aContext, aError );
+ sErrorMessage = ResourceManager::loadString(
RID_STR_ERROR_WHILE_SAVING,
- "$except$", aError.getValueTypeName(),
- "$message$", aExcept.Message
+ "$location$", _rURL,
+ "$message$", sErrorMessage
);
throw IOException( sErrorMessage, *this );
}
@@ -979,10 +975,11 @@ void SAL_CALL ODatabaseDocument::storeToURL( const ::rtl::OUString& _rURL, const
Exception aExcept;
aError >>= aExcept;
- ::rtl::OUString sErrorMessage = ResourceManager::loadString(
+ ::rtl::OUString sErrorMessage = extractExceptionMessage( m_pImpl->m_aContext, aError );
+ sErrorMessage = ResourceManager::loadString(
RID_STR_ERROR_WHILE_SAVING,
- "$except$", aError.getValueTypeName(),
- "$message$", aExcept.Message
+ "$location$", _rURL,
+ "$message$", sErrorMessage
);
throw IOException( sErrorMessage, *this );
}
@@ -1462,6 +1459,7 @@ void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference<
//------------------------------------------------------------------------------
void ODatabaseDocument::disposing()
{
+ OSL_TRACE( "DD: disp: %p: %p", this, m_pImpl.get() );
if ( !m_pImpl.is() )
{
// this means that we're already disposed
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 9d50a0d06623..58921fbab1e4 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -199,8 +199,6 @@ void SAL_CALL FlushNotificationAdapter::flushed( const EventObject& rEvent ) thr
//--------------------------------------------------------------------
void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) throw (RuntimeException)
{
- DBG_ASSERT( Source.Source == m_aBroadcaster.get(), "FlushNotificationAdapter::disposing: where did this come from?" );
-
Reference< XFlushListener > xListener( m_aListener );
if ( xListener.is() )
xListener->disposing( Source );
@@ -561,21 +559,22 @@ extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource()
//--------------------------------------------------------------------------
ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl)
:ModelDependentComponent( _pImpl )
- ,OSubComponent( getMutex(), Reference< XInterface >() )
- ,OPropertySetHelper(OComponentHelper::rBHelper)
+ ,ODatabaseSource_Base( getMutex() )
+ ,OPropertySetHelper( ODatabaseSource_Base::rBHelper )
,m_aBookmarks( *this, getMutex() )
,m_aFlushListeners( getMutex() )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::ODatabaseSource" );
// some kind of default
DBG_CTOR(ODatabaseSource,NULL);
+ OSL_TRACE( "DS: ctor: %p: %p", this, m_pImpl.get() );
}
//--------------------------------------------------------------------------
ODatabaseSource::~ODatabaseSource()
{
+ OSL_TRACE( "DS: dtor: %p: %p", this, m_pImpl.get() );
DBG_DTOR(ODatabaseSource,NULL);
- if ( !OComponentHelper::rBHelper.bInDispose && !OComponentHelper::rBHelper.bDisposed )
+ if ( !ODatabaseSource_Base::rBHelper.bInDispose && !ODatabaseSource_Base::rBHelper.bDisposed )
{
acquire();
dispose();
@@ -603,11 +602,8 @@ Sequence< Type > ODatabaseSource::getTypes() throw (RuntimeException)
::getCppuType( (const Reference< XMultiPropertySet > *)0 ));
return ::comphelper::concatSequences(
- ::comphelper::concatSequences(
- OSubComponent::getTypes(),
- aPropertyHelperTypes.getTypes()
- ),
- ODatabaseSource_Base::getTypes()
+ ODatabaseSource_Base::getTypes(),
+ aPropertyHelperTypes.getTypes()
);
}
@@ -633,39 +629,26 @@ Sequence< sal_Int8 > ODatabaseSource::getImplementationId() throw (RuntimeExcept
Any ODatabaseSource::queryInterface( const Type & rType ) throw (RuntimeException)
{
//RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::queryInterface" );
- Any aIface = OSubComponent::queryInterface( rType );
- if (!aIface.hasValue())
- {
- aIface = ODatabaseSource_Base::queryInterface( rType );
- if ( !aIface.hasValue() )
- {
- aIface = ::cppu::queryInterface(
- rType,
- static_cast< XPropertySet* >( this ),
- static_cast< XFastPropertySet* >( this ),
- static_cast< XMultiPropertySet* >( this ));
- }
- }
+ Any aIface = ODatabaseSource_Base::queryInterface( rType );
+ if ( !aIface.hasValue() )
+ aIface = ::cppu::OPropertySetHelper::queryInterface( rType );
return aIface;
}
//--------------------------------------------------------------------------
void ODatabaseSource::acquire() throw ()
{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::acquire" );
- OSubComponent::acquire();
+ ODatabaseSource_Base::acquire();
}
//--------------------------------------------------------------------------
void ODatabaseSource::release() throw ()
{
- //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::release" );
- OSubComponent::release();
+ ODatabaseSource_Base::release();
}
// -----------------------------------------------------------------------------
void SAL_CALL ODatabaseSource::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::disposing" );
if ( m_pImpl.is() )
m_pImpl->disposing(Source);
}
@@ -719,8 +702,8 @@ sal_Bool ODatabaseSource::supportsService( const ::rtl::OUString& _rServiceName
//------------------------------------------------------------------------------
void ODatabaseSource::disposing()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::disposing" );
- OSubComponent::disposing();
+ OSL_TRACE( "DS: disp: %p, %p", this, m_pImpl.get() );
+ ODatabaseSource_Base::WeakComponentImplHelperBase::disposing();
OPropertySetHelper::disposing();
EventObject aDisposeEvent(static_cast<XWeak*>(this));
diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx
index 863dc252328a..0fee4dac79e6 100644
--- a/dbaccess/source/core/dataaccess/datasource.hxx
+++ b/dbaccess/source/core/dataaccess/datasource.hxx
@@ -70,11 +70,8 @@
#ifndef _CPPUHELPER_WEAKREF_HXX_
#include <cppuhelper/weakref.hxx>
#endif
-#ifndef _CPPUHELPER_IMPLBASE11_HXX_
-#include <cppuhelper/implbase11.hxx>
-#endif
-#ifndef _CPPUHELPER_IMPLBASE12_HXX_
-#include <cppuhelper/implbase12.hxx>
+#ifndef _CPPUHELPER_COMPBASE11_HXX_
+#include <cppuhelper/compbase11.hxx>
#endif
#ifndef _COM_SUN_STAR_EMBED_XTRANSACTIONLISTENER_HPP_
#include <com/sun/star/embed/XTransactionListener.hpp>
@@ -142,32 +139,31 @@ class OChildCommitListen_Impl;
//============================================================
//= ODatabaseSource
//============================================================
-typedef ::cppu::ImplHelper11 < ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::sdbc::XDataSource
- , ::com::sun::star::sdb::XBookmarksSupplier
- , ::com::sun::star::sdb::XQueryDefinitionsSupplier
- , ::com::sun::star::sdb::XCompletedConnection
- , ::com::sun::star::container::XContainerListener
- , ::com::sun::star::sdbc::XIsolatedConnection
- , ::com::sun::star::sdbcx::XTablesSupplier
- , ::com::sun::star::util::XFlushable
- , ::com::sun::star::util::XFlushListener
- , ::com::sun::star::sdb::XDocumentDataSource
- > ODatabaseSource_Base;
+typedef ::cppu::WeakComponentImplHelper11 < ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::sdbc::XDataSource
+ , ::com::sun::star::sdb::XBookmarksSupplier
+ , ::com::sun::star::sdb::XQueryDefinitionsSupplier
+ , ::com::sun::star::sdb::XCompletedConnection
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::sdbc::XIsolatedConnection
+ , ::com::sun::star::sdbcx::XTablesSupplier
+ , ::com::sun::star::util::XFlushable
+ , ::com::sun::star::util::XFlushListener
+ , ::com::sun::star::sdb::XDocumentDataSource
+ > ODatabaseSource_Base;
class ODatabaseSource :public ModelDependentComponent // must be first
- ,public OSubComponent
+ ,public ODatabaseSource_Base
,public ::cppu::OPropertySetHelper
,public ::comphelper::OPropertyArrayUsageHelper < ODatabaseSource >
- ,public ODatabaseSource_Base
{
friend class ODatabaseContext;
friend class OConnection;
friend class OSharedConnectionManager;
private:
-
+ using ODatabaseSource_Base::rBHelper;
OBookmarkContainer m_aBookmarks;
::cppu::OInterfaceContainerHelper m_aFlushListeners;
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index c5b176478ecd..9ba06976e555 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -730,7 +730,7 @@ void SAL_CALL ODocumentContainer::revert( ) throw (::com::sun::star::io::IOExce
Reference< XStorage> ODocumentContainer::getContainerStorage() const
{
return m_pImpl->m_pDataSource
- ? m_pImpl->m_pDataSource->getStorage( ODatabaseModelImpl::getObjectContainerStorageName( m_bFormsContainer ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT ) )
+ ? m_pImpl->m_pDataSource->getStorage( m_bFormsContainer ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT )
: Reference< XStorage>();
}
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 8a4cff9624ae..c471981dbb52 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -2052,7 +2052,7 @@ void SAL_CALL ODocumentDefinition::rename( const ::rtl::OUString& _rNewName ) th
Reference< XStorage> ODocumentDefinition::getContainerStorage() const
{
return m_pImpl->m_pDataSource
- ? m_pImpl->m_pDataSource->getStorage( ODatabaseModelImpl::getObjectContainerStorageName( m_bForm ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT ) )
+ ? m_pImpl->m_pDataSource->getStorage( m_bForm ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT )
: Reference< XStorage>();
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/core/inc/core_resource.hrc b/dbaccess/source/core/inc/core_resource.hrc
index c3fcb7541c68..2f97249b5b0c 100644
--- a/dbaccess/source/core/inc/core_resource.hrc
+++ b/dbaccess/source/core/inc/core_resource.hrc
@@ -37,7 +37,6 @@
//------------------------------------------------------------------------------
#define RID_CORE_STRINGS_START RID_DBACCESS_START
-#define RID_CORE_OTHER_START RID_DBACCESS_START
//------------------------------------------------------------------------------
//- String-IDs
@@ -89,6 +88,7 @@
#define RID_STR_NAME_NOT_FOUND ( RID_CORE_STRINGS_START + 45 )
#define RID_STR_QUERY_DOES_NOT_EXIST ( RID_CORE_STRINGS_START + 46 )
#define RID_STR_ERROR_WHILE_SAVING ( RID_CORE_STRINGS_START + 47 )
+#define RID_NO_SUCH_DATA_SOURCE ( RID_CORE_STRINGS_START + 48 )
#endif // _DBA_CORE_RESOURCE_HRC_
diff --git a/dbaccess/source/core/inc/core_resource.hxx b/dbaccess/source/core/inc/core_resource.hxx
index 8778bf0204b7..f54df29a6517 100644
--- a/dbaccess/source/core/inc/core_resource.hxx
+++ b/dbaccess/source/core/inc/core_resource.hxx
@@ -110,8 +110,6 @@ namespace dbaccess
const sal_Char* _pPlaceholderAscii2,
const ::rtl::OUString& _rReplace2
);
-
- static ResMgr* getResManager();
};
//=========================================================================
diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx
index a7e2b9986f7e..92a163b3d24e 100644
--- a/dbaccess/source/core/inc/sdbcoretools.hxx
+++ b/dbaccess/source/core/inc/sdbcoretools.hxx
@@ -31,12 +31,13 @@
#ifndef DBACORE_SDBCORETOOLS_HXX
#define DBACORE_SDBCORETOOLS_HXX
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
-#endif
+
+namespace comphelper
+{
+ class ComponentContext;
+}
//.........................................................................
namespace dbaccess
@@ -71,6 +72,11 @@ namespace dbaccess
::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
);
+ // -----------------------------------------------------------------------------
+ /** retrieves a to-be-displayed string for a given caught exception;
+ */
+ ::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Any& _rError );
+
//.........................................................................
} // namespace dbaccess
//.........................................................................
diff --git a/dbaccess/source/core/misc/apitools.cxx b/dbaccess/source/core/misc/apitools.cxx
index 33dd640770e3..f956f26b9071 100644
--- a/dbaccess/source/core/misc/apitools.cxx
+++ b/dbaccess/source/core/misc/apitools.cxx
@@ -101,11 +101,14 @@ void OSubComponent::release() throw ( )
Reference< XInterface > x( xDelegator );
if (! x.is())
{
- if (osl_decrementInterlockedCount( &m_refCount ) == 0 && m_refCount == 0 )
+ if (osl_decrementInterlockedCount( &m_refCount ) == 0 )
{
- OSL_ENSURE( m_refCount == 0, "OSubComponent::release: why the hell is this false!" );
if (! rBHelper.bDisposed)
{
+ // *before* again incrementing our ref count, ensure that our weak connection point
+ // will not create references to us anymore (via XAdapter::queryAdapted)
+ disposeWeakConnectionPoint();
+
Reference< XInterface > xHoldAlive( *this );
// remember the parent
Reference< XInterface > xParent;
@@ -115,13 +118,13 @@ void OSubComponent::release() throw ( )
m_xParent = NULL;
}
- OSL_ENSURE( m_refCount == 1, "OSubComponent::release: invalid ref count!" );
+ OSL_ENSURE( m_refCount == 1, "OSubComponent::release: invalid ref count (before dispose)!" );
// First dispose
dispose();
// only the alive ref holds the object
- OSL_ENSURE( m_refCount == 1, "OSubComponent::release: invalid ref count!" );
+ OSL_ENSURE( m_refCount == 1, "OSubComponent::release: invalid ref count (after dispose)!" );
// release the parent in the ~
if (xParent.is())
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index d241067fcd4d..672b88c810d4 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -299,12 +299,6 @@ Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( const ::rtl::O
return aProperties.getPropertyValues();
}
-// -----------------------------------------------------------------------------
-String ODsnTypeCollection::getTypeExtension(const ::rtl::OUString& _sURL) const
-{
- const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
- return aFeatures.getOrDefault("Extension",::rtl::OUString());
-}
//-------------------------------------------------------------------------
bool ODsnTypeCollection::isEmbeddedDatabase( const ::rtl::OUString& _sURL ) const
{
diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx
index 75a1cd6b36eb..48e08b7ff7e4 100644
--- a/dbaccess/source/core/misc/sdbcoretools.cxx
+++ b/dbaccess/source/core/misc/sdbcoretools.cxx
@@ -31,30 +31,24 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef DBACORE_SDBCORETOOLS_HXX
#include "sdbcoretools.hxx"
-#endif
-#ifndef _TOOLS_DEBUG_HXX
-#include <tools/debug.hxx>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include "dbastrings.hrc"
+
+/** === begin UNO includes === **/
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
#include <com/sun/star/beans/PropertyValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
#include <com/sun/star/container/XChild.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_
#include <com/sun/star/util/XModifiable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
-#endif
-#ifndef DBACCESS_SHARED_DBASTRINGS_HRC
-#include "dbastrings.hrc"
-#endif
+#include <com/sun/star/task/XInteractionRequestStringResolver.hpp>
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+#include <tools/debug.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/interaction.hxx>
+#include <rtl/ref.hxx>
+#include <rtl/ustrbuf.hxx>
//.........................................................................
namespace dbaccess
@@ -67,6 +61,7 @@ namespace dbaccess
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::task;
using namespace ::com::sun::star::container;
// =========================================================================
@@ -130,6 +125,45 @@ namespace dbaccess
}
// -----------------------------------------------------------------------------
+ ::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const Any& _rError )
+ {
+ ::rtl::OUString sDisplayMessage;
+
+ try
+ {
+ Reference< XInteractionRequestStringResolver > xStringResolver;
+ if ( _rContext.createComponent( "com.sun.star.task.InteractionRequestStringResolver", xStringResolver ) )
+ {
+ ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) );
+ ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove );
+ pRequest->addContinuation( pApprove.get() );
+ Optional< ::rtl::OUString > aMessage = xStringResolver->getStringFromInformationalRequest( pRequest.get() );
+ if ( aMessage.IsPresent )
+ sDisplayMessage = aMessage.Value;
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( !sDisplayMessage.getLength() )
+ {
+ Exception aExcept;
+ _rError >>= aExcept;
+
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.append( _rError.getValueTypeName() );
+ aBuffer.appendAscii( ":\n" );
+ aBuffer.append( aExcept.Message );
+
+ sDisplayMessage = aBuffer.makeStringAndClear();
+ }
+
+ return sDisplayMessage;
+ }
+
+// -----------------------------------------------------------------------------
//.........................................................................
} // namespace dbaccess
//.........................................................................
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index dea6ea6b9d9d..ba605eb8ddfe 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -116,12 +116,6 @@ namespace dbaccess
m_pImpl = NULL;
}
}
- ResMgr* ResourceManager::getResManager()
- {
- ensureImplExists();
- return m_pImpl;
- }
-
//.........................................................................
}
//.........................................................................
diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src
index 2f65a3391dff..3fc3806963a5 100644
--- a/dbaccess/source/core/resource/strings.src
+++ b/dbaccess/source/core/resource/strings.src
@@ -243,7 +243,12 @@ String RID_STR_NAME_NOT_FOUND
String RID_STR_ERROR_WHILE_SAVING
{
- Text [ en-US ] = "Could not save the document:\n\n$except$:\n$message$";
+ Text [ en-US ] = "Could not save the document to $location$:\n$message$";
+};
+
+String RID_NO_SUCH_DATA_SOURCE
+{
+ Text [ en-US ] = "Error accessing data source '$name$':\n$error$";
};
//-------------------------------------------------------------------------
diff --git a/dbaccess/source/ext/macromigration/docinteraction.cxx b/dbaccess/source/ext/macromigration/docinteraction.cxx
index 9f7ded185553..77fba3e97a04 100644
--- a/dbaccess/source/ext/macromigration/docinteraction.cxx
+++ b/dbaccess/source/ext/macromigration/docinteraction.cxx
@@ -89,18 +89,6 @@ namespace dbmm
//= InteractionHandler
//====================================================================
//--------------------------------------------------------------------
- InteractionHandler::InteractionHandler( const ::comphelper::ComponentContext& _rContext )
- :m_pData( new InteractionHandler_Data( _rContext ) )
- {
- }
-
- //--------------------------------------------------------------------
- InteractionHandler::InteractionHandler( const Reference< XInteractionHandler >& _rxHandler )
- :m_pData( new InteractionHandler_Data( _rxHandler ) )
- {
- }
-
- //--------------------------------------------------------------------
InteractionHandler::InteractionHandler( const ::comphelper::ComponentContext& _rContext, const Reference< XModel >& _rxDocument )
:m_pData( new InteractionHandler_Data( _rContext ) )
{
diff --git a/dbaccess/source/ext/macromigration/docinteraction.hxx b/dbaccess/source/ext/macromigration/docinteraction.hxx
index f24bfea7842f..9e9dd73b4651 100644
--- a/dbaccess/source/ext/macromigration/docinteraction.hxx
+++ b/dbaccess/source/ext/macromigration/docinteraction.hxx
@@ -57,15 +57,6 @@ namespace dbmm
{
public:
/** creates an interaction handler by instantiating a css.task.InteractionHandler
- component at the given component context.
- */
- InteractionHandler( const ::comphelper::ComponentContext& _rContext );
-
- /** creates an InteractionHandler instance, using the given existing UNO handler.
- */
- InteractionHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxHandler );
-
- /** creates an interaction handler by instantiating a css.task.InteractionHandler
component at the given component context, or using the given document's interaction handler,
if one is specified in the document's media descriptor.
*/
diff --git a/dbaccess/source/ext/macromigration/progressmixer.cxx b/dbaccess/source/ext/macromigration/progressmixer.cxx
index a59e1a59b7fe..b738376fb051 100644
--- a/dbaccess/source/ext/macromigration/progressmixer.cxx
+++ b/dbaccess/source/ext/macromigration/progressmixer.cxx
@@ -108,12 +108,13 @@ namespace dbmm
//--------------------------------------------------------------------
namespace
{
+#if OSL_DEBUG_LEVEL > 0
//----------------------------------------------------------------
bool lcl_isRunning( const ProgressMixer_Data& _rData )
{
return _rData.pCurrentPhase != _rData.aPhases.end();
}
-
+#endif
//----------------------------------------------------------------
void lcl_ensureInitialized( ProgressMixer_Data& _rData )
{
diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx
index 79d5156affd3..4e9153a6a216 100644
--- a/dbaccess/source/inc/dsntypes.hxx
+++ b/dbaccess/source/inc/dsntypes.hxx
@@ -139,9 +139,6 @@ public:
/// get the datasource type display name from a DSN string
String getTypeDisplayName(const ::rtl::OUString& _sURL) const;
- /// returns the extension of the user defined type
- String getTypeExtension(const ::rtl::OUString& _sURL) const;
-
/// on a given string, cut the type prefix and return the result
String cutPrefix(const ::rtl::OUString& _sURL) const;
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index 96ca58d6f428..a8c5d5a97054 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -295,15 +295,6 @@ namespace dbaui
/// returns <TRUE/> if the clipboard supports a table format, otherwise <FALSE/>.
sal_Bool isTableFormat() const;
- /** copies a table which was constructed by tags like HTML or RTF
- @param _rDesc
- The Drop descriptor
- @param _bCheck
- If set to <TRUE/> than the controller checks only if a copy is possible.
- */
- sal_Bool copyTagTable( OTableCopyHelper::DropDescriptor& _rDesc
- , sal_Bool _bCheck);
-
/** fills the vector with all supported formats
@param _eType
The type for which we need the formats
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index a509986e8849..2d39783cdb87 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -902,18 +902,6 @@ sal_Bool OApplicationController::isTableFormat() const
return m_aTableCopyHelper.isTableFormat(getViewClipboard());
}
// -----------------------------------------------------------------------------
-sal_Bool OApplicationController::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc, sal_Bool _bCheck)
-{
- // first get the dest connection
- ::osl::MutexGuard aGuard( getMutex() );
-
- SharedConnection xConnection( ensureConnection() );
- if ( !xConnection.is() )
- return sal_False;
-
- return m_aTableCopyHelper.copyTagTable( _rDesc, _bCheck, xConnection );
-}
-// -----------------------------------------------------------------------------
IMPL_LINK( OApplicationController, OnAsyncDrop, void*, /*NOTINTERESTEDIN*/ )
{
m_nAsyncDrop = 0;
diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx
index 8ef4f77f20c7..a24fe29b5974 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.cxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.cxx
@@ -125,8 +125,9 @@ namespace dbaui
xModel.set( _rxComponent, UNO_QUERY );
if ( xModel.is() )
{
- xController.set( xModel->getCurrentController(), UNO_SET_THROW );
- xFrame.set( xController->getFrame(), UNO_SET_THROW );
+ xController.set( xModel->getCurrentController() );
+ if ( xController.is() )
+ xFrame.set( xController->getFrame(), UNO_SET_THROW );
}
else
{
@@ -468,13 +469,15 @@ namespace dbaui
// put into map
SubComponentAccessor aKey( _rName, _nComponentType, _eOpenMode );
SubComponentDescriptor aElement( _rxComponent );
+ ENSURE_OR_THROW( aElement.xModel.is() || aElement.xController.is(), "illegal component" );
m_pData->m_aComponents.insert( SubComponentMap::value_type(
aKey, aElement
) ) ;
// add as listener
- aElement.xController->addEventListener( this );
+ if ( aElement.xController.is() )
+ aElement.xController->addEventListener( this );
if ( aElement.xModel.is() )
aElement.xModel->addEventListener( this );
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 87f924129c16..913dea5c54fe 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -324,7 +324,16 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const ::
}
catch(const Exception&)
{
- DBG_UNHANDLED_EXCEPTION();
+ // Does this need to be shown to the user?
+ bSuccess = false;
+ try
+ {
+ ::comphelper::disposeComponent( xController );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
}
@@ -342,7 +351,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const ::
}
else
if ( rListener.is() )
- rListener->loadCancelled( this );
+ rListener->loadCancelled( this );
}
// -----------------------------------------------------------------------
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index a24c2d4e30dc..9d81d9c47c86 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -282,6 +282,7 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto
}
}
+#ifdef WNT
// -----------------------------------------------------------------------------
OGenericUnoController::OGenericUnoController()
:OGenericUnoController_Base( getMutex() )
@@ -302,6 +303,7 @@ OGenericUnoController::OGenericUnoController()
// we simply abort here.
abort();
}
+#endif
// -----------------------------------------------------------------------------
OGenericUnoController::~OGenericUnoController()
diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx
index dbcdc4dc5138..8fe75d85d57f 100644
--- a/dbaccess/source/ui/control/listviewitems.cxx
+++ b/dbaccess/source/ui/control/listviewitems.cxx
@@ -45,7 +45,9 @@ namespace dbaui
//------------------------------------------------------------------------
void OBoldListboxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData)
{
- SvLBoxString::InitViewData(pView,pEntry, _pViewData);
+ SvLBoxString::InitViewData( pView, pEntry, _pViewData );
+ if ( !m_bEmphasized )
+ return;
if (!_pViewData)
_pViewData = pView->GetViewDataItem( pEntry, this );
pView->Push(PUSH_ALL);
diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx
index 5b089f764337..12c25ef58a87 100644
--- a/dbaccess/source/ui/control/opendoccontrols.cxx
+++ b/dbaccess/source/ui/control/opendoccontrols.cxx
@@ -210,13 +210,6 @@ namespace dbaui
//= OpenButton
//====================================================================
//--------------------------------------------------------------------
- OpenDocumentButton::OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, WinBits _nStyle )
- :PushButton( _pParent, _nStyle )
- {
- impl_init( _pAsciiModuleName );
- }
-
- //--------------------------------------------------------------------
OpenDocumentButton::OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId )
:PushButton( _pParent, _rResId )
{
@@ -247,13 +240,6 @@ namespace dbaui
//= OpenDocumentListBox
//====================================================================
//--------------------------------------------------------------------
- OpenDocumentListBox::OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, WinBits _nStyle )
- :ListBox( _pParent, _nStyle )
- {
- impl_init( _pAsciiModuleName );
- }
-
- //--------------------------------------------------------------------
OpenDocumentListBox::OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId )
:ListBox( _pParent, _rResId )
{
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 2e155dfb4572..759054d4495e 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -952,14 +952,8 @@ DBG_NAME(OFinalDBPageSetup)
aPos.X() = pWindows[i].first->GetPosPixel().X();
Size aSize = pWindows[i].first->GetSizePixel();
FixedText* pText = dynamic_cast<FixedText*>(pWindows[i].first);
- CheckBox* pCheck = dynamic_cast<CheckBox*>(pWindows[i].first);
- RadioButton* pRadio = dynamic_cast<RadioButton*>(pWindows[i].first);
if ( pText )
aSize = pText->CalcMinimumSize(aSize.Width());
- else if ( pRadio )
- aSize = pRadio->CalcMinimumSize(aSize.Width());
- else if ( pCheck )
- aSize = pCheck->CalcMinimumSize(aSize.Width());
pWindows[i].first->SetPosSizePixel(aPos,aSize);
aPos.Y() += aSize.Height() + pWindows[i].second;
}
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 7aa91ef8ce2c..d535a0afab02 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -153,16 +153,6 @@ void ODbAdminDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage)
SfxTabDialog::PageCreated(_nId, _rPage);
}
-// -----------------------------------------------------------------------------
-void ODbAdminDialog::removeDetailPages()
-{
- // remove all current detail pages
- while (m_aCurrentDetailPages.size())
- {
- RemoveTabPage((USHORT)m_aCurrentDetailPages.top());
- m_aCurrentDetailPages.pop();
- }
-}
// -----------------------------------------------------------------------------
void ODbAdminDialog::addDetailPage(USHORT _nPageId, USHORT _nTextId, CreateTabPage _pCreateFunc)
diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src
index 6f6020d966e9..b26f2eee2e3a 100644
--- a/dbaccess/source/ui/dlg/dbadminsetup.src
+++ b/dbaccess/source/ui/dlg/dbadminsetup.src
@@ -315,7 +315,7 @@ TabPage PAGE_DBWIZARD_FINAL
{
Pos = MAP_APPFONT (START_X , 100 ) ;
Size = MAP_APPFONT ( WIZARD_PAGE_X - START_X - 6 , 8 ) ;
- Text[ en-US ] = "~After the database file has been saved, what do you want to do?" ;
+ Text[ en-US ] = "After the database file has been saved, what do you want to do?" ;
};
CheckBox CB_OPENAFTERWARDS
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 4f713e27f277..aa0157174e3d 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -171,13 +171,6 @@ DBG_NAME(DirectSQLDialog)
}
//--------------------------------------------------------------------
- void DirectSQLDialog::addHistoryEntry(const String& _rStatement)
- {
- CHECK_INVARIANTS("DirectSQLDialog::addHistoryEntry");
- implAddToStatementHistory(_rStatement);
- }
-
- //--------------------------------------------------------------------
sal_Int32 DirectSQLDialog::getHistorySize() const
{
CHECK_INVARIANTS("DirectSQLDialog::getHistorySize");
diff --git a/dbaccess/source/ui/inc/databaseobjectview.hxx b/dbaccess/source/ui/inc/databaseobjectview.hxx
index ed6e9a37ec55..07c77e388196 100644
--- a/dbaccess/source/ui/inc/databaseobjectview.hxx
+++ b/dbaccess/source/ui/inc/databaseobjectview.hxx
@@ -280,18 +280,6 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame
);
};
- //======================================================================
- //= ReportDesigner
- //======================================================================
- class ReportDesigner : public DatabaseObjectView
- {
- public:
- ReportDesigner(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame
- );
- };
// .........................................................................
} // namespace dbaui
// .........................................................................
diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx
index 5c002747a1cc..86e8ef63352c 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -114,8 +114,6 @@ public:
protected:
// adds a new detail page and remove all the old ones
void addDetailPage(USHORT _nPageId,USHORT _nTextId,CreateTabPage pCreateFunc);
- // removes all detail pages
- void removeDetailPages();
virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage);
virtual short Ok();
diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx
index a6574a26f1f9..89743f92f26e 100644
--- a/dbaccess/source/ui/inc/directsql.hxx
+++ b/dbaccess/source/ui/inc/directsql.hxx
@@ -108,9 +108,6 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn);
~DirectSQLDialog();
- /// add an history entry
- void addHistoryEntry(const String& _rStatement);
-
/// number of history entries
sal_Int32 getHistorySize() const;
diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx
index 62ad79e80a67..5372c201e0c8 100644
--- a/dbaccess/source/ui/inc/dsmeta.hxx
+++ b/dbaccess/source/ui/inc/dsmeta.hxx
@@ -77,8 +77,6 @@ namespace dbaui
const AdvancedSettingsSupport& getAdvancedSettingsSupport() const;
/// determines whether or not the data source requires authentication
- AuthenticationMode getAuthentication() const;
-
static AuthenticationMode getAuthentication( const ::rtl::OUString& _sURL );
private:
diff --git a/dbaccess/source/ui/inc/opendoccontrols.hxx b/dbaccess/source/ui/inc/opendoccontrols.hxx
index 4333b91db0a9..d363b9a91e48 100644
--- a/dbaccess/source/ui/inc/opendoccontrols.hxx
+++ b/dbaccess/source/ui/inc/opendoccontrols.hxx
@@ -61,7 +61,6 @@ namespace dbaui
::rtl::OUString m_sModule;
public:
- OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, WinBits _nStyle = 0 );
OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId );
protected:
@@ -81,7 +80,6 @@ namespace dbaui
MapIndexToStringPair m_aURLs;
public:
- OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, WinBits _nStyle = WB_BORDER );
OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId );
String GetSelectedDocumentURL() const;
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx
index 259834be1724..7cf3c067f419 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -405,16 +405,6 @@ namespace dbaui
:DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< ::rtl::OUString >( URL_COMPONENT_RELATIONDESIGN ) )
{
}
- //======================================================================
- //= ReportDesigner
- //======================================================================
- //----------------------------------------------------------------------
- ReportDesigner::ReportDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication , const Reference< XFrame >& _rxParentFrame)
- :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame,static_cast< ::rtl::OUString >( URL_COMPONENT_REPORTDESIGN ) )
- {
- }
-
-
// .........................................................................
} // namespace dbaui
// .........................................................................
diff --git a/dbaccess/source/ui/misc/documentcontroller.cxx b/dbaccess/source/ui/misc/documentcontroller.cxx
index 523307d55013..62400fdf1269 100644
--- a/dbaccess/source/ui/misc/documentcontroller.cxx
+++ b/dbaccess/source/ui/misc/documentcontroller.cxx
@@ -58,16 +58,6 @@ namespace dbaui
}
//--------------------------------------------------------------------
- ModelControllerConnector::ModelControllerConnector( const Reference< XModel >& _rxModel, const Reference< XController >& _rxController )
- :m_xModel( _rxModel )
- ,m_xController( _rxController )
- {
- DBG_CTOR( ModelControllerConnector, NULL );
- DBG_ASSERT( _rxModel.is() && m_xController.is(), "ModelControllerConnector::ModelControllerConnector: invalid model or controller!" );
- impl_connect();
- }
-
- //--------------------------------------------------------------------
ModelControllerConnector::ModelControllerConnector( const ModelControllerConnector& _rSource )
{
DBG_CTOR( ModelControllerConnector, NULL );
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index f758f529f66f..b152f12688e2 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -255,12 +255,6 @@ namespace dbaui
}
//--------------------------------------------------------------------
- AuthenticationMode DataSourceMetaData::getAuthentication() const
- {
- return getAuthenticationMode( m_pImpl->getType() );
- }
-
- //--------------------------------------------------------------------
AuthenticationMode DataSourceMetaData::getAuthentication( const ::rtl::OUString& _sURL )
{
return getAuthenticationMode( _sURL );
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 69ec1dcf4975..5869f6102eeb 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -279,10 +279,11 @@ namespace dbaui
{
::svx::ODataAccessDescriptor aDesc;
aDesc.setDataSource(m_sDataSourceName);
- if ( _nCommandType != -1 )
+ if ( _rObjectName.getLength() && ( _nCommandType != -1 ) )
+ {
aDesc[::svx::daCommandType] <<= _nCommandType;
- if ( _rObjectName.getLength() )
aDesc[::svx::daCommand] <<= _rObjectName;
+ }
if ( m_xConnection.is() )
aDesc[::svx::daConnection] <<= m_xConnection;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index e489a0c2a585..a155fa0922e8 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -330,86 +330,6 @@ namespace
return eErrorCode;
}
- //------------------------------------------------------------------------------
- ::rtl::OUString QuoteField( const OQueryDesignView* _pView,const ::rtl::OUString& rValue, sal_Int32 aType )
- {
- ::rtl::OUString rNewValue;
- switch (rValue.toChar())
- {
- case '?':
- if (rValue.getLength() != 1)
- break;
- case '\'': // ::rtl::OUString Quotierung oder Datum
- //case '#': // Datumsquotierung // jetengine
- case ':': // Parameter
- case '[': // Parameter
- return rValue;
- }
-
- Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection();
- Reference< XDatabaseMetaData > xMetaData;
- if(xConnection.is())
- xMetaData = xConnection->getMetaData();
- ::rtl::OUString aQuote;
- try
- {
- if(xMetaData.is())
- aQuote = xMetaData->getIdentifierQuoteString();
-
- switch( aType )
- {
- case DataType::DATE:
- case DataType::TIME:
- case DataType::TIMESTAMP:
- if (rValue.toChar() != '{') // nur quoten, wenn kein Access Datum
- rNewValue = ::dbtools::quoteName(aQuote,rValue);
- else
- rNewValue = rValue;
- break;
- case DataType::CHAR:
- case DataType::VARCHAR:
- case DataType::LONGVARCHAR:
- rNewValue = ::dbtools::quoteName(aQuote,rValue);
- break;
- case DataType::DECIMAL:
- case DataType::NUMERIC:
- case DataType::TINYINT:
- case DataType::SMALLINT:
- case DataType::INTEGER:
- case DataType::BIGINT:
- case DataType::REAL:
- case DataType::DOUBLE:
- case DataType::BINARY:
- case DataType::VARBINARY:
- case DataType::LONGVARBINARY:
- rNewValue = rValue;
- break;
- case DataType::BIT:
- case DataType::BOOLEAN:
- {
- if(xMetaData.is())
- {
- ::comphelper::UStringMixEqual bCase(xMetaData->supportsMixedCaseQuotedIdentifiers());
- if (bCase(rValue, String(ModuleRes(STR_QUERY_TRUE))))
- rNewValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TRUE"));
- else if (bCase(rValue, String(ModuleRes(STR_QUERY_FALSE))))
- rNewValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FALSE"));
- else
- rNewValue = rValue;
- }
- }
- break;
- default:
- DBG_ERROR( "QuoteField: illegal type" );
- break;
- }
- }
- catch(SQLException&)
- {
- DBG_ERROR( "QuoteField: Exception" );
- }
- return rNewValue;
- }
// -----------------------------------------------------------------------------
/** FillDragInfo fills the field description out of the table