25#include <com/sun/star/frame/Desktop.hpp>
26#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
63 sal_Int32 nLen = url.indexOf(
':');
64 nLen = url.indexOf(
':',nLen+1);
65 OUString aDSN(url.copy(nLen+1));
69 aURL.SetSmartProtocol(INetProtocol::File);
75 if (
aURL.GetProtocol() == INetProtocol::NotValid )
83 const char pPwd[] =
"password";
85 const PropertyValue *pIter = info.getConstArray();
86 const PropertyValue *pEnd = pIter + info.getLength();
87 for(;pIter != pEnd;++pIter)
89 if(pIter->Name == pPwd)
108 auto pArgs = aArgs.getArray();
109 pArgs[0].Name =
"Hidden";
110 pArgs[0].Value <<=
true;
111 pArgs[1].Name =
"ReadOnly";
112 pArgs[1].Value <<=
true;
116 pArgs[2].Name =
"Password";
122 Any aLoaderException;
125 xComponent = xDesktop->loadComponentFromURL(
130 aLoaderException = ::cppu::getCaughtException();
133 m_xDoc.set(xComponent, UNO_QUERY );
140 if ( aLoaderException.hasValue() )
143 OSL_VERIFY( aLoaderException >>= aLoaderError );
145 SQLException aDetailException;
147 STR_LOAD_FILE_ERROR_MESSAGE,
148 "$exception_type$", aLoaderException.getValueTypeName(),
149 "$error_message$", aLoaderError.Message
151 aErrorDetails <<= aDetailException;
155 STR_COULD_NOT_LOAD_FILE,
191 OConnection::disposing();
202 ::osl::MutexGuard aGuard(
m_aMutex );
210 m_xMetaData = xMetaData;
219 ::osl::MutexGuard aGuard(
m_aMutex );
232 ::osl::MutexGuard aGuard(
m_aMutex );
244 ::osl::MutexGuard aGuard(
m_aMutex );
249 pStmt->construct(
sql);
257 ::osl::MutexGuard aGuard(
m_aMutex );
connectivity::file::OConnection OConnection_BASE
OUString SubstituteVariable(const OUString &rVar) const
OUString getResourceStringWithSubstitution(TranslateId pResId, const char *_pAsciiPatternToReplace, const OUString &_rStringToSubstitute) const
loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
css::uno::Reference< css::sheet::XSpreadsheetDocument > const & acquireDoc()
css::uno::Reference< css::sheet::XSpreadsheetDocument > m_xDoc
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
virtual void construct(const OUString &_rUrl, const css::uno::Sequence< css::beans::PropertyValue > &_rInfo) override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual ~OCalcConnection() override
rtl::Reference< CloseVetoButTerminateListener > m_xCloseVetoButTerminateListener
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
virtual void SAL_CALL disposing() override
oslInterlockedCount m_nDocCount
Prepared statement implementation for Writer tables and Calc sheets.
Statement implementation for Writer tables and Calc sheets.
css::uno::WeakReference< css::sdbcx::XTablesSupplier > m_xCatalog
OFileDriver * getDriver() const
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
void checkDisposed(bool _bThrow)