Lines 68-74
Link Here
|
68 |
#include <swunohelper.hxx> |
68 |
#include <swunohelper.hxx> |
69 |
#include <vcl/waitobj.hxx> |
69 |
#include <vcl/waitobj.hxx> |
70 |
#include <svtools/pathoptions.hxx> |
70 |
#include <svtools/pathoptions.hxx> |
71 |
|
71 |
#include <svtools/urihelper.hxx> |
72 |
#include <addresslistdialog.hrc> |
72 |
#include <addresslistdialog.hrc> |
73 |
#include <dbui.hrc> |
73 |
#include <dbui.hrc> |
74 |
|
74 |
|
Lines 145-150
Link Here
|
145 |
if(!sCharSet.compareToAscii( cUTF8 )) |
145 |
if(!sCharSet.compareToAscii( cUTF8 )) |
146 |
{ |
146 |
{ |
147 |
sURL = String(sDBURL).Copy( 10 ); |
147 |
sURL = String(sDBURL).Copy( 10 ); |
|
|
148 |
//at this point the 'URL' can also be a file name! |
149 |
sURL = URIHelper::SmartRel2Abs( INetURLObject(), sURL ); |
148 |
sURL += C2U("/"); |
150 |
sURL += C2U("/"); |
149 |
sURL += aFilters[0]; |
151 |
sURL += aFilters[0]; |
150 |
sURL += C2U("."); |
152 |
sURL += C2U("."); |
Lines 269-274
Link Here
|
269 |
m_xDBContext->getByName(pNames[nName]) >>= xSourceProperties; |
271 |
m_xDBContext->getByName(pNames[nName]) >>= xSourceProperties; |
270 |
pUserData->sURL = lcl_getFlatURL( xSourceProperties ); |
272 |
pUserData->sURL = lcl_getFlatURL( xSourceProperties ); |
271 |
bEnableEdit = pUserData->sURL.getLength() > 0 && |
273 |
bEnableEdit = pUserData->sURL.getLength() > 0 && |
|
|
274 |
SWUnoHelper::UCB_IsFile( pUserData->sURL ) && |
272 |
!SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ); |
275 |
!SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ); |
273 |
} |
276 |
} |
274 |
catch(const uno::Exception& ) |
277 |
catch(const uno::Exception& ) |
Lines 553-558
Link Here
|
553 |
pThis->m_aListLB.SetEntryText(String(), pSelect, ITEMID_TABLE - 1); |
556 |
pThis->m_aListLB.SetEntryText(String(), pSelect, ITEMID_TABLE - 1); |
554 |
} |
557 |
} |
555 |
pThis->m_aEditPB.Enable(pUserData && pUserData->sURL.getLength() && |
558 |
pThis->m_aEditPB.Enable(pUserData && pUserData->sURL.getLength() && |
|
|
559 |
SWUnoHelper::UCB_IsFile( pUserData->sURL ) && |
556 |
!SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ) ); |
560 |
!SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL ) ); |
557 |
pThis->m_bInSelectHdl = false; |
561 |
pThis->m_bInSelectHdl = false; |
558 |
pThis->LeaveWait(); |
562 |
pThis->LeaveWait(); |
Lines 638-648
Link Here
|
638 |
m_xDBContext->getByName(m_aDBData.sDataSource) >>= xSourceProperties; |
642 |
m_xDBContext->getByName(m_aDBData.sDataSource) >>= xSourceProperties; |
639 |
pUserData->sURL = lcl_getFlatURL( xSourceProperties ); |
643 |
pUserData->sURL = lcl_getFlatURL( xSourceProperties ); |
640 |
|
644 |
|
641 |
m_aListLB.SetEntryText(m_aDBData.sCommand, pSelect, ITEMID_TABLE - 1); |
|
|
642 |
pUserData->xColumnsSupplier = SwNewDBMgr::GetColumnSupplier(pUserData->xConnection, |
645 |
pUserData->xColumnsSupplier = SwNewDBMgr::GetColumnSupplier(pUserData->xConnection, |
643 |
m_aDBData.sCommand, |
646 |
m_aDBData.sCommand, |
644 |
m_aDBData.nCommandType == CommandType::TABLE ? |
647 |
m_aDBData.nCommandType == CommandType::TABLE ? |
645 |
SW_DB_SELECT_TABLE : SW_DB_SELECT_QUERY ); |
648 |
SW_DB_SELECT_TABLE : SW_DB_SELECT_QUERY ); |
|
|
649 |
if( pUserData->xColumnsSupplier.is() ) |
650 |
{ |
651 |
m_aListLB.SetEntryText(m_aDBData.sCommand, pSelect, ITEMID_TABLE - 1); |
652 |
} |
653 |
else |
654 |
{ |
655 |
m_aListLB.SetEntryText(String(), pSelect, ITEMID_TABLE - 1); |
656 |
} |
646 |
} |
657 |
} |
647 |
String sCommand = m_aListLB.GetEntryText(pSelect, ITEMID_TABLE - 1); |
658 |
String sCommand = m_aListLB.GetEntryText(pSelect, ITEMID_TABLE - 1); |
648 |
m_aOK.Enable(pSelect && sCommand.Len()); |
659 |
m_aOK.Enable(pSelect && sCommand.Len()); |