summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
38 hourstdf#147021 Use std::size() instead of SAL_N_ELEMENTS()Ahmed Khaled
Change-Id: I327c2724b2212551c8f957b5b4c151e317094fa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183050 Reviewed-by: David Gilbert <freedesktop@treblig.org> Tested-by: Jenkins
2 daysRemove obsolete fw declarations from sal/Gabor Kelemen
found with bin/find-unneeded-includes --fwdecl Change-Id: If0ab8906d469f70e3805efd98cf1da8589d55012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183898 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
5 daysDirectly use std::cmp_*, drop o3tl::cmp_*Stephan Bergmann
Change-Id: Ic6e6f1f10cd016550df38118c4e7fdba4d3c4b6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158513 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
2025-04-15Add a test for three-segment ${file:segment:key} bootstrap referencesStephan Bergmann
Change-Id: I6d99cbdc5924b0afefaa1f5f7316824b81ccb474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184179 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-04-10Atomically write line plus newline into $SAL_LOG_FILEStephan Bergmann
At least on Windows, I see log files in the wild that have multiple lines from different threads combined into one. This has apparently been broken by 9f027559557cb132835d8a13cdc0281ad4e757ae "WNT: allow to set log level/path from file" switching to a use of std::endl, for unclear reasons. (But, compared to the version preceding that, keep the s << '\n'; after the ANDROID and sal_use_syslog branches, assuming those don't want a newline added anyway.) Change-Id: Ie68e015e594918d3480d05c741f83948f1c3d69e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183718 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2025-03-30Use _wputenv_s instead of _wputenvMike Kaganski
Avoids unneeded concatenations; also it's documented as "more secure". Change-Id: Idbe0bd330992833bc70231a069ddbd808ea94b62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183502 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-03-30Use GetEnvironmentVariableW a bit more correctlyMike Kaganski
1. Make the buffer size equal to the documented max environment variable length plus one. 2. Check that the function result is not larger than the bufer size, which would indicate "buffer too small" 3. Use the returned length to avoid finding the length again. While at this: drop the obsolete comment about large buffer again. Before commit f78a2bcce88dd5c12052ae3e55c561cdd48b05fe, the comment told about a problem in unicows library (the Win9x implementation of W-functions). The restored comment only told about unspecified problem in GetEnvironmentVariableW. Since we don't support Win9x (and unicows), the comment can be removed. The size of the buffer is not a problem here, so just let it be. Change-Id: If57a37a9c35aca2c08543619aa4aba6faac79045 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183495 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-03-27remove volatile from variable in rtl_math_acoshNoel Grandin
which does nothing useful here. was introduced in commit f70de5267d7d9b7b6946cd72fe26e91bb6ac8431 Author: Kurt Zenker <kz@openoffice.org> Date: Fri Sep 11 18:55:06 2009 +0000 CWS-TOOLING: integrate CWS odff06 Change-Id: I7a626296db7ac7588cc114db6578e05408d59de3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-26Move Windows error helpers to comphelper namespacevarshneydevansh
Previously, WindowsErrorString and WindowsErrorStringFromHRESULT were defined in an anonymous namespace in windowserrorstring.hxx, which: 1. Made them unavailable to other translation units 2. Violate ODR by creating separate copies in each TU 3. Require workarounds to access them Changes: - Move functions to proper comphelper namespace - Keep implementations inline as they're simple utilities - Preserve all existing functionality - Update all call sites to use comphelper:: prefix This change enables proper use of these utilities across LibreOffice while maintaining current behavior and performance characteristics. Introduced in this commit: commit 94cdcaa4d8db8f03ac9a84dac54357efff3eb123 Author: Tor Lillqvist <tml@collabora.com> Date: Thu Aug 13 13:22:28 2015 +0300 Add a globally usable WindowsErrorString function Change-Id: I34df1c2b1f30c6204f107ca4792131d692203880 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183332 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-02-16Simplify oslTranslateFileErrorMike Kaganski
Drop a duplicating entry in errtable (which was there from start); sort it; and use range-based for loop. A follow-up could use e.g. sorted lookup, or frozen::unordered_map. Change-Id: I025f7ec30a6e1f27b769f5d643d7e8f2bf39f2fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181747 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-20remove code duplication - conversion hex char to valueTomaž Vajngerl
We use the same funciton all over the place, so create a common function in o3tl and use that in all instances where we duplicated the code. Change-Id: I74091fbbde8c2ba8c7e4ab30194ab53e2a338e52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180372 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-01-19Use EXTENDED_MAX_PATH for consistencyMike Kaganski
... instead of literal 32767 or duplicating constants. Change-Id: I43d7bba2fa2dc74ae65b23f54fb7765f95084895 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180464 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-10Factor out and simplify COM-safe waitMike Kaganski
Before commit 1e2e51607a163021ef1fb1fb0d217266bd448173 (Try to use CoWaitForMultipleHandles magic to handle COM message loop, 2025-01-10) osl_waitCondition didn't adjust the timeout value in the COM message processing loop. The abovementioned commit started to use a function that pumps the message loop itself, but the code for manual pumping wasn't removed (it has (likely) became dead). This drops the dead code, and deduplicates the rest. Change-Id: I0f7bbf8220792fbe42178c2689a065b5f38645d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180069 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-10Try to use CoWaitForMultipleHandles magic to handle COM message loopMike Kaganski
A customer reports a freeze problem, with the call stacks seemengly indicating a shuck COM re-entry, even though osl_waitCondition should be prepared for COM re-entry. The two relevant threads are: 1. VCL Main win32u.dll!NtUserMsgWaitForMultipleObjectsEx() user32.dll!RealMsgWaitForMultipleObjectsEx() combase.dll!CCliModalLoop::BlockFn(void * * ahEvent, unsigned long cEvents, unsigned long * lpdwSignaled) Line 2156 [Inlineframe] combase.dll!ModalLoop(CSyncClientCall *) Line 164 combase.dll!ClassicSTAThreadWaitForCall(CSyncClientCall * pClientCall, WaitForCallReason reason, unsigned long dwRetryTimeout) Line 172 [Inlineframe] combase.dll!ThreadSendReceive(tagRPCOLEMESSAGE *) Line 7355 [Inlineframe] combase.dll!CSyncClientCall::SwitchAptAndDispatchCall(tagRPCOLEMESSAGE * pMessage) Line 5900 combase.dll!CSyncClientCall::SendReceive2(tagRPCOLEMESSAGE * pMessage, unsigned long * pstatus) Line 5459 [Inlineframe] combase.dll!SyncClientCallRetryContext::SendReceiveWithRetry(tagRPCOLEMESSAGE *) Line 1542 [Inlineframe] combase.dll!CSyncClientCall::SendReceiveInRetryContext(SyncClientCallRetryContext *) Line 565 combase.dll!ClassicSTAThreadSendReceive(CSyncClientCall * pClientCall, tagRPCOLEMESSAGE * pMsg, unsigned long * pulStatus) Line 547 combase.dll!CSyncClientCall::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 783 combase.dll!CClientChannel::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 655 combase.dll!NdrExtpProxySendReceive(void * pThis, _MIDL_STUB_MESSAGE * pStubMsg) Line 2002 rpcrt4.dll!NdrpClientCall3() rpcrt4.dll!NdrClientCall3() [Inlineframe] combase.dll!IDataObject_RemoteGetData_Proxy(IDataObject *) Line 2082 combase.dll!IDataObject_GetData_Proxy(IDataObject * This, tagFORMATETC * pformatetcIn, tagSTGMEDIUM * pMedium) Line 1267 ole32.dll!CDefObject::GetData(tagFORMATETC * pformatetcIn, tagSTGMEDIUM * pmedium) Line 1316 [Inlineframe] emboleobj.dll!rtl::OUString::indexOf(const char[13] &) Line 2030 [Inlineframe] emboleobj.dll!GetAspectFromFlavor(const com::sun::star::datatransfer::DataFlavor &) Line 215 emboleobj.dll!OleComponent::getTransferData(const com::sun::star::datatransfer::DataFlavor & aFlavor) Line 1556 [Inlineframe] emboleobj.dll!com::sun::star::uno::Type::{ctor}() Line 46 [Inlineframe] emboleobj.dll!com::sun::star::datatransfer::DataFlavor::{ctor}() Line 20 [Inlineframe] emboleobj.dll!com::sun::star::embed::VisualRepresentation::{ctor}() Line 19 emboleobj.dll!OleEmbeddedObject::getPreferredVisualRepresentation(__int64 nAspect) Line 372 comphelper.dll!comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream(__int64 nViewAspect, const com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> & xObj, rtl::OUString * pMediaType) Line 1430 [Inlineframe] svtlo.dll!svt::EmbeddedObjectRef::GetGraphicReplacementStream(__int64) Line 916 svtlo.dll!svt::EmbeddedObjectRef::GetGraphicStream(bool bUpdate) Line 690 svtlo.dll!svt::EmbeddedObjectRef::GetReplacement(bool bUpdate) Line 486 svtlo.dll!svt::EmbeddedObjectRef::GetGraphic() Line 524 swlo.dll!OutHTML_FrameFormatOLENodeGrf(SwHTMLWriter & rWrt, const SwFrameFormat & rFrameFormat, bool bInCntnr, bool bWriteReplacementGraphic) Line 1652 swlo.dll!SwHTMLWriter::OutFrameFormat(AllHtmlFlags nMode, const SwFrameFormat & rFrameFormat, const SdrObject * pSdrObject) Line 464 swlo.dll!OutHTML_SwFlyCnt(SwHTMLWriter & rWrt, const SfxPoolItem & rHt) Line 2974 swlo.dll!Out(SwHTMLWriter &(*)(SwHTMLWriter &, const SfxPoolItem &) * pTab, const SfxPoolItem & rHt, SwHTMLWriter & rWrt) Line 40 swlo.dll!OutHTML_SwTextNode(SwHTMLWriter & rWrt, const SwContentNode & rNode) Line 2477 swlo.dll!SwHTMLWriter::Out_SwDoc(SwPaM * pPam) Line 960 swlo.dll!SwHTMLWriter::WriteStream() Line 612 swlo.dll!Writer::Write(SwPaM & rPaM, SvStream & rStrm, const rtl::OUString * pFName) Line 236 swlo.dll!Writer::Write(SwPaM & rPam, SfxMedium & rMedium, const rtl::OUString * pFileName) Line 250 swlo.dll!SwWriter::Write(const tools::SvRef<Writer> & rxWriter, const rtl::OUString * pRealFileName) Line 872 swlo.dll!SwDocShell::ConvertTo(SfxMedium & rMedium) Line 778 sfxlo.dll!SfxObjectShell::SaveTo_Impl(SfxMedium & rMedium, const SfxItemSet * pSet) Line 1633 sfxlo.dll!SfxObjectShell::PreDoSaveAs_Impl(const rtl::OUString & rFileName, const rtl::OUString & aFilterName, const SfxItemSet & rItemSet, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs) Line 3120 sfxlo.dll!SfxObjectShell::CommonSaveAs_Impl(const INetURLObject & aURL, const rtl::OUString & aFilterName, SfxItemSet & rItemSet, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs) Line 2910 sfxlo.dll!SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t,std::char_traits<char16_t>> aFileName, SfxItemSet & rItemSet, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs) Line 320 sfxlo.dll!SfxBaseModel::impl_store(const rtl::OUString & sURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & seqArguments, bool bSaveTo) Line 3203 [Inlineframe] sfxlo.dll!SfxBaseModel::storeToURL::__l7::<lambda_1>::operator()() Line 1813 sfxlo.dll!vcl::solarthread::detail::GenericSolarThreadExecutor<`SfxBaseModel::storeToURL'::`7'::<lambda_1>,void>::doIt() Line 114 [Inlineframe] vcllo.dll!vcl::SolarThreadExecutor::worker(void *) Line 37 vcllo.dll!vcl::SolarThreadExecutor::LinkStubworker(void * instance, void * data) Line 32 [Inlineframe] vcllo.dll!Link<void *,void>::Call(void *) Line 111 [Inlineframe] vcllo.dll!ImplHandleUserEvent(ImplSVEvent *) Line 2287 vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2851 vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 310 [Inlineframe] vclplug_winlo.dll!ImplHandleAppCommand(HWND__ *) Line 5496 vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 6159 vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 6190 user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int) user32.dll!DispatchMessageWorker() vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 476 vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 544 vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 581 vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 393 vcllo.dll!Application::Execute() Line 369 sofficeapp.dll!desktop::Desktop::Main() Line 1605 vcllo.dll!ImplSVMain() Line 229 sofficeapp.dll!soffice_main() Line 94 vText.dll!00007ff7f1bb105b() vText.dll!00007ff7f1bb1304() kernel32.dll!00007fff114b7374() ntdll.dll!00007fff128fcc91() 2. cppu_threadpool::ORequestThread win32u.dll!NtUserMsgWaitForMultipleObjectsEx() user32.dll!RealMsgWaitForMultipleObjectsEx() sal3.dll!osl_waitCondition(void * Condition, const TimeValue * pTimeout) Line 82 [Inlineframe] vcllo.dll!osl::Condition::wait(const TimeValue *) Line 123 vcllo.dll!vcl::SolarThreadExecutor::execute() Line 63 sfxlo.dll!vcl::solarthread::detail::GenericSolarThreadExecutor<`SfxBaseModel::storeToURL'::`7'::<lambda_1>,void>::exec(const SfxBaseModel::storeToURL::__l7::<lambda_1> & func) Line 103 [Inlineframe] sfxlo.dll!vcl::solarthread::syncExecute(const SfxBaseModel::storeToURL::__l7::<lambda_1> &) Line 167 sfxlo.dll!SfxBaseModel::storeToURL(const rtl::OUString & rURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs) Line 1813 mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214 mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430 binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny * returnValue, std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny>> * outArguments) Line 239 binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79 binaryurplo.dll!request(void * pThreadSpecificData) Line 84 cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool bReturnWhenNoJob) Line 101 cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169 cppu3.dll!threadFunc(void * param) Line 190 sal3.dll!oslWorkerWrapperFunction(void * pData) Line 67 ucrtbase.dll!00007fff106f1bb2() kernel32.dll!00007fff114b7374() ntdll.dll!00007fff128fcc91() In fact, this is not even obvious that the problem is really re-entry; it could also turn out to be a call to an external COM server. I can't debug the problem myself, so this is just a guess. A nice summary of the problem is in https://stackoverflow.com/questions/34420920; my suspicion is that our MsgWaitForMultipleObjects call doesn't include some message types needed for proper COM message pumping, sufficiently defined as "a small set of special-cased messages" in COWAIT_FLAGS enumeration docs [1]. Let me try if CoWaitForMultipleHandles in place of MsgWaitForMultipleObjects maybe resolves the issue. [1] https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/ne-combaseapi-cowait_flags Change-Id: I4eaac32cf08c7379a3f8b88bcdd851e70e97d757 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180048 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-08Simplify using designated initializersMike Kaganski
Change-Id: I73d666a0aa4a41e8e73cb701161be1da6fd59d0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179942 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-01-08Close handles properlyMike Kaganski
Change-Id: If8620229d41ae9b6c0a1714967a8bb6d51d3ba0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179939 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-12-20correct caching in osl_getLocalHostname*Noel Grandin
the change commit eac00017e34e77343b9ac3638bed9c75115a23fe Author: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Date: Thu Dec 10 14:24:05 2020 +0100 [API CHANGE] Do not call getaddrinfo if we just want the hostname means that the result returned from osl_getLocalHostname and osl_getLocalHostnameFQDN is always the same, but depends on which one is called first. Rather cache them independently, so they always return the right thing Change-Id: Ifa2f731a6002550cf08f57b53fd6e25e8b79295f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-27tdf#152943: Add configure option to disable NaN payload related testsSakura286
Because some architecture(such as riscv64) does not support NaN payload (NaN propagation), skipping the related tests might be a good choice for builders who has already known the risk of lacking NaN payload support. Currently the tests that could be skipped via --disable-nan-tests are: - rtl_math: test_payloadNaN - sc_ucalc_formula2: testExternalRefFunctions - sc_ucalc_formula2: testFuncGCD - sc_ucalc_formula2: testFuncLCM - sc_ucalc_nanpayload: testNanPayload Change-Id: Ia8834595a8b469d8c542809b3e580a3f6316ef20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174801 Reviewed-by: René Engelhard <rene@debian.org> Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: René Engelhard <rene@debian.org>
2024-11-25tdf#152299 - Remove unused define(s) from C/C++ filesBogdan Buzea
Change-Id: Id7b5e1675963fd4b65974f4da39dbdccd45af549 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-22Fix typosAndrea Gelmini
Change-Id: I49cf90c401243c9606372735ad160f5f2b63b603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177026 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-22tsan: make oslPipe thread-safeNoel Grandin
add a mutex around accesses of the internal data structures of oslPipeImpl, to prevent data-races Change-Id: Ia39961c0a3df0a5a5db31cc515d248d013998255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176931 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-11-14tdf#163486: PVS: Expression is always trueXisco Fauli
V560 A part of conditional expression is always true: pArguments == nullptr. Change-Id: I1fd44091173ed81cdb0c4a4e27e9408cb6a25e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176578 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-12cid#1607638 silence Overflowed return valueCaolán McNamara
Change-Id: Ie6f9db4949924a53edd3b0738bee5c21ca6051a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176463 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-12clang-tidy: performance-unnecessary-copy-initialization in salNoel Grandin
Change-Id: I99d7b71b2e06c5fc016411c369b6e887a274ec4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176436 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-11loplugin:reftotemp in pyuno..saxNoel Grandin
Change-Id: Ia616256e06f64ad3c635ac30abf521e5dab107d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176401 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-04merge creating variable and assigning itCaolán McNamara
Change-Id: I1c8533f5adf5ab1db88dc279fc8e9a21c38c66bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175976 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-11-04new loplugin:staticconstexprNoel Grandin
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-02No need to use SAL_THROW_EXTERN_C macro in CXXMike Kaganski
Change-Id: I6eb9f0431a9402479a2d90d5b6f68b611d52a9f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-31use SAL_WARN_IF here insteadCaolán McNamara
Change-Id: Iaeac042caec04e5bda5c23d22995e509e9fe824a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175862 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-17extract NaN payload test from single unit testSakura286
Change-Id: I51a029c9ac729352fe435b9a70c5e8bd2cf746b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174964 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2024-10-15cid#1557682 alt fix for Initialization or destruction ordering is unspecifiedCaolán McNamara
Change-Id: Ibbcc3808a7a7ec71a046b263757506f61ac48093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174970 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-14version COVERITY conditionalsCaolán McNamara
so there's a recheck on each major if they are still needed Change-Id: I351f731fe4eaec0ebf735147a9a168cccba3bca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174883 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-14cid#1557682 Initialization or destruction ordering is unspecifiedCaolán McNamara
Change-Id: I886733628601d551d544b5abf0eae947b49b8ca6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174882 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-09cid#1607798 Overflowed integer argumentNoel Grandin
Change-Id: I561e86e07a61114523cad545646edf24cf50a260 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-19cid#1606864 Overflowed constantCaolán McNamara
Change-Id: I08beb9bd76065ea846171e07fbf6e427ada37360 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173667 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-09-07lok: add SAL_DISABLE_FSYNC environment to disable fsync.Michael Meeks
For state-less containers there is no benefit in fsync'ing, file data is safe when it is up-loaded back to storage - but profiling shows latency from stray fsyncs. Change-Id: I9f03d5866dec05e5507deb56b0dca93b6876225e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167490 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 90bd45d7a96c8c7084db13e4b6f86753db67655a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172947 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
2024-09-02cid#1607774 silence Overflowed integer argumentCaolán McNamara
Change-Id: Iebe15d0323253ebb06b26fc42e78993be5fa92d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172771 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-31assign immediatelyCaolán McNamara
Change-Id: I2e92313a2428252422b68dd5fd353425add21025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172696 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-30cid#1606819 silence Overflowed array index writeCaolán McNamara
Change-Id: I349ee3b02d25b43571c66ae9dcfcaa1e7dbea8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172638 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-08-16cid#1607030 silence Overflowed integer argumentCaolán McNamara
Change-Id: I90676cf47d7eef441cfabe5a77dfaf81986a1f89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171924 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-01This special case handling is redundantMike Kaganski
The same check and effect is done in the overload called later. Change-Id: I91baa1f3318d55a3f4ae3564064d8ccf66016853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171286 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-07-31Reintroduce OUString::replaceAt taking an OUString to LIBO_INTERNAL_ONLYMike Kaganski
This allows optimizations when 'this' is empty, avoiding allocations, and making it possible to not special-case it in other places, as was done in ContentNode::Insert in commit 8ab44b114c6706ab2e3d8a19884daeb544d3c2e1 (tdf#161846 avoid allocation in ContentNode::Insert, 2024-07-30). A couple of disambiguation templated overloads was introduced. Change-Id: I2b5e94c2175379b2696c34e600393d32731f0ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-07-20Remove now unneeded osl/diagnose.hGabor Kelemen
followup to commit 57c228803e55ed343c6693de7d0857ad7d3cd9e3 Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-07-19Fix "lets" -> "let's"Andrea Gelmini
Change-Id: Ie9b6961a2786a518876db7b26258e67e8afee848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169760 Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net> Tested-by: Jenkins
2024-07-17UI tests: use a dedicated desktop on WindowsMike Kaganski
Similar to commit 1f24d35033c2f02335ce254bbcf6ba89e1b7565e (cppunittester: use a dedicated desktop on Windows, 2023-07-09), this change allows to run UI tests on Windows without them interferring with what you are doing. The code testing LIBO_TEST_DEFAULT_DESKTOP environment variable to avoid the separate desktop, and creating it, is extracted to a new function in systools. Change-Id: I6df3cb4ae581ae289e49b47d3135d01f632fbd95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170615 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-06-28Fix "lets" -> "let's"Andrea Gelmini
Change-Id: Ibe6cbbd618aab5c145913235dc90fec3c98cd504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169723 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-19use gb_StaticLibrary_WORKDIR and gb_Library_DLLDIR more consistentlyChristian Lohmaier
same for gb_Executable_BINDIR[_FOR_BUILD] and fold gb_Library_WORKDIR_FOR_BUILD into gb_Library_DLLDIR_FOR_BUILD (the latter also has a workdir variant) Change-Id: If7e4cf9aab46728182c89344546065bc33b452b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169201 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2024-05-29Properly fix use of uninitialized valueStephan Bergmann
Following up on 66322c5f4a5465c74fa3ceefaa2f76e86a277c16 "Silence warning C4701: potentially uninitialized local variable" (which had apparently wrongly assumed that that MSVC warning was a false positive) and b1a6bd87b803f760f5bf0e2b7bc519b3b2fbfa4e "ofz: Use-of-uninitialized-value in ImplConvertUtf8ToUnicode", which had demonstrated that this was indeed a true positive, as per the comment at <https://gerrit.libreoffice.org/c/core/+/168079/2#message-8b941c986658cb41641c0a317937bd0d3574e0b9> "ofz: Use-of-uninitialized-value in ImplConvertUtf8ToUnicode", and which could also be observed with a local patch of > diff --git a/sal/textenc/tcvtutf8.cxx b/sal/textenc/tcvtutf8.cxx > index 05290cc204fd..319acd41c627 100644 > --- a/sal/textenc/tcvtutf8.cxx > +++ b/sal/textenc/tcvtutf8.cxx > @@ -56,7 +56,7 @@ void ImplResetUtf8ToUnicodeContext(void * pContext) > { > if (pContext != nullptr) > { > - static_cast< ImplUtf8ToUnicodeContext * >(pContext)->nBytes = int(); > + static_cast< ImplUtf8ToUnicodeContext * >(pContext)->nBytes = 1234; > static_cast< ImplUtf8ToUnicodeContext * >(pContext)->nShift = -1; > static_cast< ImplUtf8ToUnicodeContext * >(pContext)->bCheckBom = true; > } > @@ -74,7 +74,7 @@ sal_Size ImplConvertUtf8ToUnicode( > { > bool bJavaUtf8 = pData != nullptr; > sal_uInt32 nUtf32 = 0; > - int nBytes = int(); > + int nBytes = 1234; > int nShift = -1; > bool bCheckBom = true; > sal_uInt32 nInfo = 0; > @@ -208,6 +208,7 @@ sal_Size ImplConvertUtf8ToUnicode( > continue; > > bad_input: > + assert(nBytes != 1234); > switch (sal::detail::textenc::handleBadInputTextToUnicodeConversion( > false, nBytes != 1, 0, nFlags, &pDestBufPtr, pDestBufEnd, > &nInfo)) and seeing CppunitTest_sal_rtl CPPUNIT_TEST_NAME=Test::testInvalidUtf8 fail by hitting that assert. So initialize nBytes to 1 to make that bad_input scenario call handleBadInputTextToUnicodeConversion with a bMultiByte=false argument. Change-Id: Ib8a326d497071f4249169e9d4f5871f06cfccbdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168181 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-05-27ofz: Use-of-uninitialized-value in ImplConvertUtf8ToUnicodeCaolán McNamara
probably since: commit 08e78607ec6bc820c52ab3df1a5d3738e049b90d Date: Wed Sep 13 08:28:32 2017 +0200 Make reading UTF-8 strict Change-Id: I4754e8c1314d37c7a863db4a1d9823d53fb343f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168079 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-05-15Unit test for tdf#160985Eike Rathke
Change-Id: I721d127b145b6524a946c42eb23f8004c700db11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167648 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>