#86890# impl query paste in contextmenu

This commit is contained in:
Ocke Janssen
2001-07-03 12:59:27 +00:00
parent 2428ebf1eb
commit 2b7330395c
5 changed files with 38 additions and 34 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: dbaccess_helpid.hrc,v $ * $RCSfile: dbaccess_helpid.hrc,v $
* *
* $Revision: 1.37 $ * $Revision: 1.38 $
* *
* last change: $Author: oj $ $Date: 2001-06-25 08:23:31 $ * last change: $Author: oj $ $Date: 2001-07-03 13:59:25 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -277,6 +277,7 @@
#define HID_TAB_PAGE_LBUSER (HID_DBACCESS_START + 185) #define HID_TAB_PAGE_LBUSER (HID_DBACCESS_START + 185)
#define HID_DSBROWSER_DIRECTSQL (HID_DBACCESS_START + 186) #define HID_DSBROWSER_DIRECTSQL (HID_DBACCESS_START + 186)
#define HID_DSADMIN_LDAP_ROWCOUNT (HID_DBACCESS_START + 187) #define HID_DSADMIN_LDAP_ROWCOUNT (HID_DBACCESS_START + 187)
#define HID_BROWSER_QUERY_PASTE (HID_DBACCESS_START + 188)
// don't forget to update the file util/hidother.src // don't forget to update the file util/hidother.src
@@ -288,6 +289,9 @@
/************************************************************************* /*************************************************************************
* history: * history:
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.37 2001/06/25 08:23:31 oj
* #88699# new helpids
*
* Revision 1.36 2001/06/20 06:55:29 oj * Revision 1.36 2001/06/20 06:55:29 oj
* #88434# new helpids for useradmin page * #88434# new helpids for useradmin page
* *

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: sbabrw.src,v $ * $RCSfile: sbabrw.src,v $
* *
* $Revision: 1.46 $ * $Revision: 1.47 $
* *
* last change: $Author: oj $ $Date: 2001-07-03 07:46:43 $ * last change: $Author: oj $ $Date: 2001-07-03 13:59:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -836,6 +836,14 @@ Menu MENU_BROWSER_QUERYCONTEXT
Text[ finnish ] = "Abfrage ~kopieren"; Text[ finnish ] = "Abfrage ~kopieren";
Text[ catalan ] = "C~opy Query"; Text[ catalan ] = "C~opy Query";
}; };
MenuItem
{
Identifier = ID_TREE_QUERY_PASTE ;
HelpId = HID_BROWSER_QUERY_PASTE ;
Text = "Abfrage e~inf<6E>gen..." ;
Text [ english ] = "~insert query..." ;
Text [ english_us ] = "~Insert Query..." ;
};
}; };
}; };

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: unodatbr.cxx,v $ * $RCSfile: unodatbr.cxx,v $
* *
* $Revision: 1.86 $ * $Revision: 1.87 $
* *
* last change: $Author: oj $ $Date: 2001-07-03 12:54:05 $ * last change: $Author: oj $ $Date: 2001-07-03 13:59:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -1582,11 +1582,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId)
case etQuery: case etQuery:
case etQueryContainer: case etQueryContainer:
{ {
#if SUPD < 631
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard());
#else
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView())); TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView()));
#endif
aReturn.bEnabled = aTransferData.HasFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY); aReturn.bEnabled = aTransferData.HasFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY);
break; break;
} }
@@ -1720,11 +1716,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId)
case ID_BROWSER_PASTE: case ID_BROWSER_PASTE:
if(m_pTreeView->HasChildPathFocus()) if(m_pTreeView->HasChildPathFocus())
{ {
#if SUPD<631
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard());
#else
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView())); TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView()));
#endif
SvLBoxEntry* pEntry = m_pTreeView->getListBox()->GetCurEntry(); SvLBoxEntry* pEntry = m_pTreeView->getListBox()->GetCurEntry();
EntryType eType = getEntryType(pEntry); EntryType eType = getEntryType(pEntry);
switch(eType) switch(eType)
@@ -1753,11 +1745,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId)
pTransfer = implCopyObject( pEntry, eType == etQuery ? CommandType::QUERY : CommandType::TABLE); pTransfer = implCopyObject( pEntry, eType == etQuery ? CommandType::QUERY : CommandType::TABLE);
aEnsureDelete = pTransfer; aEnsureDelete = pTransfer;
if (pTransfer) if (pTransfer)
#if SUPD<631
pTransfer->CopyToClipboard();
#else
pTransfer->CopyToClipboard(getView()); pTransfer->CopyToClipboard(getView());
#endif
} }
else if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing()) else if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing())
{ {
@@ -3460,6 +3448,9 @@ sal_Bool SbaTableQueryBrowser::requestContextMenu( const CommandEvent& _rEvent )
case etQueryContainer: case etQueryContainer:
case etQuery: case etQuery:
{ {
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView()));
sal_Bool bPasteAble = aTransferData.HasFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY);
aContextMenu.EnableItem(ID_TREE_QUERY_PASTE, bPasteAble);
// 3.2 actions on existing queries // 3.2 actions on existing queries
aContextMenu.EnableItem(ID_EDIT_QUERY_DESIGN, etQuery == eType); aContextMenu.EnableItem(ID_EDIT_QUERY_DESIGN, etQuery == eType);
aContextMenu.EnableItem(ID_DROP_QUERY, etQuery == eType); aContextMenu.EnableItem(ID_DROP_QUERY, etQuery == eType);
@@ -3549,11 +3540,7 @@ sal_Bool SbaTableQueryBrowser::requestContextMenu( const CommandEvent& _rEvent )
TransferableHelper* pTransfer = implCopyObject( pEntry, CommandType::QUERY ); TransferableHelper* pTransfer = implCopyObject( pEntry, CommandType::QUERY );
Reference< XTransferable> aEnsureDelete = pTransfer; Reference< XTransferable> aEnsureDelete = pTransfer;
if (pTransfer) if (pTransfer)
#if SUPD<631
pTransfer->CopyToClipboard();
#else
pTransfer->CopyToClipboard(getView()); pTransfer->CopyToClipboard(getView());
#endif
} }
break; break;
@@ -3564,22 +3551,21 @@ sal_Bool SbaTableQueryBrowser::requestContextMenu( const CommandEvent& _rEvent )
Reference< XTransferable> aEnsureDelete = pTransfer; Reference< XTransferable> aEnsureDelete = pTransfer;
if (pTransfer) if (pTransfer)
#if SUPD<631
pTransfer->CopyToClipboard();
#else
pTransfer->CopyToClipboard(getView()); pTransfer->CopyToClipboard(getView());
#endif }
break;
case ID_TREE_QUERY_PASTE:
{
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView()));
implPasteQuery( pEntry, aTransferData );
} }
break; break;
case ID_TREE_TABLE_PASTE: case ID_TREE_TABLE_PASTE:
case ID_TREE_VIEW_PASTE: case ID_TREE_VIEW_PASTE:
{ {
#if SUPD<631
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard());
#else
TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView())); TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(getView()));
#endif
implPasteTable( pEntry, aTransferData ); implPasteTable( pEntry, aTransferData );
} }
break; break;

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: browserids.hxx,v $ * $RCSfile: browserids.hxx,v $
* *
* $Revision: 1.17 $ * $Revision: 1.18 $
* *
* last change: $Author: fs $ $Date: 2001-06-22 10:40:23 $ * last change: $Author: oj $ $Date: 2001-07-03 13:59:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -138,6 +138,8 @@
#define ID_TREE_VIEW_COPY 30 #define ID_TREE_VIEW_COPY 30
#define ID_TREE_VIEW_PASTE 31 #define ID_TREE_VIEW_PASTE 31
#define ID_DIRECT_SQL 32 #define ID_DIRECT_SQL 32
#define ID_TREE_QUERY_PASTE 33
#define ID_BROWSER_QUERY_EXECUTE SID_FM_EXECUTE #define ID_BROWSER_QUERY_EXECUTE SID_FM_EXECUTE

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: hidother.src,v $ * $RCSfile: hidother.src,v $
* *
* $Revision: 1.30 $ * $Revision: 1.31 $
* *
* last change: $Author: oj $ $Date: 2001-06-25 08:23:11 $ * last change: $Author: oj $ $Date: 2001-07-03 13:59:27 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -263,10 +263,14 @@ hidspecial HID_DSBROWSER_BOOKMARKSELECTED { HelpId = HID_DSBROWSER
hidspecial HID_DSBROWSER_DISCONNECTING { HelpId = HID_DSBROWSER_DISCONNECTING ; }; hidspecial HID_DSBROWSER_DISCONNECTING { HelpId = HID_DSBROWSER_DISCONNECTING ; };
hidspecial HID_DSBROWSER_DIRECTSQL { HelpId = HID_DSBROWSER_DIRECTSQL ; }; hidspecial HID_DSBROWSER_DIRECTSQL { HelpId = HID_DSBROWSER_DIRECTSQL ; };
hidspecial HID_DSADMIN_LDAP_ROWCOUNT { HelpId = HID_DSADMIN_LDAP_ROWCOUNT ; }; hidspecial HID_DSADMIN_LDAP_ROWCOUNT { HelpId = HID_DSADMIN_LDAP_ROWCOUNT ; };
hidspecial HID_BROWSER_QUERY_PASTE { HelpId = HID_BROWSER_QUERY_PASTE ; };
/************************************************************************* /*************************************************************************
* history: * history:
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.30 2001/06/25 08:23:11 oj
* #88699# new helpids
*
* Revision 1.29 2001/06/20 06:56:39 oj * Revision 1.29 2001/06/20 06:56:39 oj
* #88434# new helpids for useradmin page * #88434# new helpids for useradmin page
* *