summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/app
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/app')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx176
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx43
-rw-r--r--dbaccess/source/ui/app/app.src8
-rw-r--r--dbaccess/source/ui/app/dbu_app.hrc5
4 files changed, 73 insertions, 159 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 57f38d324b5c..20671471d863 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -80,159 +80,70 @@
#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 <svl/urihelper.hxx>
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_
+#include <svl/filenotation.hxx>
+
+#include <svtools/svtreebx.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/cliplistener.hxx>
+#include <svtools/svlbitm.hxx>
+#include <svtools/insdlg.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 <unotools/pathoptions.hxx>
+#include <unotools/tempfile.hxx>
+#include <unotools/internaloptions.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <unotools/historyoptions.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 <vos/mutex.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 <unotools/pathoptions.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX
-#include <unotools/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 <unotools/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 <unotools/historyoptions.hxx>
-#endif
-#ifndef SVTOOLS_FILENOTATION_HXX_
-#include <svl/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 +2866,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 +2879,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/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 50e357b687b8..fbc5b8d0c359 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -93,9 +93,6 @@
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/helper/vclunohelper.hxx>
#endif
-#ifndef _COM_SUN_STAR_UCB_XCONTENTCREATOR_HPP_
-#include <com/sun/star/ucb/XContentCreator.hpp>
-#endif
#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#endif
@@ -256,7 +253,7 @@ namespace
EnableInput(FALSE);
return 0L;
}
- // -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
void OTablePreviewWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -268,7 +265,7 @@ namespace
Invalidate();
}
}
- // -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
void OTablePreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -634,13 +631,13 @@ sal_Bool OAppDetailPageHelper::isCutAllowed()
// -----------------------------------------------------------------------------
sal_Bool OAppDetailPageHelper::isCopyAllowed()
{
- // int nPos = getVisibleControlIndex();
+ //int nPos = getVisibleControlIndex();
return sal_True;
}
// -----------------------------------------------------------------------------
sal_Bool OAppDetailPageHelper::isPasteAllowed()
{
- // int nPos = getVisibleControlIndex();
+ //int nPos = getVisibleControlIndex();
return sal_True;
}
// -----------------------------------------------------------------------------
@@ -658,6 +655,8 @@ void OAppDetailPageHelper::paste()
// -----------------------------------------------------------------------------
bool OAppDetailPageHelper::isLeaf(SvLBoxEntry* _pEntry) const
{
+ if ( !_pEntry )
+ return false;
sal_Int32 nEntryType = reinterpret_cast< sal_IntPtr >( _pEntry->GetUserData() );
if ( ( nEntryType == DatabaseObjectContainer::TABLES )
|| ( nEntryType == DatabaseObjectContainer::CATALOG )
@@ -1099,8 +1098,8 @@ void OAppDetailPageHelper::Resize()
//////////////////////////////////////////////////////////////////////
// Abmessungen parent window
Size aOutputSize( GetOutputSize() );
- long nOutputWidth = aOutputSize.Width();
- long nOutputHeight = aOutputSize.Height();
+ long nOutputWidth = aOutputSize.Width();
+ long nOutputHeight = aOutputSize.Height();
Window* pWindow = getCurrentView();
if ( pWindow )
@@ -1115,12 +1114,12 @@ void OAppDetailPageHelper::Resize()
String sText = m_aTBPreview.GetItemText(SID_DB_APP_DISABLE_PREVIEW);
Size aTBSize = m_aTBPreview.CalcWindowSizePixel();
- m_aTBPreview.SetPosSizePixel( Point(nOutputWidth - aTBSize.getWidth(), 0 ),
- aTBSize );
+ m_aTBPreview.SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ),
+ aTBSize );
- m_aBorder.SetPosSizePixel( Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ),
- Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) );
- m_aPreview.SetPosSizePixel( Point(0,0),m_aBorder.GetSizePixel() );
+ m_aBorder.SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ),
+ Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) );
+ m_aPreview.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
m_aDocumentInfo.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
}
@@ -1237,9 +1236,9 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent)
// Why the below code? It might have side effects, as the tree view needs to know
// its current selection for other purposes than the preview, too.
-// DBTreeListBox* pTreeView = getCurrentView();
-// if ( pTreeView )
-// pTreeView->clearCurrentSelection();
+// DBTreeListBox* pTreeView = getCurrentView();
+// if ( pTreeView )
+// pTreeView->clearCurrentSelection();
}
}
catch( const Exception& )
@@ -1386,7 +1385,7 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
(rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
(rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
@@ -1445,9 +1444,9 @@ OPreviewWindow::OPreviewWindow(Window* _pParent)
// -----------------------------------------------------------------------------
BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const
{
- const Size aWinSize( GetOutputSizePixel() );
- Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) );
- BOOL bRet = FALSE;
+ const Size aWinSize( GetOutputSizePixel() );
+ Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) );
+ BOOL bRet = FALSE;
if( aNewSize.Width() && aNewSize.Height() )
{
@@ -1505,7 +1504,7 @@ void OPreviewWindow::DataChanged( const DataChangedEvent& rDCEvt )
Invalidate();
}
}
-// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
void OPreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
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