[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 85c25ec9f198e9c335cb6f622acdab67a9c41f71 Author: Stephan Bergmann AuthorDate: Sun Nov 19 13:21:56 2023 +0100 Commit: Stephan Bergmann CommitDate: Sun Nov 19 17:30:10 2023 +0100 Extended loplugin:ostr: xmlhelp Change-Id: I8be963a7a2befe95ce30027c3298e1a41b217d0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159663 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 8859970980b9..345693b2e7c8 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -770,11 +770,11 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam, parString[last++] = "'css'"; parString[last++] = "vendorname"; -parString[last++] = OString("''"); +parString[last++] = "''"_ostr; parString[last++] = "vendorversion"; -parString[last++] = OString("''"); +parString[last++] = "''"_ostr; parString[last++] = "vendorshort"; -parString[last++] = OString("''"); +parString[last++] = "''"_ostr; } // Do we need to add extension path?
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/db.cxx | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) New commits: commit b36b24ecfbb7e9fc6c5d5d0a789fabd2a0cb18b3 Author: Stephan Bergmann AuthorDate: Thu Oct 26 08:54:31 2023 +0200 Commit: Stephan Bergmann CommitDate: Thu Oct 26 19:08:08 2023 +0200 Use std::from_chars (which also makes readInt32 report failure, instead of running into UB, when the read value is out of range) Change-Id: I8449e4fe696c9b0ab5b868127ef517dc080c31ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158489 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx index bf3c269b99ca..d60bff78ee63 100644 --- a/xmlhelp/source/cxxhelp/provider/db.cxx +++ b/xmlhelp/source/cxxhelp/provider/db.cxx @@ -20,28 +20,23 @@ #include "db.hxx" +#include +#include #include +#include #include #include -#include using namespace com::sun::star::uno; using namespace com::sun::star::io; namespace { -//TODO: Replace with C++17 std::from_chars once available: std::pair readInt32(char const * begin, char const * end) { sal_Int32 n = 0; -for (; begin != end; ++begin) { -auto const w = INetMIME::getHexWeight(static_cast(*begin)); -if (w == -1) { -break; -} -n = 16 * n + w; -} -return {n, begin}; +auto const [ptr, ec] = std::from_chars(begin, end, n, 16); +return {std::max(n, sal_Int32(0)), ec == std::errc{} && n >= 0 ? ptr : begin}; } }
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 120 ++ xmlhelp/source/cxxhelp/provider/databases.hxx | 27 - 2 files changed, 104 insertions(+), 43 deletions(-) New commits: commit 5195530f3ac43f071bc5676fd7ad1a0adc63e9d8 Author: Michael Stahl AuthorDate: Fri Apr 14 18:48:44 2023 +0200 Commit: Michael Stahl CommitDate: Tue Apr 18 11:28:20 2023 +0200 xmlhelp: fix lots of deadlocks Not sure if any of this makes sense but it doesn't deadlock immediatly. (regression from comit 2c37a0ca31095165d05740a2ff4969f625b4a75b) Change-Id: I4a5e01acb06b56a78453900a143d36cad1156f21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150431 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index be5f964ca292..351625e7dbcb 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -277,6 +277,11 @@ OUString Databases::getInstallPathAsURL() return m_aInstallDirectory; } +OUString Databases::getInstallPathAsURL(std::unique_lock& ) +{ +return m_aInstallDirectory; +} + const std::vector< OUString >& Databases::getModuleList( const OUString& Language ) { if( m_avModules.empty() ) @@ -430,20 +435,29 @@ OUString Databases::processLang( std::unique_lock& /*rGuard*/, const return ret; } -helpdatafileproxy::Hdf* Databases::getHelpDataFile( std::u16string_view Database, +helpdatafileproxy::Hdf* Databases::getHelpDataFile(std::u16string_view Database, const OUString& Language, bool helpText, const OUString* pExtensionPath ) +{ +std::unique_lock aGuard( m_aMutex ); + +return getHelpDataFile(aGuard, Database, Language, helpText, pExtensionPath); +} + +helpdatafileproxy::Hdf* Databases::getHelpDataFile(std::unique_lock& rGuard, +std::u16string_view Database, +const OUString& Language, bool helpText, +const OUString* pExtensionPath ) + { if( Database.empty() || Language.isEmpty() ) return nullptr; -std::unique_lock aGuard( m_aMutex ); - OUString aFileExt( helpText ? OUString(".ht") : OUString(".db") ); OUString dbFileName = OUString::Concat("/") + Database + aFileExt; OUString key; if( pExtensionPath == nullptr ) -key = processLang( aGuard, Language ) + dbFileName; +key = processLang( rGuard, Language ) + dbFileName; else key = *pExtensionPath + Language + dbFileName; // make unique, don't change language @@ -458,7 +472,7 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( std::u16string_view Database OUString fileURL; if( pExtensionPath ) -fileURL = expandURL(aGuard, *pExtensionPath) + Language + dbFileName; +fileURL = expandURL(rGuard, *pExtensionPath) + Language + dbFileName; else fileURL = m_aInstallDirectory + key; @@ -480,12 +494,10 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( std::u16string_view Database } Reference< XCollator > -Databases::getCollator( const OUString& Language ) +Databases::getCollator(std::unique_lock&, const OUString& Language) { OUString key = Language; -std::unique_lock aGuard( m_aMutex ); - CollatorTable::iterator it = m_aCollatorTable.emplace( key, Reference< XCollator >() ).first; @@ -728,7 +740,7 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, bool bExtension = false; for (;;) { -fileURL = aDbFileIt.nextDbFile( bExtension ); +fileURL = aDbFileIt.nextDbFile(aGuard, bExtension); if( fileURL.isEmpty() ) break; OUString fileNameHDFHelp( fileURL ); @@ -741,7 +753,7 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, helpdatafileproxy::HDFData aValue; if( aHdf.startIteration() ) { -helpdatafileproxy::Hdf* pHdf = getHelpDataFile( Database,Language ); +helpdatafileproxy::Hdf* pHdf = getHelpDataFile(aGuard, Database,Language ); if( pHdf != nullptr ) { pHdf->releaseHashMap(); @@ -776,7 +788,7 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, } // sorting -Reference< XCollator > xCollator = getCollator( Language ); +Reference xCollator = getCollator(aGuard, Language); KeywordElementComparator aComparator( xCollator ); std::sort(aVector.begin(),aVector.end(),aComparator); @@ -786,7 +798,8 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, return it->second.get(); } -Reference< XHierarchicalNameAccess > Databases::jarFile( std::u16string_view jar,
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 11 --- xmlhelp/source/cxxhelp/provider/databases.hxx |1 + 2 files changed, 9 insertions(+), 3 deletions(-) New commits: commit 47cd9b65efa662719950866ab9c45fb3f130e1b4 Author: Noel Grandin AuthorDate: Wed Feb 22 13:40:40 2023 +0200 Commit: Noel Grandin CommitDate: Wed Feb 22 13:12:04 2023 + fix deadlock in xmlhelper::Databases after commit 2c37a0ca31095165d05740a2ff4969f625b4a75b Author: Noel Grandin Date: Tue Feb 21 15:35:20 2023 +0200 osl::Mutex->std::mutex in xmlhelp::Databases Change-Id: I3cce9bcd9c6c9d55c5162fdfd351048d16574477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147459 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 256230149ec2..23ea6db661ee 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -81,7 +81,12 @@ using namespace com::sun::star::beans; OUString Databases::expandURL( const OUString& aURL ) { -std::unique_lock aGuard( m_aMutex ); +std::unique_lock aGuard(m_aMutex); +return expandURL(aGuard, aURL); +} + +OUString Databases::expandURL( std::unique_lock& /*rGuard*/, const OUString& aURL ) +{ OUString aRetURL = expandURL( aURL, m_xContext ); return aRetURL; } @@ -453,7 +458,7 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( std::u16string_view Database OUString fileURL; if( pExtensionPath ) -fileURL = expandURL(*pExtensionPath) + Language + dbFileName; +fileURL = expandURL(aGuard, *pExtensionPath) + Language + dbFileName; else fileURL = m_aInstallDirectory + key; @@ -809,7 +814,7 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( std::u16string_view jar std::u16string_view aExtensionPath = jar.substr( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 ); std::u16string_view aPureJar = jar.substr( nQuestionMark2 + 1 ); -zipFile = expandURL( OUString::Concat(aExtensionPath) + "/" + aPureJar ); +zipFile = expandURL( aGuard, OUString::Concat(aExtensionPath) + "/" + aPureJar ); } else { diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 4ea43c4e8146..dbf38e022e70 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -218,6 +218,7 @@ namespace chelp { const css::uno::Reference< css::uno::XComponentContext >& xContext ); private: +OUString expandURL( std::unique_lock& rGuard, const OUString& aURL ); OUString processLang( std::unique_lock& rGuard, const OUString& Language ); std::mutex m_aMutex;
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 58 +++--- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx | 11 +--- 2 files changed, 26 insertions(+), 43 deletions(-) New commits: commit e171af99c0ed9c0e680c9fb95340f6d8535978e9 Author: Noel Grandin AuthorDate: Tue Feb 21 15:33:51 2023 +0200 Commit: Noel Grandin CommitDate: Wed Feb 22 06:17:39 2023 + osl::Mutex->std::mutex in ResultSetBase Change-Id: I6f0afa46ad84782c3f7219bcb1b28d5627063bcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147418 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index 2f64acaac3c1..58d8e70c5b49 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -85,13 +85,8 @@ void SAL_CALL ResultSetBase::addEventListener( const uno::Reference< lang::XEventListener >& Listener ) { -osl::MutexGuard aGuard( m_aMutex ); - -if ( ! m_pDisposeEventListeners ) -m_pDisposeEventListeners.reset( -new comphelper::OInterfaceContainerHelper3( m_aMutex )); - -m_pDisposeEventListeners->addInterface( Listener ); +std::unique_lock aGuard( m_aMutex ); +m_aDisposeEventListeners.addInterface( aGuard, Listener ); } @@ -99,32 +94,30 @@ void SAL_CALL ResultSetBase::removeEventListener( const uno::Reference< lang::XEventListener >& Listener ) { -osl::MutexGuard aGuard( m_aMutex ); - -if ( m_pDisposeEventListeners ) -m_pDisposeEventListeners->removeInterface( Listener ); +std::unique_lock aGuard( m_aMutex ); +m_aDisposeEventListeners.removeInterface( aGuard, Listener ); } void SAL_CALL ResultSetBase::dispose() { -osl::MutexGuard aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); lang::EventObject aEvt; aEvt.Source = static_cast< lang::XComponent * >( this ); -if ( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() ) +if ( m_aDisposeEventListeners.getLength(aGuard) ) { -m_pDisposeEventListeners->disposeAndClear( aEvt ); +m_aDisposeEventListeners.disposeAndClear( aGuard, aEvt ); } -if( m_pRowCountListeners && m_pRowCountListeners->getLength() ) +if( m_aRowCountListeners.getLength(aGuard) ) { -m_pRowCountListeners->disposeAndClear( aEvt ); +m_aRowCountListeners.disposeAndClear( aGuard, aEvt ); } -if( m_pIsFinalListeners && m_pIsFinalListeners->getLength() ) +if( m_aIsFinalListeners.getLength(aGuard) ) { -m_pIsFinalListeners->disposeAndClear( aEvt ); +m_aIsFinalListeners.disposeAndClear( aGuard, aEvt ); } } @@ -438,20 +431,13 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( { if( aPropertyName == "IsRowCountFinal" ) { -osl::MutexGuard aGuard( m_aMutex ); -if ( ! m_pIsFinalListeners ) -m_pIsFinalListeners.reset( -new comphelper::OInterfaceContainerHelper3( m_aMutex )); - -m_pIsFinalListeners->addInterface( xListener ); +std::unique_lock aGuard( m_aMutex ); +m_aIsFinalListeners.addInterface( aGuard, xListener ); } else if ( aPropertyName == "RowCount" ) { -osl::MutexGuard aGuard( m_aMutex ); -if ( ! m_pRowCountListeners ) -m_pRowCountListeners.reset( -new comphelper::OInterfaceContainerHelper3( m_aMutex )); -m_pRowCountListeners->addInterface( xListener ); +std::unique_lock aGuard( m_aMutex ); +m_aRowCountListeners.addInterface( aGuard, xListener ); } else throw beans::UnknownPropertyException(aPropertyName); @@ -462,17 +448,15 @@ void SAL_CALL ResultSetBase::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) { -if( aPropertyName == "IsRowCountFinal" && -m_pIsFinalListeners ) +if( aPropertyName == "IsRowCountFinal" ) { -osl::MutexGuard aGuard( m_aMutex ); -m_pIsFinalListeners->removeInterface( aListener ); +std::unique_lock aGuard( m_aMutex ); +m_aIsFinalListeners.removeInterface( aGuard, aListener ); } -else if ( aPropertyName == "RowCount" && - m_pRowCountListeners ) +else if ( aPropertyName == "RowCount" ) { -osl::MutexGuard aGuard( m_aMutex ); -m_pRowCountListeners->removeInterface( aListener ); +std::unique_lock aGuard( m_aMutex ); +m_aRowCountListeners.removeInterface( aGuard, aListener ); } else throw beans::UnknownPropertyException(aPropertyName); diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index 00581142669e..4327d3e97201 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx +++
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit ed4bf43b0b75b26fea236204bf4fedfc7568eb98 Author: Caolán McNamara AuthorDate: Fri Jul 29 09:36:25 2022 +0100 Commit: Caolán McNamara CommitDate: Fri Jul 29 20:53:40 2022 +0200 cid#1507489 Big parameter passed by value and cid#1507490 Big parameter passed by value Change-Id: I53a8ee3fd0312de6fecd39238eff90cfff5b3261 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137588 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 449c86da2df5..6d12041de9ec 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -143,12 +143,12 @@ public: uno::Reference< uno::XComponentContext > xContext, uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq, -URLParameter aURLParameter, +const URLParameter& rURLParameter, Databases* pDatabases ) : m_xContext(std::move( xContext )), m_xProvider(std::move( xProvider )), m_seq( seq ), - m_aURLParameter(std::move( aURLParameter )), + m_aURLParameter(rURLParameter), m_pDatabases( pDatabases ) { } @@ -180,12 +180,12 @@ public: uno::Reference< uno::XComponentContext > xContext, uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq, -URLParameter aURLParameter, +const URLParameter& rURLParameter, Databases* pDatabases ) : m_xContext(std::move( xContext )), m_xProvider(std::move( xProvider )), m_seq( seq ), - m_aURLParameter(std::move( aURLParameter )), + m_aURLParameter(rURLParameter), m_pDatabases( pDatabases ) { }
[Libreoffice-commits] core.git: xmlhelp/source xmlscript/source xmlsecurity/inc xmlsecurity/source
xmlhelp/source/cxxhelp/inc/tvfactory.hxx |2 - xmlhelp/source/cxxhelp/inc/tvread.hxx |2 - xmlhelp/source/cxxhelp/provider/content.cxx| 25 --- xmlhelp/source/cxxhelp/provider/databases.cxx | 17 +- xmlhelp/source/cxxhelp/provider/databases.hxx | 21 ++--- xmlhelp/source/cxxhelp/provider/db.hxx | 10 +++--- xmlhelp/source/cxxhelp/provider/resultsetbase.cxx |9 +++-- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |4 +- xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx |5 +-- xmlhelp/source/treeview/tvfactory.cxx |5 +-- xmlhelp/source/treeview/tvread.cxx |5 +-- xmlscript/source/xmldlg_imexp/exp_share.hxx| 13 xmlscript/source/xmldlg_imexp/imp_share.hxx| 27 - xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|5 +-- xmlscript/source/xmllib_imexp/imp_share.hxx|2 - xmlscript/source/xmllib_imexp/xmllib_import.cxx|5 +-- xmlscript/source/xmlmod_imexp/imp_share.hxx|2 - xmlscript/source/xmlmod_imexp/xmlmod_import.cxx|5 +-- xmlsecurity/inc/certificateviewer.hxx |9 +++-- xmlsecurity/inc/digitalsignaturesdialog.hxx|2 - xmlsecurity/inc/macrosecurity.hxx |2 - xmlsecurity/inc/xsecctl.hxx|2 - xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |5 +-- xmlsecurity/source/dialogs/macrosecurity.cxx |5 +-- xmlsecurity/source/framework/buffernode.cxx|5 +-- xmlsecurity/source/framework/buffernode.hxx|3 - xmlsecurity/source/framework/elementcollector.cxx |5 +-- xmlsecurity/source/framework/elementcollector.hxx |2 - xmlsecurity/source/helper/xsecctl.cxx |5 +-- xmlsecurity/source/xmlsec/nss/nssinitializer.cxx |5 +-- xmlsecurity/source/xmlsec/nss/nssinitializer.hxx |2 - 31 files changed, 117 insertions(+), 99 deletions(-) New commits: commit 44a11bb8c99e02ac3ac16b405377ea61ffa8841b Author: Noel Grandin AuthorDate: Thu Jul 28 09:49:00 2022 +0200 Commit: Noel Grandin CommitDate: Thu Jul 28 10:42:37 2022 +0200 clang-tidy modernize-pass-by-value in xml* Change-Id: I9bd5f6adfd138c391d76aebfe08ba01e6b3ab3bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137550 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx index b5a557842867..8b51c2960324 100644 --- a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx @@ -36,7 +36,7 @@ class TVFactory final : public cppu::WeakImplHelper < { public: -TVFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); +TVFactory( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~TVFactory() override; diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index fad7fa42fcdd..08bfdb6482da 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -241,7 +241,7 @@ namespace treeview { class TreeFileIterator { public: -TreeFileIterator( const OUString& aLanguage ); +TreeFileIterator( OUString aLanguage ); OUString nextTreeFile( sal_Int32& rnFileSize ); private: diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 001d7ea76eb9..449c86da2df5 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include "content.hxx" #include "provider.hxx" #include "resultset.hxx" @@ -139,15 +140,15 @@ private: public: ResultSetForRootFactory( -const uno::Reference< uno::XComponentContext >& xContext, -const uno::Reference< ucb::XContentProvider >& xProvider, +uno::Reference< uno::XComponentContext > xContext, +uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq, -const URLParameter& rURLParameter, +URLParameter aURLParameter, Databases* pDatabases ) -: m_xContext( xContext ), - m_xProvider( xProvider ), +: m_xContext(std::move( xContext )), + m_xProvider(std::move( xProvider )), m_seq( seq ), - m_aURLParameter( rURLParameter ), + m_aURLParameter(std::move( aURLParameter )), m_pDatabases( pDatabases ) { } @@ -176,15 +177,15 @@ private: public: ResultSetForQueryFactory( -const uno::Reference< uno::XComponentContext >& rxContext, -
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 75fe4051320ef9b1f4323fa958e8df3db2066882 Author: Stephan Bergmann AuthorDate: Mon May 2 14:28:01 2022 +0200 Commit: Stephan Bergmann CommitDate: Mon May 2 20:02:03 2022 +0200 Just use Any ctor instead of makeAny in xmlhelp Change-Id: I1e8d144e8a011868bdd0083bccd90ee80eabbe66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133701 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 60e207d109ea..1a56533fd27b 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -762,7 +762,7 @@ TVChildTarget::getHierAccess( const Reference< XMultiServiceFactory >& sProvider { xHierAccess = Reference< XHierarchicalNameAccess > -( sProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", { makeAny(OUString::createFromAscii(file)) }), +( sProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", { Any(OUString::createFromAscii(file)) }), UNO_QUERY ); } catch( const css::uno::Exception& )
[Libreoffice-commits] core.git: xmlhelp/source xmlsecurity/inc xmlsecurity/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 47 - xmlhelp/source/cxxhelp/provider/databases.hxx |8 +- xmlsecurity/inc/documentsignaturemanager.hxx |2 xmlsecurity/source/helper/documentsignaturemanager.cxx | 11 ++- 4 files changed, 35 insertions(+), 33 deletions(-) New commits: commit 558aaa9ed222e7142fe87c9bab9a8293a5e2a159 Author: Noel Grandin AuthorDate: Fri Apr 15 16:43:40 2022 +0200 Commit: Noel Grandin CommitDate: Fri Apr 15 20:11:48 2022 +0200 use more string_view in xml* Change-Id: Ie219cb3feb98660463858d00f82f882881946ad0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133072 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 48e6788b0639..7d70fde659ce 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -567,35 +567,36 @@ namespace chelp { KeywordInfo::KeywordElement::KeywordElement( Databases const *pDatabases, helpdatafileproxy::Hdf* pHdf, OUString const & ky, - OUString const & data ) + std::u16string_view data ) : key( ky ) { pDatabases->replaceName( key ); init( pDatabases,pHdf,data ); } -void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafileproxy::Hdf* pHdf,const OUString& ids ) +void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafileproxy::Hdf* pHdf, std::u16string_view ids ) { std::vector< OUString > id,anchor; -int idx = -1,k; +size_t idx = std::u16string_view::npos; +size_t k = 0; for (;;) { -k = ++idx; -idx = ids.indexOf( ';', k ); -if( idx == -1 ) +idx = ids.find( ';', k ); +if( idx == std::u16string_view::npos ) break; -int h = ids.indexOf( '#', k ); -if( h < idx ) +size_t h = ids.find( '#', k ); +if( h == std::u16string_view::npos || h < idx ) { // found an anchor -id.push_back( ids.copy( k, h-k ) ); -anchor.push_back( ids.copy( h+1, idx-h-1 ) ); +id.push_back( OUString(ids.substr( k, h-k )) ); +anchor.push_back( OUString(ids.substr( h+1, idx-h-1 )) ); } else { -id.push_back( ids.copy( k, idx-k ) ); +id.push_back( OUString(ids.substr( k, idx-k )) ); anchor.emplace_back( ); } +k = ++idx; } listId.realloc( id.size() ); @@ -775,10 +776,10 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, return it->second.get(); } -Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar, +Reference< XHierarchicalNameAccess > Databases::jarFile( std::u16string_view jar, const OUString& Language ) { -if( jar.isEmpty() || Language.isEmpty() ) +if( jar.empty() || Language.isEmpty() ) { return Reference< XHierarchicalNameAccess >( nullptr ); } @@ -795,14 +796,14 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar, { OUString zipFile; // Extension jar file? Search for ? -sal_Int32 nQuestionMark1 = jar.indexOf( '?' ); -sal_Int32 nQuestionMark2 = jar.lastIndexOf( '?' ); -if( nQuestionMark1 != -1 && nQuestionMark2 != -1 && nQuestionMark1 != nQuestionMark2 ) +size_t nQuestionMark1 = jar.find( '?' ); +size_t nQuestionMark2 = jar.rfind( '?' ); +if( nQuestionMark1 != std::u16string_view::npos && nQuestionMark2 != std::u16string_view::npos && nQuestionMark1 != nQuestionMark2 ) { -OUString aExtensionPath = jar.copy( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 ); -OUString aPureJar = jar.copy( nQuestionMark2 + 1 ); +std::u16string_view aExtensionPath = jar.substr( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 ); +std::u16string_view aPureJar = jar.substr( nQuestionMark2 + 1 ); -zipFile = expandURL( aExtensionPath + "/" + aPureJar ); +zipFile = expandURL( OUString::Concat(aExtensionPath) + "/" + aPureJar ); } else { @@ -1795,12 +1796,12 @@ OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary return aIndexFolder; } -void IndexFolderIterator::deleteTempIndexFolder( const OUString& aIndexFolder ) +void IndexFolderIterator::deleteTempIndexFolder( std::u16string_view aIndexFolder ) { -sal_Int32 nLastSlash = aIndexFolder.lastIndexOf( '/' ); -if(
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/resultsetbase.cxx |6 +++--- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |8 2 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 557beef6a958f9fa67123ad5a8a232b467039030 Author: Noel Grandin AuthorDate: Mon Nov 29 09:25:40 2021 +0200 Commit: Noel Grandin CommitDate: Tue Nov 30 09:50:53 2021 +0100 use more OInterfaceContainerHelper3 in xmlhelp Change-Id: I6271459b655d09cff595e7e6eb604d5e16a8ccc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126064 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index b1f6219af4b7..d08c9f97e508 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -88,7 +88,7 @@ ResultSetBase::addEventListener( if ( ! m_pDisposeEventListeners ) m_pDisposeEventListeners.reset( -new comphelper::OInterfaceContainerHelper2( m_aMutex )); +new comphelper::OInterfaceContainerHelper3( m_aMutex )); m_pDisposeEventListeners->addInterface( Listener ); } @@ -440,7 +440,7 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pIsFinalListeners ) m_pIsFinalListeners.reset( -new comphelper::OInterfaceContainerHelper2( m_aMutex )); +new comphelper::OInterfaceContainerHelper3( m_aMutex )); m_pIsFinalListeners->addInterface( xListener ); } @@ -449,7 +449,7 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pRowCountListeners ) m_pRowCountListeners.reset( -new comphelper::OInterfaceContainerHelper2( m_aMutex )); +new comphelper::OInterfaceContainerHelper3( m_aMutex )); m_pRowCountListeners->addInterface( xListener ); } else diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index 5a98d1a1fd19..6ec04f36d60e 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -388,10 +388,10 @@ namespace chelp { css::uno::Sequence< css::beans::Property > m_sProperty; osl::Mutex m_aMutex; -std::unique_ptr m_pDisposeEventListeners; + std::unique_ptr> m_pDisposeEventListeners; -std::unique_ptr m_pRowCountListeners; -std::unique_ptr m_pIsFinalListeners; + std::unique_ptr> m_pRowCountListeners; + std::unique_ptr> m_pIsFinalListeners; };
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx |4 -- xmlhelp/source/cxxhelp/provider/contentcaps.cxx | 29 --- xmlhelp/source/cxxhelp/provider/databases.cxx| 43 +-- xmlhelp/source/cxxhelp/provider/urlparameter.cxx |5 +- xmlhelp/source/treeview/tvread.cxx | 11 + 5 files changed, 47 insertions(+), 45 deletions(-) New commits: commit cae7b855a5fd479e6df822f974870f42e91ce068 Author: Mike Kaganski AuthorDate: Fri Oct 29 10:27:52 2021 +0300 Commit: Mike Kaganski CommitDate: Mon Nov 1 07:44:25 2021 +0100 Prepare for removal of non-const operator[] from Sequence in xmlhelp Change-Id: I58c6fd9abf53a9ce3b16a31e7452bb5cb895e669 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124415 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index f00b17b6277b..001d7ea76eb9 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -410,9 +410,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } else if ( rProp.Name == "SearchScopes" ) { -uno::Sequence< OUString > seq( 2 ); -seq[0] = "Heading"; -seq[1] = "FullText"; +uno::Sequence< OUString > seq{ "Heading", "FullText" }; xRow->appendObject( rProp, uno::Any(seq) ); } else if ( rProp.Name == "Order" ) diff --git a/xmlhelp/source/cxxhelp/provider/contentcaps.cxx b/xmlhelp/source/cxxhelp/provider/contentcaps.cxx index 15ad6ba6af76..b18061e43474 100644 --- a/xmlhelp/source/cxxhelp/provider/contentcaps.cxx +++ b/xmlhelp/source/cxxhelp/provider/contentcaps.cxx @@ -43,44 +43,45 @@ uno::Sequence< beans::Property > Content::getProperties( if( isFile ) num++; uno::Sequence< beans::Property > props(num); +auto pprops = props.getArray(); sal_Int32 idx = 0; -props[idx++] = +pprops[idx++] = beans::Property( "ContentType", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "IsReadOnly", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "IsErrorDocument", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "IsDocument", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "IsFolder", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "Title", -1, @@ -88,7 +89,7 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); if( withMediaType ) -props[idx++] = +pprops[idx++] = beans::Property( "MediaType", -1, @@ -97,42 +98,42 @@ uno::Sequence< beans::Property > Content::getProperties( if( isModule ) { -props[idx++] = +pprops[idx++] = beans::Property( "Order", -1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "KeywordList", -1, cppu::UnoType>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "KeywordRef", -1, cppu::UnoType >>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "KeywordTitleForRef", -1, cppu::UnoType >>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ); -props[idx++] = +pprops[idx++] = beans::Property( "KeywordAnchorForRef", -1, cppu::UnoType
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit 29a1fc0f31cf62fcb8fce388cdf6b780d2948e7b Author: Julien Nabet AuthorDate: Sun Oct 17 12:02:58 2021 +0200 Commit: Julien Nabet CommitDate: Sun Oct 17 14:19:53 2021 +0200 Simplify Sequence in xmlhelp Change-Id: I4a7363686498151a840b1c400d466b1c2d583e7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123718 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index a2e3afd50769..8a33329f6810 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -762,14 +762,11 @@ TVChildTarget::getHierAccess( const Reference< XMultiServiceFactory >& sProvider if( sProvider.is() ) { -Sequence< Any > seq(1); -seq[0] <<= OUString::createFromAscii( file ); - try { xHierAccess = Reference< XHierarchicalNameAccess > -( sProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", seq ), +( sProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", { makeAny(OUString::createFromAscii(file)) }), UNO_QUERY ); } catch( const css::uno::Exception& )
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) New commits: commit 26f7e6320942890ff0b916d37cde02270475ae16 Author: Noel Grandin AuthorDate: Sat Jul 31 19:07:49 2021 +0200 Commit: Noel Grandin CommitDate: Sat Jul 31 22:32:34 2021 +0200 osl::Mutex->std::mutex in InputStreamTransformer Change-Id: I64344b890c35d35b3d1b481436eb624183febec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119754 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index e06a8df419ce..75633b3d03ae 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -42,6 +42,7 @@ #include "databases.hxx" #include +#include using namespace cppu; using namespace com::sun::star::io; @@ -319,7 +320,7 @@ public: private: -osl::Mutex m_aMutex; +std::mutex m_aMutex; int pos; OStringBuffer buffer; @@ -902,7 +903,7 @@ void SAL_CALL InputStreamTransformer::release() noexcept sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead ) { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); int curr,available_ = buffer.getLength() - pos; if( nBytesToRead <= available_ ) @@ -928,14 +929,14 @@ sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >& void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip ) { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); while( nBytesToSkip-- ) ++pos; } sal_Int32 SAL_CALL InputStreamTransformer::available() { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); return std::min(SAL_MAX_INT32, buffer.getLength() - pos); } @@ -947,7 +948,7 @@ void SAL_CALL InputStreamTransformer::closeInput() void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); if( location < 0 ) throw IllegalArgumentException(); @@ -960,14 +961,14 @@ void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) sal_Int64 SAL_CALL InputStreamTransformer::getPosition() { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); return sal_Int64( pos ); } sal_Int64 SAL_CALL InputStreamTransformer::getLength() { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); return buffer.getLength(); } @@ -975,7 +976,7 @@ sal_Int64 SAL_CALL InputStreamTransformer::getLength() void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ ) { -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); buffer.append( buffer_, len_ ); }
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx |3 ++- xmlhelp/source/treeview/tvread.cxx|2 +- 2 files changed, 3 insertions(+), 2 deletions(-) New commits: commit 7a4a107283dd43a35434f73cd7fbf291c8837b6d Author: Noel Grandin AuthorDate: Sat Jul 31 19:15:24 2021 +0200 Commit: Noel Grandin CommitDate: Sat Jul 31 22:32:14 2021 +0200 osl::Mutex->std::mutex in TreeFileIterator Change-Id: Ie4e102c03aef8ded29561359c58e6c78cfebbdc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119755 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index 31ec7fedfbf6..fad7fa42fcdd 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -19,6 +19,7 @@ #pragma once +#include #include #include #include @@ -258,7 +259,7 @@ namespace treeview { void implGetLanguageVectorFromPackage( ::std::vector< OUString > , const css::uno::Reference< css::deployment::XPackage >& xPackage ); -osl::Mutex m_aMutex; +std::mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext >m_xContext; css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA; diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 3b7ecf190cc6..c374b4242585 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -1081,7 +1081,7 @@ OUString TreeFileIterator::expandURL( const OUString& aURL ) static Reference< util::XMacroExpander > xMacroExpander; static Reference< uri::XUriReferenceFactory > xFac; -osl::MutexGuard aGuard( m_aMutex ); +std::lock_guard aGuard( m_aMutex ); if( !xMacroExpander.is() || !xFac.is() ) {
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/db.cxx | 37 - xmlhelp/source/cxxhelp/provider/db.hxx |5 +--- 2 files changed, 29 insertions(+), 13 deletions(-) New commits: commit daffec714ef28f52ae2d70e5553500046b8b26c2 Author: Stephan Bergmann AuthorDate: Fri Jul 23 12:20:05 2021 +0200 Commit: Stephan Bergmann CommitDate: Fri Jul 23 14:03:11 2021 +0200 Avoid strtol on non-NUL-terminated input ...as could be observed with ASan and ASAN_OPTIONS=strict_string_checks=1 during e.g. UITest_conditional_format. strtol supports leading spaces, sign, and "0x", but none of that appears to be relevant here, so readInt32 doesn't support that. Hdf::m_pItData was redundant and always pointed at m_aItData.data(), and has been elided to make it more obvious that the places that used it, which now also need to use m_aItData.size(), actually use m_aItData. Change-Id: I3d4f625cd5836438271d7c1a8d2ae06f0a45a37c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119403 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx index 1e376e83e32d..bf3c269b99ca 100644 --- a/xmlhelp/source/cxxhelp/provider/db.cxx +++ b/xmlhelp/source/cxxhelp/provider/db.cxx @@ -21,12 +21,31 @@ #include "db.hxx" #include +#include #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::io; +namespace { + +//TODO: Replace with C++17 std::from_chars once available: +std::pair readInt32(char const * begin, char const * end) { +sal_Int32 n = 0; +for (; begin != end; ++begin) { +auto const w = INetMIME::getHexWeight(static_cast(*begin)); +if (w == -1) { +break; +} +n = 16 * n + w; +} +return {n, begin}; +} + +} + namespace helpdatafileproxy { void HDFData::copyToBuffer( const char* pSrcData, int nSize ) @@ -40,14 +59,13 @@ void HDFData::copyToBuffer( const char* pSrcData, int nSize ) // Hdf -bool Hdf::implReadLenAndData( const char* pData, int& riPos, HDFData& rValue ) +bool Hdf::implReadLenAndData( const char* pData, char const * end, int& riPos, HDFData& rValue ) { bool bSuccess = false; // Read key len const char* pStartPtr = pData + riPos; -char* pEndPtr; -sal_Int32 nKeyLen = strtol( pStartPtr, , 16 ); +auto [nKeyLen, pEndPtr] = readInt32(pStartPtr, end); if( pEndPtr == pStartPtr ) return bSuccess; riPos += (pEndPtr - pStartPtr) + 1; @@ -85,19 +103,19 @@ void Hdf::createHashMap( bool bOptimizeForPerformance ) sal_Int32 nRead = xIn->readBytes( aData, nSize ); const char* pData = reinterpret_cast(aData.getConstArray()); +auto const end = pData + nRead; int iPos = 0; while( iPos < nRead ) { HDFData aDBKey; -if( !implReadLenAndData( pData, iPos, aDBKey ) ) +if( !implReadLenAndData( pData, end, iPos, aDBKey ) ) break; OString aOKeyStr = aDBKey.getData(); // Read val len const char* pStartPtr = pData + iPos; -char* pEndPtr; -sal_Int32 nValLen = strtol( pStartPtr, , 16 ); +auto [nValLen, pEndPtr] = readInt32(pStartPtr, end); if( pEndPtr == pStartPtr ) break; @@ -211,7 +229,6 @@ bool Hdf::startIteration() if( m_nItRead == nSize ) { bSuccess = true; -m_pItData = reinterpret_cast(m_aItData.getConstArray()); m_iItPos = 0; } else @@ -229,9 +246,10 @@ bool Hdf::getNextKeyAndValue( HDFData& rKey, HDFData& rValue ) if( m_iItPos < m_nItRead ) { -if( implReadLenAndData( m_pItData, m_iItPos, rKey ) ) +auto const p = reinterpret_cast(m_aItData.getConstArray()); +if( implReadLenAndData( p, p + m_aItData.size(), m_iItPos, rKey ) ) { -if( implReadLenAndData( m_pItData, m_iItPos, rValue ) ) +if( implReadLenAndData( p, p + m_aItData.size(), m_iItPos, rValue ) ) bSuccess = true; } } @@ -242,7 +260,6 @@ bool Hdf::getNextKeyAndValue( HDFData& rKey, HDFData& rValue ) void Hdf::stopIteration() { m_aItData = Sequence(); -m_pItData = nullptr; m_nItRead = -1; m_iItPos = -1; } diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index 11ec0a826916..aa02903bd16d 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -58,11 +58,11 @@ namespace helpdatafileproxy { css::uno::Sequence< sal_Int8 > m_aItData; -const char* m_pItData; int m_nItRead; int m_iItPos; -static bool implReadLenAndData( const char* pData, int& riPos, HDFData& rValue ); +static bool implReadLenAndData( +
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ff74a6eb3b4656e396368a41552699c6b642cfa4 Author: Caolán McNamara AuthorDate: Wed Jun 23 20:47:38 2021 +0100 Commit: Caolán McNamara CommitDate: Thu Jun 24 09:39:55 2021 +0200 error: unknown type name 'OStringBuffer' Change-Id: I28a4a2581e6afb02aeb137932fbf884b109e4b5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117748 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 5f1d44ef9298..e5cdf10fde52 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmloff/inc xmloff/source xmlsecurity/inc xmlsecurity/source
xmlhelp/source/cxxhelp/inc/tvfactory.hxx |5 + xmlhelp/source/cxxhelp/inc/tvread.hxx |5 + xmlhelp/source/cxxhelp/provider/content.hxx |5 + xmlhelp/source/cxxhelp/provider/databases.hxx |5 + xmlhelp/source/cxxhelp/provider/db.hxx|5 + xmlhelp/source/cxxhelp/provider/inputstream.hxx |5 + xmlhelp/source/cxxhelp/provider/provider.hxx |5 + xmlhelp/source/cxxhelp/provider/resultset.hxx |5 + xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |5 + xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx |5 + xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx |5 + xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx |5 + xmlhelp/source/cxxhelp/provider/urlparameter.hxx |5 + xmlhelp/source/cxxhelp/test/abidebug.hxx |5 + xmloff/inc/AttributeContainerHandler.hxx |5 + xmloff/inc/DomBuilderContext.hxx |5 + xmloff/inc/DomExport.hxx |5 + xmloff/inc/EnhancedCustomShapeToken.hxx |5 + xmloff/inc/MetaExportComponent.hxx|5 + xmloff/inc/MultiPropertySetHelper.hxx |5 + xmloff/inc/PageMasterImportContext.hxx|5 + xmloff/inc/PageMasterPropHdlFactory.hxx |5 + xmloff/inc/PageMasterPropMapper.hxx |5 + xmloff/inc/PropertySetMerger.hxx |5 + xmloff/inc/RDFaExportHelper.hxx |5 + xmloff/inc/RDFaImportHelper.hxx |5 + xmloff/inc/SchXMLAutoStylePoolP.hxx |5 + xmloff/inc/SchXMLExport.hxx |5 + xmloff/inc/SchXMLImport.hxx |5 + xmloff/inc/StyleMap.hxx |5 + xmloff/inc/TransGradientStyle.hxx |5 + xmloff/inc/WordWrapPropertyHdl.hxx|5 + xmloff/inc/XMLBackgroundImageContext.hxx |5 + xmloff/inc/XMLBackgroundImageExport.hxx |5 + xmloff/inc/XMLBase64Export.hxx|5 + xmloff/inc/XMLBasicExportFilter.hxx |5 + xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx|5 + xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx |5 + xmloff/inc/XMLChartPropertySetMapper.hxx |5 + xmloff/inc/XMLChartStyleContext.hxx |5 + xmloff/inc/XMLClipPropertyHandler.hxx |5 + xmloff/inc/XMLElementPropertyContext.hxx |5 + xmloff/inc/XMLEmbeddedObjectImportContext.hxx |5 + xmloff/inc/XMLEventImportHelper.hxx |5 + xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx |5 + xmloff/inc/XMLFootnoteConfigurationImportContext.hxx |5 + xmloff/inc/XMLImageMapContext.hxx |5 + xmloff/inc/XMLImageMapExport.hxx |5 + xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx |5 + xmloff/inc/XMLIsPercentagePropertyHandler.hxx |5 + xmloff/inc/XMLLineNumberingImportContext.hxx |5 + xmloff/inc/XMLNumberStylesImport.hxx |5 + xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx |5 + xmloff/inc/XMLRectangleMembersHandler.hxx |5 + xmloff/inc/XMLReplacementImageContext.hxx |5 + xmloff/inc/XMLScriptContextFactory.hxx|5 + xmloff/inc/XMLScriptExportHandler.hxx |5 + xmloff/inc/XMLShapePropertySetContext.hxx |5 + xmloff/inc/XMLStarBasicContextFactory.hxx
[Libreoffice-commits] core.git: xmlhelp/source xmlscript/source xmlsecurity/source
xmlhelp/source/cxxhelp/provider/content.cxx |4 +--- xmlscript/source/xmlflat_imexp/xmlbas_export.cxx |6 ++ xmlsecurity/source/component/certificatecontainer.cxx |3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) New commits: commit bd43c754d3a6977fc2de80bce27d4045046cb32f Author: Mani Kumar AuthorDate: Wed Mar 17 22:50:33 2021 +0530 Commit: Mike Kaganski CommitDate: Thu Mar 18 07:29:56 2021 +0100 tdf#88205: Use initializer_list ctor in css::uno::Sequence Change-Id: I95aaefa11c733f5c020600cf13510af1bc9c0de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112652 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index f16c6b880471..1dc5347f2d1e 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -105,9 +105,7 @@ OUString SAL_CALL Content::getImplementationName() // virtual uno::Sequence< OUString > SAL_CALL Content::getSupportedServiceNames() { -uno::Sequence aSNS { "com.sun.star.ucb.CHelpContent" }; - -return aSNS; +return { "com.sun.star.ucb.CHelpContent" }; } // XContent methods. diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx index fcec0985dbec..3f0351a1f97e 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx @@ -331,8 +331,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& / Sequence< OUString > XMLBasicExporter::getSupportedServiceNames( ) { -Sequence< OUString > aNames { "com.sun.star.document.XMLBasicExporter" }; -return aNames; +return { "com.sun.star.document.XMLBasicExporter" }; } // XMLOasisBasicExporter @@ -355,8 +354,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& / Sequence< OUString > XMLOasisBasicExporter::getSupportedServiceNames( ) { -Sequence< OUString > aNames { "com.sun.star.document.XMLOasisBasicExporter" }; -return aNames; +return { "com.sun.star.document.XMLOasisBasicExporter" }; } } // namespace xmlscript diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx index 8f921d881715..e311b1b600f8 100644 --- a/xmlsecurity/source/component/certificatecontainer.cxx +++ b/xmlsecurity/source/component/certificatecontainer.cxx @@ -138,8 +138,7 @@ CertificateContainer::supportsService( const OUString& ServiceName ) Sequence< OUString > SAL_CALL CertificateContainer::getSupportedServiceNames( ) { -Sequence< OUString > aRet { "com.sun.star.security.CertificateContainer" }; -return aRet; +return { "com.sun.star.security.CertificateContainer" }; } namespace ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx |4 ++-- xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx |3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit 095928cd526da3b26c44e204624a4e5b55cfcaaa Author: Noel AuthorDate: Mon Mar 1 20:36:47 2021 +0200 Commit: Noel Grandin CommitDate: Tue Mar 2 07:20:06 2021 +0100 loplugin:refcounting in xmlhelp Change-Id: I0b045ab762e946db16632637f24b06d20e294bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111768 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 273c68555c9f..f16c6b880471 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -154,7 +154,7 @@ public: { } -ResultSetBase* createResultSet() override +rtl::Reference createResultSet() override { return new ResultSetForRoot( m_xContext, m_xProvider, @@ -191,7 +191,7 @@ public: { } -ResultSetBase* createResultSet() override +rtl::Reference createResultSet() override { return new ResultSetForQuery( m_xContext, m_xProvider, diff --git a/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx b/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx index 2dba0ec05fb6..ad1e03c13196 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetfactory.hxx @@ -21,6 +21,7 @@ #define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_RESULTSETFACTORY_HXX #include "resultsetbase.hxx" +#include namespace chelp { @@ -32,7 +33,7 @@ namespace chelp { virtual ~ResultSetFactory() { }; -virtual ResultSetBase* createResultSet() = 0; +virtual rtl::Reference createResultSet() = 0; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e6862e7828ba6bdd63bffd7eeaecc7de5d7d1c2e Author: Stephan Bergmann AuthorDate: Thu Jul 2 16:07:56 2020 +0200 Commit: Stephan Bergmann CommitDate: Thu Jul 2 18:45:20 2020 +0200 Upcoming improved loplugin:staticanonymous -> redundantstatic: xmlhelp Change-Id: I4ea84c662ec481e6dd992e82aa4426dba136aded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97770 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index e56a83975c77..2b09cc452c31 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -830,7 +830,7 @@ void TVChildTarget::subst( OUString& instpath ) } -static const char aHelpMediaType[] = "application/vnd.sun.star.help"; +const char aHelpMediaType[] = "application/vnd.sun.star.help"; TreeFileIterator::TreeFileIterator( const OUString& aLanguage ) : m_eState( IteratorState::UserExtensions ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmloff/inc xmloff/source xmlscript/source xmlsecurity/inc xmlsecurity/source
xmlhelp/source/cxxhelp/provider/content.hxx |9 ++--- xmloff/inc/DomBuilderContext.hxx | 12 +++--- xmloff/inc/DomExport.hxx |8 ++-- xmloff/inc/EnhancedCustomShapeToken.hxx |4 +- xmloff/inc/MultiPropertySetHelper.hxx |4 +- xmloff/inc/RDFaExportHelper.hxx |4 +- xmloff/inc/RDFaImportHelper.hxx |4 +- xmloff/inc/SchXMLExport.hxx |4 +- xmloff/inc/TransGradientStyle.hxx |6 +-- xmloff/inc/XMLBackgroundImageContext.hxx |4 +- xmloff/inc/XMLBackgroundImageExport.hxx |4 +- xmloff/inc/XMLBase64Export.hxx|3 - xmloff/inc/XMLEmbeddedObjectImportContext.hxx |3 - xmloff/inc/XMLEventImportHelper.hxx |6 +-- xmloff/inc/XMLFootnoteConfigurationImportContext.hxx |6 +-- xmloff/inc/XMLImageMapContext.hxx |6 +-- xmloff/inc/XMLImageMapExport.hxx |4 +- xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx |6 +-- xmloff/inc/XMLLineNumberingImportContext.hxx |6 +-- xmloff/inc/XMLReplacementImageContext.hxx |5 +- xmloff/inc/XMLScriptContextFactory.hxx|6 +-- xmloff/inc/XMLScriptExportHandler.hxx |4 +- xmloff/inc/XMLStarBasicContextFactory.hxx |6 +-- xmloff/inc/XMLStarBasicExportHandler.hxx |4 +- xmloff/inc/XMLTextColumnsExport.hxx |3 - xmloff/inc/XMLTextHeaderFooterContext.hxx |4 +- xmloff/inc/facreg.hxx |4 +- xmloff/inc/txtflde.hxx|4 +- xmloff/inc/txtfldi.hxx|6 +-- xmloff/inc/xmltabe.hxx|4 +- xmloff/source/chart/SchXMLChartContext.hxx|8 ++-- xmloff/source/chart/SchXMLParagraphContext.hxx|4 +- xmloff/source/chart/SchXMLPlotAreaContext.hxx |7 ++- xmloff/source/chart/SchXMLPropertyMappingContext.hxx |4 +- xmloff/source/chart/SchXMLSeries2Context.hxx |4 +- xmloff/source/chart/SchXMLTableContext.hxx|9 ++--- xmloff/source/chart/SchXMLTextListContext.hxx |4 +- xmloff/source/chart/SchXMLTools.hxx |4 +- xmloff/source/chart/XMLSymbolImageContext.hxx |4 +- xmloff/source/chart/contexts.hxx |4 +- xmloff/source/draw/ximpcustomshape.hxx|6 +-- xmloff/source/forms/property_meta_data.hxx|4 +- xmloff/source/forms/propertyimport.hxx|4 +- xmloff/source/style/XMLFontStylesContext_impl.hxx |4 +- xmloff/source/style/XMLFootnoteSeparatorImport.hxx|6 +-- xmloff/source/text/XMLAutoMarkFileContext.hxx |6 +-- xmloff/source/text/XMLAutoTextContainerEventImport.hxx|6 +-- xmloff/source/text/XMLAutoTextEventExport.hxx |6 +-- xmloff/source/text/XMLAutoTextEventImport.hxx |6 +-- xmloff/source/text/XMLChangeElementImportContext.hxx |8 ++-- xmloff/source/text/XMLChangeImportContext.hxx |8 ++-- xmloff/source/text/XMLChangeInfoContext.hxx |6 +-- xmloff/source/text/XMLChangedRegionImportContext.hxx |8 ++-- xmloff/source/text/XMLFootnoteBodyImportContext.hxx |8 ++-- xmloff/source/text/XMLFootnoteImportContext.hxx |8 ++-- xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx |6 +-- xmloff/source/text/XMLIndexBibliographyEntryContext.hxx |6 +-- xmloff/source/text/XMLIndexBibliographySourceContext.hxx |6 +-- xmloff/source/text/XMLIndexBodyContext.hxx|6 +-- xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx|6 +-- xmloff/source/text/XMLIndexIllustrationSourceContext.hxx |6 +-- xmloff/source/text/XMLIndexMarkExport.hxx |4 +- xmloff/source/text/XMLIndexObjectSourceContext.hxx|6 +-- xmloff/source/text/XMLIndexSimpleEntryContext.hxx |6 +-- xmloff/source/text/XMLIndexSourceBaseContext.hxx |6 +-- xmloff/source/text/XMLIndexSpanEntryContext.hxx |6 +-- xmloff/source/text/XMLIndexTOCContext.hxx |6 +-- xmloff/source/text/XMLIndexTOCSourceContext.hxx
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx |2 +- xmlhelp/source/cxxhelp/provider/content.cxx | 10 +- xmlhelp/source/cxxhelp/provider/databases.hxx | 12 ++-- xmlhelp/source/cxxhelp/provider/db.hxx|2 +- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |2 +- xmlhelp/source/cxxhelp/provider/urlparameter.hxx |2 +- 6 files changed, 15 insertions(+), 15 deletions(-) New commits: commit 073817736f359821b668921cfad20c96943486bd Author: Noel Grandin AuthorDate: Mon Mar 16 09:24:00 2020 +0200 Commit: Noel Grandin CommitDate: Mon Mar 16 10:29:56 2020 +0100 Revert "loplugin:constfields in xmlhelp" This reverts commit 04e9a4c012f12dc26fda10aabb8d229555c711ab. Change-Id: I2d1b44c84197d88bc58adf0280c8e1fd84795293 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90546 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index 4753b9859930..fe529d3bfcfa 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -265,7 +265,7 @@ namespace treeview { css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA; IteratorState m_eState; -OUString const m_aLanguage; +OUString m_aLanguage; css::uno::Sequence< css::uno::Reference < css::deployment::XPackage > > m_aUserPackagesSeq; diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 88ebe87bfece..4ad2c3fa78c8 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -134,9 +134,9 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; -uno::Sequence< beans::Property > const m_seq; -URLParameter const m_aURLParameter; -Databases* const m_pDatabases; +uno::Sequence< beans::Property > m_seq; +URLParameter m_aURLParameter; +Databases* m_pDatabases; public: @@ -171,9 +171,9 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; -uno::Sequence< beans::Property > const m_seq; +uno::Sequence< beans::Property > m_seq; URLParameter m_aURLParameter; -Databases* const m_pDatabases; +Databases* m_pDatabases; public: diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 3577b39d975f..6edf6a0ce78d 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -54,10 +54,10 @@ namespace chelp { { private: -OUString const m_aStartId; -OUString const m_aProgramSwitch; -OUString const m_aTitle; -int const m_nOrder; +OUString m_aStartId; +OUString m_aProgramSwitch; +OUString m_aTitle; +int m_nOrder; public: @@ -223,7 +223,7 @@ namespace chelp { css::uno::Reference< css::lang::XMultiComponentFactory > m_xSMgr; css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA; -bool const m_bShowBasic; +bool m_bShowBasic; std::vector m_vCustomCSSDoc; OUString m_aCSS; @@ -377,7 +377,7 @@ namespace chelp { const css::uno::Reference< css::deployment::XPackage >& xPackage, OUString* o_pExtensionPath, OUString* o_pExtensionRegistryPath ); -bool const m_bHelpText; +bool m_bHelpText; }; // end class DataBaseIterator diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index ce7dbc29d15d..607b987ff838 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -51,7 +51,7 @@ namespace helpdatafileproxy { class Hdf { -OUString const m_aFileURL; +OUString m_aFileURL; std::unique_ptr m_pStringToDataMap; std::unique_ptr m_pStringToValPosMap; css::uno::Reference< css::ucb::XSimpleFileAccess3 > diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx | 19 +++ xmlhelp/source/treeview/tvread.cxx| 27 +++ 2 files changed, 14 insertions(+), 32 deletions(-) New commits: commit 3e8a8806df33b8ffeac6f89c10d8d56baf9a2b89 Author: Noel Grandin AuthorDate: Fri Nov 29 15:08:19 2019 +0200 Commit: Noel Grandin CommitDate: Sun Dec 1 08:37:44 2019 +0100 loplugin:mergeclasses treeview::TreeFileIterator Change-Id: I9312806870b005e076fea3688f30ca86e93aeb4a Reviewed-on: https://gerrit.libreoffice.org/84108 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index 5f87ca5cf542..4753b9859930 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -239,18 +239,17 @@ namespace treeview { EndReached }; -class ExtensionIteratorBase +class TreeFileIterator { public: -ExtensionIteratorBase( const OUString& aLanguage ); -void init(); +TreeFileIterator( const OUString& aLanguage ); +OUString nextTreeFile( sal_Int32& rnFileSize ); private: static css::uno::Reference< css::deployment::XPackage > implGetHelpPackageFromPackage ( const css::uno::Reference< css::deployment::XPackage >& xPackage, css::uno::Reference< css::deployment::XPackage >& o_xParentPackageBundle ); -protected: css::uno::Reference< css::deployment::XPackage > implGetNextUserHelpPackage ( css::uno::Reference< css::deployment::XPackage >& o_xParentPackageBundle ); css::uno::Reference< css::deployment::XPackage > implGetNextSharedHelpPackage @@ -284,18 +283,6 @@ namespace treeview { int m_iSharedPackage; int m_iBundledPackage; -}; // end class ExtensionIteratorBase - -class TreeFileIterator : public ExtensionIteratorBase -{ -public: -TreeFileIterator( const OUString& aLanguage ) -: ExtensionIteratorBase( aLanguage ) -{} - -OUString nextTreeFile( sal_Int32& rnFileSize ); - -private: OUString expandURL( const OUString& aURL ); OUString implGetTreeFileFromPackage( sal_Int32& rnFileSize, const css::uno::Reference< css::deployment::XPackage >& xPackage ); diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index a01dd66a51ef..922a418d401f 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -825,23 +825,18 @@ void TVChildTarget::subst( OUString& instpath ) instpath = aOptions.SubstituteVariable( instpath ); } -// class ExtensionIteratorBase +// class TreeFileIterator static const char aHelpMediaType[] = "application/vnd.sun.star.help"; -ExtensionIteratorBase::ExtensionIteratorBase( const OUString& aLanguage ) +TreeFileIterator::TreeFileIterator( const OUString& aLanguage ) : m_eState( IteratorState::UserExtensions ) , m_aLanguage( aLanguage ) { -init(); -} - -void ExtensionIteratorBase::init() -{ m_xContext = ::comphelper::getProcessComponentContext(); if( !m_xContext.is() ) { -throw RuntimeException( "ExtensionIteratorBase::init(), no XComponentContext" ); +throw RuntimeException( "TreeFileIterator::TreeFileIterator(), no XComponentContext" ); } m_xSFA = ucb::SimpleFileAccess::create(m_xContext); @@ -854,7 +849,7 @@ void ExtensionIteratorBase::init() m_iBundledPackage = 0; } -Reference< deployment::XPackage > ExtensionIteratorBase::implGetHelpPackageFromPackage +Reference< deployment::XPackage > TreeFileIterator::implGetHelpPackageFromPackage ( const Reference< deployment::XPackage >& xPackage, Reference< deployment::XPackage >& o_xParentPackageBundle ) { o_xParentPackageBundle.clear(); @@ -903,7 +898,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetHelpPackageFromP return xHelpPackage; } -Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPackage +Reference< deployment::XPackage > TreeFileIterator::implGetNextUserHelpPackage ( Reference< deployment::XPackage >& o_xParentPackageBundle ) { Reference< deployment::XPackage > xHelpPackage; @@ -926,14 +921,14 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack { const Reference< deployment::XPackage >* pUserPackages = m_aUserPackagesSeq.getConstArray(); Reference< deployment::XPackage > xPackage = pUserPackages[ m_iUserPackage++ ]; -OSL_ENSURE( xPackage.is(), "ExtensionIteratorBase::implGetNextUserHelpPackage(): Invalid package" ); +OSL_ENSURE( xPackage.is(), "TreeFileIterator::implGetNextUserHelpPackage(): Invalid
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) New commits: commit 30d803e83390d8a4f475522dc23bcd107f7fdc12 Author: Stephan Bergmann AuthorDate: Wed Oct 16 22:49:10 2019 +0200 Commit: Stephan Bergmann CommitDate: Thu Oct 17 07:29:11 2019 +0200 Remove code that is dead ...ever since 8f55fe4c6c73f110b1c72903c209399ff2527ea5 "INTEGRATION: CWS help2" dropped p->application and "/" from strBuff. Change-Id: I48aa9271daac4caf23d932741a5c75cb00ad7ee9 Reviewed-on: https://gerrit.libreoffice.org/80924 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index f0331dea7a29..ddfba452c67d 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -123,15 +123,7 @@ namespace treeview { { if( targetURL.isEmpty() ) { -sal_Int32 len; -for ( const TVDom* p = this;; p = p->parent ) -{ -len = p->application.getLength(); -if ( len != 0 ) -break; -} - -OUStringBuffer strBuff( 22 + len + id.getLength() ); +OUStringBuffer strBuff( 21 + id.getLength() ); strBuff.append( "vnd.sun.star.help://" ).append(id); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 30 +- 1 file changed, 15 insertions(+), 15 deletions(-) New commits: commit 049189f49dba87e0b6d948e2b6a5e416f1fca36b Author: Eike Rathke AuthorDate: Fri Jun 28 18:02:38 2019 +0200 Commit: Eike Rathke CommitDate: Fri Jun 28 20:49:29 2019 +0200 Use LanguageTag::getFallbackStrings() instead of old dumb hard coded stuff So finding correct offline help will actually work with language tags containing scripts or variants. Change-Id: I493041fbfe62dc7cd2e035592fe94ef9fe3c2480 Reviewed-on: https://gerrit.libreoffice.org/74855 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 9f75248910b6..04aba4c5991e 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -400,23 +400,23 @@ OUString Databases::processLang( const OUString& Language ) if( it == m_aLangSet.end() ) { -sal_Int32 idx; -osl::DirectoryItem aDirItem; +// XXX the old code looked for '-' and '_' as separator between +// language and country, no idea if '_' actually still can happen +// (probably not), but play safe and keep that and transform to proper +// BCP47. +const OUString aBcp47( Language.replaceAll( "_", "-")); -if( osl::FileBase::E_None == osl::DirectoryItem::get( getInstallPathAsURL() + Language,aDirItem ) ) -{ -ret = Language; -m_aLangSet[ Language ] = ret; -} -/* FIXME-BCP47: this is wrong, does not work as soon as script or - * variant is involved in the language tag. */ -else if( ( ( idx = Language.indexOf( '-' ) ) != -1 || - ( idx = Language.indexOf( '_' ) ) != -1 ) && -osl::FileBase::E_None == osl::DirectoryItem::get( getInstallPathAsURL() + Language.copy( 0,idx ), - aDirItem ) ) +// Try if language tag or fallbacks are installed. +osl::DirectoryItem aDirItem; +std::vector aFallbacks( LanguageTag( aBcp47).getFallbackStrings(true)); +for (auto const & rFB : aFallbacks) { -ret = Language.copy( 0,idx ); -m_aLangSet[ Language ] = ret; +if (osl::FileBase::E_None == osl::DirectoryItem::get( getInstallPathAsURL() + rFB, aDirItem)) +{ +ret = rFB; +m_aLangSet[ Language ] = ret; +break; // for +} } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 30 ++ xmlhelp/source/cxxhelp/provider/databases.hxx |9 --- 2 files changed, 13 insertions(+), 26 deletions(-) New commits: commit 41cf4e6604bfb9b51ce54c5ea64d77249c7545d7 Author: Eike Rathke AuthorDate: Fri Jun 28 16:03:23 2019 +0200 Commit: Eike Rathke CommitDate: Fri Jun 28 17:01:28 2019 +0200 Fix Help collator loading, processLang() does not return only the language ... but a tag of an installed language, e.g. "en-US". Adding a country then resulted in "en-US-US", used to load a collator. Further inspection of processLang() needed which can't work for sr-Latn or ca-valencia, for example. Change-Id: Id587ede738143c506da1ff2822aa605d0e7bee83 Reviewed-on: https://gerrit.libreoffice.org/74847 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 26b673982333..9f75248910b6 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -408,6 +408,8 @@ OUString Databases::processLang( const OUString& Language ) ret = Language; m_aLangSet[ Language ] = ret; } +/* FIXME-BCP47: this is wrong, does not work as soon as script or + * variant is involved in the language tag. */ else if( ( ( idx = Language.indexOf( '-' ) ) != -1 || ( idx = Language.indexOf( '_' ) ) != -1 ) && osl::FileBase::E_None == osl::DirectoryItem::get( getInstallPathAsURL() + Language.copy( 0,idx ), @@ -423,16 +425,6 @@ OUString Databases::processLang( const OUString& Language ) return ret; } -OUString Databases::country( const OUString& Language ) -{ -sal_Int32 idx; -if( ( idx = Language.indexOf( '-' ) ) != -1 || -( idx = Language.indexOf( '_' ) ) != -1 ) -return Language.copy( 1+idx ); - -return OUString(); -} - helpdatafileproxy::Hdf* Databases::getHelpDataFile( const OUString& Database, const OUString& Language, bool helpText, const OUString* pExtensionPath ) @@ -495,10 +487,11 @@ Databases::getCollator( const OUString& Language ) if( ! it->second.is() ) { it->second = Collator::create(m_xContext); -OUString langStr = processLang(Language); -OUString countryStr = country(Language); +LanguageTag aLanguageTag( Language); +OUString countryStr = aLanguageTag.getCountry(); if( countryStr.isEmpty() ) { +const OUString langStr = aLanguageTag.getLanguage(); if( langStr == "de" ) countryStr = "DE"; else if( langStr == "en" ) @@ -515,13 +508,14 @@ Databases::getCollator( const OUString& Language ) countryStr = "JP"; else if( langStr == "ko" ) countryStr = "KR"; + +// XXX NOTE: there are no complex language tags involved in those +// "add country" cases, only because of this we can use this +// simplified construction. +if (!countryStr.isEmpty()) +aLanguageTag.reset( langStr + "-" + countryStr); } -/* FIXME-BCP47: all this does not look right for language tag context, - * also check processLang() and country() methods */ -it->second->loadDefaultCollator( Locale( langStr, - countryStr, - OUString() ), - 0 ); +it->second->loadDefaultCollator( aLanguageTag.getLocale(), 0); } return it->second; diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 3900e9918cdc..c7ffa765b348 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -204,18 +204,11 @@ namespace chelp { OUString* o_pExtensionRegistryPath = nullptr ); /** - * Maps a given language-locale combination to language. + * Maps a given language-locale combination to language or locale. */ OUString processLang( const OUString& Language ); -/** - * Maps a given language-locale combination to locale. - * The returned string maybe empty - */ - -static OUString country( const OUString& Language ); - void replaceName( OUString& oustring ) const; const OUString& getProductName() const { return m_vReplacement[0]; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmlsecurity/inc xmlsecurity/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx |2 +- xmlhelp/source/cxxhelp/provider/urlparameter.hxx |1 - xmlsecurity/inc/certificatechooser.hxx |2 -- xmlsecurity/inc/digitalsignaturesdialog.hxx|2 -- xmlsecurity/source/component/documentdigitalsignatures.cxx |2 +- xmlsecurity/source/dialogs/certificatechooser.cxx |2 -- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |3 +-- 7 files changed, 3 insertions(+), 11 deletions(-) New commits: commit 6ed5464a69de171a479e3c042b236bbd64554ba1 Author: Noel Grandin AuthorDate: Thu Feb 21 09:51:26 2019 +0200 Commit: Noel Grandin CommitDate: Thu Feb 21 12:04:47 2019 +0100 loplugin:unusedfields in xmlhelp,xmlsecurity Change-Id: Id3858365a54e6ae96bf9e6c3e27a777441ab56ae Reviewed-on: https://gerrit.libreoffice.org/68133 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index a0f0c94a434d..10970e8c50e6 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -486,7 +486,7 @@ bool URLParameter::query() if( parameter == "Language" ) m_aLanguage = value; else if( parameter == "Device" ) -m_aDevice = value; +; else if( parameter == "Program" ) m_aProgram = value; else if( parameter == "Eid" ) diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx index ff917d6def08..5fe4627fcaa1 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx @@ -184,7 +184,6 @@ namespace chelp { OUString m_aLanguage; OUString m_aPrefix; -OUString m_aDevice; OUString m_aProgram; OUString m_aSystem; OUString m_aActive; diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx index b98b30fdc6b3..7f551937d2ba 100644 --- a/xmlsecurity/inc/certificatechooser.hxx +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -53,7 +53,6 @@ enum class UserAction class CertificateChooser : public weld::GenericDialogController { private: -css::uno::Reference< css::uno::XComponentContext > mxCtx; std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > mxSecurityContexts; std::vector> mvUserData; @@ -81,7 +80,6 @@ private: public: CertificateChooser(weld::Window* pParent, - css::uno::Reference< css::uno::XComponentContext> const & rxCtx, std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > const & rxSecurityContexts, UserAction eAction); virtual ~CertificateChooser() override; diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index 6fd74ad70964..459beafcc956 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -48,8 +48,6 @@ class HeaderBar; class DigitalSignaturesDialog : public weld::GenericDialogController { private: -css::uno::Reference< css::uno::XComponentContext >& mxCtx; - DocumentSignatureManager maSignatureManager; boolmbVerifySignatures; boolmbSignaturesChanged; diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 8e1044f414af..e27181d95129 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -652,7 +652,7 @@ DocumentDigitalSignatures::chooseCertificatesImpl(std::map& xSecContexts.push_back(aSignatureManager.getGpgSecurityContext()); } -CertificateChooser aChooser(Application::GetFrameWeld(mxParentWindow), mxCtx, xSecContexts, eAction); +CertificateChooser aChooser(Application::GetFrameWeld(mxParentWindow), xSecContexts, eAction); uno::Sequence< Reference< css::security::XCertificate > > xCerts(1); xCerts[0] = Reference< css::security::XCertificate >(nullptr); diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index d6a552b7e105..91e43835d5f5 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -38,7 +38,6 @@ using namespace comphelper; using namespace css; CertificateChooser::CertificateChooser(weld::Window* _pParent, - uno::Reference const & _rxCtx, std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > const & rxSecurityContexts,
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit eef4268f05ca7771651d48ab661276981ef7d573 Author: Noel Grandin AuthorDate: Fri Dec 21 11:22:12 2018 +0200 Commit: Noel Grandin CommitDate: Fri Dec 21 18:51:34 2018 +0100 use unique_ptr in xmlhelp Change-Id: Ic49bb1bc6591735562b0b23d821202bab00ceba2 Reviewed-on: https://gerrit.libreoffice.org/65533 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index e59ddae7bea5..e12ae7930853 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -808,15 +808,15 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar, Sequence< Any > aArguments( 2 ); -XInputStream_impl* p = new XInputStream_impl( zipFile ); +std::unique_ptr p(new XInputStream_impl( zipFile )); if( p->CtorSuccess() ) { -Reference< XInputStream > xInputStream( p ); +Reference< XInputStream > xInputStream( p.release() ); aArguments[ 0 ] <<= xInputStream; } else { -delete p; +p.reset(); aArguments[ 0 ] <<= zipFile; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit dac1ff8b233d319e660670e0eb091ce2e1cf1c0d Author: Noel Grandin AuthorDate: Mon Nov 26 14:09:21 2018 +0200 Commit: Noel Grandin CommitDate: Tue Nov 27 14:42:02 2018 +0100 convert treeview::TVDom::Kind to scoped enum Change-Id: Ia505df60f5758d40dd55bc5b24886fd8aec327ce Reviewed-on: https://gerrit.libreoffice.org/64092 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 0667b3fdfd55..c6fe6d0c74ab 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -50,7 +50,7 @@ namespace treeview { public: explicit TVDom( TVDom* arent = nullptr ) -: kind( other ), +: kind( Kind::other ), parent( arent ), children( 0 ) { @@ -76,13 +76,13 @@ namespace treeview { return const_cast(this);// I am my own parent, if I am the root } -enum Kind { +enum class Kind { tree_node, tree_leaf, other }; -bool isLeaf() const { return kind == TVDom::tree_leaf; } +bool isLeaf() const { return kind == TVDom::Kind::tree_leaf; } void setKind( Kind ind ) { kind = ind; } void setApplication( const char* appl ) @@ -330,9 +330,9 @@ static void start_handler(void *userData, if( strcmp( name,"help_section" ) == 0 || strcmp( name,"node" ) == 0 ) -kind = TVDom::tree_node; +kind = TVDom::Kind::tree_node; else if( strcmp( name,"topic" ) == 0 ) -kind = TVDom::tree_leaf; +kind = TVDom::Kind::tree_leaf; else return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 30 +-- 1 file changed, 23 insertions(+), 7 deletions(-) New commits: commit 99c59c594ff6747abef4529fbb2251751737eb7e Author: Damjan Jovanovic AuthorDate: Thu Oct 4 17:49:09 2018 + Commit: Michael Stahl CommitDate: Wed Oct 10 10:30:57 2018 +0200 Set up our own libxslt security context in xmlhelp, as per #i117643. Patch by: me (cherry picked from commit ae1f34be5c9a49fae1eacdb3c1e5267acea53441) Change-Id: I0e5277b17243f6b8f5f4303206cf446b10dd0aef Reviewed-on: https://gerrit.libreoffice.org/61597 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 85e4cb4051ad..a0f0c94a434d 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include "db.hxx" #include #include @@ -847,14 +848,29 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam, xmlDocPtr doc = xmlParseFile("vnd.sun.star.zip:/"); -xmlDocPtr res = xsltApplyStylesheet(cur, doc, parameter); -if (res) +xmlDocPtr res = nullptr; +xsltTransformContextPtr transformContext = xsltNewTransformContext(cur, doc); +if (transformContext) { -xmlChar *doc_txt_ptr=nullptr; -int doc_txt_len; -xsltSaveResultToString(_txt_ptr, _txt_len, res, cur); -addToBuffer(reinterpret_cast(doc_txt_ptr), doc_txt_len); -xmlFree(doc_txt_ptr); +xsltSecurityPrefsPtr securityPrefs = xsltNewSecurityPrefs(); +if (securityPrefs) +{ +xsltSetSecurityPrefs(securityPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityAllow); +if (xsltSetCtxtSecurityPrefs(securityPrefs, transformContext) == 0) +{ +res = xsltApplyStylesheetUser(cur, doc, parameter, nullptr, nullptr, transformContext); +if (res) +{ +xmlChar *doc_txt_ptr=nullptr; +int doc_txt_len; +xsltSaveResultToString(_txt_ptr, _txt_len, res, cur); +addToBuffer(reinterpret_cast(doc_txt_ptr), doc_txt_len); +xmlFree(doc_txt_ptr); +} +} +xsltFreeSecurityPrefs(securityPrefs); +} +xsltFreeTransformContext(transformContext); } xmlPopInputCallbacks(); //filePatch xmlPopInputCallbacks(); //helpPatch ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 41 ++ xmlhelp/source/cxxhelp/provider/databases.hxx |6 +-- 2 files changed, 19 insertions(+), 28 deletions(-) New commits: commit 70c0c3b6157a869074ad7e9909b0e48d2da245e0 Author: Noel Grandin AuthorDate: Mon Sep 17 09:18:28 2018 +0200 Commit: Noel Grandin CommitDate: Tue Sep 18 11:52:24 2018 +0200 loplugin:useuniqueptr in xmlhelp::Databases Change-Id: Idaf73fd5d12badbee58861c6ca3b087c16946b9c Reviewed-on: https://gerrit.libreoffice.org/60615 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 2ab99629f3df..d71c62b4a95c 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -165,23 +165,14 @@ Databases::~Databases() { // unload the databases -{ -// DatabasesTable -for (auto& rDatabase : m_aDatabases) -delete rDatabase.second; -} +// DatabasesTable +m_aDatabases.clear(); -{ -// ModInfoTable -for (auto& rModInfo : m_aModInfo) -delete rModInfo.second; -} +// ModInfoTable +m_aModInfo.clear(); -{ -// KeywordInfoTable -for (auto& rKeywordInfo : m_aKeywordInfo) -delete rKeywordInfo.second; -} +// KeywordInfoTable +m_aKeywordInfo.clear(); } OString Databases::getImageTheme() @@ -390,14 +381,14 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin lineBuffer[ pos++ ] = ch; } replaceName( title ); -it->second = new StaticModuleInformation( title, +it->second.reset(new StaticModuleInformation( title, startid, program, - order ); + order )); } } -return it->second; +return it->second.get(); } OUString Databases::processLang( const OUString& Language ) @@ -460,13 +451,13 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( const OUString& Database, key = *pExtensionPath + Language + dbFileName; // make unique, don't change language std::pair< DatabasesTable::iterator,bool > aPair = -m_aDatabases.emplace( key, reinterpret_cast(0) ); +m_aDatabases.emplace( key, nullptr); DatabasesTable::iterator it = aPair.first; if( aPair.second && ! it->second ) { -helpdatafileproxy::Hdf* pHdf = nullptr; +std::unique_ptr pHdf; OUString fileURL; if( pExtensionPath ) @@ -482,13 +473,13 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( const OUString& Database, //fails for example when using long path names on Windows (starting with \\?\) if( m_xSFA->exists( fileNameHDFHelp ) ) { -pHdf = new helpdatafileproxy::Hdf( fileNameHDFHelp, m_xSFA ); +pHdf.reset(new helpdatafileproxy::Hdf( fileNameHDFHelp, m_xSFA )); } -it->second = pHdf; +it->second = std::move(pHdf); } -return it->second; +return it->second.get(); } Reference< XCollator > @@ -775,10 +766,10 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, KeywordElementComparator aComparator( xCollator ); std::sort(aVector.begin(),aVector.end(),aComparator); -it->second = new KeywordInfo( aVector ); +it->second.reset(new KeywordInfo( aVector )); } -return it->second; +return it->second.get(); } Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar, diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index ae3e5049af5c..3900e9918cdc 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -257,16 +257,16 @@ namespace chelp { std::vector< OUString >m_avModules; -typedef std::unordered_map< OUString,helpdatafileproxy::Hdf* > DatabasesTable; +typedef std::unordered_map< OUString, std::unique_ptr > DatabasesTable; DatabasesTable m_aDatabases; // Language and module dependent databases typedef std::unordered_map< OUString,OUString > LangSetTable; LangSetTable m_aLangSet; // Mapping to of lang-country to lang -typedef std::unordered_map< OUString,StaticModuleInformation* > ModInfoTable; +typedef std::unordered_map< OUString, std::unique_ptr > ModInfoTable; ModInfoTable m_aModInfo; // Module information -typedef std::unordered_map< OUString,KeywordInfo* > KeywordInfoTable; +typedef std::unordered_map< OUString,
[Libreoffice-commits] core.git: xmlhelp/source xmlreader/source xmlscript/source xmlsecurity/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 26 + xmlhelp/source/treeview/tvread.cxx|8 - xmlreader/source/xmlreader.cxx| 13 +- xmlscript/source/xml_helper/xml_impctx.cxx|8 - xmlsecurity/source/framework/buffernode.cxx | 122 +++--- 5 files changed, 52 insertions(+), 125 deletions(-) New commits: commit 87b24ddbba056b4887ad4613a84686ab3d2218cd Author: Arkadiy Illarionov AuthorDate: Thu Sep 13 22:09:43 2018 +0300 Commit: Noel Grandin CommitDate: Sat Sep 15 09:06:38 2018 +0200 Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurity Use range-based loop or replace with functions from std algorithm. Change-Id: I5b1859da37c2a6c6e5e70602287bfc2ada951893 Reviewed-on: https://gerrit.libreoffice.org/60463 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index fa94f56a9a68..88cedb7bfefd 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -167,34 +167,20 @@ Databases::~Databases() { // DatabasesTable -DatabasesTable::iterator it = m_aDatabases.begin(); -while( it != m_aDatabases.end() ) -{ -delete it->second; -++it; -} +for (auto& rDatabase : m_aDatabases) +delete rDatabase.second; } { // ModInfoTable - -ModInfoTable::iterator it = m_aModInfo.begin(); -while( it != m_aModInfo.end() ) -{ -delete it->second; -++it; -} +for (auto& rModInfo : m_aModInfo) +delete rModInfo.second; } { // KeywordInfoTable - -KeywordInfoTable::iterator it = m_aKeywordInfo.begin(); -while( it != m_aKeywordInfo.end() ) -{ -delete it->second; -++it; -} +for (auto& rKeywordInfo : m_aKeywordInfo) +delete rKeywordInfo.second; } } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 2d98eb7755dd..c8006bee590f 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -503,11 +503,11 @@ TVChildTarget::SearchAndInsert(std::unique_ptr p, TVDom* tvDom) } else { -i = tvDom->children.begin(); -while ((i!=tvDom->children.end()) && (p != nullptr)) +for (auto& child : tvDom->children) { -p = SearchAndInsert(std::move(p), i->get()); -++i; +p = SearchAndInsert(std::move(p), child.get()); +if (p == nullptr) +break; } return p; } diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx index 699567a53a32..58f3ec88ebb6 100644 --- a/xmlreader/source/xmlreader.cxx +++ b/xmlreader/source/xmlreader.cxx @@ -184,13 +184,12 @@ Span XmlReader::getAttributeValue(bool fullyNormalize) { } int XmlReader::getNamespaceId(Span const & prefix) const { -for (NamespaceList::const_reverse_iterator i(namespaces_.rbegin()); - i != namespaces_.rend(); ++i) -{ -if (prefix.equals(i->prefix)) { -return i->nsId; -} -} +auto i = std::find_if(namespaces_.crbegin(), namespaces_.crend(), +[](const NamespaceData& rNamespaceData) { return prefix.equals(rNamespaceData.prefix); }); + +if (i != namespaces_.rend()) +return i->nsId; + return NAMESPACE_UNKNOWN; } diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index face4f5ca01f..dfb4b8141be6 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -395,12 +395,10 @@ sal_Int32 DocumentHandlerImpl::getUidByUri( OUString const & Uri ) OUString DocumentHandlerImpl::getUriByUid( sal_Int32 Uid ) { MGuard guard( m_pMutex ); -t_OUString2LongMap::const_iterator iPos( m_URI2Uid.begin() ); -t_OUString2LongMap::const_iterator const iEnd( m_URI2Uid.end() ); -for ( ; iPos != iEnd; ++iPos ) +for (const auto& rURIUid : m_URI2Uid) { -if (iPos->second == Uid) -return iPos->first; +if (rURIUid.second == Uid) +return rURIUid.first; } throw container::NoSuchElementException( "no such xmlns uid!" , static_cast< OWeakObject * >(this) ); } diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx index d1cd8d17ed44..3de2c4ef5271 100644 --- a/xmlsecurity/source/framework/buffernode.cxx +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -63,23 +63,12 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const * bExist - true if a match found, false otherwise
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx |2 +- xmlhelp/source/cxxhelp/provider/content.cxx | 10 +- xmlhelp/source/cxxhelp/provider/databases.hxx | 12 ++-- xmlhelp/source/cxxhelp/provider/db.hxx|2 +- xmlhelp/source/cxxhelp/provider/provider.cxx |3 +-- xmlhelp/source/cxxhelp/provider/provider.hxx |1 - xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |2 +- xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx |2 +- xmlhelp/source/cxxhelp/provider/urlparameter.hxx |2 +- 9 files changed, 17 insertions(+), 19 deletions(-) New commits: commit 04e9a4c012f12dc26fda10aabb8d229555c711ab Author: Noel Grandin AuthorDate: Thu Sep 13 10:40:54 2018 +0200 Commit: Noel Grandin CommitDate: Thu Sep 13 14:37:36 2018 +0200 loplugin:constfields in xmlhelp Change-Id: Ia8eda3075b0387ec3a5ed6267f1dfcfb3a8cf782 Reviewed-on: https://gerrit.libreoffice.org/60426 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index bee206db49c6..05c6991ab28c 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -269,7 +269,7 @@ namespace treeview { css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA; IteratorState m_eState; -OUString m_aLanguage; +OUString const m_aLanguage; css::uno::Sequence< css::uno::Reference < css::deployment::XPackage > > m_aUserPackagesSeq; diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 2551c82baa61..8a2696557dea 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -137,9 +137,9 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; -uno::Sequence< beans::Property > m_seq; -URLParameter m_aURLParameter; -Databases* m_pDatabases; +uno::Sequence< beans::Property > const m_seq; +URLParameter const m_aURLParameter; +Databases* const m_pDatabases; public: @@ -174,9 +174,9 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; -uno::Sequence< beans::Property > m_seq; +uno::Sequence< beans::Property > const m_seq; URLParameter m_aURLParameter; -Databases* m_pDatabases; +Databases* const m_pDatabases; public: diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index e5beff449e8e..ae3e5049af5c 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -57,10 +57,10 @@ namespace chelp { { private: -OUString m_aStartId; -OUString m_aProgramSwitch; -OUString m_aTitle; -int m_nOrder; +OUString const m_aStartId; +OUString const m_aProgramSwitch; +OUString const m_aTitle; +int const m_nOrder; public: @@ -233,7 +233,7 @@ namespace chelp { css::uno::Reference< css::lang::XMultiComponentFactory > m_xSMgr; css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA; -bool m_bShowBasic; +bool const m_bShowBasic; std::vector m_vCustomCSSDoc; OUString m_aCSS; @@ -387,7 +387,7 @@ namespace chelp { const css::uno::Reference< css::deployment::XPackage >& xPackage, OUString* o_pExtensionPath, OUString* o_pExtensionRegistryPath ); -bool m_bHelpText; +bool const m_bHelpText; }; // end class DataBaseIterator diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index 607b987ff838..ce7dbc29d15d 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -51,7 +51,7 @@ namespace helpdatafileproxy { class Hdf { -OUString m_aFileURL; +OUString const m_aFileURL; std::unique_ptr m_pStringToDataMap; std::unique_ptr m_pStringToValPosMap; css::uno::Reference< css::ucb::XSimpleFileAccess3 > diff --git
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx |5 +++-- xmlhelp/source/cxxhelp/provider/resultset.cxx |4 ++-- xmlhelp/source/cxxhelp/provider/resultset.hxx |2 +- 3 files changed, 6 insertions(+), 5 deletions(-) New commits: commit 5cb74685babe8ce8ea61bec515c0b701e0df34a5 Author: Noel Grandin AuthorDate: Wed Aug 22 09:45:14 2018 +0200 Commit: Noel Grandin CommitDate: Wed Aug 22 13:24:24 2018 +0200 loplugin:useuniqueptr in chelp::DynamicResultSet Change-Id: If9ffa025ba0ce9a1c97c89ec50e71e7f90c5435b Reviewed-on: https://gerrit.libreoffice.org/59436 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index e785daa4b1fa..1b7104950641 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include "content.hxx" #include "provider.hxx" #include "resultset.hxx" @@ -289,7 +290,7 @@ uno::Any SAL_CALL Content::execute( = new DynamicResultSet( m_xContext, aOpenCommand, -new ResultSetForRootFactory( +o3tl::make_unique( m_xContext, m_xProvider.get(), aOpenCommand.Properties, @@ -303,7 +304,7 @@ uno::Any SAL_CALL Content::execute( = new DynamicResultSet( m_xContext, aOpenCommand, -new ResultSetForQueryFactory( +o3tl::make_unique( m_xContext, m_xProvider.get(), aOpenCommand.Properties, diff --git a/xmlhelp/source/cxxhelp/provider/resultset.cxx b/xmlhelp/source/cxxhelp/provider/resultset.cxx index c6983ebcf954..23d7dcbf79e4 100644 --- a/xmlhelp/source/cxxhelp/provider/resultset.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultset.cxx @@ -34,9 +34,9 @@ using namespace chelp; DynamicResultSet::DynamicResultSet( const Reference< XComponentContext >& rxContext, const OpenCommandArgument2& rCommand, -ResultSetFactory* pFactory ) +std::unique_ptr pFactory ) : ResultSetImplHelper( rxContext, rCommand ), - m_pFactory( pFactory ) + m_pFactory( std::move(pFactory) ) { } diff --git a/xmlhelp/source/cxxhelp/provider/resultset.hxx b/xmlhelp/source/cxxhelp/provider/resultset.hxx index 82849ab3abe3..24891246d766 100644 --- a/xmlhelp/source/cxxhelp/provider/resultset.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultset.hxx @@ -42,7 +42,7 @@ namespace chelp { DynamicResultSet( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::ucb::OpenCommandArgument2& rCommand, -ResultSetFactory* pFactory ); +std::unique_ptr pFactory ); virtual ~DynamicResultSet() override; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 15 ++- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |7 --- 2 files changed, 10 insertions(+), 12 deletions(-) New commits: commit 1fa230f73c907b1003034e17134275595f19f0e6 Author: Noel GrandinDate: Wed Feb 28 10:13:54 2018 +0200 loplugin:useuniqueptr in chelp::ResultSetBase Change-Id: I6e8541837a07c8cf2e001289e0804d7e4e7ba3b1 Reviewed-on: https://gerrit.libreoffice.org/50658 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index 70fdf9c5e0e5..8d5fb3f3722a 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -48,9 +48,6 @@ ResultSetBase::ResultSetBase( const uno::Reference< uno::XComponentContext >& r ResultSetBase::~ResultSetBase() { -delete m_pIsFinalListeners; -delete m_pRowCountListeners; -delete m_pDisposeEventListeners; } @@ -96,8 +93,8 @@ ResultSetBase::addEventListener( osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pDisposeEventListeners ) -m_pDisposeEventListeners = -new comphelper::OInterfaceContainerHelper2( m_aMutex ); +m_pDisposeEventListeners.reset( +new comphelper::OInterfaceContainerHelper2( m_aMutex )); m_pDisposeEventListeners->addInterface( Listener ); } @@ -453,8 +450,8 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pIsFinalListeners ) -m_pIsFinalListeners = -new comphelper::OInterfaceContainerHelper2( m_aMutex ); +m_pIsFinalListeners.reset( +new comphelper::OInterfaceContainerHelper2( m_aMutex )); m_pIsFinalListeners->addInterface( xListener ); } @@ -462,8 +459,8 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pRowCountListeners ) -m_pRowCountListeners = -new comphelper::OInterfaceContainerHelper2( m_aMutex ); +m_pRowCountListeners.reset( +new comphelper::OInterfaceContainerHelper2( m_aMutex )); m_pRowCountListeners->addInterface( xListener ); } else diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index af6d4a6959ce..9c1a016030dd 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx @@ -20,6 +20,7 @@ #define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_RESULTSETBASE_HXX #include +#include #include #include #include @@ -390,10 +391,10 @@ namespace chelp { css::uno::Sequence< css::beans::Property > m_sProperty; osl::Mutex m_aMutex; -comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners; +std::unique_ptr m_pDisposeEventListeners; -comphelper::OInterfaceContainerHelper2* m_pRowCountListeners; -comphelper::OInterfaceContainerHelper2* m_pIsFinalListeners; +std::unique_ptr m_pRowCountListeners; +std::unique_ptr m_pIsFinalListeners; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx |9 - 1 file changed, 9 deletions(-) New commits: commit c7f1a8a8726fe0395a88e674be8f3fdaf0b7af3f Author: Mike KaganskiDate: Wed Jan 31 22:48:02 2018 +0300 xmlhelp: MSVC: pragma warning: make more specific, remove obsolete Change-Id: I211a6f95f7146d7ffaa0c44af786c4474abc73f4 Reviewed-on: https://gerrit.libreoffice.org/49058 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 5ccbb5137197..69f30b06130d 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -28,11 +28,6 @@ #include -#if defined _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4068 4263 4264 4266) -#endif - #if defined(__GNUC__) # pragma GCC visibility push (default) #endif @@ -41,10 +36,6 @@ # pragma GCC visibility pop #endif -#if defined _MSC_VER -#pragma warning(pop) -#endif - #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit 4094f9baf62a426b24f497c86d6a96ccfcb22ad1 Author: Eike RathkeDate: Mon Dec 11 22:34:21 2017 +0100 Attempt to blind fix build breaker Change-Id: Ic20cc65b7fa78729d432fbf5e15fabe0e25cf627 diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index f4bb0631d30d..bee206db49c6 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -36,6 +36,7 @@ #include #include #include +#include namespace treeview { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvread.hxx |2 - xmlhelp/source/treeview/tvread.cxx| 36 -- 2 files changed, 23 insertions(+), 15 deletions(-) New commits: commit 8a3bb9356219754af7e651a879b5fc8925a18468 Author: Michael StahlDate: Mon Dec 11 20:00:15 2017 +0100 tdf#114242 xmlhelp: fix crash in TVChildTarget::Check() The ... idiomatic C++ code in TVChildTarget::Check() and SearchAndInsert() handles ownership in non-obvious ways, so it's not surprising that it took offense at the recent conversion to std::unique_ptr. Let's at least try to prevent it from crashing so quickly. (regression from 4b69497e36b941d4db62ae8d5bad863d032fdc50) Change-Id: I0981707a61aee1733e727b1c00346d8ec524362e diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index bef027c06399..f4bb0631d30d 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -227,7 +227,7 @@ namespace treeview { static void subst( OUString& instpath ); -bool SearchAndInsert(TVDom* p, TVDom* tvDom); +std::unique_ptr SearchAndInsert(std::unique_ptr p, TVDom* tvDom); void Check(TVDom* tvDom); diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index d8b95c84bfad..f3fe31b44d46 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -61,11 +61,10 @@ namespace treeview { return children.back().get(); } -TVDom* newChild(TVDom* p) +void newChild(std::unique_ptr p) { -children.emplace_back( p ); -p->parent = this; -return children.back().get(); +children.emplace_back(std::move(p)); +children.back()->parent = this; } TVDom* getParent() const @@ -448,8 +447,13 @@ void TVChildTarget::Check(TVDom* tvDom) TVDom* p = tvDom->children.back().get(); for(auto & k : p->children) -if (!SearchAndInsert(k.get(), tvDom->children[i].get())) -tvDom->children[i]->newChild(k.get()); +{ +std::unique_ptr tmp(SearchAndInsert(std::move(k), tvDom->children[i].get())); +if (tmp) +{ +tvDom->children[i]->newChild(std::move(tmp)); +} +} tvDom->children.pop_back(); h = true; @@ -458,9 +462,10 @@ void TVChildTarget::Check(TVDom* tvDom) } } -bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) +std::unique_ptr +TVChildTarget::SearchAndInsert(std::unique_ptr p, TVDom* tvDom) { -if (p->isLeaf()) return false; +if (p->isLeaf()) return p; bool h = false; sal_Int32 max = 0; @@ -481,8 +486,8 @@ bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) if (p_int==c_int) { -(*(tvDom->children.insert(i+1, std::unique_ptr(p->parent = tvDom; -return true; +(*(tvDom->children.insert(i+1, std::move(p->parent = tvDom; +return nullptr; } else if(c_int>max && c_int < p_int) { @@ -491,17 +496,20 @@ bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) } } if (h) -(*(tvDom->children.insert(max_It, std::unique_ptr(p->parent = tvDom; +{ +(*(tvDom->children.insert(max_It, std::move(p->parent = tvDom; +return nullptr; +} else { i = tvDom->children.begin(); -while ((i!=tvDom->children.end()) && (!h)) +while ((i!=tvDom->children.end()) && (p != nullptr)) { -h = SearchAndInsert(p, i->get()); +p = SearchAndInsert(std::move(p), i->get()); ++i; } +return p; } -return h; } Any SAL_CALL ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx | 38 - 1 file changed, 17 insertions(+), 21 deletions(-) New commits: commit 4b69497e36b941d4db62ae8d5bad863d032fdc50 Author: Noel GrandinDate: Fri Nov 17 10:31:00 2017 +0200 loplugin:useuniqueptr in TVDom Change-Id: I885c202c64f43b89372d079659dd9b5b12677fbd Reviewed-on: https://gerrit.libreoffice.org/44861 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index af03833bc58e..5339a93117d7 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -37,6 +37,7 @@ #include #include #include +#include namespace treeview { @@ -54,23 +55,17 @@ namespace treeview { { } -~TVDom() -{ -for(TVDom* p : children) -delete p; -} - TVDom* newChild() { -children.push_back( new TVDom( this ) ); -return children.back(); +children.emplace_back( new TVDom( this ) ); +return children.back().get(); } TVDom* newChild(TVDom* p) { -children.push_back( p ); +children.emplace_back( p ); p->parent = this; -return children.back(); +return children.back().get(); } TVDom* getParent() const @@ -158,7 +153,7 @@ namespace treeview { OUString targetURL; TVDom *parent; -std::vector< TVDom* > children; +std::vector< std::unique_ptr > children; }; } @@ -382,7 +377,7 @@ TVChildTarget::TVChildTarget( const ConfigData& configData,TVDom* tvDom ) { Elements.resize( tvDom->children.size() ); for( size_t i = 0; i < Elements.size(); ++i ) -Elements[i] = new TVRead( configData,tvDom->children[i] ); +Elements[i] = new TVRead( configData,tvDom->children[i].get() ); } TVChildTarget::TVChildTarget( const Reference< XComponentContext >& xContext ) @@ -428,7 +423,7 @@ TVChildTarget::TVChildTarget( const Reference< XComponentContext >& xContext ) Elements.resize( tvDom.children.size() ); for( size_t i = 0; i < Elements.size(); ++i ) -Elements[i] = new TVRead( configData,tvDom.children[i] ); +Elements[i] = new TVRead( configData,tvDom.children[i].get() ); } TVChildTarget::~TVChildTarget() @@ -450,11 +445,11 @@ void TVChildTarget::Check(TVDom* tvDom) if (((tvDom->children[i])->application == (tvDom->children[tvDom->children.size()-1])->application) && ((tvDom->children[i])->id == (tvDom->children[tvDom->children.size()-1])->id)) { -TVDom* p = tvDom->children[tvDom->children.size()-1]; +TVDom* p = tvDom->children.back().get(); -for(TVDom* k : p->children) -if (!SearchAndInsert(k, tvDom->children[i])) -tvDom->children[i]->newChild(k); +for(auto & k : p->children) +if (!SearchAndInsert(k.get(), tvDom->children[i].get())) +tvDom->children[i]->newChild(k.get()); tvDom->children.pop_back(); h = true; @@ -470,7 +465,7 @@ bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) bool h = false; sal_Int32 max = 0; -std::vector< TVDom* >::iterator max_It, i; +std::vector< std::unique_ptr >::iterator max_It, i; max_It = tvDom->children.begin(); sal_Int32 c_int; @@ -486,7 +481,7 @@ bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) if (p_int==c_int) { -(*(tvDom->children.insert(i+1, p)))->parent = tvDom; +(*(tvDom->children.insert(i+1, std::unique_ptr(p->parent = tvDom; return true; } else if(c_int>max && c_int < p_int) @@ -495,13 +490,14 @@ bool TVChildTarget::SearchAndInsert(TVDom* p, TVDom* tvDom) max_It = i+1; } } -if (h) (*(tvDom->children.insert(max_It, p)))->parent = tvDom; +if (h) +(*(tvDom->children.insert(max_It, std::unique_ptr(p->parent = tvDom; else { i = tvDom->children.begin(); while ((i!=tvDom->children.end()) && (!h)) { -h = SearchAndInsert(p, *i); +h = SearchAndInsert(p, i->get()); ++i; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) New commits: commit f393b34cd0f11679f1229cdb3afc91d0d654e8ed Author: Stephan BergmannDate: Fri Jun 30 16:38:20 2017 +0200 lang_ is unused ...ever since 8b8926aeba974cf07fdbaf121a11ef8a2c3c23e0 "Initial revison" Change-Id: Ice5655cfa8981cb6a97aeb710ab779b2be3f3c96 diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 1038566cc3f0..8e8aa07fa8a8 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -366,7 +366,7 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin cfgFile.close(); const sal_Unicode* str = fileContent.getStr(); -OUString current,lang_,program,startid,title; +OUString current,program,startid,title; OUString order( "1" ); for( sal_Int32 i = 0;i < fileContent.getLength();i++ ) @@ -386,10 +386,6 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin { startid = current.copy( current.indexOf('=') + 1 ); } -else if( current.startsWith("Language") ) -{ -lang_ = current.copy( current.indexOf('=') + 1 ); -} else if( current.startsWith("Program") ) { program = current.copy( current.indexOf('=') + 1 ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmloff/inc xmloff/source xmlscript/source xmlsecurity/inc
xmlhelp/source/cxxhelp/provider/urlparameter.cxx |3 --- xmlhelp/source/cxxhelp/provider/urlparameter.hxx |1 - xmloff/inc/txtfldi.hxx |1 - xmloff/inc/txtvfldi.hxx|3 --- xmloff/source/draw/ximp3dobject.cxx| 20 ++-- xmloff/source/draw/ximp3dobject.hxx|4 xmloff/source/style/PageMasterExportPropMapper.cxx | 12 xmloff/source/table/XMLTableImport.cxx |5 - xmloff/source/text/txtfldi.cxx |2 -- xmloff/source/text/txtvfldi.cxx| 12 xmlscript/source/xmlmod_imexp/imp_share.hxx|5 - xmlscript/source/xmlmod_imexp/xmlmod_import.cxx|2 -- xmlsecurity/inc/xmlsignaturehelper.hxx |8 ++-- 13 files changed, 4 insertions(+), 74 deletions(-) New commits: commit 83f9325f0d8d643d8b3e71fa3ff76ebbd599373d Author: Noel GrandinDate: Thu Jun 15 11:42:29 2017 +0200 loplugin:unusedfields xmlhelp..xmlsecurity Change-Id: I7e680e1913c787ce0adad5be1f84668d57ad00b3 Reviewed-on: https://gerrit.libreoffice.org/38821 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 8c2f0067e8fa..85d33f8463a1 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -119,8 +119,6 @@ OUString const & URLParameter::get_id() get_language() ); if( inf ) m_aId = inf->get_id(); - -m_bStart = true; } return m_aId; @@ -180,7 +178,6 @@ OUString const & URLParameter::get_program() void URLParameter::init() { m_bHelpDataFileRead = false; -m_bStart = false; m_bUseDB = true; m_nHitCount = 100;// The default maximum hitcount } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx index 07601e48eb1a..b261eaa99e96 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx @@ -175,7 +175,6 @@ namespace chelp { Databases* m_pDatabases; bool m_bHelpDataFileRead; -bool m_bStart; bool m_bUseDB; OUString m_aURL; diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index 1aa9c5ac3761..e42ee3b51d96 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -1159,7 +1159,6 @@ class XMLScriptImportContext : public XMLTextFieldImportContext OUString sScriptType; bool bContentOK; -bool bScriptTypeOK; public: diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx index 437657b5442b..a4c05bcd37ae 100644 --- a/xmloff/inc/txtvfldi.hxx +++ b/xmloff/inc/txtvfldi.hxx @@ -45,9 +45,7 @@ class XMLValueImportHelper final bool bStringType; /// is this a string (or a float) type? bool bFormatOK; /// have we read a style:data-style-name attr.? -bool bTypeOK; /// have we read a value-type attribute? bool bStringValueOK;/// have we read a string-value attr.? -bool bFloatValueOK; /// have we read any of the float attr.s? bool bFormulaOK;/// have we read the formula attribute? const bool bSetType;/// should PrepareField set the SetExp subtype? @@ -118,7 +116,6 @@ private: bool bDisplayFormula; /// display formula?(rather than value) bool bDisplayNone; /// hide field? -bool bNameOK; /// sName was set bool bFormulaOK;/// sFormula was set bool bDescriptionOK;/// sDescription was set bool bHelpOK; /// sHelp was set diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx index b573afd2fc9f..930ce52dd326 100644 --- a/xmloff/source/draw/ximp3dobject.cxx +++ b/xmloff/source/draw/ximp3dobject.cxx @@ -103,9 +103,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( uno::Reference< drawing::XShapes >& rShapes) : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ), maMinEdge(-2500.0, -2500.0, -2500.0), -maMaxEdge(2500.0, 2500.0, 2500.0), -mbMinEdgeUsed(false), -mbMaxEdgeUsed(false) +maMaxEdge(2500.0, 2500.0, 2500.0) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for(sal_Int16 i=0; i < nAttrCount; i++) @@ -124,10 +122,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( SvXMLUnitConverter::convertB3DVector(aNewVec, sValue); if(aNewVec != maMinEdge) -{ maMinEdge = aNewVec; -
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx| 19 ++ xmlhelp/source/cxxhelp/provider/databases.hxx|6 +-- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 40 --- 3 files changed, 21 insertions(+), 44 deletions(-) New commits: commit 88ff39aee58cf0c098a2cce311cf62efbd76bb6d Author: Noel GrandinDate: Thu Jun 1 11:32:56 2017 +0200 use OStringBuffer instead of manual buffer management Change-Id: Iba155637cbbdfc5d6b3a427372695d4d03319621 Reviewed-on: https://gerrit.libreoffice.org/38297 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 6f8ed43c5205..cbabe0890bed 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -952,8 +952,7 @@ void Databases::changeCSS(const OUString& newStyleSheet) } void Databases::cascadingStylesheet( const OUString& Language, - std::unique_ptr & buffer, - int* byteCount ) + OStringBuffer& buffer ) { if( ! m_pCustomCSSDoc ) { @@ -1056,18 +1055,13 @@ void Databases::cascadingStylesheet( const OUString& Language, } } -*byteCount = m_nCustomCSSDocLength; -buffer.reset( new char[ 1 + *byteCount ] ); -buffer[*byteCount] = 0; -memcpy( buffer.get(), m_pCustomCSSDoc, m_nCustomCSSDocLength ); - +buffer.append( m_pCustomCSSDoc, m_nCustomCSSDocLength ); } void Databases::setActiveText( const OUString& Module, const OUString& Language, const OUString& Id, - std::unique_ptr & buffer, - int* byteCount ) + OStringBuffer& buffer ) { DataBaseIterator aDbIt( m_xContext, *this, Module, Language, true ); @@ -1110,15 +1104,10 @@ void Databases::setActiveText( const OUString& Module, break; } -*byteCount = nSize; -buffer.reset( new char[ 1 + nSize ] ); -buffer[nSize] = 0; -memcpy( buffer.get(), pData, nSize ); +buffer.append( pData, nSize ); } else { -*byteCount = 0; -buffer.reset( new char[1] ); // Initialize with 1 to avoid compiler warnings if( !bFoundAsEmpty ) m_aEmptyActiveTextSet.insert( id ); } diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 2b5975119e12..862faa5c7b29 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -173,8 +173,7 @@ namespace chelp { */ void cascadingStylesheet( const OUString& Language, - std::unique_ptr & buffer, - int* byteCount ); + OStringBuffer& buffer ); /** * Changes the stylesheet for further reads. @@ -189,8 +188,7 @@ namespace chelp { void setActiveText( const OUString& Module, const OUString& Language, const OUString& Id, -std::unique_ptr & buffer, -int* byteCount ); +OStringBuffer& buffer ); /** * Has the purpose of forcing the jarfile to stay open diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 334029d48633..8c2f0067e8fa 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -327,16 +327,14 @@ public: void addToBuffer( const char* buffer,int len ); -sal_Int8 const * getData() const { return reinterpret_cast(buffer.get()); } - -sal_Int32 getLen() const { return sal_Int32( len ); } +OStringBuffer const & getData() const { return buffer; } private: osl::Mutex m_aMutex; -int len,pos; -std::unique_ptr buffer; +int pos; +OStringBuffer buffer; }; @@ -356,7 +354,7 @@ void URLParameter::open( const Command& aCommand, InputStreamTransformer* p = new InputStreamTransformer( this,m_pDatabases,isRoot() ); try { -xDataSink->writeBytes( Sequence< sal_Int8 >( p->getData(),p->getLen() ) ); +xDataSink->writeBytes( Sequence< sal_Int8 >( reinterpret_cast(p->getData().getStr()), p->getData().getLength() ) ); } catch( const Exception& ) { @@ -716,25 +714,21 @@ fileClose(void * context) { InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) New commits: commit a46803587d48adccfb314dc0e7e9d07daed1b313 Author: Arnaud VersiniDate: Sun Sep 18 16:55:38 2016 +0200 Replace local ASCII function with rtl/character.hxx Change-Id: I63568dabbcea4159276b4020af6bc01f9175dfa7 Reviewed-on: https://gerrit.libreoffice.org/28996 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 4db1933..0099970 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -46,26 +47,6 @@ #include "urlparameter.hxx" #include "databases.hxx" -namespace chelp { - -inline bool ascii_isDigit( sal_Unicode ch ) -{ -return ((ch >= 0x0030) && (ch <= 0x0039)); -} - -inline bool ascii_isLetter( sal_Unicode ch ) -{ -return ( ( (ch >= 0x0041) && (ch <= 0x005A) ) || - ( (ch >= 0x0061) && (ch <= 0x007A) ) ); -} - -inline bool isLetterOrDigit( sal_Unicode ch ) -{ -return ascii_isLetter( ch ) || ascii_isDigit( ch ); -} - -} - using namespace cppu; using namespace com::sun::star::io; using namespace com::sun::star::uno; @@ -469,7 +450,7 @@ bool URLParameter::module() { sal_Int32 idx = 0,length = m_aExpr.getLength(); -while( idx < length && isLetterOrDigit( (m_aExpr.getStr())[idx] ) ) +while( idx < length && rtl::isAsciiAlphanumeric( (m_aExpr.getStr())[idx] ) ) ++idx; if( idx != 0 ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmloff/inc xmloff/source
xmlhelp/source/cxxhelp/provider/resultsetbase.cxx |3 - xmlhelp/source/cxxhelp/provider/resultsetbase.hxx |1 xmloff/inc/XMLImageMapExport.hxx |2 xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx |2 xmloff/inc/txtvfldi.hxx|3 - xmloff/source/chart/ColorPropertySet.cxx |3 - xmloff/source/chart/ColorPropertySet.hxx |1 xmloff/source/draw/XMLImageMapExport.cxx | 13 ++--- xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx | 24 +- xmloff/source/text/XMLPropertyBackpatcher.cxx | 31 + xmloff/source/text/XMLPropertyBackpatcher.hxx |8 --- xmloff/source/text/txtvfldi.cxx|9 +-- xmloff/source/transform/FormPropOOoTContext.cxx| 19 --- 13 files changed, 21 insertions(+), 98 deletions(-) New commits: commit 6a5e30d52c345cbeb89eab0722fe866db0d62fc6 Author: Noel GrandinDate: Thu Jun 23 11:06:14 2016 +0200 loplugin:singlevalfields in xmlhelp,xmloff Change-Id: Ia40d1c9a153b5237c46d5a2b807dceff30775f4a Reviewed-on: https://gerrit.libreoffice.org/26589 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index 8046a77..9858740 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -38,7 +38,6 @@ ResultSetBase::ResultSetBase( const uno::Reference< uno::XComponentContext >& r m_xProvider( xProvider ), m_nRow( -1 ), m_nWasNull( true ), - m_bRowCountFinal( true ), m_sProperty( seq ), m_pDisposeEventListeners( nullptr ), m_pRowCountListeners( nullptr ), @@ -498,7 +497,7 @@ uno::Any SAL_CALL ResultSetBase::getPropertyValue( { if( PropertyName == "IsRowCountFinal" ) { -return uno::Any(m_bRowCountFinal); +return uno::Any(true); } else if ( PropertyName == "RowCount" ) { diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index 56a591b..4d6d36e 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx @@ -487,7 +487,6 @@ namespace chelp { css::uno::Reference< css::ucb::XContentProvider > m_xProvider; sal_Int32 m_nRow; boolm_nWasNull; -boolm_bRowCountFinal; typedef std::vector< css::uno::Reference< css::ucb::XContentIdentifier > > IdentSet; typedef std::vector< css::uno::Reference< css::sdbc::XRow > > ItemSet; diff --git a/xmloff/inc/XMLImageMapExport.hxx b/xmloff/inc/XMLImageMapExport.hxx index ada29c3..db7ab92 100644 --- a/xmloff/inc/XMLImageMapExport.hxx +++ b/xmloff/inc/XMLImageMapExport.hxx @@ -49,8 +49,6 @@ class XMLImageMapExport SvXMLExport& mrExport; -bool mbWhiteSpace; /// use whitespace between image map elements? - public: XMLImageMapExport(SvXMLExport& rExport); diff --git a/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx b/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx index 152d866..9aeaea3 100644 --- a/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx +++ b/xmloff/inc/XMLPercentOrMeasurePropertyHandler.hxx @@ -27,8 +27,6 @@ */ class XMLPercentOrMeasurePropertyHandler : public XMLPropertyHandler { -private: -bool mbPercent; public: XMLPercentOrMeasurePropertyHandler(); virtual ~XMLPercentOrMeasurePropertyHandler (); diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx index a92f6bc..168d937 100644 --- a/xmloff/inc/txtvfldi.hxx +++ b/xmloff/inc/txtvfldi.hxx @@ -61,9 +61,6 @@ class XMLValueImportHelper const bool bSetStyle; /// should PrepareField set NumberFormat? const bool bSetFormula; /// should PrepareField set Formula? -const bool bStringDefault; /// default: string-value = content -const bool bFormulaDefault; /// default: formula = content - public: XMLValueImportHelper( SvXMLImport& rImprt,/// XML Import diff --git a/xmloff/source/chart/ColorPropertySet.cxx b/xmloff/source/chart/ColorPropertySet.cxx index a14eeec..cba1746 100644 --- a/xmloff/source/chart/ColorPropertySet.cxx +++ b/xmloff/source/chart/ColorPropertySet.cxx @@ -88,7 +88,6 @@ ColorPropertySet::ColorPropertySet( sal_Int32 nColor ) : // note: length of FillColor and LineColor is 9 m_aColorPropName( "FillColor", 9, RTL_TEXTENCODING_ASCII_US ), m_nColor( nColor ), -m_bIsFillColor( true ), m_nDefaultColor( 0x0099ccff ) // blue 8 {} @@ -101,7 +100,7 @@ Reference<
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/inputstream.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit a31840be018cdc9a32f0a27e522b758cd3400b69 Author: Noel GrandinDate: Sun Apr 3 18:02:42 2016 +0200 reduce unnecessary reallocing Change-Id: I01880cfecdab4addb358c74cbcdc02c98c0d6224 Reviewed-on: https://gerrit.libreoffice.org/23764 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/inputstream.cxx b/xmlhelp/source/cxxhelp/provider/inputstream.cxx index 36b9027..ec4f7f9 100644 --- a/xmlhelp/source/cxxhelp/provider/inputstream.cxx +++ b/xmlhelp/source/cxxhelp/provider/inputstream.cxx @@ -84,19 +84,20 @@ XInputStream_impl::readBytes( if( ! m_bIsOpen ) throw io::IOException(); -aData.realloc(nBytesToRead); +if (aData.getLength() < nBytesToRead) +aData.realloc(nBytesToRead); //TODO! translate memory exhaustion (if it were detectable...) into // io::BufferSizeExceededException -sal_uInt64 nrc; -m_aFile.read( aData.getArray(),sal_uInt64(nBytesToRead),nrc ); +sal_uInt64 nBytesRead; +m_aFile.read( aData.getArray(), sal_uInt64(nBytesToRead), nBytesRead ); // Shrink aData in case we read less than nBytesToRead (XInputStream // documentation does not tell whether this is required, and I do not know // if any code relies on this, so be conservative---SB): -if (nrc != sal::static_int_cast( nBytesToRead) ) -aData.realloc(sal_Int32(nrc)); -return ( sal_Int32 ) nrc; +if (nBytesRead != sal::static_int_cast(nBytesToRead) ) +aData.realloc(sal_Int32(nBytesRead)); +return ( sal_Int32 ) nBytesRead; } sal_Int32 SAL_CALL ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/provider.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 549e900b4b0047b8cb6c236ea50a3fc046e5fb51 Author: Stephan BergmannDate: Mon Jan 4 15:14:27 2016 +0100 tdf#96855: Put back assignment of xHierAccess ...that had inadvertently been removed as part of a larger code removal in 6948c546fdc00dddec7d58e03150dcc87921d6b2 "tdf#75637: Resolve help images via a vnd.libreoffice.image UCP" Change-Id: Ic2d5e1a5fa5a10b240bb9e511e6dcb8097e58081 diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx index 2df4bb5..ffac57d 100644 --- a/xmlhelp/source/cxxhelp/provider/provider.cxx +++ b/xmlhelp/source/cxxhelp/provider/provider.cxx @@ -323,6 +323,8 @@ void ContentProvider::init() } OUString productversion( setupversion + " " + setupextension ); + +xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" ); bool showBasic = getBooleanKey(xHierAccess,"Help/ShowBasic"); m_pDatabases = new Databases( showBasic, instPath, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx |8 1 file changed, 8 deletions(-) New commits: commit e65233abd48c290448c361a75a90a0a9e5652062 Author: Stephan BergmannDate: Thu Nov 26 13:47:16 2015 +0100 -Werror,-Wunused-private-field Change-Id: I4649381a330bc4e9d4f419137f0393f6f35bea17 diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index fbffd7a..c035546 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -169,7 +169,6 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; uno::Sequence< beans::Property > m_seq; -uno::Sequence< ucb::NumberedSortingInfo >m_seqSort; URLParameter m_aURLParameter; Databases* m_pDatabases; @@ -179,13 +178,11 @@ public: const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ucb::XContentProvider >& xProvider, const uno::Sequence< beans::Property >& seq, -const uno::Sequence< ucb::NumberedSortingInfo >& seqSort, const URLParameter& rURLParameter, Databases* pDatabases ) : m_xContext( xContext ), m_xProvider( xProvider ), m_seq( seq ), - m_seqSort( seqSort ), m_aURLParameter( rURLParameter ), m_pDatabases( pDatabases ) { @@ -209,7 +206,6 @@ private: uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< ucb::XContentProvider > m_xProvider; uno::Sequence< beans::Property > m_seq; -uno::Sequence< ucb::NumberedSortingInfo >m_seqSort; URLParameter m_aURLParameter; Databases* m_pDatabases; @@ -219,13 +215,11 @@ public: const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< ucb::XContentProvider >& xProvider, const uno::Sequence< beans::Property >& seq, -const uno::Sequence< ucb::NumberedSortingInfo >& seqSort, const URLParameter& rURLParameter, Databases* pDatabases ) : m_xContext( rxContext ), m_xProvider( xProvider ), m_seq( seq ), - m_seqSort( seqSort ), m_aURLParameter( rURLParameter ), m_pDatabases( pDatabases ) { @@ -343,7 +337,6 @@ uno::Any SAL_CALL Content::execute( m_xContext, m_xProvider.get(), aOpenCommand.Properties, -aOpenCommand.SortingInfo, m_aURLParameter, m_pDatabases)); aRet <<= xSet; @@ -360,7 +353,6 @@ uno::Any SAL_CALL Content::execute( m_xContext, m_xProvider.get(), aOpenCommand.Properties, -aOpenCommand.SortingInfo, m_aURLParameter, m_pDatabases ) ); aRet <<= xSet; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/tvfactory.hxx| 42 +- xmlhelp/source/cxxhelp/inc/tvread.hxx | 144 +++ xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx | 70 +-- xmlhelp/source/cxxhelp/provider/content.hxx | 46 -- xmlhelp/source/cxxhelp/provider/databases.cxx |2 xmlhelp/source/cxxhelp/provider/databases.hxx | 128 +++--- xmlhelp/source/cxxhelp/provider/db.hxx |6 xmlhelp/source/cxxhelp/provider/inputstream.hxx | 64 +-- xmlhelp/source/cxxhelp/provider/provider.hxx| 45 +- xmlhelp/source/cxxhelp/provider/resultset.hxx | 11 xmlhelp/source/cxxhelp/provider/resultsetbase.hxx | 328 xmlhelp/source/cxxhelp/provider/resultsetforquery.hxx |8 xmlhelp/source/cxxhelp/provider/resultsetforroot.hxx|8 xmlhelp/source/cxxhelp/provider/urlparameter.cxx|6 xmlhelp/source/cxxhelp/provider/urlparameter.hxx| 16 xmlhelp/source/treeview/tvread.cxx | 10 16 files changed, 462 insertions(+), 472 deletions(-) New commits: commit fa452b54a5d2b31d5bc57617323f0f1092d0794f Author: Noel GrandinDate: Tue Nov 24 14:17:16 2015 +0200 com::sun::star->css in xmlhelp Change-Id: Iaa57a071f8f0e6945d24f019cb4c06e02d066e0a Reviewed-on: https://gerrit.libreoffice.org/20147 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx index 12e28d9..8bd8551 100644 --- a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx @@ -39,7 +39,7 @@ class TVFactory: public cppu::WeakImplHelper < { public: -TVFactory( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext ); +TVFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~TVFactory(); @@ -47,57 +47,57 @@ class TVFactory: public cppu::WeakImplHelper < virtual OUString SAL_CALL getImplementationName( void ) -throw( com::sun::star::uno::RuntimeException, std::exception ) override; +throw( css::uno::RuntimeException, std::exception ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) -throw(com::sun::star::uno::RuntimeException, std::exception ) override; +throw(css::uno::RuntimeException, std::exception ) override; -virtual com::sun::star::uno::Sequence< OUString > SAL_CALL +virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( void ) -throw( com::sun::star::uno::RuntimeException, std::exception ) override; +throw( css::uno::RuntimeException, std::exception ) override; // XMultiServiceFactory -virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) -throw( com::sun::star::uno::Exception, - com::sun::star::uno::RuntimeException, std::exception ) override; +throw( css::uno::Exception, + css::uno::RuntimeException, std::exception ) override; -virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, -const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) -throw( com::sun::star::uno::Exception, - com::sun::star::uno::RuntimeException, std::exception) override; +const css::uno::Sequence< css::uno::Any >& Arguments ) +throw( css::uno::Exception, + css::uno::RuntimeException, std::exception) override; -virtual com::sun::star::uno::Sequence< OUString > SAL_CALL +virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) -throw( com::sun::star::uno::RuntimeException, std::exception ) override; +throw( css::uno::RuntimeException, std::exception ) override; // Other static OUString SAL_CALL getImplementationName_static(); -static com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static(); +static css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static(); -static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL +static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx |9 - xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx |8 - xmlhelp/source/cxxhelp/inc/qe/Query.hxx | 89 --- xmlhelp/source/cxxhelp/provider/content.hxx |4 xmlhelp/source/cxxhelp/provider/databases.hxx|2 xmlhelp/source/cxxhelp/provider/urlparameter.hxx |5 xmlhelp/source/cxxhelp/qe/DocGenerator.cxx |3 7 files changed, 6 insertions(+), 114 deletions(-) New commits: commit fc0079ee90ab466ca5391292ed1be9e937ef6f2a Author: Noel Grandin n...@peralex.com Date: Mon Jul 6 10:36:14 2015 +0200 loplugin:unusedmethods xmlhelp Change-Id: Iaaeb6e6f928c6e40112b6c852a6868e1f4abdc47 Reviewed-on: https://gerrit.libreoffice.org/16793 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Noel Grandin noelgran...@gmail.com diff --git a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx b/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx index bddb024..fedfae3 100644 --- a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx +++ b/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx @@ -30,20 +30,12 @@ namespace xmlsearch { class XmlSearchException { public: - XmlSearchException( const OUString message ) : _message( message ) { } -OUString getMessage() const -{ -return _message; -} - - private: - OUString _message; }; @@ -52,7 +44,6 @@ namespace xmlsearch { : public virtual XmlSearchException { public: - IOException( const OUString message ) : XmlSearchException( message ) { diff --git a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx index a1a6d06..a3ad760 100644 --- a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx +++ b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx @@ -28,26 +28,18 @@ namespace xmlsearch { namespace qe { - class RoleFiller { public: - static RoleFiller* STOP() { return roleFiller_; } RoleFiller(); ~RoleFiller(); -void acquire() { ++m_nRefcount; } -void release() { if( ! --m_nRefcount ) delete this; } - private: - static RoleFiller roleFiller_; -sal_uInt32 m_nRefcount; - std::vector RoleFiller* fillers_; }; } diff --git a/xmlhelp/source/cxxhelp/inc/qe/Query.hxx b/xmlhelp/source/cxxhelp/inc/qe/Query.hxx index f4de3fe..986b568 100644 --- a/xmlhelp/source/cxxhelp/inc/qe/Query.hxx +++ b/xmlhelp/source/cxxhelp/inc/qe/Query.hxx @@ -32,87 +32,19 @@ namespace xmlsearch { { public: -QueryHit( sal_Int32 nColumns,double penalty,sal_Int32 doc,sal_Int32 begin,sal_Int32 end ) -: doc_( doc ), - begin_( begin ), - end_( end ), -matchesL_( 2*nColumns ), -matches_( new sal_Int32[ 2*nColumns ] ), - penalty_( penalty ) +QueryHit( sal_Int32 nColumns ) +: matchesL_( 2*nColumns ), + matches_( new sal_Int32[ 2*nColumns ] ) { memset( matches_, 0, sizeof( sal_Int32 ) * matchesL_ ); } ~QueryHit() { delete[] matches_; } -sal_Int32 getDocument() const { return doc_; } - -sal_Int32 countOfMatches() const { return matchesL_; } - -sal_Int32 getBegin() const { return begin_; } - -sal_Int32 getEnd() const { return end_; } - -double getPenalty() const { return penalty_; } - -bool betterThan( const QueryHit* o ) -{ -if( penalty_ != o-penalty_ ) -return penalty_ o-penalty_; -else if( begin_ != o-begin_ ) -return begin_ o-begin_; -else if( end_ != o-end_ ) -return end_ o-end_; -else -return false; -} - -bool worseThan( const QueryHit* o ) -{ -if( penalty_ != o-penalty_ ) -return penalty_ o-penalty_; -else if( begin_ != o-begin_ ) -return begin_ o-begin_; -else if( end_ != o-end_ ) -return end_ o-end_; -else -return false; -} - -bool worseThan( double penalty,sal_Int32 begin,sal_Int32 end ) -{ -if( penalty_ != penalty ) -return penalty_ penalty; -else if( begin_ != begin ) -return begin_ begin; -
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx | 59 --- xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx |1 xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx|1 3 files changed, 61 deletions(-) New commits: commit 760e7c269b8890517c650ad69bee8c53f2b8219e Author: Stephan Bergmann sberg...@redhat.com Date: Tue Jul 7 09:18:54 2015 +0200 Remove unused XmlSearchExceptions.hxx Change-Id: Iff364452d72c49f6484bed1520b5d2a17c342ddf diff --git a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx b/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx deleted file mode 100644 index c3eea1f..000 --- a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- 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 . - */ -#ifndef INCLUDED_XMLHELP_SOURCE_CXXHELP_INC_EXCEP_XMLSEARCHEXCEPTIONS_HXX -#define INCLUDED_XMLHELP_SOURCE_CXXHELP_INC_EXCEP_XMLSEARCHEXCEPTIONS_HXX - -#include rtl/ustring.hxx - - -namespace xmlsearch { - -namespace excep { - - -class XmlSearchException -{}; - - -class IOException -: public virtual XmlSearchException -{}; - - -class NoFactoryException -: public virtual XmlSearchException -{}; - - -class NoSuchBlock -: public virtual XmlSearchException -{}; - - -class IllegalIndexException -: public virtual XmlSearchException -{}; - -} -} - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx index a3ad760..250c876 100644 --- a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx +++ b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx @@ -21,7 +21,6 @@ #include rtl/ref.hxx #include rtl/ustring.hxx -#include excep/XmlSearchExceptions.hxx #include vector namespace xmlsearch { diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index bd6ebaa..7f127b2 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -55,7 +55,6 @@ using namespace std; using namespace chelp; -using namespace xmlsearch::excep; using namespace xmlsearch::qe; using namespace com::sun::star; using namespace com::sun::star::ucb; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx | 43 +-- xmlhelp/source/cxxhelp/inc/qe/Query.hxx |7 -- xmlhelp/source/cxxhelp/provider/databases.cxx| 12 xmlhelp/source/cxxhelp/provider/databases.hxx|6 -- 4 files changed, 8 insertions(+), 60 deletions(-) New commits: commit e1b30d688105afa28c8d927d78e137b85662a79b Author: Stephan Bergmann sberg...@redhat.com Date: Tue Jul 7 09:14:33 2015 +0200 -Werror,-Wunused-private-field Change-Id: I80da554ab15450ff6aa13575784ee8f64ca506db diff --git a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx b/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx index fedfae3..c3eea1f 100644 --- a/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx +++ b/xmlhelp/source/cxxhelp/inc/excep/XmlSearchExceptions.hxx @@ -28,60 +28,27 @@ namespace xmlsearch { class XmlSearchException -{ -public: -XmlSearchException( const OUString message ) -: _message( message ) -{ -} - -private: -OUString _message; -}; +{}; class IOException : public virtual XmlSearchException -{ -public: -IOException( const OUString message ) -: XmlSearchException( message ) -{ -} -}; +{}; class NoFactoryException : public virtual XmlSearchException -{ -public: -NoFactoryException( const OUString message ) -: XmlSearchException( message ) -{ -} -}; +{}; class NoSuchBlock : public virtual XmlSearchException -{ -public: -NoSuchBlock( const OUString message ) -: XmlSearchException( message ) -{ -} -}; +{}; class IllegalIndexException : public virtual XmlSearchException -{ -public: -IllegalIndexException( const OUString message ) -: XmlSearchException( message ) -{ -} -}; +{}; } } diff --git a/xmlhelp/source/cxxhelp/inc/qe/Query.hxx b/xmlhelp/source/cxxhelp/inc/qe/Query.hxx index 986b568..dab5d38 100644 --- a/xmlhelp/source/cxxhelp/inc/qe/Query.hxx +++ b/xmlhelp/source/cxxhelp/inc/qe/Query.hxx @@ -52,15 +52,12 @@ namespace xmlsearch { class QueryHitData { public: -QueryHitData( const OUString document, OUString* terms ) -: document_( document ), - terms_( terms ) { } +QueryHitData( OUString* terms ) +: terms_( terms ) { } ~QueryHitData() { delete[] terms_; } private: -const OUString document_; - OUString* terms_; }; // end class QueryHitData diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 865528a..908fdab 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -459,7 +459,7 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin cfgFile.close(); const sal_Unicode* str = fileContent.getStr(); -OUString current,lang_,program,startid,title,heading,fulltext; +OUString current,lang_,program,startid,title; OUString order( 1 ); for( sal_Int32 i = 0;i fileContent.getLength();i++ ) @@ -487,14 +487,6 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin { program = current.copy( current.indexOf('=') + 1 ); } -else if( current.startsWith(Heading) ) -{ -heading = current.copy( current.indexOf('=') + 1 ); -} -else if( current.startsWith(FullText) ) -{ -fulltext = current.copy( current.indexOf('=') + 1 ); -} else if( current.startsWith(Order) ) { order = current.copy( current.indexOf('=') + 1 ); @@ -509,8 +501,6 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin it-second = new StaticModuleInformation( title, startid, program, - heading, - fulltext, order );
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/db.cxx |6 +++--- xmlhelp/source/cxxhelp/provider/urlparameter.cxx |6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 473c20d86ea0cdd1307bfd5c89f89c3ba2c316a1 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Jan 20 11:31:42 2015 +0100 Some more loplugin:cstylecast: xmlhelp Change-Id: I1aa45f669711a90cce52bafd839bd84eb711436a diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx index c8cbbe7..8a834d0 100644 --- a/xmlhelp/source/cxxhelp/provider/db.cxx +++ b/xmlhelp/source/cxxhelp/provider/db.cxx @@ -85,7 +85,7 @@ void Hdf::createHashMap( bool bOptimizeForPerformance ) sal_Int32 nSize = m_xSFA-getSize( m_aFileURL ); sal_Int32 nRead = xIn-readBytes( aData, nSize ); -const char* pData = (const char*)aData.getConstArray(); +const char* pData = reinterpret_castconst char*(aData.getConstArray()); int iPos = 0; while( iPos nRead ) { @@ -173,7 +173,7 @@ bool Hdf::getValueForKey( const OString rKey, HDFData rValue ) sal_Int32 nRead = xIn-readBytes( aData, nValueLen ); if( nRead == nValueLen ) { -const char* pData = (const sal_Char*)aData.getConstArray(); +const char* pData = reinterpret_castconst sal_Char*(aData.getConstArray()); rValue.copyToBuffer( pData, nValueLen ); bSuccess = true; } @@ -218,7 +218,7 @@ bool Hdf::startIteration( void ) if( m_nItRead == nSize ) { bSuccess = true; -m_pItData = (const char*)m_aItData.getConstArray(); +m_pItData = reinterpret_castconst char*(m_aItData.getConstArray()); m_iItPos = 0; } else diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 08cdee8..6deea99 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -370,7 +370,7 @@ public: void addToBuffer( const char* buffer,int len ); -sal_Int8* getData() const { return (sal_Int8*) buffer; } +sal_Int8 const * getData() const { return reinterpret_castsal_Int8 const *(buffer); } sal_Int32 getLen() const { return sal_Int32( len ); } @@ -986,7 +986,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam, xmlRegisterInputCallbacks(fileMatch, fileOpen, fileRead, fileClose); xsltStylesheetPtr cur = -xsltParseStylesheetFile((const xmlChar *)xslURLascii.getStr()); +xsltParseStylesheetFile(reinterpret_castconst xmlChar *(xslURLascii.getStr())); xmlDocPtr doc = xmlParseFile(vnd.sun.star.zip:/); @@ -996,7 +996,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam, xmlChar *doc_txt_ptr=0; int doc_txt_len; xsltSaveResultToString(doc_txt_ptr, doc_txt_len, res, cur); -addToBuffer((const char*)doc_txt_ptr, doc_txt_len); +addToBuffer(reinterpret_castchar*(doc_txt_ptr), doc_txt_len); xmlFree(doc_txt_ptr); } xmlPopInputCallbacks(); //filePatch ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.hxx | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) New commits: commit ad40561d13e004ca4c532afb406675eea3c6a663 Author: Caolán McNamara caol...@redhat.com Date: Mon Aug 11 11:27:53 2014 +0100 Resolves: fdo#82025 use strlen instead of stored length byte Change-Id: I58cf2391d7bf2480cd12d2b1b4cf73f346f4f95f diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx index ba8f29c..05bca6d 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx @@ -43,7 +43,6 @@ namespace chelp { { } - OUString getHash() { if( m_ptr ) @@ -88,11 +87,15 @@ namespace chelp { if( ! m_ptr ) return OUString(); -sal_Int32 sizeOfTitle = -( sal_Int32 ) m_ptr[ 2 + m_ptr[0] + ( sal_Int32 ) m_ptr[ 1+ ( sal_Int32 ) m_ptr[0] ] ]; -return OUString( m_ptr + 3 + m_ptr[0] + ( sal_Int32 ) m_ptr[ 1+ ( sal_Int32 ) m_ptr[0] ], - sizeOfTitle, - RTL_TEXTENCODING_UTF8 ); +//fdo#82025 - use strlen instead of stored length byte to determine string len +//There is a one byte length field at m_ptr[2 + m_ptr[0] + m_ptr[1 +//+ m_ptr[0]]] but by default sal_Char is signed so anything larger +//than 127 defaults to a negative value, casting it would allow up +//to 255 but instead make use of the null termination to avoid +//running into a later problem with strings = 255 +const sal_Char* pTitle = m_ptr + 3 + m_ptr[0] + ( sal_Int32 ) m_ptr[ 1+ ( sal_Int32 ) m_ptr[0] ]; + +return OUString(pTitle, rtl_str_getLength(pTitle), RTL_TEXTENCODING_UTF8); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source xmlscript/source xmlsecurity/source
xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx |5 + xmlscript/source/xmldlg_imexp/exp_share.hxx |5 + xmlscript/source/xmldlg_imexp/imp_share.hxx |5 + xmlscript/source/xmllib_imexp/imp_share.hxx |5 + xmlscript/source/xmlmod_imexp/imp_share.hxx |5 + xmlsecurity/source/helper/xmlsignaturehelper2.hxx |5 + 6 files changed, 30 insertions(+) New commits: commit 626a4283672be163085b90d2240638eb0126c654 Author: Jens Carl j.car...@gmx.de Date: Wed May 28 20:19:23 2014 + fdo#68849: Add header guards to all include files Added header guards to files in directories xml*/* Change-Id: Ia5dfb9ab494bfbfae7537f2d54ff11331dc8c922 Reviewed-on: https://gerrit.libreoffice.org/9539 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx index b52d359..f126fe6 100644 --- a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx +++ b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX +#define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX + #include cppuhelper/weak.hxx #include osl/mutex.hxx #include com/sun/star/io/XInputStream.hpp @@ -104,4 +107,6 @@ namespace chelp { } +#endif // INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_BUFFEREDINPUTSTREAM_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index 93be668..c3f8f8c 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX +#define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX + #include common.hxx #include misc.hxx #include xmlscript/xmldlg_imexp.hxx @@ -279,4 +282,6 @@ inline bool ElementDescriptor::readProp( } +#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index fea64f5..b381ee2 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX +#define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX + #include common.hxx #include misc.hxx #include xmlscript/xmldlg_imexp.hxx @@ -1120,4 +1123,6 @@ public: } +#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index 4b8449f..c7cc694 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLLIB_IMEXP_IMP_SHARE_HXX +#define INCLUDED_XMLSCRIPT_SOURCE_XMLLIB_IMEXP_IMP_SHARE_HXX + #include xmlscript/xmllib_imexp.hxx #include cppuhelper/implbase1.hxx @@ -242,4 +245,6 @@ public: } +#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLLIB_IMEXP_IMP_SHARE_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx index d9cc069..07fb25e 100644 --- a/xmlscript/source/xmlmod_imexp/imp_share.hxx +++ b/xmlscript/source/xmlmod_imexp/imp_share.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLMOD_IMEXP_IMP_SHARE_HXX +#define INCLUDED_XMLSCRIPT_SOURCE_XMLMOD_IMEXP_IMP_SHARE_HXX + #include xmlscript/xmlmod_imexp.hxx #include cppuhelper/implbase1.hxx @@ -125,4 +128,6 @@ public: } +#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLMOD_IMEXP_IMP_SHARE_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx index b02732a..e58a5fc 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#ifndef INCLUDED_XMLSECURITY_SOURCE_HELPER_XMLSIGNATUREHELPER2_HXX +#define INCLUDED_XMLSECURITY_SOURCE_HELPER_XMLSIGNATUREHELPER2_HXX + #include tools/link.hxx
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx |3 --- xmlhelp/source/treeview/tvread.cxx|1 - 2 files changed, 4 deletions(-) New commits: commit 9d9f8151f32046a09fe903361d3e85cb601390ba Author: Stephan Bergmann sberg...@redhat.com Date: Tue Apr 15 09:30:36 2014 +0200 Remove unused code Change-Id: Ia624a624271b1143c96cd189cc9e4dab4c5ae302 diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 1a19fc1..b362ee2 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -68,9 +68,6 @@ struct HitItem OUString m_aURL; float m_fScore; -HitItem() -: m_fScore(0.0) -{} HitItem(const OUString aURL, float fScore) : m_aURL(aURL) , m_fScore(fScore) diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index cd78d77..f2ceb5d 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -90,7 +90,6 @@ namespace treeview { bool isLeaf() const { return kind == TVDom::tree_leaf; } void setKind( Kind ind ) { kind = ind; } -Kind getKind( ) const { return kind; } void setApplication( const char* appl ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 57b15f2dcd2963808b8af3f0665450ef81bb3eb8 Author: Caolán McNamara caol...@redhat.com Date: Fri Dec 6 13:27:17 2013 + Resolves: fdo#72022 Integrated help ignored if installed regression since 58fa3d50aa43102cea8690fd6bf51fb80c007955 Change-Id: Ia20f28daace30181652ec3f9845045db03b4 diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index fb16e66..ed30a7d 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -1233,7 +1233,7 @@ void Databases::setInstallPath( const OUString aInstDir ) osl::FileBase::getFileURLFromSystemPath( aInstDir,m_aInstallDirectory ); //TODO: check returned error code -if( m_aInstallDirectory.endsWith( / ) ) +if( !m_aInstallDirectory.endsWith( / ) ) m_aInstallDirectory += /; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/urlparameter.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6b713bafe4d8f7fc4f5dfe2b794c07fb713a3462 Author: Caolán McNamara caol...@redhat.com Date: Fri Dec 6 14:59:06 2013 + Related: fdo#72022 internal links busted regression since 58fa3d50aa43102cea8690fd6bf51fb80c007955 Change-Id: I499704d18872da6f2f01cf955a6496104c53dd3f diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 99447df..0acae63 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -627,7 +627,7 @@ bool URLParameter::query() else if( parameter.equalsAscii( Eid ) ) m_aEid = value; else if( parameter.equalsAscii( UseDB ) ) -m_bUseDB = ( value.equalsAscii(no) != 0 ); +m_bUseDB = !value.equalsAscii(no); else if( parameter.equalsAscii( DbPAR ) ) m_aDbPar = value; else if( parameter.equalsAscii( Query ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/treeview/tvread.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ebfa1e6c86037c4143d2ced2da5b5431e8e7e7db Author: Caolán McNamara caol...@redhat.com Date: Sat Sep 21 12:36:43 2013 +0100 CID#707598 uninitialized scalar values Change-Id: Id3c6488cfda25ab809bf554216bf2e5161456be0 diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 0066281..c0c62fc 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -183,6 +183,7 @@ ConfigData::ConfigData() vendVersion(%VENDORVERSION), vendShort(%VENDORSHORT) { +memset(m_vAdd, 0, sizeof(m_vAdd)); } void SAL_CALL ConfigData::replaceName( OUString oustring ) const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx| 32 +++ xmlhelp/source/cxxhelp/provider/urlparameter.cxx |7 - xmlhelp/source/treeview/tvread.cxx | 12 3 files changed, 13 insertions(+), 38 deletions(-) New commits: commit 87b5ac652d9625545a62fac83bccce369976140c Author: Jelle van der Waa je...@vdwaa.nl Date: Mon Aug 12 21:29:22 2013 +0200 fdo#57950: Remove some chained appends in xmhelp Change-Id: I4680547aa1d12d3e8eab3c33e3158845848c2068 Reviewed-on: https://gerrit.libreoffice.org/5376 Reviewed-by: Tor Lillqvist t...@iki.fi Tested-by: Tor Lillqvist t...@iki.fi diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index e19dc00..b961caf 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -576,7 +576,7 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( const OUString Database, osl::MutexGuard aGuard( m_aMutex ); OUString aFileExt( helpText ? OUString(.ht) : OUString(.db) ); -OUString dbFileName = OUStringBuffer().append('/').append(Database).append(aFileExt).makeStringAndClear(); +OUString dbFileName = / + Database + aFileExt; OUString key; if( pExtensionPath == NULL ) key = processLang( Language ) + dbFileName; @@ -920,7 +920,7 @@ Reference XHierarchicalNameAccess Databases::jarFile( const OUString jar, { return Reference XHierarchicalNameAccess ( 0 ); } -OUString key = OUStringBuffer(processLang(Language)).append('/').append(jar).makeStringAndClear(); +OUString key = processLang(Language) + / + jar; osl::MutexGuard aGuard( m_aMutex ); @@ -940,12 +940,7 @@ Reference XHierarchicalNameAccess Databases::jarFile( const OUString jar, OUString aExtensionPath = jar.copy( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 ); OUString aPureJar = jar.copy( nQuestionMark2 + 1 ); -OUStringBuffer aStrBuf; -aStrBuf.append( aExtensionPath ); -aStrBuf.append( '/' ); -aStrBuf.append( aPureJar ); - -zipFile = expandURL( aStrBuf.makeStringAndClear() ); +zipFile = expandURL( aExtensionPath + / + aPureJar ); } else { @@ -1485,18 +1480,13 @@ OUString ExtensionIteratorBase::implGetFileFromPackage( OUString aLanguage = m_aLanguage; for( sal_Int32 iPass = 0 ; iPass 2 ; ++iPass ) { -OUStringBuffer aStrBuf; -aStrBuf.append( xPackage-getRegistrationDataURL().Value); -aStrBuf.append( '/' ); -aStrBuf.append( aLanguage ); +OUString aStr = xPackage-getRegistrationDataURL().Value + / + aLanguage; if( !bLangFolderOnly ) { -aStrBuf.append( '/' ); -aStrBuf.append( help ); -aStrBuf.append( rFileExtension ); +aStr += /help + rFileExtension; } -aFile = m_rDatabases.expandURL( aStrBuf.makeStringAndClear() ); +aFile = m_rDatabases.expandURL( aStr ); if( iPass == 0 ) { if( m_xSFA-exists( aFile ) ) @@ -1626,7 +1616,7 @@ helpdatafileproxy::Hdf* DataBaseIterator::implGetHdfFromPackage( Reference depl helpdatafileproxy::Hdf* pRetHdf = NULL; if (optRegData.IsPresent !optRegData.Value.isEmpty()) { -OUString aRegDataUrl = OUStringBuffer(optRegData.Value).append('/').makeStringAndClear(); +OUString aRegDataUrl = optRegData.Value + /; OUString aHelpFilesBaseName(help); @@ -1652,7 +1642,7 @@ helpdatafileproxy::Hdf* DataBaseIterator::implGetHdfFromPackage( Reference depl *o_pExtensionPath = aRegDataUrl + aUsedLanguage; if( o_pExtensionRegistryPath ) -*o_pExtensionRegistryPath = OUStringBuffer(xPackage-getURL()).append('/').append(aUsedLanguage).makeStringAndClear(); +*o_pExtensionRegistryPath = xPackage-getURL() + / + aUsedLanguage; } return pRetHdf; @@ -1869,9 +1859,9 @@ OUString IndexFolderIterator::nextIndexFolder( bool o_rbExtension, bool o_rbTe switch( m_eState ) { case INITIAL_MODULE: -aIndexFolder = OUStringBuffer(m_rDatabases.getInstallPathAsURL()). -append(m_rDatabases.processLang(m_aLanguage)).append('/'). - append(m_aInitialModule).append(.idxl).makeStringAndClear(); +aIndexFolder = m_rDatabases.getInstallPathAsURL() ++ m_rDatabases.processLang(m_aLanguage) + / ++ m_aInitialModule + .idxl; o_rbTemporary = false; o_rbExtension = false; diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 254be31..8cc8cf8 100644 ---
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/content.cxx | 46 xmlhelp/source/cxxhelp/provider/content.hxx |9 xmlhelp/source/cxxhelp/provider/contentcaps.cxx |9 xmlhelp/source/cxxhelp/provider/databases.cxx | 34 - xmlhelp/source/cxxhelp/provider/databases.hxx | 30 --- xmlhelp/source/cxxhelp/provider/provider.cxx| 30 --- xmlhelp/source/cxxhelp/provider/provider.hxx| 12 -- xmlhelp/source/cxxhelp/provider/resultset.cxx | 15 --- xmlhelp/source/cxxhelp/provider/services.cxx|5 -- xmlhelp/source/treeview/tvfactory.cxx | 35 -- xmlhelp/source/treeview/tvread.cxx | 14 --- xmlhelp/source/treeview/tvread.hxx | 26 - 12 files changed, 265 deletions(-) New commits: commit 2f66b0cb110c2f7d864f96e850015aa1741e1f94 Author: Jelle van der Waa je...@vdwaa.nl Date: Sat Aug 10 19:28:48 2013 +0200 fdo#62475 removed pointless comments Change-Id: I4fa01553246fa023806b3fec8e6e756a1efa59f1 Reviewed-on: https://gerrit.libreoffice.org/5342 Reviewed-by: Norbert Thiebaud nthieb...@gmail.com Tested-by: Norbert Thiebaud nthieb...@gmail.com diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 04837f2..7a84493 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - /** TODO ** @@ -52,13 +51,7 @@ using namespace com::sun::star; using namespace chelp; -//= -//= -// // Content Implementation. -// -//= -//= Content::Content( const uno::Reference uno::XComponentContext rxContext, ::ucbhelper::ContentProviderImplHelper* pProvider, @@ -71,17 +64,12 @@ Content::Content( const uno::Reference uno::XComponentContext rxContext, { } -//= // virtual Content::~Content() { } -//= -// // XInterface methods. -// -//= // virtual void SAL_CALL Content::acquire() @@ -90,7 +78,6 @@ void SAL_CALL Content::acquire() ContentImplHelper::acquire(); } -//= // virtual void SAL_CALL Content::release() throw( ) @@ -98,7 +85,6 @@ void SAL_CALL Content::release() ContentImplHelper::release(); } -//= // virtual uno::Any SAL_CALL Content::queryInterface( const uno::Type rType ) throw ( uno::RuntimeException ) @@ -107,15 +93,10 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type rType ) return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface( rType ); } -//= -// // XTypeProvider methods. -// -//= XTYPEPROVIDER_COMMON_IMPL( Content ); -//= // virtual uno::Sequence uno::Type SAL_CALL Content::getTypes() throw( uno::RuntimeException ) @@ -145,11 +126,7 @@ uno::Sequence uno::Type SAL_CALL Content::getTypes() return (*pCollection).getTypes(); } -//= -// // XServiceInfo methods. -// -//= // virtual OUString SAL_CALL Content::getImplementationName() @@ -158,7 +135,6 @@ OUString SAL_CALL Content::getImplementationName() return OUString( CHelpContent ); } -//= // virtual uno::Sequence OUString SAL_CALL Content::getSupportedServiceNames() throw( uno::RuntimeException ) @@ -169,11 +145,7 @@ uno::Sequence OUString SAL_CALL Content::getSupportedServiceNames() return aSNS; } -//= -// // XContent methods. -// -//= // virtual OUString SAL_CALL Content::getContentType() @@ -182,11 +154,7 @@ OUString SAL_CALL
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/db.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ca54015d7ea10f5648bccb2adfb7a321747e70f9 Author: Sameer Deshmukh sameer.deshmuk...@gmail.com Date: Mon Apr 22 00:43:56 2013 +0530 fdo#62096 Corrected stupid error in previous patch Change-Id: Ieb3ed1201918c5b4ba64e6f767353497e697 Reviewed-on: https://gerrit.libreoffice.org/3545 Reviewed-by: Thomas Arnhold tho...@arnhold.org Tested-by: Thomas Arnhold tho...@arnhold.org Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index d00fbab..7945591 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -68,7 +68,7 @@ namespace helpdatafileproxy { struct eq { bool operator()( const OString rKey1, const OString rKey2 ) const -{ return rKey1.compareTo( rKey2 ) == 0; } +{ return (rKey1 == rKey2); } }; struct ha ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlhelp/source
xmlhelp/source/cxxhelp/provider/databases.cxx | 27 ++ 1 file changed, 27 insertions(+) New commits: commit c9d5cfa194e9e27e144e801ab179a708d77663b9 Author: Andras Timar ati...@suse.com Date: Thu Apr 11 03:38:38 2013 -0700 detect and apply Windows' high contrast theme to local help Change-Id: Ibd45773179be334991d0d493324cadaad772ea33 diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 2428c66..447d1e0 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -66,6 +66,10 @@ #include databases.hxx #include urlparameter.hxx +#ifdef WNT +#include windows.h +#endif + using namespace chelp; using namespace com::sun::star; using namespace com::sun::star::uno; @@ -1146,7 +1150,30 @@ void Databases::cascadingStylesheet( const OUString Language, { uno::Any aHCMode = xVclWindowPeer-getProperty( OUString( HighContrastMode ) ); if ( ( aHCMode = bHighContrastMode ) bHighContrastMode ) +{ aCSS = OUString( highcontrastblack ); +#ifdef WNT +HKEY hKey = NULL; +LONG lResult = RegOpenKeyExA( HKEY_CURRENT_USER, Control Panel\\Accessibility\\HighContrast, 0, KEY_QUERY_VALUE, hKey ); +if ( ERROR_SUCCESS == lResult ) +{ +CHAR szBuffer[1024]; +DWORD nSize = sizeof( szBuffer ); +lResult = RegQueryValueExA( hKey, High Contrast Scheme, NULL, NULL, (LPBYTE)szBuffer, nSize ); +if ( ERROR_SUCCESS == lResult nSize 0 ) +{ +szBuffer[nSize] = '\0'; +if ( strncmp( szBuffer, High Contrast #1, strlen(High Contrast #1) ) == 0 ) +aCSS = OUString( highcontrast1 ); +if ( strncmp( szBuffer, High Contrast #2, strlen(High Contrast #2) ) == 0 ) +aCSS = OUString( highcontrast2 ); +if ( strncmp( szBuffer, High Contrast White, strlen(High Contrast White) ) == 0 ) +aCSS = OUString( highcontrastwhite ); +} +RegCloseKey( hKey ); +} +#endif +} } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits