diff options
author | sb <sb@openoffice.org> | 2010-04-07 13:14:23 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-04-07 13:14:23 +0200 |
commit | 55d474d85391d1eb9c9c6f04f88ed9a9f5161b13 (patch) | |
tree | f09b37fae8df408fbd154e93a7396c1517d1b802 /extensions/source | |
parent | d11e7c65afe7eb24f8c696b5bd18898ae095f382 (diff) | |
parent | 1b192bd38a3695cc2965ece438d47d6f74958289 (diff) |
sb118: merged in re/DEV300_next towards DEV300_m76
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 2 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 2 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.hxx | 2 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 32 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.hxx | 9 | ||||
-rw-r--r-- | extensions/source/propctrlr/propres.src | 5 | ||||
-rw-r--r-- | extensions/source/propctrlr/propresid.hrc | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/usercontrol.cxx | 58 | ||||
-rw-r--r-- | extensions/source/propctrlr/usercontrol.hxx | 3 |
10 files changed, 86 insertions, 32 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index b6d5298b7712..07bca1490e35 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -542,7 +542,7 @@ namespace abp // ................................................................ // create the interaction handler (needed for authentication and error handling) - static ::rtl::OUString s_sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler"); + static ::rtl::OUString s_sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler"); Reference< XInteractionHandler > xInteractions; try { diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 92a59665d1b5..9fa401a1620c 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -148,7 +148,7 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL) try { - Reference<XInterface> xHdl = xMgr->createInstance(C2U("com.sun.star.sdb.InteractionHandler")); + Reference<XInterface> xHdl = xMgr->createInstance(C2U("com.sun.star.task.InteractionHandler")); Reference<task::XInteractionHandler> xIHdl(xHdl, UNO_QUERY); xConn = xComplConn->connectWithCompletion(xIHdl); // xConn = xDataSource->getConnection(sUser, sPwd); diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 675452801029..b97eb60504b4 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -518,7 +518,7 @@ namespace dbp //--------------------------------------------------------------------- Reference< XInteractionHandler > OControlWizard::getInteractionHandler(Window* _pWindow) const { - const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler"); + const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler"); Reference< XInteractionHandler > xHandler; try { diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index 4615d2529adb..13920c5978f7 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -145,7 +145,7 @@ namespace dbp ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getFormConnection(const OAccessRegulator&) const; - /** returns the com.sun.star.sdb.InteractionHandler + /** returns the com.sun.star.task.InteractionHandler @param _pWindow The window will be used when an error message has to be shown. */ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > getInteractionHandler(Window* _pWindow) const; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 8302f9fff503..fbf2cc38b63e 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -30,6 +30,7 @@ #include "controltype.hxx" #include "propctrlr.hrc" +#include "extensio.hrc" #include "fontdialog.hxx" #include "formcomponenthandler.hxx" #include "formlinkdialog.hxx" @@ -2535,17 +2536,38 @@ namespace pcr Reference< XQueriesSupplier > xSupplyQueries( m_xRowSetConnection, UNO_QUERY ); Reference< XNameAccess > xQueryNames; if ( xSupplyQueries.is() ) + { xQueryNames = xSupplyQueries->getQueries(); - DBG_ASSERT( xQueryNames.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" ); - if ( !xQueryNames.is() ) + impl_fillQueryNames_throw(xQueryNames,_out_rNames); + } + } + //------------------------------------------------------------------------ + void FormComponentPropertyHandler::impl_fillQueryNames_throw( const Reference< XNameAccess >& _xQueryNames,::std::vector< ::rtl::OUString >& _out_rNames,const ::rtl::OUString& _sName ) const + { + DBG_ASSERT( _xQueryNames.is(), "FormComponentPropertyHandler::impl_fillQueryNames_throw: no way to obtain the queries of the connection!" ); + if ( !_xQueryNames.is() ) return; - Sequence< ::rtl::OUString> aQueryNames = xQueryNames->getElementNames(); + Sequence< ::rtl::OUString> aQueryNames = _xQueryNames->getElementNames(); sal_uInt32 nCount = aQueryNames.getLength(); const ::rtl::OUString* pQueryNames = aQueryNames.getConstArray(); + sal_Bool bAdd = _sName.getLength(); for ( sal_uInt32 i=0; i<nCount; i++, ++pQueryNames ) - _out_rNames.push_back( *pQueryNames ); + { + ::rtl::OUStringBuffer sTemp; + if ( bAdd ) + { + sTemp.append(_sName); + sTemp.appendAscii("/"); + } + sTemp.append(*pQueryNames); + Reference< XNameAccess > xSubQueries(_xQueryNames->getByName(*pQueryNames),UNO_QUERY); + if ( xSubQueries.is() ) + impl_fillQueryNames_throw(xSubQueries,_out_rNames,sTemp.makeStringAndClear()); + else + _out_rNames.push_back( sTemp.makeStringAndClear() ); + } } //------------------------------------------------------------------------ @@ -2707,7 +2729,7 @@ namespace pcr SvNumberFormatter* pFormatter = pSupplier->GetNumberFormatter(); double dPreviewVal = OFormatSampleControl::getPreviewValue(pFormatter,nFormatKey); - SvxNumberInfoItem aFormatter( pFormatter, dPreviewVal, SID_ATTR_NUMBERFORMAT_INFO ); + SvxNumberInfoItem aFormatter( pFormatter, dPreviewVal, String( PcrRes( RID_STR_TEXT_FORMAT ) ), SID_ATTR_NUMBERFORMAT_INFO ); aCoreSet.Put( aFormatter ); // a tab dialog with a single page diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index dfe976e6de75..ea724c61828c 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -235,6 +235,15 @@ namespace pcr */ void impl_fillQueryNames_throw( ::std::vector< ::rtl::OUString >& _out_rNames ) const; + /** describes the UI for selecting a query name + + @precond + m_xRowSetConnection is not <NULL/> + */ + void impl_fillQueryNames_throw( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xQueryNames + ,::std::vector< ::rtl::OUString >& _out_rNames + ,const ::rtl::OUString& _sName = ::rtl::OUString() ) const; + /** describes the UI for selecting a ListSource (for list-like form controls) @precond ->m_xRowSetConnection is not <NULL/> diff --git a/extensions/source/propctrlr/propres.src b/extensions/source/propctrlr/propres.src index 2701c0e3a1df..23b11a932e34 100644 --- a/extensions/source/propctrlr/propres.src +++ b/extensions/source/propctrlr/propres.src @@ -61,3 +61,8 @@ String RID_EMBED_IMAGE_PLACEHOLDER { Text [ en-US ] = "<Embedded-Image>"; }; + +String RID_STR_TEXT_FORMAT +{ + Text [ en-US ] = "Text"; +}; diff --git a/extensions/source/propctrlr/propresid.hrc b/extensions/source/propctrlr/propresid.hrc index bdf79c7d5c81..5328617735a9 100644 --- a/extensions/source/propctrlr/propresid.hrc +++ b/extensions/source/propctrlr/propresid.hrc @@ -42,6 +42,7 @@ #define RID_STR_PROPPAGE_DEFAULT ( RID_PROPCONTROLLER_START + 1 ) #define RID_STR_PROPPAGE_DATA ( RID_PROPCONTROLLER_START + 2 ) #define RID_STR_HELP_SECTION_LABEL ( RID_PROPCONTROLLER_START + 3 ) -#define RID_EMBED_IMAGE_PLACEHOLDER ( RID_PROPCONTROLLER_START + 5 ) +#define RID_EMBED_IMAGE_PLACEHOLDER ( RID_PROPCONTROLLER_START + 4 ) +#define RID_STR_TEXT_FORMAT ( RID_PROPCONTROLLER_START + 5 ) #endif // EXTENSIONS_PROPRESID_HRC diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index 3bbc8dd7d7b7..e168fd0da830 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/util/Time.hpp> #include "modulepcr.hxx" #include "propresid.hrc" + //............................................................................ namespace pcr { @@ -115,39 +116,52 @@ namespace pcr getTypedControlWindow()->SetFormatKey( nFormatKey ); SvNumberFormatter* pNF = getTypedControlWindow()->GetFormatter(); - getTypedControlWindow()->SetValue( getPreviewValue(pNF,getTypedControlWindow()->GetFormatKey()) ); + const SvNumberformat* pEntry = pNF->GetEntry( nFormatKey ); + OSL_ENSURE( pEntry, "OFormatSampleControl::setValue: invalid format entry!" ); + + const bool bIsTextFormat = ( pEntry && pEntry->IsTextFormat() ); + if ( bIsTextFormat ) + getTypedControlWindow()->SetText( String( PcrRes( RID_STR_TEXT_FORMAT ) ) ); + else + getTypedControlWindow()->SetValue( pEntry ? getPreviewValue( *pEntry ) : 1234.56789 ); } else getTypedControlWindow()->SetText( String() ); } //------------------------------------------------------------------ + double OFormatSampleControl::getPreviewValue( const SvNumberformat& i_rEntry ) + { + double nValue = 1234.56789; + switch ( i_rEntry.GetType() & ~NUMBERFORMAT_DEFINED ) + { + case NUMBERFORMAT_DATE: + { + Date aCurrentDate; + static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899); + nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE); + } + break; + case NUMBERFORMAT_TIME: + case NUMBERFORMAT_DATETIME: + { + Time aCurrentTime; + nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime())); + } + break; + default: + break; + } + return nValue; + } + + //------------------------------------------------------------------ double OFormatSampleControl::getPreviewValue(SvNumberFormatter* _pNF,sal_Int32 _nFormatKey) { const SvNumberformat* pEntry = _pNF->GetEntry(_nFormatKey); DBG_ASSERT( pEntry, "OFormattedNumericControl::SetFormatDescription: invalid format key!" ); double nValue = 1234.56789; if ( pEntry ) - { - switch (pEntry->GetType() & ~NUMBERFORMAT_DEFINED) - { - case NUMBERFORMAT_DATE: - { - Date aCurrentDate; - static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899); - nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE); - } - break; - case NUMBERFORMAT_TIME: - case NUMBERFORMAT_DATETIME: - { - Time aCurrentTime; - nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime())); - } - break; - default: - break; - } - } + nValue = getPreviewValue( *pEntry ); return nValue; } //------------------------------------------------------------------ diff --git a/extensions/source/propctrlr/usercontrol.hxx b/extensions/source/propctrlr/usercontrol.hxx index 88bb20223516..82835d1df16e 100644 --- a/extensions/source/propctrlr/usercontrol.hxx +++ b/extensions/source/propctrlr/usercontrol.hxx @@ -87,6 +87,9 @@ namespace pcr * \return current date or time or the value 1234.56789 */ static double getPreviewValue(SvNumberFormatter* _pNF,sal_Int32 _nFormatKey); + + private: + static double getPreviewValue( const SvNumberformat& i_rEntry ); }; //======================================================================== |