Subject: Devashish Gupta license statement
All of my past & future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license.
core.git: framework/source
framework/source/services/frame.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 52225dfaeb78d2c99dfa7b2ef140183accf668a2 Author: Devashish Gupta AuthorDate: Fri Mar 21 02:59:03 2025 +0530 Commit: Ilmari Lauhakangas CommitDate: Fri Mar 21 06:30:26 2025 +0100 tdf#165233 Use lambdas instead of std::bind Change-Id: Ie6a8c76bae10f52d8e97645d71e2825dd59c52c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183184 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index ff6d73bd9369..54c33bb96058 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -588,9 +588,10 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL XFrameImpl::loadComponentF // another thread, leading to an std::abort() at the end. SolarMutexGuard g; -return vcl::solarthread::syncExecute(std::bind(&LoadEnv::loadComponentFromURL, xThis, - m_xContext, sURL, sTargetFrameName, - nSearchFlags, lArguments)); +return vcl::solarthread::syncExecute([this, xThis, sURL, sTargetFrameName, nSearchFlags, lArguments] { +return LoadEnv::loadComponentFromURL(xThis, m_xContext, sURL, sTargetFrameName, + nSearchFlags, lArguments); +}); } else return LoadEnv::loadComponentFromURL(xThis, m_xContext, sURL, sTargetFrameName,
core.git: sw/source
sw/source/core/text/EnhancedPDFExportHelper.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 81dfc7afcdc473bd655ff64038e8a449ac0c Author: Devashish Gupta AuthorDate: Thu Mar 20 17:21:47 2025 +0530 Commit: Mike Kaganski CommitDate: Fri Mar 21 21:30:26 2025 +0100 tdf#158237 Use C++20 contains() instead of find() and end() Change-Id: Ieb5d3ee0ade0f9657722e05132d260c304de5410 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183168 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 517b32171d4a..74b3aa7b7574 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -567,7 +567,7 @@ bool SwTaggedPDFHelper::CheckReopenTag() { void const*const pKey = lcl_GetKeyFromFrame(*pKeyFrame); FrameTagSet& rFrameTagSet(mpPDFExtOutDevData->GetSwPDFState()->m_FrameTagSet); -if (rFrameTagSet.find(pKey) != rFrameTagSet.end() +if (rFrameTagSet.contains(pKey) || rFrame.IsFlyFrame()) // for hell layer flys { pReopenKey = pKey; @@ -654,7 +654,7 @@ void SwTaggedPDFHelper::BeginTag(vcl::pdf::StructElement eType, const OUString& if (pKey) { FrameTagSet& rFrameTagSet(mpPDFExtOutDevData->GetSwPDFState()->m_FrameTagSet); -assert(rFrameTagSet.find(pKey) == rFrameTagSet.end()); +assert(!rFrameTagSet.contains(pKey)); rFrameTagSet.emplace(pKey); } } @@ -1461,7 +1461,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() } FrameTagSet& rFrameTagSet(mpPDFExtOutDevData->GetSwPDFState()->m_FrameTagSet); -if (rFrameTagSet.find(pSection) != rFrameTagSet.end()) +if (rFrameTagSet.contains(pSection)) { // special case: section may have *multiple* master frames, // when it is interrupted by nested section - reopen! @@ -1573,7 +1573,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() if (pTabFrame) { const SwTable* pTable = pTabFrame->GetTable(); -if (rTableCaptionsMap.find(pTable) != rTableCaptionsMap.end()) +if (rTableCaptionsMap.contains(pTable)) { // Reopen Caption tag: // - if the table has an above and below caption
core.git: include/desktop
include/desktop/dllapi.h |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit d986127690cf6b61e8973ee37e009a1f0dbbc9ca Author: Devashish Gupta AuthorDate: Thu Mar 20 00:47:39 2025 +0530 Commit: Ilmari Lauhakangas CommitDate: Thu Mar 20 19:29:22 2025 +0100 tdf#143148: Use pragma once instead of include guards Change-Id: Ibfc42cd388f08e5e4c84c2761f6b5ec3f37f7a0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183139 Tested-by: Ilmari Lauhakangas Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/include/desktop/dllapi.h b/include/desktop/dllapi.h index 5cf948ce08a4..46b5c3af41be 100644 --- a/include/desktop/dllapi.h +++ b/include/desktop/dllapi.h @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H -#define INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H +#pragma once #include #include @@ -25,6 +24,4 @@ #define CRASHREPORT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT #endif -#endif - /* vim: set shiftwidth=4 softtabstop=4 expandtab: */
core.git: sc/source
sc/source/filter/oox/pivottablebuffer.cxx | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) New commits: commit 8994f2a43c2c5930c5fb0bfb7270d28fec9ef140 Author: Devashish Gupta AuthorDate: Tue Mar 25 00:22:43 2025 +0530 Commit: Ilmari Lauhakangas CommitDate: Wed Mar 26 11:34:09 2025 +0100 tdf#48140: Replace PropertySet with ScDPSaveData in finalizeImport Change-Id: If8286bba7170d00dccec23e38fd3a80d348e2c8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183277 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index 04ace38fa876..995cca5d57eb 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -1286,17 +1286,15 @@ void PivotTable::finalizeImport() return; // global data pilot properties -PropertySet aDescProp(( css::uno::Reference< css::beans::XPropertySet >(mxDPDescriptor) )); -aDescProp.setProperty( PROP_ColumnGrand, maDefModel.mbColGrandTotals ); -aDescProp.setProperty( PROP_RowGrand, maDefModel.mbRowGrandTotals ); -aDescProp.setProperty( PROP_ShowFilterButton, false ); -aDescProp.setProperty( PROP_DrillDownOnDoubleClick, maDefModel.mbEnableDrill ); - -mpDPObject->SetHideHeader(maLocationModel.mnFirstHeaderRow == 0); - if (auto* pSaveData = mpDPObject->GetSaveData()) +{ +pSaveData->SetColumnGrand(maDefModel.mbColGrandTotals); +pSaveData->SetRowGrand(maDefModel.mbRowGrandTotals); +pSaveData->SetDrillDown(maDefModel.mbEnableDrill); +pSaveData->SetFilterButton(false); pSaveData->SetExpandCollapse(maDefModel.mbShowDrill); - +} +mpDPObject->SetHideHeader(maLocationModel.mnFirstHeaderRow == 0); // finalize all fields, this finds field names and creates grouping fields finalizeFieldsImport();
core.git: vcl/osx
vcl/osx/salinst.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fbd888bfc8e916361afbc55dbfa329ebaab6d2d3 Author: Devashish Gupta AuthorDate: Thu Mar 27 15:58:47 2025 +0530 Commit: Noel Grandin CommitDate: Fri Mar 28 08:03:57 2025 +0100 tdf#158068: Replace OUString literal with u'...'_ustr in getOSVersion Change-Id: Id8a706cd3f906d37f865080f154aabcfac2647cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183387 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 6d6cb6d49989..8b9fed74c5b0 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -1023,7 +1023,7 @@ OUString AquaSalInstance::getOSVersion() if ( sysVersionDict ) versionString = [ sysVersionDict valueForKey: @"ProductVersion" ]; -OUString aVersion = "macOS "; +OUString aVersion = u"macOS "_ustr; if ( versionString ) aVersion += OUString::fromUtf8( [ versionString UTF8String ] ); else
core.git: sw/source
sw/source/core/bastyp/bparr.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit 1d04721870ab60cb6d66d99dc62ee21eee02232f Author: Devashish Gupta AuthorDate: Fri Mar 28 02:06:43 2025 +0530 Commit: Hossein CommitDate: Fri Mar 28 14:48:33 2025 +0100 tdf#163691 Replace memcpy / memmove with std::copy / std::copy_backward Change-Id: Icaead7aadedd8734a2f862c7c684f2846c1e2fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183418 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index cae512d7af10..d47f43126657 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -21,6 +21,7 @@ #include #include #include +#include /** Resize block management by this constant. As a result there are approx. 20 * MAXENTRY == 2 entries available */ @@ -160,14 +161,14 @@ BlockInfo* BigPtrArray::InsBlock( sal_uInt16 pos ) { // than extend the array first BlockInfo** ppNew = new BlockInfo* [ m_nMaxBlock + nBlockGrowSize ]; -memcpy( ppNew, m_ppInf.get(), m_nMaxBlock * sizeof( BlockInfo* )); +std::copy(m_ppInf.get(), m_ppInf.get() + m_nMaxBlock, ppNew); m_nMaxBlock += nBlockGrowSize; m_ppInf.reset( ppNew ); } if( pos != m_nBlock ) { -memmove( m_ppInf.get() + pos+1, m_ppInf.get() + pos, - ( m_nBlock - pos ) * sizeof( BlockInfo* )); +std::copy_backward(m_ppInf.get() + pos, m_ppInf.get() + m_nBlock, + m_ppInf.get() + m_nBlock + 1); } ++m_nBlock; BlockInfo* p = new BlockInfo; @@ -192,7 +193,7 @@ void BigPtrArray::BlockDel( sal_uInt16 nDel ) // than shrink array nDel = (( m_nBlock / nBlockGrowSize ) + 1 ) * nBlockGrowSize; BlockInfo** ppNew = new BlockInfo* [ nDel ]; -memcpy( ppNew, m_ppInf.get(), m_nBlock * sizeof( BlockInfo* )); +std::copy(m_ppInf.get(), m_ppInf.get() + m_nBlock, ppNew); m_ppInf.reset( ppNew ); m_nMaxBlock = nDel; } @@ -369,8 +370,8 @@ void BigPtrArray::ImplRemove( sal_Int32 pos, sal_Int32 n, bool bClearElement ) if( ( nBlk1del + nBlkdel ) < m_nBlock ) { -memmove( m_ppInf.get() + nBlk1del, m_ppInf.get() + nBlk1del + nBlkdel, - ( m_nBlock - nBlkdel - nBlk1del ) * sizeof( BlockInfo* ) ); +std::copy(m_ppInf.get() + nBlk1del + nBlkdel, m_ppInf.get() + m_nBlock, + m_ppInf.get() + nBlk1del); // UpdateIdx updates the successor thus start before first elem if( !nBlk1 )
core.git: sw/source
sw/source/core/doc/DocumentStylePoolManager.cxx | 42 1 file changed, 21 insertions(+), 21 deletions(-) New commits: commit 19ebfeb83d39d7ff246a89cfedcc4691c966dff1 Author: Devashish Gupta AuthorDate: Thu Mar 27 15:39:38 2025 +0530 Commit: Ilmari Lauhakangas CommitDate: Fri Mar 28 15:59:31 2025 +0100 tdf#147021 Use std::ssize() instead of SAL_N_ELEMENTS macro Change-Id: I602fa86255fafbc30ed63178eeab569db8c8d6dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183379 Tested-by: Ilmari Lauhakangas Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 60944d3e2619..a0cf040e6307 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -621,32 +621,32 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, TranslateId pResId; if (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY) == RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_TEXT_ARY) == RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_TEXT_ARY[nId - RES_POOLCOLL_TEXT_BEGIN]; } else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY) == RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_LISTS_ARY) == RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_LISTS_ARY[nId - RES_POOLCOLL_LISTS_BEGIN]; } else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_EXTRA_ARY) == RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_EXTRA_ARY) == RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_EXTRA_ARY[nId - RES_POOLCOLL_EXTRA_BEGIN]; } else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY) == RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_REGISTER_ARY) == RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_REGISTER_ARY[nId - RES_POOLCOLL_REGISTER_BEGIN]; } else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY) == RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_DOC_ARY) == RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_DOC_ARY[nId - RES_POOLCOLL_DOC_BEGIN]; } else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END) { -static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY) == RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLCOLL_HTML_ARY) == RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN, "### unexpected size!"); pResId = STR_POOLCOLL_HTML_ARY[nId - RES_POOLCOLL_HTML_BEGIN]; } @@ -1810,7 +1810,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool SwPageDesc* pNewPgDsc = nullptr; { -static_assert(SAL_N_ELEMENTS(STR_POOLPAGE_ARY) == RES_POOLPAGE_END - RES_POOLPAGE_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLPAGE_ARY) == RES_POOLPAGE_END - RES_POOLPAGE_BEGIN, "### unexpected size!"); const OUString aNm(SwResId(STR_POOLPAGE_ARY[nId - RES_POOLPAGE_BEGIN])); const bool bIsModified = m_rDoc.getIDocumentState().IsModified(); @@ -1986,7 +1986,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId ) nId = RES_POOLNUMRULE_BEGIN; } -static_assert(SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY) == RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN, "### unexpected size!"); +static_assert(std::ssize(STR_POOLNUMRULE_NUM_ARY) == RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN, "### unexpected size!"); OUString aNm(SwResId(STR_POOLNUMRULE_NUM_ARY[nId - RES_POOLNUMRULE_BEGIN])); SwCharForm
core.git: sw/source
sw/source/uibase/docvw/edtwin.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 1ab04b964122897ea4d3d0470dde1379955d7bbb Author: Devashish Gupta AuthorDate: Thu Mar 27 01:15:09 2025 +0530 Commit: Hossein CommitDate: Mon Mar 31 10:30:47 2025 +0200 tdf#145614 - Convert #define to constexpr Change-Id: Ia213981f353b16f2c3d5097eed1c08c55533902e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183354 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index e1655da968eb..7a5938f172e1 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -306,11 +306,11 @@ struct QuickHelpData void SortAndFilter(const OUString &rOrigWord); }; -/** - * Avoid minimal movement shiver - */ -#define HIT_PIX 2 /* hit tolerance in pixel */ -#define MIN_MOVE 4 + +// Minimise jitter + +constexpr auto HIT_PIX = 2; // Hit tolerance in pixels +constexpr auto MIN_MOVE = 4; static bool IsMinMove(const Point &rStartPos, const Point &rLPt) {
core.git: embeddedobj/source
embeddedobj/source/msole/olecomponent.cxx | 73 ++ 1 file changed, 54 insertions(+), 19 deletions(-) New commits: commit 797292f65b214353e407e3d61ded45fb90ac3191 Author: Devashish Gupta AuthorDate: Thu Mar 20 15:48:55 2025 +0530 Commit: Mike Kaganski CommitDate: Thu Mar 27 05:25:43 2025 +0100 tdf#42982 Improve UNO API error reporting Change-Id: Icba16d0ec6782c1d135c693cb840c6a2116c0fa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183163 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx index 1d4fa24e8e4f..c5a94ac65cfc 100644 --- a/embeddedobj/source/msole/olecomponent.cxx +++ b/embeddedobj/source/msole/olecomponent.cxx @@ -511,12 +511,15 @@ sal::systools::COMReference OleComponentNative_Impl::CreateNewStorage( // write the stream to the temporary file if (url.isEmpty()) -throw uno::RuntimeException(); // TODO +throw uno::RuntimeException( +u"Cannot create storage: Provided URL is empty."_ustr); // TODO // open an IStorage based on the temporary file OUString aTempFilePath; if (osl::FileBase::getSystemPathFromFileURL(url, aTempFilePath) != osl::FileBase::E_None) -throw uno::RuntimeException(); // TODO: something dangerous happened +throw uno::RuntimeException( +u"Failed to retrieve system path from file URL. Possible invalid or unsafe URL."_ustr +); // TODO: something dangerous happened sal::systools::COMReference pStorage; HRESULT hr = StgCreateDocfile( o3tl::toW(aTempFilePath.getStr()), STGM_CREATE | STGM_READWRITE | STGM_TRANSACTED | STGM_DELETEONRELEASE, 0, &pStorage ); @@ -618,7 +621,9 @@ void OleComponent::InitializeObject_Impl() auto pViewObject2(m_pNativeImpl->m_pObj.QueryInterface(sal::systools::COM_QUERY)); if (!pViewObject2) -throw uno::RuntimeException(); // TODO +throw uno::RuntimeException( + u"Failed to query IViewObject2 interface from native implementation object."_ustr +); // TODO // remove all the caches if ( sal::systools::COMReference< IOleCache > pIOleCache{ m_pNativeImpl->m_pObj, sal::systools::COM_QUERY } ) @@ -643,7 +648,9 @@ void OleComponent::InitializeObject_Impl() auto pOleObject(m_pNativeImpl->m_pObj.QueryInterface(sal::systools::COM_QUERY)); if (!pOleObject) -throw uno::RuntimeException(); // Static objects are not supported, they should be inserted as graphics +throw uno::RuntimeException( + u"Failed to query IOleObject interface from native implementation object."_ustr +); // Static objects are not supported, they should be inserted as graphics DWORD nOLEMiscFlags(0); pOleObject->GetMiscStatus(DVASPECT_CONTENT, reinterpret_cast(&nOLEMiscFlags)); @@ -699,7 +706,7 @@ void OleComponent::LoadEmbeddedObject( const OUString& aTempURL ) // open an IStorage based on the temporary file OUString aFilePath; if (osl::FileBase::getSystemPathFromFileURL(aTempURL, aFilePath) != ::osl::FileBase::E_None) -throw uno::RuntimeException(); // TODO: something dangerous happened +throw uno::RuntimeException( u"Failed to retrieve system path from file URL: Invalid or unsupported URL."_ustr); // TODO: something dangerous happened sal::systools::COMReference pStorage; HRESULT hr = StgOpenStorage(o3tl::toW(aFilePath.getStr()), nullptr, @@ -712,7 +719,9 @@ void OleComponent::LoadEmbeddedObject( const OUString& aTempURL ) hr = OleLoadSeh(pStorage, &m_pNativeImpl->m_pObj); if (FAILED(hr)) -throw uno::RuntimeException(); +throw uno::RuntimeException( +"Failed to load OLE object from storage: " + comphelper::WindowsErrorStringFromHRESULT(hr) +); InitializeObject_Impl(); } @@ -722,12 +731,16 @@ void OleComponent::CreateObjectFromClipboard() { auto pStorage(m_pNativeImpl->CreateNewStorage(getTempURL())); if (!pStorage) -throw uno::RuntimeException(); // TODO +throw uno::RuntimeException( + u"Failed to create new storage for clipboard object."_ustr +); // TODO IDataObject * pDO = nullptr; HRESULT hr = OleGetClipboard( &pDO ); if (FAILED(hr)) -throw uno::RuntimeException(); +throw uno::RuntimeException( +"Failed to retrieve clipboard data: " + comphelper::WindowsErrorStringFromHRESULT(hr) +); hr = OleQueryCreateFromData(pDO); if (S_OK == hr) @@ -740,7 +753,9 @@ void OleComponent::CreateObjectFromClipboard() pStorage, IID_PPV_ARGS_Helper(&m_pNativeImpl->m_pObj) ); if (FAILED(hr)) -