summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2009-12-10 10:15:20 +0100
committerKai Sommerfeld <kso@openoffice.org>2009-12-10 10:15:20 +0100
commitfe0cc8930b4367e34de105813700e19138122c1c (patch)
treebb4c07e39b68b548b2ae75c78ee93068ba1af09a
parent921784e3a396a49ce051b2737ca65ebb23344d8c (diff)
parentf17e58864db1476a09cc5156e85f745a9286da63 (diff)
merged with DEV300_m67
-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/DatabaseDataProvider.cxx3
-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/brwctrlr.cxx3
-rw-r--r--dbaccess/source/ui/browser/dbloader.cxx13
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.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/dlg/indexdialog.cxx2
-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/ToolBoxHelper.cxx6
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/misc/controllerframe.cxx25
-rw-r--r--dbaccess/source/ui/misc/databaseobjectview.cxx59
-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.cxx131
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx26
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx1
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx3
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx2
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx4
63 files changed, 733 insertions, 876 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..87ab49fe193c 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& _sOldName, const ::rtl::OUString& _sNewName);
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/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index cd16eb68a5ee..b6aff3db3240 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -584,7 +584,8 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat
{
xChartData->setData(uno::Sequence< uno::Sequence<double> >());
xChartData->setColumnDescriptions(uno::Sequence< ::rtl::OUString >());
- m_xInternal->deleteSequence(0);
+ if ( m_xInternal->hasDataByRangeRepresentation(::rtl::OUString::valueOf(sal_Int32(0))) )
+ m_xInternal->deleteSequence(0);
}
uno::Sequence< ::rtl::OUString > aColumns;
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/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index ddfb583f65c9..91b0fd968afb 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1368,7 +1368,10 @@ void SbaXDataBrowserController::errorOccured(const ::com::sun::star::sdb::SQLErr
m_aCurrentError = aInfo;
}
else
+ {
+ m_aCurrentError = aInfo;
m_aAsyncDisplayError.Call();
+ }
}
//------------------------------------------------------------------------------
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/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 8f2528e1f96a..aad25f1cd7ab 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3608,7 +3608,7 @@ sal_Bool SbaTableQueryBrowser::isHiContrast() const
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::isHiContrast" );
sal_Bool bRet = sal_False;
if ( m_pTreeView )
- bRet = m_pTreeView->getListBox().GetBackground().GetColor().IsDark();
+ bRet = m_pTreeView->getListBox().GetSettings().GetStyleSettings().GetHighContrastMode();
return bRet;
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index a11d39bdba04..b5bc5f817198 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -568,7 +568,7 @@ namespace
void lcl_insertMenuItemImages( Menu& _rMenu, IController& _rCommandController )
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- const BOOL bHiContrast = rSettings.GetMenuColor().IsDark();
+ const BOOL bHiContrast = rSettings.GetHighContrastMode();
uno::Reference< frame::XController > xController = _rCommandController.getXController();
uno::Reference< frame::XFrame> xFrame;
if ( xController.is() )
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/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index ea082491e85b..1d9dfba5623e 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -342,7 +342,7 @@ DBG_NAME(DbaIndexDialog)
//------------------------------------------------------------------
void DbaIndexDialog::fillIndexList()
{
- sal_Bool bHiContrast = GetBackground().GetColor().IsDark();
+ sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
Image aPKeyIcon(ModuleRes( bHiContrast ? IMG_PKEYICON_SCH : IMG_PKEYICON));
// fill the list with the index names
m_aIndexes.Clear();
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/ToolBoxHelper.cxx b/dbaccess/source/ui/misc/ToolBoxHelper.cxx
index bfb5f9cf4dab..8982ae4571da 100644
--- a/dbaccess/source/ui/misc/ToolBoxHelper.cxx
+++ b/dbaccess/source/ui/misc/ToolBoxHelper.cxx
@@ -79,10 +79,10 @@ namespace dbaui
{
sal_Int16 nCurSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize();
if ( nCurSymbolsSize != m_nSymbolsSize ||
- m_bIsHiContrast != m_pToolBox->GetBackground().GetColor().IsDark() )
+ m_bIsHiContrast != m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode() )
{
m_nSymbolsSize = nCurSymbolsSize;
- m_bIsHiContrast = m_pToolBox->GetBackground().GetColor().IsDark();
+ m_bIsHiContrast = m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode();
m_pToolBox->SetImageList( getImageList(m_nSymbolsSize,m_bIsHiContrast) );
@@ -131,7 +131,7 @@ namespace dbaui
m_pToolBox = _pTB;
if ( m_pToolBox )
{
- // m_bIsHiContrast = m_pToolBox->GetBackground().GetColor().IsDark();
+ // m_bIsHiContrast = m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode();
ConfigOptionsChanged(NULL);
if ( bFirstTime )
adjustToolBoxSize(m_pToolBox);
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 25a6299bae12..20cb7cb9308e 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1326,7 +1326,7 @@ sal_Bool isHiContrast(Window* _pWindow)
else
break;
}
- return pIter && pIter->GetBackground().GetColor().IsDark();
+ return pIter && pIter->GetSettings().GetStyleSettings().GetHighContrastMode();
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx
index e20f5e04b35b..491e27fc49de 100644
--- a/dbaccess/source/ui/misc/controllerframe.cxx
+++ b/dbaccess/source/ui/misc/controllerframe.cxx
@@ -44,6 +44,8 @@
#include <rtl/ref.hxx>
#include <sfx2/objsh.hxx>
#include <tools/diagnose_ex.h>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/window.hxx>
//........................................................................
namespace dbaui
@@ -77,6 +79,7 @@ namespace dbaui
using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::document::XDocumentEventBroadcaster;
+ using ::com::sun::star::awt::XWindow;
/** === end UNO using === **/
//====================================================================
@@ -125,7 +128,7 @@ namespace dbaui
,m_xDocEventBroadcaster()
,m_pListener()
,m_bActive( false )
- ,m_bLivesInTopWindow( false )
+ ,m_bIsTopLevelDocumentWindow( false )
{
}
@@ -134,7 +137,7 @@ namespace dbaui
Reference< XDocumentEventBroadcaster > m_xDocEventBroadcaster;
::rtl::Reference< FrameWindowActivationListener > m_pListener;
bool m_bActive;
- bool m_bLivesInTopWindow;
+ bool m_bIsTopLevelDocumentWindow;
};
//====================================================================
@@ -208,7 +211,7 @@ namespace dbaui
if ( !xCompController.is() )
return;
- if ( _rData.m_bActive && _rData.m_bLivesInTopWindow )
+ if ( _rData.m_bActive && _rData.m_bIsTopLevelDocumentWindow )
{
// set the "current component" at the SfxObjectShell
Reference< XModel > xModel( xCompController->getModel() );
@@ -288,9 +291,21 @@ namespace dbaui
void ( SAL_CALL XTopWindow::*pListenerAction )( const Reference< XTopWindowListener >& ) =
_bRegister ? &XTopWindow::addTopWindowListener : &XTopWindow::removeTopWindowListener;
- Reference< XTopWindow > xFrameContainer( m_pData->m_xFrame->getContainerWindow(), UNO_QUERY );
+ const Reference< XWindow > xContainerWindow( m_pData->m_xFrame->getContainerWindow(), UNO_SET_THROW );
if ( _bRegister )
- m_pData->m_bLivesInTopWindow = xFrameContainer.is();
+ {
+ const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ ENSURE_OR_THROW( pContainerWindow, "no Window implementation for the frame's container window!" );
+
+ /*const Window* pContainerParentWindow = pContainerWindow->GetParent();
+ if ( pContainerParentWindow && ( pContainerParentWindow->GetType() == WINDOW_BORDERWINDOW ) )
+ pContainerParentWindow = pContainerParentWindow->GetParent();
+ m_pData->m_bIsTopLevelDocumentWindow = ( pContainerParentWindow == NULL );*/
+
+ m_pData->m_bIsTopLevelDocumentWindow = ( pContainerWindow->GetExtendedStyle() & WB_EXT_DOCUMENT ) != 0;
+ }
+
+ const Reference< XTopWindow > xFrameContainer( xContainerWindow, UNO_QUERY );
if ( xFrameContainer.is() )
(xFrameContainer.get()->*pListenerAction)( this );
}
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx
index 259834be1724..24debbe9bf7d 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -31,66 +31,30 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef DBACCESS_DATABASE_OBJECT_VIEW_HXX
#include "databaseobjectview.hxx"
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef DBACCESS_ASYNCMODALDIALOG_HXX
#include "asyncmodaldialog.hxx"
-#endif
/** === begin UNO includes === **/
-#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
#include <com/sun/star/frame/XDispatchProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
#include <com/sun/star/frame/XFrame.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XFRAMES_HPP_
#include <com/sun/star/frame/XFrames.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
#include <com/sun/star/sdb/CommandType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_APPLICATION_XTABLEUIPROVIDER_HPP_
#include <com/sun/star/sdb/application/XTableUIProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
#include <com/sun/star/beans/NamedValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HPP_
#include <com/sun/star/awt/Rectangle.hpp>
-#endif
/** === end UNO includes === **/
-#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
#include <comphelper/sequence.hxx>
-#endif
-#ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
#include <comphelper/namedvaluecollection.hxx>
-#endif
-
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
-#endif
-
-#ifndef _OSL_DIAGNOSE_H_
#include <osl/diagnose.h>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
+#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
-#endif
+#include <vcl/window.hxx>
// .........................................................................
namespace dbaui
@@ -183,6 +147,15 @@ namespace dbaui
lArgs[nArg++] <<= aProp;
m_xFrameLoader.set(xFact->createInstanceWithArguments(lArgs), UNO_QUERY_THROW);
+
+ // everything we load can be considered a "top level document", so set the respective bit at the window.
+ // This, amongst other things, triggers that the component in this task participates in the
+ // "ThisComponent"-game for the global application Basic.
+ const Reference< XFrame > xFrame( m_xFrameLoader, UNO_QUERY_THROW );
+ const Reference< XWindow > xFrameWindow( xFrame->getContainerWindow(), UNO_SET_THROW );
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xFrameWindow );
+ ENSURE_OR_THROW( pContainerWindow, "no implementation access to the frame's container window!" );
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
}
Reference< XComponentLoader > xFrameLoader( m_xFrameLoader, UNO_QUERY_THROW );
@@ -405,16 +378,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..6c94d9bc869c 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
@@ -1385,6 +1305,9 @@ namespace
// first extract the inner joins conditions
GetInnerJoinCriteria(_pView,pNodeTmp);
+ // now simplify again, join are checked in ComparisonPredicate
+ ::connectivity::OSQLParseNode::absorptions(pNodeTmp);
+ pNodeTmp = pNode->getChild(1);
// it could happen that pCondition is not more valid
eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pNodeTmp, rLevel);
@@ -1395,7 +1318,7 @@ namespace
SqlParseError GetANDCriteria( OQueryDesignView* _pView,
OSelectionBrowseBox* _pSelectionBrw,
const ::connectivity::OSQLParseNode * pCondition,
- const sal_uInt16 nLevel,
+ sal_uInt16& nLevel,
sal_Bool bHaving,
bool bAddOrOnOneLine);
//------------------------------------------------------------------------------
@@ -1432,7 +1355,11 @@ namespace
if ( SQL_ISRULE(pChild,search_condition) )
eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pChild,nLevel,bHaving,bAddOrOnOneLine);
else
- eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, bAddOrOnOneLine ? nLevel : nLevel++,bHaving, i == 0 ? false : bAddOrOnOneLine);
+ {
+ eErrorCode = GetANDCriteria(_pView,_pSelectionBrw,pChild, nLevel,bHaving, i == 0 ? false : bAddOrOnOneLine);
+ if ( !bAddOrOnOneLine)
+ nLevel++;
+ }
}
}
else
@@ -1466,7 +1393,7 @@ namespace
SqlParseError GetANDCriteria( OQueryDesignView* _pView,
OSelectionBrowseBox* _pSelectionBrw,
const ::connectivity::OSQLParseNode * pCondition,
- const sal_uInt16 nLevel,
+ sal_uInt16& nLevel,
sal_Bool bHaving,
bool bAddOrOnOneLine)
{
@@ -1480,10 +1407,18 @@ namespace
// Runde Klammern
if (SQL_ISRULE(pCondition,boolean_primary))
{
- sal_uInt16 nLevel2 = nLevel;
// check if we have to put the or criteria on one line.
- bool bMustAddOrOnOneLine = CheckOrCriteria(pCondition->getChild(1),NULL);
- eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pCondition->getChild(1), nLevel2,bHaving,bMustAddOrOnOneLine );
+ const ::connectivity::OSQLParseNode* pSearchCondition = pCondition->getChild(1);
+ bool bMustAddOrOnOneLine = CheckOrCriteria(pSearchCondition,NULL);
+ if ( SQL_ISRULE( pSearchCondition, search_condition) ) // we have a or
+ {
+ _pSelectionBrw->DuplicateConditionLevel( nLevel);
+ eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(0), nLevel,bHaving,bMustAddOrOnOneLine );
+ ++nLevel;
+ eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(2), nLevel,bHaving,bMustAddOrOnOneLine );
+ }
+ else
+ eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition, nLevel,bHaving,bMustAddOrOnOneLine );
}
// Das erste Element ist (wieder) eine AND-Verknuepfung
else if ( SQL_ISRULE(pCondition,boolean_term) )
@@ -1579,10 +1514,32 @@ namespace
_pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine);
}
}
+ else
+ {
+ // Funktions-Bedingung parsen
+ ::rtl::OUString sCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,1);
+ Reference< XConnection> xConnection = rController.getConnection();
+ Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData();
+ // the international doesn't matter I have a string
+ ::rtl::OUString sName;
+ pCondition->getChild(0)->parseNodeToPredicateStr(sName,
+ xConnection,
+ rController.getNumberFormatter(),
+ aLocale,
+ static_cast<sal_Char>(sDecimal.toChar()),
+ &rController.getParser().getContext());
+
+ OTableFieldDescRef aDragLeft = new OTableFieldDesc();
+ aDragLeft->SetField(sName);
+ aDragLeft->SetFunctionType(FKT_OTHER);
+
+ if ( bHaving )
+ aDragLeft->SetGroupBy(sal_True);
+ _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine);
+ }
}
else if( SQL_ISRULEOR2(pCondition,existence_test,unique_test) )
{
-
// Funktions-Bedingung parsen
::rtl::OUString aCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,0);
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 6b48bc528776..05c001751fef 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1836,6 +1836,32 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt
}
}
//------------------------------------------------------------------------------
+void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel)
+{
+ DBG_CHKTHIS(OSelectionBrowseBox,NULL);
+ const sal_uInt16 nNewLevel = nLevel +1;
+ OTableFields& rFields = getFields();
+ OTableFields::iterator aIter = rFields.begin();
+ OTableFields::iterator aEnd = rFields.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ OTableFieldDescRef pEntry = *aIter;
+
+ ::rtl::OUString sValue = pEntry->GetCriteria(nLevel);
+ if ( sValue.getLength() )
+ {
+ pEntry->SetCriteria( nNewLevel, sValue);
+ if ( nNewLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1) )
+ {
+ RowInserted( GetRowCount()-1, 1, TRUE );
+ m_bVisibleRow.push_back(sal_True);
+ ++m_nVisibleCount;
+ }
+ m_bVisibleRow[BROW_CRIT1_ROW + nNewLevel] = sal_True;
+ } // if (!pEntry->GetCriteria(nLevel).getLength() )
+ } // for(;aIter != getFields().end();++aIter)
+}
+//------------------------------------------------------------------------------
void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine )
{
Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection();
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
index 1d4a188dab9d..c92ce7caf7f0 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
@@ -132,6 +132,7 @@ namespace dbaui
const String& rValue,
const sal_uInt16 nLevel,
bool _bAddOrOnOneLine );
+ void DuplicateConditionLevel( const sal_uInt16 nLevel);
void AddOrder(const OTableFieldDescRef& rInfo, const EOrderDir eDir, sal_uInt32 _nCurrentPos);
void ClearAll();
OTableFieldDescRef AppendNewCol( sal_uInt16 nCnt=1 );
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index ea1095258261..4cf7c9c5abc9 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -122,6 +122,9 @@ void SAL_CALL ImportDocumentHandler::startDocument() throw (uno::RuntimeExceptio
void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, xml::sax::SAXException)
{
m_xDelegatee->endDocument();
+ uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
+ if ( xReceiver.is() )
+ xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
}
void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException)
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 2055f1ee5358..ea04c7c2d300 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -505,7 +505,7 @@ void OReportSection::Command( const CommandEvent& _rCEvt )
case COMMAND_CONTEXTMENU:
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- BOOL bHiContrast = rSettings.GetMenuColor().IsDark();
+ BOOL bHiContrast = rSettings.GetHighContrastMode();
OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController();
uno::Reference<frame::XFrame> xFrame = rController.getFrame();
PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) );
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index d87f7464a140..5a22e9cff5ed 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -194,7 +194,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
void OStartMarker::changeImage()
{
Image* pImage = NULL;
- if ( GetDisplayBackground().GetColor().IsDark() )
+ if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC;
else
pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
@@ -212,7 +212,7 @@ void OStartMarker::initDefaultNodeImages()
}
Image* pImage = NULL;
- if ( GetDisplayBackground().GetColor().IsDark() )
+ if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
{
pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC;
}