summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2008-11-19 17:43:08 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2008-11-19 17:43:08 +0000
commit0e8ff6898609c3291ec605f8e97450fb2735290a (patch)
treeab7b6860136a46d4fce9f8c06c0f4933b014ddf4
parent5524ea27e2162f33c37baeb3de1ae41ba850b919 (diff)
CWS-TOOLING: integrate CWS dba301a_DEV300
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx51
-rw-r--r--dbaccess/source/core/misc/DatabaseDataProvider.cxx5
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx7
-rw-r--r--dbaccess/source/ui/inc/TableWindowAccess.hxx4
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx13
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx15
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx4
7 files changed, 85 insertions, 14 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index a224dff54087..fe01e88509b1 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -65,6 +65,7 @@
/** === end UNO includes === **/
#include <comphelper/documentconstants.hxx>
+#include <comphelper/interaction.hxx>
#include <comphelper/enumhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -72,6 +73,9 @@
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <framework/titlehelper.hxx>
+#include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp>
+#include <com/sun/star/task/InteractionClassification.hpp>
+#include <com/sun/star/task/XInteractionAskLater.hpp>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <tools/errcode.hxx>
@@ -84,6 +88,8 @@
#define MAP_LEN(x) x, sizeof(x) - 1
+#define MAP_LEN(x) x, sizeof(x) - 1
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
@@ -370,6 +376,21 @@ void ODatabaseDocument::impl_import_throw( const ::comphelper::NamedValueCollect
Reference< XStatusIndicator > xStatusIndicator;
lcl_extractAndStartStatusIndicator( _rResource, xStatusIndicator, aFilterArgs );
+ /** property map for import info set */
+ comphelper::PropertyMapEntry aExportInfoMap[] =
+ {
+ { MAP_LEN( "BaseURI"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "StreamName"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 },
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(_rResource.getOrDefault("URL",::rtl::OUString())));
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"))));
+
+ const sal_Int32 nCount = aFilterArgs.getLength();
+ aFilterArgs.realloc(nCount + 1);
+ aFilterArgs[nCount] <<= xInfoSet;
+
Reference< XImporter > xImporter(
m_pImpl->m_aContext.createComponentWithArguments( "com.sun.star.comp.sdb.DBFilter", aFilterArgs ),
UNO_QUERY_THROW );
@@ -510,6 +531,36 @@ void SAL_CALL ODatabaseDocument::connectController( const Reference< XController
// check/adjust our macro mode.
m_pImpl->checkMacrosOnLoading();
+
+ // If we encounter a document which already contains macros in the document storage (instead of
+ // macros in the form's/report's storages), then this has been written by a newer version of OOo (>=3.1).
+ // In this case, warn the user, too.
+ if ( m_pImpl->hasMacroStorages() )
+ {
+ ::comphelper::NamedValueCollection aArgs( m_pImpl->m_aArgs );
+ Reference< XInteractionHandler > xInteraction;
+ xInteraction = aArgs.getOrDefault( "InteractionHandler", xInteraction );
+ if ( xInteraction.is() )
+ {
+ FutureDocumentVersionProductUpdateRequest aUpdateRequest;
+ aUpdateRequest.Classification = InteractionClassification_QUERY;
+ aUpdateRequest.DocumentURL = getURL();
+
+ ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest = new ::comphelper::OInteractionRequest( makeAny( aUpdateRequest ) );
+ pRequest->addContinuation( new ::comphelper::OInteractionApprove );
+ pRequest->addContinuation( new ::comphelper::OInteractionDisapprove );
+ pRequest->addContinuation( new ::comphelper::OInteraction< XInteractionAskLater >() );
+
+ try
+ {
+ xInteraction->handle( pRequest.get() );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 981d66e3ad65..d6851cf14901 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DatabaseDataProvider.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.34.1 $
*
* This file is part of OpenOffice.org.
*
@@ -39,6 +39,7 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/sdb/XCompletedExecution.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
@@ -71,7 +72,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
m_aParameterManager( m_aMutex, uno::Reference< lang::XMultiServiceFactory >(context->getServiceManager(),uno::UNO_QUERY) ),
m_aFilterManager( uno::Reference< lang::XMultiServiceFactory >(context->getServiceManager(),uno::UNO_QUERY) ),
m_xContext(context),
- m_CommandType(0),
+ m_CommandType(sdb::CommandType::COMMAND), // #i94114
m_RowLimit(0),
m_EscapeProcessing(sal_True),
m_ApplyFilter(sal_False)
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 2a8e075ce93c..cef28b731c2d 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -58,6 +58,7 @@
#include <tools/diagnose_ex.h>
#endif
#include <comphelper/sequence.hxx>
+#include <svtools/filenotation.hxx>
#include "dsntypes.hxx"
namespace dbaxml
{
@@ -95,7 +96,11 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
switch( rTokenMap.Get( nPrefix, sLocalName ) )
{
case XML_TOK_DB_HREF:
- sLocation = sValue;
+ {
+ sLocation = ::svt::OFileNotation(rImport.GetAbsoluteReference(sValue)).get( ::svt::OFileNotation::N_SYSTEM );
+ if ( sLocation.getLength() == 0 )
+ sLocation = sValue;
+ }
break;
case XML_TOK_MEDIA_TYPE:
sMediaType = sValue;
diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx
index e351f7135011..1684a6385a9b 100644
--- a/dbaccess/source/ui/inc/TableWindowAccess.hxx
+++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindowAccess.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.74.1 $
*
* This file is part of OpenOffice.org.
*
@@ -64,6 +64,8 @@ namespace dbaui
@return true if it is editable otherwise false
*/
virtual sal_Bool isEditable() const;
+
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
public:
OTableWindowAccess( OTableWindow* _pTable);
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index d6fcba7dbe67..8372f6689347 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -641,15 +641,11 @@ namespace
}
else if(pEntryTabTo == pEntryConn->GetDestWin())
{
- ::rtl::OUString aTmpJoin('(');
- (aTmpJoin += aJoin) += ::rtl::OUString(')');
- aJoin = BuildJoin(_xConnection,aTmpJoin,pEntryTabTo,pEntryConnData);
+ aJoin = BuildJoin(_xConnection,aJoin,pEntryTabTo,pEntryConnData);
}
else if(pEntryTabTo == pEntryConn->GetSourceWin())
{
- ::rtl::OUString aTmpJoin('(');
- (aTmpJoin += aJoin) += ::rtl::OUString(')');
- aJoin = BuildJoin(_xConnection,pEntryTabTo,aTmpJoin,pEntryConnData);
+ aJoin = BuildJoin(_xConnection,pEntryTabTo,aJoin,pEntryConnData);
}
pEntryConn->SetVisited(sal_True);
@@ -1912,6 +1908,11 @@ namespace
sal_Bool bRet = sal_True;
if (SQL_ISRULE(_pNode,qualified_join))
pJoinNode = _pNode;
+ else if (SQL_ISRULE(_pNode,table_ref)
+ && _pNode->count() == 3
+ && SQL_ISPUNCTUATION(_pNode->getChild(0),"(")
+ && SQL_ISPUNCTUATION(_pNode->getChild(2),")") ) // '(' joined_table ')'
+ pJoinNode = _pNode->getChild(1);
else if (! ( SQL_ISRULE(_pNode, table_ref) && _pNode->count() == 2) ) // table_node table_primary_as_range_column
bRet = sal_False;
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index 13e843f3552a..9db1be38959f 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableWindowAccess.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.34.2 $
*
* This file is part of OpenOffice.org.
*
@@ -92,6 +92,17 @@ namespace dbaui
VCLXAccessibleComponent::disposing();
}
// -----------------------------------------------------------------------------
+ void OTableWindowAccess::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
+ {
+ if ( rVclWindowEvent.GetId() == VCLEVENT_OBJECT_DYING )
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_pTable = NULL;
+ }
+
+ VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
+ }
+ // -----------------------------------------------------------------------------
Any SAL_CALL OTableWindowAccess::queryInterface( const Type& aType ) throw (RuntimeException)
{
Any aRet(VCLXAccessibleComponent::queryInterface( aType ));
@@ -255,7 +266,7 @@ namespace dbaui
{
::osl::MutexGuard aGuard( m_aMutex );
return AccessibleRelationType::CONTROLLER_FOR == aRelationType
- && m_pTable->getTableView()->ExistsAConn(m_pTable);
+ && m_pTable && m_pTable->getTableView()->ExistsAConn(m_pTable);
}
// -----------------------------------------------------------------------------
AccessibleRelation SAL_CALL OTableWindowAccess::getRelationByType( sal_Int16 aRelationType ) throw (RuntimeException)
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 3b2a4b7b9614..0f7ab046cc41 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1496,9 +1496,9 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
OSL_ENSURE(0,"Exception Caught: Could not commit report storage!");
throw io::IOException();
}
- if ( xStatusIndicator.is() )
- setModified(sal_False);
+ if ( _xStorageToSaveTo == m_pImpl->m_xStorage )
+ setModified(sal_False);
}
if ( xStatusIndicator.is() )
xStatusIndicator->end();