| controlwizard.cxx (2a97ec55) | controlwizard.cxx (46d9d397) |
|---|---|
| 1/************************************************************** | 1/************************************************************** |
| 2 * | 2 * |
| 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
| 10 * | 10 * |
| 11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 * | 12 * |
| 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
| 19 * | 19 * |
| 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_extensions.hxx" 26#include "controlwizard.hxx" 27#include <tools/debug.hxx> --- 151 unchanged lines hidden (view full) --- 179 180 //--------------------------------------------------------------------- 181 void OControlWizardPage::enableFormDatasourceDisplay() 182 { 183 if (m_pFormSettingsSeparator) 184 // nothing to do 185 return; 186 | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_extensions.hxx" 26#include "controlwizard.hxx" 27#include <tools/debug.hxx> --- 151 unchanged lines hidden (view full) --- 179 180 //--------------------------------------------------------------------- 181 void OControlWizardPage::enableFormDatasourceDisplay() 182 { 183 if (m_pFormSettingsSeparator) 184 // nothing to do 185 return; 186 |
| 187 ModuleRes aModuleRes(RID_PAGE_FORM_DATASOURCE_STATUS); | 187 ModuleRes aModuleRes(RID_PAGE_FORM_DATASOURCE_STATUS); |
| 188 OLocalResourceAccess aLocalControls(aModuleRes, RSC_TABPAGE); 189 190 m_pFormSettingsSeparator = new FixedLine(this, ModuleRes(FL_FORMSETINGS)); 191 m_pFormDatasourceLabel = new FixedText(this, ModuleRes(FT_FORMDATASOURCELABEL)); 192 m_pFormDatasource = new FixedText(this, ModuleRes(FT_FORMDATASOURCE)); 193 m_pFormContentTypeLabel = new FixedText(this, ModuleRes(FT_FORMCONTENTTYPELABEL)); 194 m_pFormContentType = new FixedText(this, ModuleRes(FT_FORMCONTENTTYPE)); 195 m_pFormTableLabel = new FixedText(this, ModuleRes(FT_FORMTABLELABEL)); --- 201 unchanged lines hidden (view full) --- 397 xPage = xPageSupp->getDrawPage(); 398 } 399 else 400 { 401 // get the controller currently working on this model 402 Reference< XController > xController = xModel->getCurrentController(); 403 DBG_ASSERT(xController.is(), "OControlWizard::implDeterminePage: no current controller!"); 404 | 188 OLocalResourceAccess aLocalControls(aModuleRes, RSC_TABPAGE); 189 190 m_pFormSettingsSeparator = new FixedLine(this, ModuleRes(FL_FORMSETINGS)); 191 m_pFormDatasourceLabel = new FixedText(this, ModuleRes(FT_FORMDATASOURCELABEL)); 192 m_pFormDatasource = new FixedText(this, ModuleRes(FT_FORMDATASOURCE)); 193 m_pFormContentTypeLabel = new FixedText(this, ModuleRes(FT_FORMCONTENTTYPELABEL)); 194 m_pFormContentType = new FixedText(this, ModuleRes(FT_FORMCONTENTTYPE)); 195 m_pFormTableLabel = new FixedText(this, ModuleRes(FT_FORMTABLELABEL)); --- 201 unchanged lines hidden (view full) --- 397 xPage = xPageSupp->getDrawPage(); 398 } 399 else 400 { 401 // get the controller currently working on this model 402 Reference< XController > xController = xModel->getCurrentController(); 403 DBG_ASSERT(xController.is(), "OControlWizard::implDeterminePage: no current controller!"); 404 |
| 405 // maybe it's a spredsheet | 405 // maybe it's a spreadsheet |
| 406 Reference< XSpreadsheetView > xView(xController, UNO_QUERY); 407 if (xView.is()) 408 { // okay, it is one 409 Reference< XSpreadsheet > xSheet = xView->getActiveSheet(); 410 xPageSupp = Reference< XDrawPageSupplier >(xSheet, UNO_QUERY); 411 DBG_ASSERT(xPageSupp.is(), "OControlWizard::implDeterminePage: a spreadsheet which is no page supplier!"); 412 if (xPageSupp.is()) 413 xPage = xPageSupp->getDrawPage(); 414 } 415 else | 406 Reference< XSpreadsheetView > xView(xController, UNO_QUERY); 407 if (xView.is()) 408 { // okay, it is one 409 Reference< XSpreadsheet > xSheet = xView->getActiveSheet(); 410 xPageSupp = Reference< XDrawPageSupplier >(xSheet, UNO_QUERY); 411 DBG_ASSERT(xPageSupp.is(), "OControlWizard::implDeterminePage: a spreadsheet which is no page supplier!"); 412 if (xPageSupp.is()) 413 xPage = xPageSupp->getDrawPage(); 414 } 415 else |
| 416 { // can be a draw/impress doc only | 416 { // can be a Draw/Impress doc only |
| 417 Reference< XDrawView > xDrawView(xController, UNO_QUERY); 418 DBG_ASSERT(xDrawView.is(), "OControlWizard::implDeterminePage: no alternatives left ... can't determine the page!"); 419 if (xDrawView.is()) 420 xPage = xDrawView->getCurrentPage(); 421 } 422 } 423 } 424 else | 417 Reference< XDrawView > xDrawView(xController, UNO_QUERY); 418 DBG_ASSERT(xDrawView.is(), "OControlWizard::implDeterminePage: no alternatives left ... can't determine the page!"); 419 if (xDrawView.is()) 420 xPage = xDrawView->getCurrentPage(); 421 } 422 } 423 } 424 else |
| 425 { | 425 { |
| 426 DBG_ASSERT(xPage.is(), "OControlWizard::implDeterminePage: can't determine the page (no model)!"); 427 } 428 m_aContext.xDrawPage = xPage; 429 } 430 catch(Exception&) 431 { 432 DBG_ERROR("OControlWizard::implDeterminePage: caught an exception!"); 433 } --- 18 unchanged lines hidden (view full) --- 452 catch(Exception&) 453 { 454 DBG_ERROR("OControlWizard::implGetDSContext: invalid database context!"); 455 } 456 } 457 458 //--------------------------------------------------------------------- 459 Reference< XConnection > OControlWizard::getFormConnection(const OAccessRegulator&) const | 426 DBG_ASSERT(xPage.is(), "OControlWizard::implDeterminePage: can't determine the page (no model)!"); 427 } 428 m_aContext.xDrawPage = xPage; 429 } 430 catch(Exception&) 431 { 432 DBG_ERROR("OControlWizard::implDeterminePage: caught an exception!"); 433 } --- 18 unchanged lines hidden (view full) --- 452 catch(Exception&) 453 { 454 DBG_ERROR("OControlWizard::implGetDSContext: invalid database context!"); 455 } 456 } 457 458 //--------------------------------------------------------------------- 459 Reference< XConnection > OControlWizard::getFormConnection(const OAccessRegulator&) const |
| 460 { | 460 { |
| 461 return getFormConnection(); 462 } | 461 return getFormConnection(); 462 } |
| 463 //--------------------------------------------------------------------- | 463 //--------------------------------------------------------------------- |
| 464 Reference< XConnection > OControlWizard::getFormConnection() const 465 { 466 Reference< XConnection > xConn; 467 try 468 { 469 if ( !::dbtools::isEmbeddedInDatabase(m_aContext.xForm,xConn) ) | 464 Reference< XConnection > OControlWizard::getFormConnection() const 465 { 466 Reference< XConnection > xConn; 467 try 468 { 469 if ( !::dbtools::isEmbeddedInDatabase(m_aContext.xForm,xConn) ) |
| 470 m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("ActiveConnection")) >>= xConn; | 470 m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("ActiveConnection")) >>= xConn; |
| 471 } 472 catch(const Exception&) 473 { 474 DBG_ERROR("OControlWizard::getFormConnection: caught an exception!"); 475 } 476 return xConn; 477 } 478 --- 6 unchanged lines hidden (view full) --- 485 if (xOldConn.get() == _rxConn.get()) 486 return; 487 488 disposeComponent(xOldConn); 489 490 // set the new connection 491 if ( _bAutoDispose ) 492 { | 471 } 472 catch(const Exception&) 473 { 474 DBG_ERROR("OControlWizard::getFormConnection: caught an exception!"); 475 } 476 return xConn; 477 } 478 --- 6 unchanged lines hidden (view full) --- 485 if (xOldConn.get() == _rxConn.get()) 486 return; 487 488 disposeComponent(xOldConn); 489 490 // set the new connection 491 if ( _bAutoDispose ) 492 { |
| 493 // for this, use a AutoDisposer (so the conn is cleaned up when the form dies or get's another connection) | 493 // for this, use a AutoDisposer (so the conn is cleaned up when the form dies or gets another connection) |
| 494 Reference< XRowSet > xFormRowSet( m_aContext.xForm, UNO_QUERY ); 495 OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn ); 496 Reference< XPropertyChangeListener > xEnsureDelete( pAutoDispose ); 497 } 498 else 499 { 500 m_aContext.xForm->setPropertyValue( ::rtl::OUString::createFromAscii("ActiveConnection"), makeAny( _rxConn ) ); 501 } --- 4 unchanged lines hidden (view full) --- 506 } 507 } 508 509 //--------------------------------------------------------------------- 510 sal_Bool OControlWizard::updateContext(const OAccessRegulator&) 511 { 512 return initContext(); 513 } | 494 Reference< XRowSet > xFormRowSet( m_aContext.xForm, UNO_QUERY ); 495 OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn ); 496 Reference< XPropertyChangeListener > xEnsureDelete( pAutoDispose ); 497 } 498 else 499 { 500 m_aContext.xForm->setPropertyValue( ::rtl::OUString::createFromAscii("ActiveConnection"), makeAny( _rxConn ) ); 501 } --- 4 unchanged lines hidden (view full) --- 506 } 507 } 508 509 //--------------------------------------------------------------------- 510 sal_Bool OControlWizard::updateContext(const OAccessRegulator&) 511 { 512 return initContext(); 513 } |
| 514 //--------------------------------------------------------------------- 515 Reference< XInteractionHandler > OControlWizard::getInteractionHandler(Window* _pWindow) const 516 { 517 const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler"); | 514 //--------------------------------------------------------------------- 515 Reference< XInteractionHandler > OControlWizard::getInteractionHandler(Window* _pWindow) const 516 { 517 const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler"); |
| 518 Reference< XInteractionHandler > xHandler; 519 try 520 { 521 if (getServiceFactory().is()) 522 xHandler = Reference< XInteractionHandler >(getServiceFactory()->createInstance(sInteractionHandlerServiceName), UNO_QUERY); 523 } 524 catch(Exception&) { } 525 if (!xHandler.is()) 526 ShowServiceNotAvailableError(_pWindow, sInteractionHandlerServiceName, sal_True); | 518 Reference< XInteractionHandler > xHandler; 519 try 520 { 521 if (getServiceFactory().is()) 522 xHandler = Reference< XInteractionHandler >(getServiceFactory()->createInstance(sInteractionHandlerServiceName), UNO_QUERY); 523 } 524 catch(Exception&) { } 525 if (!xHandler.is()) 526 ShowServiceNotAvailableError(_pWindow, sInteractionHandlerServiceName, sal_True); |
| 527 return xHandler; 528 } | 527 return xHandler; 528 } |
| 529 //--------------------------------------------------------------------- 530 sal_Bool OControlWizard::initContext() 531 { 532 DBG_ASSERT(m_aContext.xObjectModel.is(), "OGroupBoxWizard::initContext: have no control model to work with!"); 533 if (!m_aContext.xObjectModel.is()) 534 return sal_False; 535 536 // reset the context --- 4 unchanged lines hidden (view full) --- 541 m_aContext.xObjectShape.clear(); 542 m_aContext.aFieldNames.realloc(0); 543 544 m_aContext.xObjectContainer.clear(); 545 m_aContext.aTypes.clear(); 546 m_aContext.bEmbedded = sal_False; 547 548 Any aSQLException; | 529 //--------------------------------------------------------------------- 530 sal_Bool OControlWizard::initContext() 531 { 532 DBG_ASSERT(m_aContext.xObjectModel.is(), "OGroupBoxWizard::initContext: have no control model to work with!"); 533 if (!m_aContext.xObjectModel.is()) 534 return sal_False; 535 536 // reset the context --- 4 unchanged lines hidden (view full) --- 541 m_aContext.xObjectShape.clear(); 542 m_aContext.aFieldNames.realloc(0); 543 544 m_aContext.xObjectContainer.clear(); 545 m_aContext.aTypes.clear(); 546 m_aContext.bEmbedded = sal_False; 547 548 Any aSQLException; |
| 549 Reference< XPreparedStatement > xStatement; | 549 Reference< XPreparedStatement > xStatement; |
| 550 try 551 { 552 // get the datasource context 553 implGetDSContext(); 554 555 // first, determine the form the control belongs to 556 implDetermineForm(); 557 558 // need the page, too 559 implDeterminePage(); 560 561 // the shape of the control 562 implDetermineShape(); 563 | 550 try 551 { 552 // get the datasource context 553 implGetDSContext(); 554 555 // first, determine the form the control belongs to 556 implDetermineForm(); 557 558 // need the page, too 559 implDeterminePage(); 560 561 // the shape of the control 562 implDetermineShape(); 563 |
| 564 // get the columns of the object the settins refer to 565 Reference< XNameAccess > xColumns; | 564 // get the columns of the object the settings refer to 565 Reference< XNameAccess > xColumns; |
| 566 567 if (m_aContext.xForm.is()) 568 { 569 // collect some properties of the form 570 ::rtl::OUString sObjectName = ::comphelper::getString(m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("Command"))); 571 sal_Int32 nObjectType = ::comphelper::getINT32(m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("CommandType"))); 572 573 // calculate the connection the rowset is working with 574 Reference< XConnection > xConnection; | 566 567 if (m_aContext.xForm.is()) 568 { 569 // collect some properties of the form 570 ::rtl::OUString sObjectName = ::comphelper::getString(m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("Command"))); 571 sal_Int32 nObjectType = ::comphelper::getINT32(m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("CommandType"))); 572 573 // calculate the connection the rowset is working with 574 Reference< XConnection > xConnection; |
| 575 m_aContext.bEmbedded = ::dbtools::isEmbeddedInDatabase( m_aContext.xForm, xConnection ); | 575 m_aContext.bEmbedded = ::dbtools::isEmbeddedInDatabase( m_aContext.xForm, xConnection ); |
| 576 if ( !m_aContext.bEmbedded ) | 576 if ( !m_aContext.bEmbedded ) |
| 577 xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, getServiceFactory(), sal_True ); | 577 xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, getServiceFactory(), sal_True ); |
| 578 579 // get the fields 580 if (xConnection.is()) 581 { 582 switch (nObjectType) 583 { 584 case 0: 585 { | 578 579 // get the fields 580 if (xConnection.is()) 581 { 582 switch (nObjectType) 583 { 584 case 0: 585 { |
| 586 Reference< XTablesSupplier > xSupplyTables(xConnection, UNO_QUERY); | 586 Reference< XTablesSupplier > xSupplyTables(xConnection, UNO_QUERY); |
| 587 if (xSupplyTables.is() && xSupplyTables->getTables().is() && xSupplyTables->getTables()->hasByName(sObjectName)) 588 { | 587 if (xSupplyTables.is() && xSupplyTables->getTables().is() && xSupplyTables->getTables()->hasByName(sObjectName)) 588 { |
| 589 Reference< XColumnsSupplier > xSupplyColumns; | 589 Reference< XColumnsSupplier > xSupplyColumns; |
| 590 m_aContext.xObjectContainer = xSupplyTables->getTables(); 591 m_aContext.xObjectContainer->getByName(sObjectName) >>= xSupplyColumns; 592 DBG_ASSERT(xSupplyColumns.is(), "OControlWizard::initContext: invalid table columns!"); 593 xColumns = xSupplyColumns->getColumns(); 594 } 595 } 596 break; 597 case 1: 598 { | 590 m_aContext.xObjectContainer = xSupplyTables->getTables(); 591 m_aContext.xObjectContainer->getByName(sObjectName) >>= xSupplyColumns; 592 DBG_ASSERT(xSupplyColumns.is(), "OControlWizard::initContext: invalid table columns!"); 593 xColumns = xSupplyColumns->getColumns(); 594 } 595 } 596 break; 597 case 1: 598 { |
| 599 Reference< XQueriesSupplier > xSupplyQueries(xConnection, UNO_QUERY); | 599 Reference< XQueriesSupplier > xSupplyQueries(xConnection, UNO_QUERY); |
| 600 if (xSupplyQueries.is() && xSupplyQueries->getQueries().is() && xSupplyQueries->getQueries()->hasByName(sObjectName)) 601 { | 600 if (xSupplyQueries.is() && xSupplyQueries->getQueries().is() && xSupplyQueries->getQueries()->hasByName(sObjectName)) 601 { |
| 602 Reference< XColumnsSupplier > xSupplyColumns; | 602 Reference< XColumnsSupplier > xSupplyColumns; |
| 603 m_aContext.xObjectContainer = xSupplyQueries->getQueries(); 604 m_aContext.xObjectContainer->getByName(sObjectName) >>= xSupplyColumns; 605 DBG_ASSERT(xSupplyColumns.is(), "OControlWizard::initContext: invalid query columns!"); | 603 m_aContext.xObjectContainer = xSupplyQueries->getQueries(); 604 m_aContext.xObjectContainer->getByName(sObjectName) >>= xSupplyColumns; 605 DBG_ASSERT(xSupplyColumns.is(), "OControlWizard::initContext: invalid query columns!"); |
| 606 xColumns = xSupplyColumns->getColumns(); | 606 xColumns = xSupplyColumns->getColumns(); |
| 607 } 608 } 609 break; 610 default: 611 { 612 xStatement = xConnection->prepareStatement(sObjectName); 613 614 // not interested in any results, only in the fields 615 Reference< XPropertySet > xStatementProps(xStatement, UNO_QUERY); 616 xStatementProps->setPropertyValue(::rtl::OUString::createFromAscii("MaxRows"), makeAny(sal_Int32(0))); 617 618 // TODO: think about handling local SQLExceptions here ... | 607 } 608 } 609 break; 610 default: 611 { 612 xStatement = xConnection->prepareStatement(sObjectName); 613 614 // not interested in any results, only in the fields 615 Reference< XPropertySet > xStatementProps(xStatement, UNO_QUERY); 616 xStatementProps->setPropertyValue(::rtl::OUString::createFromAscii("MaxRows"), makeAny(sal_Int32(0))); 617 618 // TODO: think about handling local SQLExceptions here ... |
| 619 Reference< XColumnsSupplier > xSupplyCols(xStatement->executeQuery(), UNO_QUERY); | 619 Reference< XColumnsSupplier > xSupplyCols(xStatement->executeQuery(), UNO_QUERY); |
| 620 if (xSupplyCols.is()) 621 xColumns = xSupplyCols->getColumns(); 622 } 623 } 624 } 625 } 626 627 if (xColumns.is()) --- 25 unchanged lines hidden (view full) --- 653 catch(Exception&) 654 { 655 DBG_ERROR("OControlWizard::initContext: could not retrieve the control context (caught an exception)!"); 656 } 657 658 ::comphelper::disposeComponent(xStatement); 659 660 if (aSQLException.hasValue()) | 620 if (xSupplyCols.is()) 621 xColumns = xSupplyCols->getColumns(); 622 } 623 } 624 } 625 } 626 627 if (xColumns.is()) --- 25 unchanged lines hidden (view full) --- 653 catch(Exception&) 654 { 655 DBG_ERROR("OControlWizard::initContext: could not retrieve the control context (caught an exception)!"); 656 } 657 658 ::comphelper::disposeComponent(xStatement); 659 660 if (aSQLException.hasValue()) |
| 661 { // an SQLException (or derivee) was thrown ... | 661 { // an SQLException (or derive) was thrown ... |
| 662 663 // prepend an extra SQLContext explaining what we were doing 664 SQLContext aContext; 665 aContext.Message = String(ModuleRes(RID_STR_COULDNOTOPENTABLE)); 666 aContext.NextException = aSQLException; 667 668 // create an interaction handler to display this exception 669 Reference< XInteractionHandler > xHandler = getInteractionHandler(this); --- 41 unchanged lines hidden (view full) --- 711 712 //--------------------------------------------------------------------- 713 void OControlWizard::initControlSettings(OControlWizardSettings* _pSettings) 714 { 715 DBG_ASSERT(m_aContext.xObjectModel.is(), "OControlWizard::initControlSettings: have no control model to work with!"); 716 if (!m_aContext.xObjectModel.is()) 717 return; 718 | 662 663 // prepend an extra SQLContext explaining what we were doing 664 SQLContext aContext; 665 aContext.Message = String(ModuleRes(RID_STR_COULDNOTOPENTABLE)); 666 aContext.NextException = aSQLException; 667 668 // create an interaction handler to display this exception 669 Reference< XInteractionHandler > xHandler = getInteractionHandler(this); --- 41 unchanged lines hidden (view full) --- 711 712 //--------------------------------------------------------------------- 713 void OControlWizard::initControlSettings(OControlWizardSettings* _pSettings) 714 { 715 DBG_ASSERT(m_aContext.xObjectModel.is(), "OControlWizard::initControlSettings: have no control model to work with!"); 716 if (!m_aContext.xObjectModel.is()) 717 return; 718 |
| 719 // initialize some settings from the control model give | 719 // initialize some settings from the control model given |
| 720 try 721 { 722 ::rtl::OUString sLabelPropertyName = ::rtl::OUString::createFromAscii("Label"); 723 Reference< XPropertySetInfo > xInfo = m_aContext.xObjectModel->getPropertySetInfo(); 724 if (xInfo.is() && xInfo->hasPropertyByName(sLabelPropertyName)) 725 { 726 ::rtl::OUString sControlLabel; 727 m_aContext.xObjectModel->getPropertyValue(sLabelPropertyName) >>= sControlLabel; --- 4 unchanged lines hidden (view full) --- 732 { 733 DBG_ERROR("OControlWizard::initControlSettings: could not retrieve the basic control settings!"); 734 } 735 } 736 737 //--------------------------------------------------------------------- 738 sal_Bool OControlWizard::needDatasourceSelection() 739 { | 720 try 721 { 722 ::rtl::OUString sLabelPropertyName = ::rtl::OUString::createFromAscii("Label"); 723 Reference< XPropertySetInfo > xInfo = m_aContext.xObjectModel->getPropertySetInfo(); 724 if (xInfo.is() && xInfo->hasPropertyByName(sLabelPropertyName)) 725 { 726 ::rtl::OUString sControlLabel; 727 m_aContext.xObjectModel->getPropertyValue(sLabelPropertyName) >>= sControlLabel; --- 4 unchanged lines hidden (view full) --- 732 { 733 DBG_ERROR("OControlWizard::initControlSettings: could not retrieve the basic control settings!"); 734 } 735 } 736 737 //--------------------------------------------------------------------- 738 sal_Bool OControlWizard::needDatasourceSelection() 739 { |
| 740 // lemme see ... | 740 // let me see... |
| 741 return (0 == getContext().aFieldNames.getLength()); 742 // if we got fields, the data source is valid ... 743// try 744// { 745// // first, we need a valid data source name 746// ::rtl::OUString sDataSourceName; 747// m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("DataSourceName")) >>= sDataSourceName; 748// if (m_aContext.xDatasourceContext.is() && m_aContext.xDatasourceContext->hasByName(sDataSourceName)) --- 25 unchanged lines hidden --- | 741 return (0 == getContext().aFieldNames.getLength()); 742 // if we got fields, the data source is valid ... 743// try 744// { 745// // first, we need a valid data source name 746// ::rtl::OUString sDataSourceName; 747// m_aContext.xForm->getPropertyValue(::rtl::OUString::createFromAscii("DataSourceName")) >>= sDataSourceName; 748// if (m_aContext.xDatasourceContext.is() && m_aContext.xDatasourceContext->hasByName(sDataSourceName)) --- 25 unchanged lines hidden --- |