summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2009-11-27 10:17:16 +0100
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2009-11-27 10:17:16 +0100
commit05bb4138d25b8adcec7f9b69398163986f258073 (patch)
tree44c248a4baa0afd242240fe661f4d87de93de1ff /dbaccess/source/ui
parent8a3694e8aa6b04a4347b32daac1b22d5200ab1f4 (diff)
dba33d: #i106772# check if update and refetching works otherwise set iter to end and some resource handling for error messages
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx173
-rw-r--r--dbaccess/source/ui/app/app.src8
-rw-r--r--dbaccess/source/ui/app/dbu_app.hrc5
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx2
-rw-r--r--dbaccess/source/ui/inc/dbu_uno.hrc5
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx12
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.src12
7 files changed, 71 insertions, 146 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index b87b7706d87f..2664436ade4c 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -79,160 +79,68 @@
#include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
/** === end UNO includes === **/
-
-#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
-#endif
-#ifndef SVTOOLS_URIHELPER_HXX
+#include <tools/string.hxx>
+
#include <svtools/urihelper.hxx>
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_
+#include <svtools/pathoptions.hxx>
+#include <svtools/internaloptions.hxx>
+#include <svtools/moduleoptions.hxx>
+#include <svtools/svtreebx.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/cliplistener.hxx>
+#include <svtools/svlbitm.hxx>
+#include <svtools/historyoptions.hxx>
+#include <svtools/filenotation.hxx>
+#include <svtools/insdlg.hxx>
+
+#include <unotools/tempfile.hxx>
+
+#include <comphelper/sequence.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
-#endif
-#ifndef _COMPHELPER_INTERACTION_HXX_
#include <comphelper/interaction.hxx>
-#endif
-#ifndef COMPHELPER_COMPONENTCONTEXT_HXX
#include <comphelper/componentcontext.hxx>
-#endif
-#ifndef _SV_MSGBOX_HXX
+
#include <vcl/msgbox.hxx>
-#endif
-#ifndef _VCL_STDTEXT_HXX
#include <vcl/stdtext.hxx>
-#endif
-#ifndef _FILEDLGHELPER_HXX
+#include <vcl/svapp.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <sfx2/mailmodelapi.hxx>
#include <sfx2/filedlghelper.hxx>
-#endif
-#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
+#include <sfx2/docfilt.hxx>
+#include <sfx2/QuerySaveDocument.hxx>
+
#include <cppuhelper/typeprovider.hxx>
-#endif
-#ifndef _CPPUHELPER_EXC_HLP_HXX_
#include <cppuhelper/exc_hlp.hxx>
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+
#include <connectivity/dbtools.hxx>
-#endif
-#ifndef DBAUI_APPVIEW_HXX
+#include <connectivity/dbexception.hxx>
+
+#include <svx/dbaexchange.hxx>
+#include <svx/dbaobjectex.hxx>
+#include <svx/svxdlg.hxx>
+
#include "AppView.hxx"
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
-#endif
-#ifndef _DBAU_REGHELPER_HXX_
#include "dbu_reghelper.hxx"
-#endif
-#ifndef _DBU_APP_HRC_
#include "dbu_app.hrc"
-#endif
-#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX
#include "defaultobjectnamecheck.hxx"
-#endif
-#ifndef _SV_MENU_HXX
-#include <vcl/menu.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
-#include <svtools/pathoptions.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX
-#include <svtools/internaloptions.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX_
-#include <comphelper/uno3.hxx>
-#endif
-#ifndef DBACCESS_DATABASE_OBJECT_VIEW_HXX
#include "databaseobjectview.hxx"
-#endif
-#ifndef _SV_SVAPP_HXX //autogen
-#include <vcl/svapp.hxx>
-#endif
-#ifndef _SVLBOXITM_HXX
-#include <svtools/svlbitm.hxx>
-#endif
-#ifndef _DBAUI_LISTVIEWITEMS_HXX_
#include "listviewitems.hxx"
-#endif
-
-#ifndef DBAUI_APPDETAILVIEW_HXX
#include "AppDetailView.hxx"
-#endif
-#ifndef _DBAUI_LINKEDDOCUMENTS_HXX_
#include "linkeddocuments.hxx"
-#endif
-#ifndef _SV_LSTBOX_HXX
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _DBHELPER_DBEXCEPTION_HXX_
-#include <connectivity/dbexception.hxx>
-#endif
-#ifndef _DBAUI_SQLMESSAGE_HXX_
#include "sqlmessage.hxx"
-#endif
-#ifndef _STRING_HXX
-#include <tools/string.hxx>
-#endif
-#ifndef INCLUDED_SFX_MAILMODELAPI_HXX
-#include <sfx2/mailmodelapi.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
-#include <svtools/moduleoptions.hxx>
-#endif
-#ifndef _SVTREEBOX_HXX
-#include <svtools/svtreebx.hxx>
-#endif
-#ifndef _TRANSFER_HXX
-#include <svtools/transfer.hxx>
-#endif
-#ifndef _CLIPLISTENER_HXX
-#include <svtools/cliplistener.hxx>
-#endif
-#ifndef _SVX_DBAEXCHANGE_HXX_
-#include <svx/dbaexchange.hxx>
-#endif
-#ifndef SVX_DBAOBJECTEX_HXX
-#include <svx/dbaobjectex.hxx>
-#endif
-#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
-#ifndef _DBAUI_DSNTYPES_HXX_
#include "dsntypes.hxx"
-#endif
-#include <svx/svxdlg.hxx>
-#include <svtools/insdlg.hxx>
-#ifndef _UNOTOOLS_TEMPFILE_HXX
-#include <unotools/tempfile.hxx>
-#endif
-#ifndef _DBA_DBACCESS_HELPID_HRC_
#include "dbaccess_helpid.hrc"
-#endif
-#ifndef DBAUI_DLGSAVE_HXX
#include "dlgsave.hxx"
-#endif
-#ifndef _SFX_DOCFILT_HACK_HXX
-#include <sfx2/docfilt.hxx>
-#endif
-#ifndef SFX_QUERYSAVEDOCUMENT_HXX
-#include <sfx2/QuerySaveDocument.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
-#include <svtools/historyoptions.hxx>
-#endif
-#ifndef SVTOOLS_FILENOTATION_HXX_
-#include <svtools/filenotation.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
-#include <comphelper/sequence.hxx>
-#endif
-#ifndef _VOS_MUTEX_HXX_
#include <vos/mutex.hxx>
-#endif
-#ifndef _DBACCESS_SLOTID_HRC_
#include "dbaccess_slotid.hrc"
-#endif
#include <algorithm>
#include <functional>
@@ -2955,8 +2863,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
case DatabaseObjectContainer::REPORTS:
if ( eSelectedCategory != E_NONE )
throw IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "You cannot select different categories." ) ),
- // TODO: resource
+ String(ModuleRes(RID_STR_NO_DIFF_CAT)),
*this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) );
eSelectedCategory =
( pObject->Type == DatabaseObjectContainer::TABLES ) ? E_TABLE
@@ -2969,13 +2876,9 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
default:
case DatabaseObjectContainer::DATA_SOURCE:
{
- ::rtl::OUStringBuffer aMessage;
- aMessage.appendAscii( "Unsupported object type found (" );
- aMessage.append ( sal_Int32( pObject->Type ) );
- aMessage.appendAscii( ")." );
- // TODO: resource
- throw IllegalArgumentException(
- aMessage.makeStringAndClear(), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) );
+ ::rtl::OUString sMessage = String(ModuleRes( RID_STR_UNSUPPORTED_OBJECT_TYPE ));
+ ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$type$", ::rtl::OUString::valueOf(sal_Int32( pObject->Type )) );
+ throw IllegalArgumentException(sMessage, *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ));
}
}
}
diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src
index c913d16ebd2d..9aff7f73d992 100644
--- a/dbaccess/source/ui/app/app.src
+++ b/dbaccess/source/ui/app/app.src
@@ -469,3 +469,11 @@ String RID_STR_EMBEDDED_DATABASE
{
Text [ en-US ] = "Embedded database";
};
+String RID_STR_NO_DIFF_CAT
+{
+ Text [ en-US ] = "You cannot select different categories.";
+};
+String RID_STR_UNSUPPORTED_OBJECT_TYPE
+{
+ Text [ en-US ] = "Unsupported object type found ($type$).";
+};
diff --git a/dbaccess/source/ui/app/dbu_app.hrc b/dbaccess/source/ui/app/dbu_app.hrc
index 63aa923ce30f..5b4aee52304e 100644
--- a/dbaccess/source/ui/app/dbu_app.hrc
+++ b/dbaccess/source/ui/app/dbu_app.hrc
@@ -68,11 +68,12 @@
#define RID_STR_FORMS_HELP_TEXT_WIZARD RID_STR_APP_START + 29
#define RID_STR_REPORT_HELP_TEXT RID_STR_APP_START + 30
#define RID_STR_EMBEDDED_DATABASE RID_STR_APP_START + 31
-
+#define RID_STR_NO_DIFF_CAT RID_STR_APP_START + 32
+#define RID_STR_UNSUPPORTED_OBJECT_TYPE RID_STR_APP_START + 33
// please adjust checking before insert new strings
-#if RID_STR_EMBEDDED_DATABASE > RID_STR_APP_END
+#if RID_STR_UNSUPPORTED_OBJECT_TYPE > RID_STR_APP_END
#error Resource-Id Ueberlauf in #file, #line
#endif
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index 16859283c9b7..51121b022e88 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -166,7 +166,7 @@ void SbaTableQueryBrowser::SelectionChanged()
InvalidateFeature(ID_BROWSER_INSERTCONTENT);
InvalidateFeature(ID_BROWSER_FORMLETTER);
} // if ( !m_bShowMenu )
- InvalidateFeature(ID_BROWSER_COPY);
+ InvalidateFeature(ID_BROWSER_COPY);
InvalidateFeature(ID_BROWSER_CUT);
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/inc/dbu_uno.hrc b/dbaccess/source/ui/inc/dbu_uno.hrc
index acd15c94c7ef..6aec13955ac0 100644
--- a/dbaccess/source/ui/inc/dbu_uno.hrc
+++ b/dbaccess/source/ui/inc/dbu_uno.hrc
@@ -43,9 +43,12 @@
#define STR_CTW_UNSUPPORTED_COLUMN_TYPE ( RID_STR_UNO_START + 6 )
#define STR_CTW_ILLEGAL_PARAMETER_COUNT ( RID_STR_UNO_START + 7 )
#define STR_CTW_ERROR_DURING_INITIALIZATION ( RID_STR_UNO_START + 8 )
+#define STR_CTW_ERROR_UNSUPPORTED_SETTING ( RID_STR_UNO_START + 9 )
+#define STR_CTW_ERROR_NO_QUERY ( RID_STR_UNO_START + 10 )
+#define STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ( RID_STR_UNO_START + 11 )
// please adjust when inserting new strings:
-#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_DURING_INITIALIZATION
+#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_INVALID_INTERACTIONHANDLER
#if RID_STR_UNO_LAST_USED >= RID_STR_UNO_END
#error too many resources in uno ....
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 159d447ae554..aa2b87fca329 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -70,6 +70,7 @@
#include <comphelper/interaction.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/proparrhlp.hxx>
+#include <comphelper/string.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -775,9 +776,8 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
if ( sUnsupportedSetting.getLength() != 0 )
{
- ::rtl::OUString sMessage( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported setting in the copy source descriptor: $name$." ) ) );
- // TODO: resource
- sMessage = sMessage.replaceAt( sMessage.indexOfAsciiL( "$name$", 6 ), 6, sUnsupportedSetting );
+ ::rtl::OUString sMessage( String(ModuleRes( STR_CTW_ERROR_UNSUPPORTED_SETTING )) );
+ ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$name$", sUnsupportedSetting );
throw IllegalArgumentException(
sMessage,
*const_cast< CopyTableWizard* >( this ),
@@ -849,8 +849,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
if ( _out_rCommandType == CommandType::QUERY )
// we cannot copy a query if the connection cannot provide it ...
throw IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "To copy a query, your connection must be able to provide queries." ) ),
- // TODO: resource
+ String(ModuleRes( STR_CTW_ERROR_NO_QUERY )),
*const_cast< CopyTableWizard* >( this ),
1
);
@@ -1516,8 +1515,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments )
{ // ->createWithInteractionHandler
if ( !( _rArguments[2] >>= m_xInteractionHandler ) )
throw IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The given interaction handler is invalid." ) ),
- // TODO: resource
+ String(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )),
*this,
3
);
diff --git a/dbaccess/source/ui/uno/copytablewizard.src b/dbaccess/source/ui/uno/copytablewizard.src
index 07db51196ce2..4bb6efc839cc 100644
--- a/dbaccess/source/ui/uno/copytablewizard.src
+++ b/dbaccess/source/ui/uno/copytablewizard.src
@@ -69,3 +69,15 @@ String STR_CTW_ERROR_DURING_INITIALIZATION
{
Text [ en-US ] = "An error occurred during initialization.";
};
+String STR_CTW_ERROR_UNSUPPORTED_SETTING
+{
+ Text [ en-US ] = "Unsupported setting in the copy source descriptor: $name$.";
+};
+String STR_CTW_ERROR_NO_QUERY
+{
+ Text [ en-US ] = "To copy a query, your connection must be able to provide queries.";
+};
+String STR_CTW_ERROR_INVALID_INTERACTIONHANDLER
+{
+ Text [ en-US ] = "The given interaction handler is invalid.";
+};