summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-08-26 10:09:17 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-08-26 10:09:17 +0000
commit89ca2412500ba32d18c94dee9630f6df8d74ced2 (patch)
treed40909ad7737babfcb9acca178902593ed830f2a /dbaccess/source/ui
parentb7002f10a38c89573bc2a0b260762df9a4642277 (diff)
CWS-TOOLING: integrate CWS dba32e
2009-08-10 13:16:25 +0200 fs r274805 : #i84390# typo corrected 2009-08-10 13:04:28 +0200 fs r274804 : #i103741# properly terminate the last token in a string with a 0 byte 2009-07-24 08:54:05 +0200 msc r274286 : #103219# changed long name 2009-07-24 08:42:28 +0200 msc r274285 : #i79649# changed behaviour of the wizard 2009-07-22 14:17:49 +0200 oj r274238 : GrabFocus 2009-07-22 13:38:01 +0200 oj r274232 : #i102934# mixed up 2009-07-22 13:37:16 +0200 oj r274231 : #i102934# mixed up 2009-07-21 12:30:36 +0200 oj r274176 : crash when using distinct 2009-07-21 10:03:44 +0200 oj r274163 : set last char to 0 2009-07-21 09:31:22 +0200 oj r274161 : mediatype corrected 2009-07-20 11:45:33 +0200 fs r274118 : typo in formatting string 2009-07-20 11:40:39 +0200 fs r274117 : removed unused include 2009-07-20 11:40:01 +0200 fs r274116 : class name corrected 2009-07-16 13:41:45 +0200 oj r274046 : i101587 wrong check for embeddeddatabase url in confguration, have to check path 2009-07-16 13:12:05 +0200 tbo r274044 : #i103219# adjust declarion to new hid.lst 2009-07-16 12:43:48 +0200 oj r274041 : #i102497# check also fot longvarchar 2009-07-16 12:15:41 +0200 oj r274039 : #i103030# handle type description and exceptions as well 2009-07-16 11:14:26 +0200 fs r274035 : let SVN ignore output paths 2009-07-16 09:23:43 +0200 fs r274030 : TransforFormComponentProperties: no need to check for attribute equality 2009-07-10 14:16:23 +0200 oj r273892 : CWS-TOOLING: rebase CWS dba32e to trunk@273858 (milestone: DEV300:m52) 2009-07-01 21:41:50 +0200 fs r273614 : #i10000# 2009-07-01 15:01:10 +0200 fs r273589 : Input required doesn't make sense at all in XML form documents 2009-07-01 12:10:31 +0200 fs r273562 : updated 2009-07-01 11:46:12 +0200 fs r273560 : #i103219# add about 100 missing long names 2009-07-01 10:11:41 +0200 fs r273551 : moved from socket/port usage to pipe/name usage, which is more common nowadays 2009-07-01 09:50:03 +0200 fs r273549 : removed obsolete (empty) folder 2009-07-01 09:47:35 +0200 fs r273548 : copied the code for the Accessibility Workbench herein, formerly located in the old CVS repository, at gsl/awb 2009-06-30 10:07:47 +0200 fs r273493 : merging latest changes from CWS dba32d 2009-06-29 20:46:31 +0200 fs r273482 : #i103138# Rectangle conversions 2009-06-29 10:01:13 +0200 fs r273453 : #i103138# refactored the code for positioning/zooming the control Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to take an additional ViewTransformation parameter, describing the transformation to obtain the actual control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter. This has become necessary since during painting, the device which we created our control for might not necessarily have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size, this would lead to wrong results. Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken. Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ... I consider it broken, since: - we need the map mode to obtain the proper zoom level, which is to be forwarded to the control - there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears). It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand one has no possibility to obtain the current zoom by other means. Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used, which means the controls have a zoom of "1:1" set, which is wrong here. 2009-06-29 09:52:13 +0200 fs r273452 : during #i103138#: belongsToDevice is unused nowadays 2009-06-24 12:40:06 +0200 fs r273329 : #i102888# #i102899# 2009-06-24 12:10:29 +0200 oj r273327 : #i103030# some code changes 2009-06-24 09:44:14 +0200 oj r273311 : #i103030# some code changes 2009-06-24 09:24:42 +0200 oj r273309 : #i103030# add log 2009-06-24 09:03:29 +0200 fs r273308 : if a col's table name is schema.table, properly quote all parts 2009-06-24 08:56:06 +0200 oj r273307 : #i102691# changed string 2009-06-23 13:31:43 +0200 oj r273280 : #i102479# fix date, time and datetime 2009-06-23 12:51:28 +0200 oj r273277 : #i103020# clear old expression when updating to avoid dead pointers in treelist userdata 2009-06-23 12:17:16 +0200 oj r273275 : #i103030# add LogBridge 2009-06-23 11:53:10 +0200 oj r273272 : shawdowed var resolved 2009-06-23 11:48:49 +0200 oj r273270 : #i103030# add :log to uno env if var UNO_ENV_LOG is set 2009-06-23 11:47:47 +0200 oj r273269 : #i103030# add LogBridge 2009-06-23 11:47:11 +0200 oj r273268 : #i103030# add LogBridge 2009-06-23 08:05:08 +0200 oj r273253 : #i102934# add key for collapsing 2009-06-22 13:21:33 +0200 fs r273225 : merging latest changes from CWS dba32d 2009-06-22 13:15:22 +0200 fs r273221 : why restrict to 12 entries? 2009-06-22 08:12:21 +0200 oj r273196 : #i102655# choosen > chosen typo fixed 2009-06-22 08:08:04 +0200 oj r273195 : #i102657# typo fix 2009-06-22 08:06:28 +0200 oj r273194 : #i102934# expanding and collasping of section 2009-06-22 08:05:52 +0200 oj r273193 : #i102930# set focus in treelistbox 2009-06-22 08:04:56 +0200 oj r273192 : #i102929# enable tabstop 2009-06-19 13:18:26 +0200 oj r273157 : remove unused param 2009-06-19 10:07:05 +0200 oj r273149 : CWS-TOOLING: rebase CWS dba32e to trunk@272827 (milestone: DEV300:m50) 2009-06-19 07:32:40 +0200 oj r273146 : merge from dba32d to dba32e 2009-06-19 07:22:56 +0200 oj r273145 : merge from dba32d to dba32e 2009-06-19 07:22:33 +0200 oj r273144 : merge from dba32d to dba32e 2009-06-18 14:09:34 +0200 fs r273116 : merging the latest changes from CWS dba32d (up to revision 273108) herein, which effectively is a rebase to DEV300.m50 2009-06-18 08:50:35 +0200 oj r273098 : #i102894# fix for new line in text 2009-06-18 08:28:48 +0200 oj r273097 : #i102892# check any 2009-06-18 08:21:34 +0200 oj r273096 : check if error is valid 2009-06-16 13:49:28 +0200 fs r273019 : why make a drop down control by default? The form control factory in SVX does this better those days ... 2009-06-10 09:53:20 +0200 oj r272797 : add lic text 2009-06-10 09:48:55 +0200 oj r272796 : test added for i101618 2009-06-09 14:57:39 +0200 oj r272771 : #i101618# access database document only when script container is needed 2009-06-09 12:42:25 +0200 oj r272765 : #i102497# check type property 2009-06-09 12:32:49 +0200 oj r272764 : adjust test cases 2009-06-09 12:31:58 +0200 oj r272763 : adjust test cases 2009-06-09 12:31:22 +0200 oj r272762 : adjust test cases 2009-06-09 11:35:42 +0200 oj r272761 : check if error is valid 2009-06-09 11:29:42 +0200 oj r272760 : #i102497# longvarchar was missing 2009-06-08 14:52:49 +0200 fs r272733 : #i102564# when setting a new field, also set m_nFieldType 2009-06-08 13:51:20 +0200 oj r272730 : add tests 2009-06-05 14:38:01 +0200 oj r272686 : add dep 2009-06-05 14:35:00 +0200 oj r272684 : add new tests 2009-06-05 13:41:18 +0200 oj r272681 : code clean ups 2009-06-05 12:40:51 +0200 oj r272678 : code cleanup 2009-06-05 12:02:57 +0200 oj r272677 : code cleanup 2009-06-05 10:42:38 +0200 oj r272670 : #i49320# impl export of single rows and as RTF and HTML 2009-06-03 14:30:37 +0200 oj r272576 : #i79649# check if file matches filter wildcard 2009-06-03 13:41:57 +0200 oj r272560 : #i102470# impl not b like 'c'
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx2
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx72
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx27
-rw-r--r--dbaccess/source/ui/browser/dbexchange.cxx18
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx4
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx38
-rw-r--r--dbaccess/source/ui/browser/sbagrid.src4
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx50
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx5
-rw-r--r--dbaccess/source/ui/dlg/makefile.mk2
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx13
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx9
-rw-r--r--dbaccess/source/ui/inc/IUpdateHelper.hxx7
-rw-r--r--dbaccess/source/ui/inc/TokenWriter.hxx2
-rw-r--r--dbaccess/source/ui/inc/dbexchange.hxx5
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hxx7
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx1
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx14
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx148
-rw-r--r--dbaccess/source/ui/misc/UpdateHelperImpl.hxx27
-rw-r--r--dbaccess/source/ui/misc/dbumiscres.src6
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx3
-rw-r--r--dbaccess/source/ui/relationdesign/relation.src2
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescriptions.cxx12
24 files changed, 325 insertions, 153 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 99c29398fc33..b87b7706d87f 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -155,7 +155,7 @@
#ifndef _DBAUI_LISTVIEWITEMS_HXX_
#include "listviewitems.hxx"
#endif
-#include "ExtensionNotPresent.hxx"
+
#ifndef DBAUI_APPDETAILVIEW_HXX
#include "AppDetailView.hxx"
#endif
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index c532c0d45fe7..a509986e8849 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -719,19 +719,24 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc
}
// the target object name (as we'll suggest it to the user)
- String sTargetName;
- Reference< XNameAccess > xQueries;
+ ::rtl::OUString sTargetName;
try
{
- // the query container
- xQueries.set(getQueryDefintions(),UNO_QUERY);
- String aQueryDefaultName = String(ModuleRes(STR_QRY_TITLE));
- aQueryDefaultName = aQueryDefaultName.GetToken(0,' ');
- sTargetName = ::dbtools::createUniqueName(xQueries,aQueryDefaultName);
+ if ( CommandType::QUERY == nCommandType )
+ sTargetName = sCommand;
+
+ if ( !sTargetName.getLength() )
+ {
+ String sDefaultName = String( ModuleRes( STR_QRY_TITLE ) );
+ sDefaultName = sDefaultName.GetToken( 0, ' ' );
+
+ Reference< XNameAccess > xQueries( getQueryDefintions(), UNO_QUERY_THROW );
+ sTargetName = ::dbtools::createUniqueName( xQueries, sDefaultName, sal_False );
+ }
}
- catch(Exception)
+ catch(const Exception&)
{
- OSL_ENSURE(0,"could not create query default name!");
+ DBG_UNHANDLED_EXCEPTION();
}
Reference< XPropertySet > xQuery;
@@ -742,16 +747,14 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc
try
{
// the concrete query
- Reference< XDataSource > xDataSource( getDataSourceByName( sDataSourceName, getView(), getORB(), NULL ) );
- Reference< XQueryDefinitionsSupplier > xSourceQuerySup( xDataSource, UNO_QUERY );
- if ( xSourceQuerySup.is() )
- xQueries.set(xSourceQuerySup->getQueryDefinitions(),UNO_QUERY);
-
- if ( xQueries.is() && xQueries->hasByName(sCommand) )
+ Reference< XQueryDefinitionsSupplier > xSourceQuerySup(
+ getDataSourceByName( sDataSourceName, getView(), getORB(), NULL ),
+ UNO_QUERY_THROW );
+ Reference< XNameAccess > xQueries( xSourceQuerySup->getQueryDefinitions(), UNO_SET_THROW );
+ if ( xQueries->hasByName( sCommand ) )
{
- xQuery.set(xQueries->getByName(sCommand),UNO_QUERY);
- bSuccess = xQuery.is();
- xQueries.clear();
+ xQuery.set( xQueries->getByName(sCommand), UNO_QUERY_THROW );
+ bSuccess = true;
}
}
catch(SQLException&) { throw; } // caught and handled by the outer catch
@@ -780,19 +783,28 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc
// here we have everything needed to create a new query object ...
// ... ehm, except a new name
ensureConnection();
- DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );
- OSaveAsDlg aAskForName( getView(),
- CommandType::QUERY,
- getORB(),
- getConnection(),
- sTargetName,
- aNameChecker,
- SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
- if ( RET_OK != aAskForName.Execute() )
- // cancelled by the user
- return sal_False;
- sTargetName = aAskForName.getName();
+ DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );
+ ::dbtools::SQLExceptionInfo aDummy;
+ bool bNeedAskForName = ( sCommand.getLength() == 0 )
+ /* we did not have a source name, so the target name was auto-generated */
+ || ( !aNameChecker.isNameValid( sTargetName, aDummy ) );
+ /* name is invalid in the target DB (e.g. because it already
+ has a /table/ with that name) */
+ if ( bNeedAskForName )
+ {
+ OSaveAsDlg aAskForName( getView(),
+ CommandType::QUERY,
+ getORB(),
+ getConnection(),
+ sTargetName,
+ aNameChecker,
+ SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
+ if ( RET_OK != aAskForName.Execute() )
+ // cancelled by the user
+ return sal_False;
+ sTargetName = aAskForName.getName();
+ }
// create a new object
Reference< XPropertySet > xNewQuery(xQueryFactory->createInstance(), UNO_QUERY);
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 94160b21a134..ddfb583f65c9 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1344,8 +1344,11 @@ void SbaXDataBrowserController::frameAction(const ::com::sun::star::frame::Frame
//------------------------------------------------------------------------------
IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotInterestedIn */ )
{
- OSQLMessageBox aDlg( getBrowserView(), m_aCurrentError );
- aDlg.Execute();
+ if ( m_aCurrentError.isValid() )
+ {
+ OSQLMessageBox aDlg( getBrowserView(), m_aCurrentError );
+ aDlg.Execute();
+ }
return 0L;
}
@@ -1541,8 +1544,14 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const
}
break;
- case ID_BROWSER_PASTE:
case ID_BROWSER_COPY:
+ if ( getBrowserView()->getVclControl()->GetSelectRowCount() )
+ {
+ aReturn.bEnabled = m_aCurrentFrame.isActive();
+ break;
+ }
+ // run through
+ case ID_BROWSER_PASTE:
case ID_BROWSER_CUT:
{
CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
@@ -1988,6 +1997,12 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
break;
case ID_BROWSER_COPY:
+ if ( getBrowserView()->getVclControl()->GetSelectRowCount() > 0 )
+ {
+ getBrowserView()->getVclControl()->CopySelectedRowsToClipboard();
+ break;
+ }
+ // run through
case ID_BROWSER_CUT:
case ID_BROWSER_PASTE:
{
@@ -2002,9 +2017,9 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
Edit& rEdit = (Edit&)xCurrentController->GetWindow();
switch (nId)
{
- case ID_BROWSER_CUT : rEdit.Cut(); break;
- case SID_COPY : rEdit.Copy(); break;
- case ID_BROWSER_PASTE : rEdit.Paste(); break;
+ case ID_BROWSER_CUT : rEdit.Cut(); break;
+ case SID_COPY : rEdit.Copy(); break;
+ case ID_BROWSER_PASTE : rEdit.Paste(); break;
}
if (ID_BROWSER_CUT == nId || ID_BROWSER_PASTE == nId)
{
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx
index 5a6f11ebf840..70caccc10a3e 100644
--- a/dbaccess/source/ui/browser/dbexchange.cxx
+++ b/dbaccess/source/ui/browser/dbexchange.cxx
@@ -61,6 +61,7 @@
#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
#include <svx/dataaccessdescriptor.hxx>
#endif
+#include "UITools.hxx"
namespace dbaui
@@ -141,7 +142,8 @@ namespace dbaui
// -----------------------------------------------------------------------------
ODataClipboard::ODataClipboard( const Reference< XPropertySet >& _rxLivingForm,
const Sequence< Any >& _rSelectedRows,
- const Reference< XResultSet>& _rxResultSet)
+ const Reference< XResultSet>& _rxResultSet,
+ const Reference< XMultiServiceFactory >& _rxORB)
:ODataAccessObjectTransferable( _rxLivingForm )
,m_pHtml(NULL)
,m_pRtf(NULL)
@@ -158,6 +160,20 @@ namespace dbaui
getDescriptor()[daCursor] <<= _rxResultSet;
addCompatibleSelectionDescription( _rSelectedRows );
+ if ( xConnection.is() && _rxORB.is() )
+ {
+ Reference< XNumberFormatter > xFormatter( getNumberFormatter( xConnection, _rxORB ) );
+ if ( xFormatter.is() )
+ {
+ m_pHtml = new OHTMLImportExport( getDescriptor(),_rxORB, xFormatter );
+ m_aEventListeners.push_back( m_pHtml );
+
+ m_pRtf = new ORTFImportExport( getDescriptor(),_rxORB, xFormatter );
+ m_aEventListeners.push_back( m_pRtf );
+ }
+ }
+
+
osl_decrementInterlockedCount( &m_refCount );
}
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index 4880e9197170..16859283c9b7 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -165,7 +165,9 @@ void SbaTableQueryBrowser::SelectionChanged()
InvalidateFeature(ID_BROWSER_INSERTCOLUMNS);
InvalidateFeature(ID_BROWSER_INSERTCONTENT);
InvalidateFeature(ID_BROWSER_FORMLETTER);
- }
+ } // if ( !m_bShowMenu )
+ InvalidateFeature(ID_BROWSER_COPY);
+ InvalidateFeature(ID_BROWSER_CUT);
}
//------------------------------------------------------------------------------
void SbaTableQueryBrowser::describeSupportedFeatures()
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 0251b6f653b8..1ca1a737dfd2 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -983,9 +983,16 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu)
rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), 0, nPos++);
rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT));
+ rMenu.InsertSeparator(nPos++);
+ } // if (!IsReadOnlyDB())
+
+ if ( GetSelectRowCount() > 0 )
+ {
+ rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++);
+ rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY));
+
+ rMenu.InsertSeparator(nPos++);
}
- if (nPos)
- rMenu.InsertSeparator(nPos);
}
//------------------------------------------------------------------------------
@@ -1145,6 +1152,9 @@ void SbaGridControl::PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu&
case ID_BROWSER_ROWHEIGHT:
SetRowHeight();
break;
+ case ID_BROWSER_COPY:
+ CopySelectedRowsToClipboard();
+ break;
default:
FmGridControl::PostExecuteRowContextMenu(nRow, rMenu, nExecutionResult);
@@ -1418,10 +1428,23 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos)
}
// -----------------------------------------------------------------------
-void SbaGridControl::DoRowDrag(sal_Int16 nRowPos)
+void SbaGridControl::CopySelectedRowsToClipboard()
+{
+ DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" );
+ implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true );
+}
+
+// -----------------------------------------------------------------------
+void SbaGridControl::DoRowDrag( sal_Int16 nRowPos )
+{
+ implTransferSelectedRows( nRowPos, false );
+}
+
+// -----------------------------------------------------------------------
+void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag )
{
Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY);
- DBG_ASSERT(xDataSource.is(), "SbaGridControl::DoRowDrag : invalid data source !");
+ DBG_ASSERT(xDataSource.is(), "SbaGridControl::implTransferSelectedRows : invalid data source !");
// build the sequence of numbers of selected rows
Sequence< Any > aSelectedRows;
@@ -1452,10 +1475,13 @@ void SbaGridControl::DoRowDrag(sal_Int16 nRowPos)
if ( xResultSetAccess.is() )
xRowSetClone = xResultSetAccess->createResultSet();
- ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone);
+ ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone, getServiceManager());
Reference< XTransferable > xEnsureDelete = pTransfer;
- pTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK);
+ if ( _bTrueIfClipboardFalseIfDrag )
+ pTransfer->CopyToClipboard( this );
+ else
+ pTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK);
}
catch(Exception&)
{
diff --git a/dbaccess/source/ui/browser/sbagrid.src b/dbaccess/source/ui/browser/sbagrid.src
index 8bcba2ffc3b8..aa86ed799657 100644
--- a/dbaccess/source/ui/browser/sbagrid.src
+++ b/dbaccess/source/ui/browser/sbagrid.src
@@ -84,6 +84,10 @@ Menu RID_SBA_GRID_ROWCTXMENU
HelpID = HID_BROWSER_ROWHEIGHT ;
Text [ en-US ] = "Row Height..." ;
};
+ MenuItem
+ {
+ ITEM_EDIT_COPY
+ };
};
};
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 98caa841c84c..3c26b06aa003 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1547,25 +1547,6 @@ void SbaTableQueryBrowser::LoadFinished(sal_Bool _bWasSynch)
// if the form has been loaded, this means that our "selection" has changed
EventObject aEvent( *this );
m_aSelectionListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvent );
-
- // update our database document
- Reference< XModel > xDocument;
- try
- {
- Reference< XPropertySet > xCursorProps( getRowSet(), UNO_QUERY_THROW );
- Reference< XConnection > xConnection( xCursorProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY );
- if ( xConnection.is() )
- {
- Reference< XChild > xChild( xConnection, UNO_QUERY_THROW );
- Reference< XDocumentDataSource > xDataSource( xChild->getParent(), UNO_QUERY_THROW );
- xDocument.set( xDataSource->getDatabaseDocument(), UNO_QUERY_THROW );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- m_xCurrentDatabaseDocument = xDocument;
}
//------------------------------------------------------------------------------
@@ -1758,7 +1739,13 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const
if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing())
{
SbaGridControl* pControl = getBrowserView()->getVclControl();
- aReturn.bEnabled = pControl->canCopyCellText(pControl->GetCurRow(), pControl->GetCurColumnId());
+ if ( pControl->GetSelectRowCount() )
+ {
+ aReturn.bEnabled = m_aCurrentFrame.isActive();
+ break;
+ } // if ( getBrowserView()->getVclControl()->GetSelectRowCount() )
+ else
+ aReturn.bEnabled = pControl->canCopyCellText(pControl->GetCurRow(), pControl->GetCurColumnId());
break;
}
// NO break here
@@ -1954,7 +1941,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
{
copyEntry(m_pTreeView->getListBox().GetCurEntry());
}
- else if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing())
+ else if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing() && getBrowserView()->getVclControl()->GetSelectRowCount() < 1)
{
SbaGridControl* pControl = getBrowserView()->getVclControl();
pControl->copyCellText(pControl->GetCurRow(), pControl->GetCurColumnId());
@@ -3713,8 +3700,25 @@ void SbaTableQueryBrowser::postReloadForm()
Reference< XEmbeddedScripts > SAL_CALL SbaTableQueryBrowser::getScriptContainer() throw (RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getScriptContainer" );
- Reference< XEmbeddedScripts > xScripts( m_xCurrentDatabaseDocument, UNO_QUERY );
- OSL_ENSURE( xScripts.is() || !m_xCurrentDatabaseDocument.is(),
+ // update our database document
+ Reference< XModel > xDocument;
+ try
+ {
+ Reference< XPropertySet > xCursorProps( getRowSet(), UNO_QUERY_THROW );
+ Reference< XConnection > xConnection( xCursorProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY );
+ if ( xConnection.is() )
+ {
+ Reference< XChild > xChild( xConnection, UNO_QUERY_THROW );
+ Reference< XDocumentDataSource > xDataSource( xChild->getParent(), UNO_QUERY_THROW );
+ xDocument.set( xDataSource->getDatabaseDocument(), UNO_QUERY_THROW );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ Reference< XEmbeddedScripts > xScripts( xDocument, UNO_QUERY );
+ OSL_ENSURE( xScripts.is() || !xDocument.is(),
"SbaTableQueryBrowser::getScriptContainer: invalid database document!" );
return xScripts;
}
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 71708e6e87f3..66b36bd1a3f8 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -559,7 +559,8 @@ namespace dbaui
}
if ( aFileDlg.Execute() == ERRCODE_NONE )
{
- if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() )
+ String sPath = aFileDlg.GetPath();
+ if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) )
{
String sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO));
InfoBox aError(this, sMessage);
@@ -568,7 +569,7 @@ namespace dbaui
OnSetupModeSelected(&m_aRB_GetExistingDatabase);
return 0L;
}
- m_aBrowsedDocument.sURL = aFileDlg.GetPath();
+ m_aBrowsedDocument.sURL = sPath;
m_aBrowsedDocument.sFilter = String();
m_aChooseDocumentHandler.Call( this );
return 1L;
diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk
index b0c991b176be..ceeac9f8cdc7 100644
--- a/dbaccess/source/ui/dlg/makefile.mk
+++ b/dbaccess/source/ui/dlg/makefile.mk
@@ -80,7 +80,6 @@ SRC1FILES = \
advancedsettings.src\
UserAdminDlg.src \
sqlmessage.src \
- ExtensionNotPresent.src \
textconnectionsettings.src
@@ -119,7 +118,6 @@ EXCEPTIONSFILES= \
$(SLO)$/dbfindex.obj \
$(SLO)$/DriverSettings.obj \
$(SLO)$/odbcconfig.obj \
- $(SLO)$/ExtensionNotPresent.obj \
$(SLO)$/advancedsettings.obj \
$(SLO)$/datasourceui.obj \
$(SLO)$/textconnectionsettings.obj
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 0241fab2a2c5..ff8ceca88ce6 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: queryfilter.cxx,v $
- * $Revision: 1.36.66.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -382,7 +379,16 @@ sal_Bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rCom
if ( xInfo->hasPropertyByName(PROPERTY_REALNAME) )
{
if ( xInfo->hasPropertyByName(PROPERTY_TABLENAME) )
+ {
xColumn->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName;
+ if ( sTableName.getLength() )
+ {
+ // properly quote all parts of the table name, so e.g. <schema>.<table> becomes "<schema>"."<table>"
+ ::rtl::OUString aCatlog,aSchema,aTable;
+ ::dbtools::qualifiedNameComponents( m_xMetaData, sTableName, aCatlog, aSchema, aTable, ::dbtools::eInDataManipulation );
+ sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, sal_True, ::dbtools::eInDataManipulation );
+ }
+ }
xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name;
static ::rtl::OUString sAgg(RTL_CONSTASCII_USTRINGPARAM("AggregateFunction"));
if ( xInfo->hasPropertyByName(sAgg) )
@@ -398,7 +404,6 @@ sal_Bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rCom
if ( sTableName.getLength() )
{
static ::rtl::OUString sSep(RTL_CONSTASCII_USTRINGPARAM("."));
- sTableName = ::dbtools::quoteName(aQuote,sTableName);
sTableName += sSep;
sTableName += _rFilter.Name;
_rFilter.Name = sTableName;
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index cc8f01dd4daf..b27429092f60 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -539,14 +539,17 @@ void OSQLMessageBox::impl_positionControls()
{
OSL_PRECOND( !m_pImpl->aDisplayInfo.empty(), "OSQLMessageBox::impl_positionControls: nothing to display at all?" );
- const ExceptionDisplayInfo& rFirstInfo = *m_pImpl->aDisplayInfo.begin();
+
+ if ( m_pImpl->aDisplayInfo.empty() )
+ return;
const ExceptionDisplayInfo* pSecondInfo = NULL;
+
+ const ExceptionDisplayInfo& rFirstInfo = *m_pImpl->aDisplayInfo.begin();
if ( m_pImpl->aDisplayInfo.size() > 1 )
pSecondInfo = &m_pImpl->aDisplayInfo[1];
-
- // one or two texts to display?
String sPrimary, sSecondary;
sPrimary = rFirstInfo.sMessage;
+ // one or two texts to display?
if ( pSecondInfo )
{
// we show two elements in the main dialog if and only if one of
diff --git a/dbaccess/source/ui/inc/IUpdateHelper.hxx b/dbaccess/source/ui/inc/IUpdateHelper.hxx
index acf4038fbcc0..aff1072153c1 100644
--- a/dbaccess/source/ui/inc/IUpdateHelper.hxx
+++ b/dbaccess/source/ui/inc/IUpdateHelper.hxx
@@ -30,6 +30,10 @@
#ifndef DBAUI_IUPDATEHELPER_HXX
#define DBAUI_IUPDATEHELPER_HXX
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Time.hpp>
+
namespace dbaui
{
class SAL_NO_VTABLE IUpdateHelper
@@ -39,6 +43,9 @@ namespace dbaui
virtual void updateDouble(sal_Int32 _nPos,const double& _nValue) = 0;
virtual void updateInt(sal_Int32 _nPos,const sal_Int32& _nValue) = 0;
virtual void updateNull(sal_Int32 _nPos, ::sal_Int32 sqlType) = 0;
+ virtual void updateDate(sal_Int32 _nPos,const ::com::sun::star::util::Date& _nValue) = 0;
+ virtual void updateTime(sal_Int32 _nPos,const ::com::sun::star::util::Time& _nValue) = 0;
+ virtual void updateTimestamp(sal_Int32 _nPos,const ::com::sun::star::util::DateTime& _nValue) = 0;
virtual void moveToInsertRow() = 0;
virtual void insertRow() = 0;
};
diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx
index 2eb162a05020..27a103e1af8a 100644
--- a/dbaccess/source/ui/inc/TokenWriter.hxx
+++ b/dbaccess/source/ui/inc/TokenWriter.hxx
@@ -173,7 +173,7 @@ namespace dbaui
class ORTFImportExport : public ODatabaseImportExport
{
-
+ void appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCount,sal_Int32& k,sal_Int32& kk);
public:
// export data
ORTFImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor,
diff --git a/dbaccess/source/ui/inc/dbexchange.hxx b/dbaccess/source/ui/inc/dbexchange.hxx
index dd93d241a912..6627e3b2af1d 100644
--- a/dbaccess/source/ui/inc/dbexchange.hxx
+++ b/dbaccess/source/ui/inc/dbexchange.hxx
@@ -89,12 +89,11 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
);
- /** with this ctor, only the object descriptor format will be provided
- */
ODataClipboard(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxLivingForm,
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rSelectedRows,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxResultSet
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxResultSet,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
);
DECLARE_XINTERFACE( )
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index 41e99ca0124b..60c879d3fbb7 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -299,6 +299,12 @@ namespace dbaui
virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
virtual void DeleteSelectedRows();
+ /** copies the currently selected rows to the clipboard
+ @precond
+ at least one row is selected
+ */
+ void CopySelectedRowsToClipboard();
+
protected:
// DragSourceHelper overridables
@@ -348,6 +354,7 @@ namespace dbaui
private:
sal_Bool IsReadOnlyDB() const;
+ void implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag );
private:
using FmGridControl::AcceptDrop;
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 9354aa943a93..c6315cc1db22 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -130,7 +130,6 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_xCollator;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xCurrentFrameParent;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xMainToolbar;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xCurrentDatabaseDocument;
// ---------------------------
struct ExternalFeature
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index e55508a67608..aaa1e9ce1ff4 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -353,8 +353,8 @@ void ODatabaseExport::insertValueIntoColumn()
{
Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier();
Reference<XNumberFormatTypes> xNumType(xSupplier->getNumberFormats(),UNO_QUERY);
- sal_Int16 nFormats[] = { NumberFormat::DATETIME
- ,NumberFormat::DATETIME
+ sal_Int16 nFormats[] = {
+ NumberFormat::DATETIME
,NumberFormat::DATE
,NumberFormat::TIME
,NumberFormat::NUMBER
@@ -393,13 +393,17 @@ void ODatabaseExport::insertValueIntoColumn()
switch(nType)
{
case NumberFormat::DATE:
+ m_pUpdateHelper->updateDate(nPos,::dbtools::DBTypeConversion::toDate(fOutNumber,m_aNullDate));
+ break;
case NumberFormat::DATETIME:
- fOutNumber = ::dbtools::DBTypeConversion::toStandardDbDate(m_aNullDate,fOutNumber);
+ m_pUpdateHelper->updateTimestamp(nPos,::dbtools::DBTypeConversion::toDateTime(fOutNumber,m_aNullDate));
+ break;
+ case NumberFormat::TIME:
+ m_pUpdateHelper->updateTime(nPos,::dbtools::DBTypeConversion::toTime(fOutNumber));
break;
default:
- ;
+ m_pUpdateHelper->updateDouble(nPos,fOutNumber);
}
- m_pUpdateHelper->updateDouble(nPos,fOutNumber);//::dbtools::DBTypeConversion::getStandardDate()
}
catch(Exception&)
{
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 38643109d675..02765c333c21 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -95,6 +95,7 @@ const static char __FAR_DATA sFontFamily[] = "font-family: ";
const static char __FAR_DATA sFontSize[] = "font-size: ";
#define SBA_FORMAT_SELECTION_COUNT 4
+#define CELL_X 1437
DBG_NAME(ODatabaseImportExport)
//======================================================================
@@ -479,12 +480,9 @@ BOOL ORTFImportExport::Write()
(*m_pStream) << ";\\red255\\green255\\blue255;\\red192\\green192\\blue192;}"
<< ODatabaseImportExport::sNewLine;
- sal_Int32 nCellx = 1437;
::rtl::OString aTRRH("\\trrh-270\\pard\\intbl");
::rtl::OString aFS("\\fs20\\f0\\cf0\\cb2");
- ::rtl::OString aFS2("\\fs20\\f1\\cf0\\cb1");
::rtl::OString aCell1("\\clbrdrl\\brdrs\\brdrcf0\\clbrdrt\\brdrs\\brdrcf0\\clbrdrb\\brdrs\\brdrcf0\\clbrdrr\\brdrs\\brdrcf0\\clshdng10000\\clcfpat2\\cellx");
- ::rtl::OString aCell2("\\clbrdrl\\brdrs\\brdrcf2\\clbrdrt\\brdrs\\brdrcf2\\clbrdrb\\brdrs\\brdrcf2\\clbrdrr\\brdrs\\brdrcf2\\clshdng10000\\clcfpat1\\cellx");
(*m_pStream) << OOO_STRING_SVTOOLS_RTF_TROWD << OOO_STRING_SVTOOLS_RTF_TRGAPH;
m_pStream->WriteNumber(40);
@@ -508,7 +506,7 @@ BOOL ORTFImportExport::Write()
for( sal_Int32 i=1; i<=nCount; ++i )
{
(*m_pStream) << aCell1;
- m_pStream->WriteNumber(i*nCellx);
+ m_pStream->WriteNumber(i*CELL_X);
(*m_pStream) << ODatabaseImportExport::sNewLine;
}
@@ -572,65 +570,30 @@ BOOL ORTFImportExport::Write()
Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
sal_Int32 k=1;
sal_Int32 kk=0;
- m_xResultSet->beforeFirst(); // set back before the first row
- while(m_xResultSet->next())
+ if(m_aSelection.getLength())
{
- if(!m_pRowMarker || m_pRowMarker[kk] == k)
+ const Any* pSelIter = m_aSelection.getConstArray();
+ const Any* pEnd = pSelIter + m_aSelection.getLength();
+ sal_Bool bContinue = sal_True;
+ for(;pSelIter != pEnd && bContinue;++pSelIter)
{
- ++kk;
- (*m_pStream) << OOO_STRING_SVTOOLS_RTF_TROWD << OOO_STRING_SVTOOLS_RTF_TRGAPH;
- m_pStream->WriteNumber(40);
- (*m_pStream) << ODatabaseImportExport::sNewLine;
-
- for ( sal_Int32 i=1; i<=nCount; ++i )
- {
- (*m_pStream) << aCell2;
- m_pStream->WriteNumber(i*nCellx);
- (*m_pStream) << ODatabaseImportExport::sNewLine;
- }
-
- (*m_pStream) << '{';
- (*m_pStream) << aTRRH;
- for ( sal_Int32 i=1; i<=nCount; ++i )
- {
- (*m_pStream) << ODatabaseImportExport::sNewLine;
- (*m_pStream) << '{';
- (*m_pStream) << pHorzChar[i-1];
+ sal_Int32 nPos = -1;
+ *pSelIter >>= nPos;
+ OSL_ENSURE(nPos != -1,"Invalid posiotion!");
+ bContinue = (m_xResultSet->absolute(nPos));
+ if ( bContinue )
+ appendRow(pHorzChar,nCount,k,kk);
- if ( bBold ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_B;
- if ( bItalic ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_I;
- if ( bUnderline ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_UL;
- if ( bStrikeout ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_STRIKE;
-
- (*m_pStream) << aFS2;
- (*m_pStream) << ' ';
-
- try
- {
- Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW);
- dbtools::FormattedColumnValue aFormatedValue(aContext,xRowSet,xColumn);
- ::rtl::OUString sValue = aFormatedValue.getFormattedValue();
- // m_xRow->getString(i);
- //if (!m_xRow->wasNull())
- if ( sValue.getLength() )
- RTFOutFuncs::Out_String(*m_pStream,sValue,m_eDestEnc);
- }
- catch (Exception&)
- {
- OSL_ENSURE(0,"RTF WRITE!");
- }
-
- (*m_pStream) << OOO_STRING_SVTOOLS_RTF_CELL;
- (*m_pStream) << '}';
- (*m_pStream) << ODatabaseImportExport::sNewLine;
- (*m_pStream) << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_INTBL;
- }
- (*m_pStream) << OOO_STRING_SVTOOLS_RTF_ROW << ODatabaseImportExport::sNewLine;
- (*m_pStream) << '}';
}
- ++k;
+ } // if(m_aSelection.getLength())
+ else
+ {
+ m_xResultSet->beforeFirst(); // set back before the first row
+ while(m_xResultSet->next())
+ {
+ appendRow(pHorzChar,nCount,k,kk);
+ }
}
-
delete [] pHorzChar;
}
@@ -638,6 +601,75 @@ BOOL ORTFImportExport::Write()
(*m_pStream) << (BYTE) 0;
return ((*m_pStream).GetError() == SVSTREAM_OK);
}
+// -----------------------------------------------------------------------------
+void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCount,sal_Int32& k,sal_Int32& kk)
+{
+ if(!m_pRowMarker || m_pRowMarker[kk] == k)
+ {
+ ++kk;
+ (*m_pStream) << OOO_STRING_SVTOOLS_RTF_TROWD << OOO_STRING_SVTOOLS_RTF_TRGAPH;
+ m_pStream->WriteNumber(40);
+ (*m_pStream) << ODatabaseImportExport::sNewLine;
+
+ static const ::rtl::OString aCell2("\\clbrdrl\\brdrs\\brdrcf2\\clbrdrt\\brdrs\\brdrcf2\\clbrdrb\\brdrs\\brdrcf2\\clbrdrr\\brdrs\\brdrcf2\\clshdng10000\\clcfpat1\\cellx");
+ static const ::rtl::OString aTRRH("\\trrh-270\\pard\\intbl");
+
+ for ( sal_Int32 i=1; i<=_nColumnCount; ++i )
+ {
+ (*m_pStream) << aCell2;
+ m_pStream->WriteNumber(i*CELL_X);
+ (*m_pStream) << ODatabaseImportExport::sNewLine;
+ }
+
+ const BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight );
+ const BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant );
+ const BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline );
+ const BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout );
+ static const ::rtl::OString aFS2("\\fs20\\f1\\cf0\\cb1");
+ ::comphelper::ComponentContext aContext(m_xFactory);
+ Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
+
+ (*m_pStream) << '{';
+ (*m_pStream) << aTRRH;
+ for ( sal_Int32 i=1; i <= _nColumnCount; ++i )
+ {
+ (*m_pStream) << ODatabaseImportExport::sNewLine;
+ (*m_pStream) << '{';
+ (*m_pStream) << pHorzChar[i-1];
+
+ if ( bBold ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_B;
+ if ( bItalic ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_I;
+ if ( bUnderline ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_UL;
+ if ( bStrikeout ) (*m_pStream) << OOO_STRING_SVTOOLS_RTF_STRIKE;
+
+ (*m_pStream) << aFS2;
+ (*m_pStream) << ' ';
+
+ try
+ {
+ Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW);
+ dbtools::FormattedColumnValue aFormatedValue(aContext,xRowSet,xColumn);
+ ::rtl::OUString sValue = aFormatedValue.getFormattedValue();
+ // m_xRow->getString(i);
+ //if (!m_xRow->wasNull())
+ if ( sValue.getLength() )
+ RTFOutFuncs::Out_String(*m_pStream,sValue,m_eDestEnc);
+ }
+ catch (Exception&)
+ {
+ OSL_ENSURE(0,"RTF WRITE!");
+ }
+
+ (*m_pStream) << OOO_STRING_SVTOOLS_RTF_CELL;
+ (*m_pStream) << '}';
+ (*m_pStream) << ODatabaseImportExport::sNewLine;
+ (*m_pStream) << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_INTBL;
+ }
+ (*m_pStream) << OOO_STRING_SVTOOLS_RTF_ROW << ODatabaseImportExport::sNewLine;
+ (*m_pStream) << '}';
+ }
+ ++k;
+}
//-------------------------------------------------------------------
BOOL ORTFImportExport::Read()
{
diff --git a/dbaccess/source/ui/misc/UpdateHelperImpl.hxx b/dbaccess/source/ui/misc/UpdateHelperImpl.hxx
index a0a9e63fc183..5a5633571722 100644
--- a/dbaccess/source/ui/misc/UpdateHelperImpl.hxx
+++ b/dbaccess/source/ui/misc/UpdateHelperImpl.hxx
@@ -60,6 +60,18 @@ namespace dbaui
{
m_xRowUpdate->updateDouble(_nPos, _nValue);
}
+ virtual void updateDate(sal_Int32 _nPos,const ::com::sun::star::util::Date& _nValue)
+ {
+ m_xRowUpdate->updateDate(_nPos, _nValue);
+ }
+ virtual void updateTime(sal_Int32 _nPos,const ::com::sun::star::util::Time& _nValue)
+ {
+ m_xRowUpdate->updateTime(_nPos, _nValue);
+ }
+ virtual void updateTimestamp(sal_Int32 _nPos,const ::com::sun::star::util::DateTime& _nValue)
+ {
+ m_xRowUpdate->updateTimestamp(_nPos, _nValue);
+ }
virtual void updateInt(sal_Int32 _nPos,const sal_Int32& _nValue)
{
m_xRowUpdate->updateInt(_nPos, _nValue);
@@ -100,6 +112,21 @@ namespace dbaui
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OParameterUpdateHelper::updateDouble" );
m_xParameters->setDouble(_nPos, _nValue);
}
+ virtual void updateDate(sal_Int32 _nPos,const ::com::sun::star::util::Date& _nValue)
+ {
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OParameterUpdateHelper::updateDouble" );
+ m_xParameters->setDate(_nPos, _nValue);
+ }
+ virtual void updateTime(sal_Int32 _nPos,const ::com::sun::star::util::Time& _nValue)
+ {
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OParameterUpdateHelper::updateDouble" );
+ m_xParameters->setTime(_nPos, _nValue);
+ }
+ virtual void updateTimestamp(sal_Int32 _nPos,const ::com::sun::star::util::DateTime& _nValue)
+ {
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OParameterUpdateHelper::updateDouble" );
+ m_xParameters->setTimestamp(_nPos, _nValue);
+ }
virtual void updateInt(sal_Int32 _nPos,const sal_Int32& _nValue)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OParameterUpdateHelper::updateInt" );
diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src
index f58b0b8b23ba..e20e603b2343 100644
--- a/dbaccess/source/ui/misc/dbumiscres.src
+++ b/dbaccess/source/ui/misc/dbumiscres.src
@@ -96,4 +96,8 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS
{
Text [ en-US ] = "The name '$#$' already exists.\nPlease enter another name." ;
};
-
+String RID_STR_EXTENSION_NOT_PRESENT
+{
+ // #i96130# use hard coded name
+ Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder.";
+};
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index d1c056b6e4a3..69ec1dcf4975 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -140,7 +140,6 @@
#include <connectivity/dbtools.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/io/WrongFormatException.hpp>
-#include "ExtensionNotPresent.hxx"
#include "com/sun/star/sdb/RowSetVetoException.hpp"
//......................................................................
@@ -455,7 +454,7 @@ namespace dbaui
// more like a hack, insert an empty message
String sText( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) );
- sText = sText.GetToken(0,'\n');
+ sText.SearchAndReplaceAscii("$file$",_rLinkName);
aInfo.prepend(sText);
String sMessage = String(ModuleRes(STR_COULDNOTOPEN_LINKEDDOC));
diff --git a/dbaccess/source/ui/relationdesign/relation.src b/dbaccess/source/ui/relationdesign/relation.src
index 391205223886..cb068c43d50c 100644
--- a/dbaccess/source/ui/relationdesign/relation.src
+++ b/dbaccess/source/ui/relationdesign/relation.src
@@ -77,7 +77,7 @@ String STR_QUERY_REL_DELETE_WINDOW
String STR_QUERY_REL_COULD_NOT_CREATE
{
- Text [ en-US ] = "The datbase could not create the relation. May be foreign keys for this kind of table aren't supported.\nPlease check your documentation of the database.";
+ Text [ en-US ] = "The database could not create the relation. May be foreign keys for this kind of table aren't supported.\nPlease check your documentation of the database.";
};
diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
index 4ece37f2fa51..699a2db8404b 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
@@ -176,7 +176,11 @@ OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedC
if(xPropSetInfo->hasPropertyByName(PROPERTY_ISNULLABLE))
SetIsNullable(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_ISNULLABLE)));
if(xPropSetInfo->hasPropertyByName(PROPERTY_FORMATKEY))
- SetFormatKey(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY)));
+ {
+ const Any aValue = xAffectedCol->getPropertyValue(PROPERTY_FORMATKEY);
+ if ( aValue.hasValue() )
+ SetFormatKey(::comphelper::getINT32(aValue));
+ }
if(xPropSetInfo->hasPropertyByName(PROPERTY_RELATIVEPOSITION))
m_aRelativePosition = xAffectedCol->getPropertyValue(PROPERTY_RELATIVEPOSITION);
if(xPropSetInfo->hasPropertyByName(PROPERTY_WIDTH))
@@ -184,7 +188,11 @@ OFieldDescription::OFieldDescription(const Reference< XPropertySet >& xAffectedC
if(xPropSetInfo->hasPropertyByName(PROPERTY_HIDDEN))
xAffectedCol->getPropertyValue(PROPERTY_HIDDEN) >>= m_bHidden;
if(xPropSetInfo->hasPropertyByName(PROPERTY_ALIGN))
- SetHorJustify( ::dbaui::mapTextJustify(::comphelper::getINT32(xAffectedCol->getPropertyValue(PROPERTY_ALIGN))));
+ {
+ const Any aValue = xAffectedCol->getPropertyValue(PROPERTY_ALIGN);
+ if ( aValue.hasValue() )
+ SetHorJustify( ::dbaui::mapTextJustify(::comphelper::getINT32(aValue)));
+ }
if(xPropSetInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT))
SetAutoIncrement(::cppu::any2bool(xAffectedCol->getPropertyValue(PROPERTY_ISAUTOINCREMENT)));
}