/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include "mysqlc_connection.hxx" #include "mysqlc_databasemetadata.hxx" #include "mysqlc_driver.hxx" #include "mysqlc_statement.hxx" #include "mysqlc_preparedstatement.hxx" #include "mysqlc_general.hxx" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace connectivity::mysqlc; #include using namespace com::sun::star::uno; using namespace com::sun::star::container; using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; using ::osl::MutexGuard; #define MYSQLC_URI_PREFIX "sdbc:mysqlc:" OConnection::OConnection(MysqlCDriver& _rDriver, sql::Driver * _cppDriver) :OMetaConnection_BASE(m_aMutex) ,OSubComponent(static_cast(&_rDriver), this) ,m_xMetaData(nullptr) ,m_rDriver(_rDriver) ,cppDriver(_cppDriver) ,m_bClosed(false) { m_rDriver.acquire(); } OConnection::~OConnection() { if (!isClosed()) { close(); } m_rDriver.release(); } void SAL_CALL OConnection::release() throw() { release_ChildImpl(); } void OConnection::construct(const rtl::OUString& url, const Sequence< PropertyValue >& info) { MutexGuard aGuard(m_aMutex); sal_Int32 nIndex; bool bEmbedded = false; rtl::OUString token; rtl::OUString aHostName("localhost"); sal_Int32 nPort = 3306; rtl::OUString aDbName; m_settings.encoding = MysqlCDriver::getDefaultEncoding(); m_settings.quoteIdentifier.clear(); // parse url. Url has the following format: // external server: sdbc:mysqlc:[hostname]:[port]/[dbname] if (url.startsWith(MYSQLC_URI_PREFIX)) { nIndex = 12; } else { bEmbedded = true; nIndex = 20; mysqlc_sdbc_driver::throwFeatureNotImplementedException("OConnection::construct (embedded MySQL)", *this); } token = url.getToken(0, '/', nIndex); if (!token.isEmpty()) { sal_Int32 nIndex1 = 0; rtl::OUString hostandport = token.getToken(0,':', nIndex1); if (!hostandport.isEmpty()) { aHostName = hostandport; hostandport = token.getToken(0, ':', nIndex1); if (!hostandport.isEmpty() && nIndex1) { nPort = hostandport.toInt32(); } token = url.getToken(0, '/', nIndex); if (!token.isEmpty() && nIndex) { aDbName = token; } } } // get user and password for mysql connection const PropertyValue *pIter = info.getConstArray(); const PropertyValue *pEnd = pIter + info.getLength(); rtl::OUString aUser, aPass, sUnixSocket, sNamedPipe; bool unixSocketPassed = false; bool namedPipePassed = false; m_settings.connectionURL = url; for (;pIter != pEnd;++pIter) { if (pIter->Name.equalsAscii("user")) { OSL_VERIFY( pIter->Value >>= aUser ); } else if (pIter->Name.equalsAscii("password")) { OSL_VERIFY( pIter->Value >>= aPass ); } else if (pIter->Name.equalsAscii("LocalSocket")) { OSL_VERIFY( pIter->Value >>= sUnixSocket ); unixSocketPassed = !sUnixSocket.isEmpty(); } else if (pIter->Name.equalsAscii("NamedPipe")) { OSL_VERIFY( pIter->Value >>= sNamedPipe ); namedPipePassed = !sNamedPipe.isEmpty(); } else if ( pIter->Name.equalsAscii("PublicConnectionURL")) { OSL_VERIFY( pIter->Value >>= m_settings.connectionURL ); } else if ( pIter->Name.equalsAscii("NewURL")) { // legacy name for "PublicConnectionURL" OSL_VERIFY( pIter->Value >>= m_settings.connectionURL ); } } if (!bEmbedded) { try { sql::ConnectOptionsMap connProps; std::string host_str = rtl::OUStringToOString(aHostName, m_settings.encoding).getStr(); std::string user_str = rtl::OUStringToOString(aUser, m_settings.encoding).getStr(); std::string pass_str = rtl::OUStringToOString(aPass, m_settings.encoding).getStr(); std::string schema_str = rtl::OUStringToOString(aDbName, m_settings.encoding).getStr(); connProps["hostName"] = sql::ConnectPropertyVal(host_str); connProps["userName"] = sql::ConnectPropertyVal(user_str); connProps["password"] = sql::ConnectPropertyVal(pass_str); connProps["schema"] = sql::ConnectPropertyVal(schema_str); connProps["port"] = sql::ConnectPropertyVal((int)(nPort)); if (unixSocketPassed) { sql::SQLString socket_str = rtl::OUStringToOString(sUnixSocket, m_settings.encoding).getStr(); connProps["socket"] = socket_str; } else if (namedPipePassed) { sql::SQLString pipe_str = rtl::OUStringToOString(sNamedPipe, m_settings.encoding).getStr(); connProps["socket"] = pipe_str; } m_settings.cppConnection.reset(cppDriver->connect(connProps)); } catch (const sql::SQLException &e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } else { // TODO: support for embedded server } m_settings.schema = aDbName; // Check if the server is 4.1 or above if (this->getMysqlVersion() < 40100) { throw SQLException( "MariaDB LibreOffice Connector requires MySQL Server 4.1 or above", *this, rtl::OUString(), 0, Any()); } std::unique_ptr stmt(m_settings.cppConnection->createStatement()); stmt->executeUpdate("SET session sql_mode='ANSI_QUOTES'"); stmt->executeUpdate("SET NAMES utf8"); } rtl::OUString OConnection::getImplementationName() { return rtl::OUString("com.sun.star.sdbc.drivers.mysqlc.OConnection"); } css::uno::Sequence OConnection::getSupportedServiceNames() { css::uno::Sequence s(1); s[0] = "com.sun.star.sdbc.Connection"; return s; } sal_Bool OConnection::supportsService(rtl::OUString const & ServiceName) { return cppu::supportsService(this, ServiceName); } Reference< XStatement > SAL_CALL OConnection::createStatement() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); // create a statement Reference< XStatement > xReturn; // the statement can only be executed once try { xReturn = new OStatement(this, m_settings.cppConnection->createStatement()); m_aStatements.push_back(WeakReferenceHelper(xReturn)); return xReturn; } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return xReturn; } Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement(const rtl::OUString& _sSql) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); const rtl::OUString sSqlStatement = transFormPreparedStatement( _sSql ); Reference< XPreparedStatement > xStatement; try { // create a statement // the statement can only be executed more than once xStatement = new OPreparedStatement(this, m_settings.cppConnection->prepareStatement(rtl::OUStringToOString(sSqlStatement, getConnectionEncoding()).getStr())); m_aStatements.push_back( WeakReferenceHelper( xStatement ) ); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return xStatement; } Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall(const rtl::OUString& /*_sSql*/ ) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); mysqlc_sdbc_driver::throwFeatureNotImplementedException("OConnection::prepareCall", *this); return Reference< XPreparedStatement >(); } rtl::OUString SAL_CALL OConnection::nativeSQL(const rtl::OUString& _sSql) { MutexGuard aGuard(m_aMutex); const rtl::OUString sSqlStatement = transFormPreparedStatement( _sSql ); rtl::OUString sNativeSQL; try { sNativeSQL = mysqlc_sdbc_driver::convert(m_settings.cppConnection->nativeSQL(mysqlc_sdbc_driver::convert(sSqlStatement, getConnectionEncoding())), getConnectionEncoding()); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return sNativeSQL; } void SAL_CALL OConnection::setAutoCommit(sal_Bool autoCommit) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { m_settings.cppConnection->setAutoCommit(autoCommit); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } sal_Bool SAL_CALL OConnection::getAutoCommit() { // you have to distinguish which if you are in autocommit mode or not // at normal case true should be fine here MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); bool autoCommit = false; try { autoCommit = m_settings.cppConnection->getAutoCommit(); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return autoCommit; } void SAL_CALL OConnection::commit() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { m_settings.cppConnection->commit(); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } void SAL_CALL OConnection::rollback() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { m_settings.cppConnection->rollback(); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } sal_Bool SAL_CALL OConnection::isClosed() { MutexGuard aGuard(m_aMutex); // just simple -> we are close when we are disposed that means someone called dispose(); (XComponent) return OConnection_BASE::rBHelper.bDisposed; } Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); Reference< XDatabaseMetaData > xMetaData = m_xMetaData; if (!xMetaData.is()) { try { xMetaData = new ODatabaseMetaData(*this); // need the connection because it can return it } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } m_xMetaData = xMetaData; } return xMetaData; } void SAL_CALL OConnection::setReadOnly(sal_Bool readOnly) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); m_settings.readOnly = readOnly; } sal_Bool SAL_CALL OConnection::isReadOnly() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); // return if your connection to readonly return m_settings.readOnly; } void SAL_CALL OConnection::setCatalog(const rtl::OUString& catalog) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { // m_settings.cppConnection->setCatalog(rtl::OUStringToOString(catalog, m_settings.encoding).getStr()); m_settings.cppConnection->setSchema(rtl::OUStringToOString(catalog, getConnectionEncoding()).getStr()); } catch (sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } rtl::OUString SAL_CALL OConnection::getCatalog() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); rtl::OUString catalog; try { catalog = mysqlc_sdbc_driver::convert(m_settings.cppConnection->getSchema(), getConnectionEncoding()); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return catalog; } void SAL_CALL OConnection::setTransactionIsolation(sal_Int32 level) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); sql::enum_transaction_isolation cpplevel = sql::TRANSACTION_SERIALIZABLE; switch (level) { case TransactionIsolation::READ_UNCOMMITTED: cpplevel = sql::TRANSACTION_READ_UNCOMMITTED; break; case TransactionIsolation::READ_COMMITTED: cpplevel = sql::TRANSACTION_READ_COMMITTED; break; case TransactionIsolation::REPEATABLE_READ: cpplevel = sql::TRANSACTION_REPEATABLE_READ; break; case TransactionIsolation::SERIALIZABLE: cpplevel = sql::TRANSACTION_SERIALIZABLE; break; case TransactionIsolation::NONE: cpplevel = sql::TRANSACTION_SERIALIZABLE; break; default:; /* XXX: Exception ?? */ } try { m_settings.cppConnection->setTransactionIsolation(cpplevel); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } } sal_Int32 SAL_CALL OConnection::getTransactionIsolation() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); try { switch (m_settings.cppConnection->getTransactionIsolation()) { case sql::TRANSACTION_SERIALIZABLE: return TransactionIsolation::SERIALIZABLE; case sql::TRANSACTION_REPEATABLE_READ: return TransactionIsolation::REPEATABLE_READ; case sql::TRANSACTION_READ_COMMITTED: return TransactionIsolation::READ_COMMITTED; case sql::TRANSACTION_READ_UNCOMMITTED: return TransactionIsolation::READ_UNCOMMITTED; default: ; } } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return TransactionIsolation::NONE; } Reference SAL_CALL OConnection::getTypeMap() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); Reference t = m_typeMap; return t; } void SAL_CALL OConnection::setTypeMap(const Reference& typeMap) { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); m_typeMap = typeMap; } // XCloseable void SAL_CALL OConnection::close() { /* we need block, because the mutex is a local variable, which will guard the block */ { // we just dispose us MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); } dispose(); } // XWarningsSupplier Any SAL_CALL OConnection::getWarnings() { Any x = Any(); // when you collected some warnings -> return it return x; } void SAL_CALL OConnection::clearWarnings() { // you should clear your collected warnings here# } void OConnection::disposing() { // we noticed that we should be destroied in near future so we have to dispose our statements MutexGuard aGuard(m_aMutex); for (OWeakRefArray::iterator i = m_aStatements.begin(); i != m_aStatements.end() ; ++i) { Reference< XComponent > xComp(i->get(), UNO_QUERY); if (xComp.is()) { xComp->dispose(); } } m_aStatements.clear(); m_bClosed = true; m_xMetaData = WeakReference< XDatabaseMetaData >(); dispose_ChildImpl(); OConnection_BASE::disposing(); } sal_Int32 OConnection::getMysqlVersion() { MutexGuard aGuard(m_aMutex); checkDisposed(OConnection_BASE::rBHelper.bDisposed); sal_Int32 version(0); try { version = 10000 * m_settings.cppConnection->getMetaData()->getDatabaseMajorVersion(); version += 100 * m_settings.cppConnection->getMetaData()->getDatabaseMinorVersion(); version += m_settings.cppConnection->getMetaData()->getDatabasePatchVersion(); } catch (const sql::SQLException & e) { mysqlc_sdbc_driver::translateAndThrow(e, *this, getConnectionEncoding()); } return version; } rtl::OUString OConnection::transFormPreparedStatement(const rtl::OUString& _sSQL) { rtl::OUString sSqlStatement = _sSQL; if ( !m_xParameterSubstitution.is() ) { try { Sequence< Any > aArgs(1); Reference< XConnection> xCon = this; aArgs[0] <<= NamedValue(rtl::OUString("ActiveConnection"), makeAny(xCon)); m_xParameterSubstitution.set(m_rDriver.getFactory()->createInstanceWithArguments("org.openoffice.comp.helper.ParameterSubstitution",aArgs),UNO_QUERY); } catch(const Exception&) {} } if ( m_xParameterSubstitution.is() ) { try { sSqlStatement = m_xParameterSubstitution->substituteVariables(sSqlStatement,true); } catch(const Exception&) { } } return sSqlStatement; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ained-text-boxes LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-25svx: combine svx::NamedThemedColor into NamedColorTomaž Vajngerl
Change-Id: I9a9656ddce9c12564411cfcb3e8e8714ae74a418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152236 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-25svx: change NamedColor be a struct instead of std::pairTomaž Vajngerl
Change-Id: Ice1625e8cae8da859ea8a940b3f8e40f6f9d7037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152235 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-20sd theme: allow setting the color's theme index in the chardlgMiklos Vajna
This routes not only the rgb color and a name, but also a theme index from the color picker to the chardlg (only there as a start). That way the picked color will be updated if the master page theme changes. Change-Id: I7a45d7cf63c7c36013e4656c66d9b2dbc3aa0b88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127135 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-08-11convert some LogicToLogic calls to use o3tl::convert insteadTomaž Vajngerl
If a LogicToLogic uses fixed units, we can use o3tl::convert instead. We can also do the same for all other cases where LogicToLogic is used, but that needs additional investigation to determine if it is safe to do so. Note: MapUnit::Pixel is converted to o3tl::Length::pt because it assumed 72 PPI for a logical pixel, which corresponds with the conversion rate of a point (72 PPI). Today, 96 PPI is standard, which is also used for o3tl::Length:px. Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-09defer getting toplevel for color picker until we need itCaolán McNamara
Change-Id: I60f4ded47f7d80b397647ea3344e83a5dfd1b11e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112183 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-16loplugin:referencecasting in reportdesignNoel
Also, I needed to add castToXInterface() to the upcasting Reference::Reference constructor, to resolve ambiguity in casting to XInterface. Change-Id: Ica60190bc842444c37de56407b586aa267f08372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16make the Color constructors explicitly specify transparencyNoel
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-18Clarify signature of some opertor() that must match ColorSelectFunctionStephan Bergmann
Change-Id: Ibb71d1e993bbb0fa453c59f48ab5f7c79e1d8025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106036 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-03Resolves tdf#137059 - Use application colors for font previewHeiko Tietze
Background is set to document's application color now (options > application colors > document) to provide a true WYSIWYG experience (except for modifications to the page background color). Change-Id: Ifd78e667f3eeff3573ff09bcb4d2a9634dd49c99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105011 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-05tdf#42949 Fix IWYU warnings in reportdesign/*/*cxxGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ica1a10a8f8fff7c3780adcc30b2c8d0e385b1326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-02loplugin:flatten in reportdesignNoel Grandin
Change-Id: I6d8b2730cede4453e7afd581cc24ed101ca6c81b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91557 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-24loplugin:makeshared in reportdesignNoel Grandin
Change-Id: I3f7cb6010142c8bdce96bf541a7efb650233942e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87325 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-06weld AreaPropertyPanelCaolán McNamara
Change-Id: I5f4c4b43067b99cd57f8ea941002481ef5977e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86144 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-03drop some unnecessary includesCaolán McNamara
Change-Id: Ic88ed0d36f1aae9f32a0097354042526fc18d649 Reviewed-on: https://gerrit.libreoffice.org/84244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-13no longer need bInterimBuilderCaolán McNamara
Change-Id: Ieff1e34de9665c80ded39d605656fe7d0626aec7 Reviewed-on: https://gerrit.libreoffice.org/80716 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-13weld ConditionalFormattingDialogCaolán McNamara
Change-Id: I87c03555c5555b12a1be997e368a96d9b07d2b63 Reviewed-on: https://gerrit.libreoffice.org/80689 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-03loplugin:virtualdeadNoel Grandin
Change-Id: I86bae18ed2682871032aeb2a178f49f3e4601129 Reviewed-on: https://gerrit.libreoffice.org/80129 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-27tdf#42949 Fix IWYU warnings in include/svx/[a-D]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9770343f31f882427c9ae13e363b59cd1fb47e98 Reviewed-on: https://gerrit.libreoffice.org/71295 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-12Simplify containers iterations in reportdesign, sal, saxArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-17Rename BorderColorStatus to ColorStatusMaxim Monastirsky
Next commit will use this for all color status updates, not just for borders. Change-Id: Ibd95d755a33bfc079fcbffabfd8896b6b777609f Reviewed-on: https://gerrit.libreoffice.org/63498 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2018-10-27tdf#108751 Show currently selected color name in color button tooltipJim Raykowski
Based on Heiko Tietze's work in I26f0500527d2b86049948ca64e636e1ff566f262 Change-Id: I20541dd6ad155a39c0f87361088b44923406064f Reviewed-on: https://gerrit.libreoffice.org/61815 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-09-10loplugin:simplifyconstruct in reportdesign..saxNoel Grandin
Change-Id: I7d2a754cdc5576b5a5b35db2fbffd19ea17c16ff Reviewed-on: https://gerrit.libreoffice.org/60224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in rptui::ConditionNoel Grandin
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374 Reviewed-on: https://gerrit.libreoffice.org/57879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22Resolves: tdf#118251 decide what parent colorpicker should have...Caolán McNamara
depending on if launched from a listbox within a dialog, or from a (potentially) ephemeral toolbar Change-Id: I5d3b5cc6dd501490b99b46250e2729fb8bc2a2e2 Reviewed-on: https://gerrit.libreoffice.org/56297 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-27make WB_LINESPACING a bool field on ToolboxNoel Grandin
Change-Id: If9332993a4917b00c230d2a3693daf8c5d3f5559 Reviewed-on: https://gerrit.libreoffice.org/53521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-07use more Color in reportdesignNoel Grandin
Change-Id: I9e51bfa6346823863b00bca9c007e28de62aab29 Reviewed-on: https://gerrit.libreoffice.org/50859 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-01tdf#42949 Remove unneeded helpids.h headers (2/3)Gabor Kelemen
A side effect of the .ui migration is that we use a lot less HIDs in the code. A lot of files still contain helpids.h includes even if no actual HID is referenced. This cleans up directories r* - svx*. Found with: git grep helpids.h | cut -d : -f 1 | xargs grep -c HID_ | grep :0$ Change-Id: I81bdb80161b0207f5df651eb17c58caef44250d3 Reviewed-on: https://gerrit.libreoffice.org/46869 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-17Handle focus_on_click glade property for buttonsMaxim Monastirsky
It maps to our WB_NOPOINTERFOCUS. Change-Id: Ib00e696801b72de2c931e282ed8d50c972fa59fb Reviewed-on: https://gerrit.libreoffice.org/47990 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2018-01-12More loplugin:cstylecast: reportdesignStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I690ddd7eeb5fbac979292a382074e9b29c065416
2017-11-09Resolves: tdf#113695 crash in color picker after parent is closedCaolán McNamara
Change-Id: If2217abed784bf24e37e3403fa33cd2663dc51a4 Reviewed-on: https://gerrit.libreoffice.org/44545 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-26vcl: make MapMode constructor explicitMichael Stahl
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-23loplugin:includeform: reportdesignStephan Bergmann
Change-Id: Ie531677be09c264ed1536ad2512e76f29ab46881
2017-09-24tdf#106762 Base SvxColorToolBoxControl on svt::PopupWindowControllerMaxim Monastirsky
This allows us to support tearoff without breaking gtk3/wayland. SvxColorWindow no longer inherits from FloatingWindow, so several call sites need also to be changed to use DockingManager. Change-Id: I5d0bc611bbd2a8b9bfd4335212d0ae7e8fc10593