summaryrefslogtreecommitdiff
path: root/ucb
AgeCommit message (Collapse)AuthorFilesLines
2019-07-29Fix typosAndrea Gelmini1-1/+1
Change-Id: I94bfbfef24be46583c5c2877e468ed65c2bd5eb0 Reviewed-on: https://gerrit.libreoffice.org/76513 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-23dispose() methods should clear their smart pointersNoel Grandin1-0/+1
especiall the ref-counted ones Change-Id: Ib3bb029043b1b923010ef4a47bfc377e1f569da7 Reviewed-on: https://gerrit.libreoffice.org/76102 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-22cid#705118 Using invalid iteratorCaolán McNamara1-40/+38
Change-Id: If90375ee49e71357482f86e31185c95774aef17c Reviewed-on: https://gerrit.libreoffice.org/76092 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-21cid#1448305 silence Out-of-bounds accessCaolán McNamara1-0/+1
Change-Id: I7a25cc0c30f06ec146bdc205c51d5cad70e713b1 Reviewed-on: https://gerrit.libreoffice.org/76014 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-21loplugin:referencecasting in ucbNoel Grandin7-43/+23
Change-Id: I2f0959c280a832fb80fd0dda263de5f9ae63a698 Reviewed-on: https://gerrit.libreoffice.org/76030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19loplugin:constantparamNoel Grandin3-9/+2
and tweak the plugin to handle a crash seen with clang-9 Change-Id: Ie1ccf80c16a20dbca58e5bd081af13f75cf5ac8f Reviewed-on: https://gerrit.libreoffice.org/75850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19cid#1448426 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: Ia6ad812f76d1f69eb91a7d4f65f221b6598ce05a Reviewed-on: https://gerrit.libreoffice.org/75887 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19cid#1448437 Unchecked return valueCaolán McNamara1-2/+2
Change-Id: I2dec7a66f5609b1e34d9b337f8c562440d3f5132 Reviewed-on: https://gerrit.libreoffice.org/75891 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18cid#1448431 Using invalid iteratorCaolán McNamara1-11/+14
if we are checking itnew against end in the first block, presumably the second block use of itnew needs the same guard Change-Id: Ia8cc45229024e477c00b2356665d5656d36f723b Reviewed-on: https://gerrit.libreoffice.org/75828 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-09Use constexpr ctor to simplify TimeValue initializationMike Kaganski1-5/+2
Change-Id: Ie2588659c3eb34faf8311c25644b59e363cee66b Reviewed-on: https://gerrit.libreoffice.org/75254 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-08tdf#126279 related: remove locks from NeonLockStore after NE_AUTH errorMike Kaganski3-1/+15
Change-Id: Idbbb9bb215e3a56e72a29f798c5a5f84afaf2213 Reviewed-on: https://gerrit.libreoffice.org/75224 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-08tdf#39593 Reduce copy-paste in XRow_impl::get* some moreArkadiy Illarionov1-29/+8
Add value initialization to template Change-Id: I89ff656bfd5df56ead7e976ff3b532ddb662c374 Reviewed-on: https://gerrit.libreoffice.org/75169 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-07-08tdf#126279: reinitialize session after NE_AUTH errors in (UN)LOCKMike Kaganski1-2/+14
This just fixes the crash; but there's still a problem left/TODO, because the lock is kept registered with NeonLockStore; following attempts to lock and unlock fail. The NE_AUTH error is returned from this call stack: neon.dll!clean_session(auth_session * sess) Line 275 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(275) neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * status) Line 1554 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1554) neon.dll!ne_end_request(ne_request_s * req) Line 1399 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399) neon.dll!ne_xml_dispatch_request(ne_request_s * req, ne_xml_parser_s * parser) Line 105 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_xmlreq.c(105) neon.dll!ne_lock_refresh(ne_session_s * sess, ne_lock * lock) Line 849 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_locks.c(849) ucpdav1.dll!webdav_ucp::NeonSession::LOCK(ne_lock * pLock, long & rlastChanceToSendRefreshRequest) Line 1663 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(1663) ucpdav1.dll!webdav_ucp::NeonLockStore::refreshLocks() Line 216 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(216) ucpdav1.dll!webdav_ucp::TickerThread::execute() Line 78 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(78) salhelper3MSC.dll!salhelper::Thread::run() Line 40 at C:\cygwin\home\user\lode\dev\core\salhelper\source\thread.cxx(40) salhelper3MSC.dll!threadFunc(void * param) Line 186 at C:\cygwin\home\user\lode\dev\core\include\osl\thread.hxx(186) sal3.dll!oslWorkerWrapperFunction(void * pData) Line 58 at C:\cygwin\home\user\lode\dev\core\sal\osl\w32\thread.cxx(58) ucrtbased.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) Line 97 at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97) kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() If not reinitialized, then on next access, it SEGFAULTs (hostname is nullptr): neon.dll!ne_addr_resolve(const char * hostname, int flags) Line 926 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_socket.c(926) neon.dll!canonical_hostname(const char * serverName) Line 382 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(382) neon.dll!ne_sspi_create_context(void * * context, char * serverName, int ntlm) Line 423 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(423) neon.dll!continue_sspi(auth_session * sess, int ntlm, const char * hdr, int attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 639 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(639) neon.dll!sspi_challenge(auth_session * sess, int attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 675 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(675) neon.dll!auth_challenge(auth_session * sess, int attempt, const char * value) Line 1419 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1419) neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * status) Line 1550 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1550) neon.dll!ne_end_request(ne_request_s * req) Line 1399 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399) neon.dll!ne_request_dispatch(ne_request_s * req) Line 1458 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1458) ucpdav1.dll!webdav_ucp::NeonSession::OPTIONS(const rtl::OUString & inPath, webdav_ucp::DAVOptions & rOptions, const webdav_ucp::DAVRequestEnvironment & rEnv) Line 913 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(913) ucpdav1.dll!webdav_ucp::DAVResourceAccess::OPTIONS(webdav_ucp::DAVOptions & rOptions, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv) Line 187 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\DAVResourceAccess.cxx(187) ucpdav1.dll!webdav_ucp::Content::getResourceOptions(const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv, webdav_ucp::DAVOptions & rDAVOptions, const std::unique_ptr<webdav_ucp::DAVResourceAccess,std::default_delete<webdav_ucp::DAVResourceAccess> > & rResAccess, bool * networkAccessAllowed) Line 3940 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\webdavcontent.cxx(3940) ucpdav1.dll!webdav_ucp::Content::getProperties(const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv) Line 323 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\webdavcontentcaps.cxx(323) ucbhelper.dll!ucbhelper::PropertySetInfo::getProperties() Line 106 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(106) ucbhelper.dll!ucbhelper::PropertySetInfo::queryProperty(const rtl::OUString & rName, com::sun::star::beans::Property & rProp) Line 187 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(187) ucbhelper.dll!ucbhelper::PropertySetInfo::hasPropertyByName(const rtl::OUString & Name) Line 168 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(168) sfxlo.dll!SfxBaseModel::getBoolPropertyValue(const rtl::OUString & rName) Line 2582 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\sfxbasemodel.cxx(2582) sfxlo.dll!SfxBaseModel::isVersionable() Line 2599 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\sfxbasemodel.cxx(2599) sfxlo.dll!SfxObjectShell::GetState_Impl(SfxItemSet & rSet) Line 1133 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\objserv.cxx(1133) sfxlo.dll!SfxStubSfxObjectShellGetState_Impl(SfxShell * pShell, SfxItemSet & rSet) Line 220 at C:\cygwin\home\user\lode\dev\core\workdir\SdiTarget\sfx2\sdi\sfxslots.hxx(220) sfxlo.dll!SfxShell::CallState(void(*)(SfxShell *, SfxItemSet &) pFunc, SfxItemSet & rSet) Line 199 at C:\cygwin\home\user\lode\dev\core\include\sfx2\shell.hxx(199) sfxlo.dll!SfxShell::GetSlotState(unsigned short nSlotId, const SfxInterface * pIF, SfxItemSet * pStateSet) Line 480 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\shell.cxx(480) sfxlo.dll!SfxDispatcher::QueryState(unsigned short nSID, com::sun::star::uno::Any & rAny) Line 1967 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(1967) sfxlo.dll!SfxDispatchController_Impl::addStatusListener(const com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> & aListener, const com::sun::star::util::URL & aURL) Line 832 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(832) sfxlo.dll!SfxOfficeDispatch::addStatusListener(const com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> & aListener, const com::sun::star::util::URL & aURL) Line 252 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(252) fwklo.dll!framework::MenuBarManager::Activate(Menu * pMenu) Line 756 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(756) fwklo.dll!framework::MenuBarManager::LinkStubActivate(void * instance, Menu * data) Line 605 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(605) vcllo.dll!Link<Menu *,bool>::Call(Menu * data) Line 112 at C:\cygwin\home\user\lode\dev\core\include\tools\link.hxx(112) vcllo.dll!Menu::Activate() Line 270 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(270) vcllo.dll!PopupMenu::ImplExecute(const VclPtr<vcl::Window> & pW, const tools::Rectangle & rRect, FloatWinPopupFlags nPopupModeFlags, Menu * pSFrom, bool bPreSelectFirst) Line 2876 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(2876) vcllo.dll!MenuBarWindow::ImplCreatePopup(bool bPreSelectFirst) Line 339 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(339) vcllo.dll!MenuBarWindow::ChangeHighlightItem(unsigned short n, bool bSelectEntry, bool bAllowRestoreFocus, bool bDefaultToDocument) Line 558 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(558) vcllo.dll!MenuBarWindow::MouseButtonDown(const MouseEvent & rMEvt) Line 403 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(403) vcllo.dll!ImplHandleMouseEvent(const VclPtr<vcl::Window> & xWindow, MouseNotifyEvent nSVEvent, bool bMouseLeave, long nX, long nY, unsigned __int64 nMsgTime, unsigned short nCode, MouseEventModifiers nMode) Line 700 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(700) vcllo.dll!ImplHandleSalMouseButtonDown(vcl::Window * pWindow, const SalMouseEvent * pEvent) Line 2017 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(2017) vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2351 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(2351) vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 299 at C:\cygwin\home\user\lode\dev\core\vcl\inc\salframe.hxx(299) vclplug_winlo.dll!ImplHandleMouseMsg(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 3132 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(3132) vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5487 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5487) vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 5840 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5840) user32.dll!UserCallWinProcCheckWow() user32.dll!CallWindowProcW() opengl32.dll!wglWndProc() user32.dll!UserCallWinProcCheckWow() user32.dll!DispatchMessageWorker() vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 411 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(411) vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 484 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(484) vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 513 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(513) vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 447 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(447) vcllo.dll!Application::Yield() Line 512 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(512) vcllo.dll!Application::Execute() Line 428 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(428) sofficeapp.dll!desktop::Desktop::Main() Line 1620 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\app.cxx(1620) vcllo.dll!ImplSVMain() Line 191 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(191) vcllo.dll!SVMain() Line 226 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(226) sofficeapp.dll!soffice_main() Line 170 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\sofficemain.cxx(170) soffice.bin!sal_main() Line 48 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(48) soffice.bin!main(int argc, char * * argv) Line 47 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(47) soffice.bin!invoke_main() Line 79 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79) soffice.bin!__scrt_common_main_seh() Line 288 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288) soffice.bin!__scrt_common_main() Line 331 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331) soffice.bin!mainCRTStartup() Line 17 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17) kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() Change-Id: I632d85b65406e29ad0e3d56d8481c651c64b2ec8 Reviewed-on: https://gerrit.libreoffice.org/75194 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-08Simplify lastChanceToSendRefreshRequest calculationMike Kaganski1-2/+1
Change-Id: I5c716f641e3d45572f4de01b52316377a21655af Reviewed-on: https://gerrit.libreoffice.org/75192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-06no need for XResultSet_impl to extend NotifierNoel Grandin3-35/+6
it never returns any kind of ContentEventNotifier Change-Id: I53d14378c3c70e4797782aa2c35602103c7cf813 Reviewed-on: https://gerrit.libreoffice.org/75139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-30Simplify Sequence iterations in ucbArkadiy Illarionov29-508/+326
Use range-based loops or replace with STL functions Change-Id: I755dec47aeeed879a032eecd50dee585c392ec59 Reviewed-on: https://gerrit.libreoffice.org/74915 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-30tdf#39593 Reduce copy-paste in XRow_impl::get*Arkadiy Illarionov2-74/+48
Add isIndexOutOfBounds and template getValue methods Change-Id: I2eab7a86329b68d659b4780be50826da42c631aa Reviewed-on: https://gerrit.libreoffice.org/74885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-29Flatten TaskManager::erasePersistentSet and TaskManager::copyPersistentSetArkadiy Illarionov2-75/+73
Explicitly do operations without children Change-Id: Ice1d9562f6b40620c53c398bc6cc707e11be8f96 Reviewed-on: https://gerrit.libreoffice.org/74876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-29Use proper index in loop bodyArkadiy Illarionov1-1/+1
Change-Id: I80bc0d8f23ad436c9f1d1b1501bbcba6f3cb29ff Reviewed-on: https://gerrit.libreoffice.org/74890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25improve loplugin:simplifyconstructNoel Grandin1-6/+3
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18loplugin:logexceptionnicely in toolkit..unoxmlNoel Grandin1-2/+3
Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355 Reviewed-on: https://gerrit.libreoffice.org/74244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-03tdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part1Noel Grandin1-4/+4
Skip creating an intermediary buffer in XStream_impl::readBytes, and just read directly into the destination. This is specifically fixing the performance of queryTypeByDescriptor when called from a basic macro on a local test file. This takes my test macro from 17.1s to 16.1s. Change-Id: Iaa7d38c6a90a3b3f01a4b748c4512dd8fda690c7 Reviewed-on: https://gerrit.libreoffice.org/73374 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-21tdf#125424: properly reset temporarily cleared guardMike Kaganski1-1/+2
Since the guard is only cleared optionally, most probably the code after the conditional block is expected to be guarded until the second clear. Change-Id: I913cb4bff42140da605a6f45414bece419f4a4c8 Reviewed-on: https://gerrit.libreoffice.org/72689 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-05-09tdf#124962: Reduce risk of g_main_loop_run from within gio MountOperationStephan Bergmann3-4/+65
Using g_main_loop_run here appears to be inherently necessary for the g_file_mount_enclosing_volume/g_file_mount_enclosing_volume_finish protocol, but has at least two problems: For one, it temporarily drops the SolarMutex (if it was held by the current thread), causing the usual integrity issues caused by an inner stack frame temporarily releasing the SolarMutex that is held by some unsuspecting caller. This is an inherent problem of our broken SolarMutex design, and this change can't do much about it. But for another, at least with GTK-based VCL backends, it also means that the current thread can start to execute VCL events at "unexpected" times from within this g_main_loop_run (e.g., paint events, as in the backtraces linked from tdf#124962). While handling of VCL events is necessary when a callback to ooo_mount_operation_ask_password happens and it actually pops up a dialog prompting the user for credentials, such handling of VCL events is completely unwanted when no such dialog is popped up (e.g., when the given server is unreachable anyway, as is the case in tdf#124962). So, to shrink the problematic window of time in which VCL events may get handled from within the gio MountOperation, use a dedicated GMainContext for the gio GMainLoop (so that it only handles events related to the mount operation), and only temporarily put back in place the original GMainContext during ooo_mount_operation_ask_password (so that VCL events will get handled as necessary when a dialog is actually popped up). Change-Id: Ie410f23778045b1adf98579bb34ce38d0f8f3320 Reviewed-on: https://gerrit.libreoffice.org/72026 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-09Remove unhelpful "using namespace com::sun::star;" from ucb/source/ucp/gio/Stephan Bergmann7-297/+283
...in preparation for another change using a top-level namespace ucb Change-Id: I3a92d64806bc570bdfd4fe06e672cb6ce2049e7e Reviewed-on: https://gerrit.libreoffice.org/71987 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-02Use hasElements to check Sequence emptiness in [t-u]*Arkadiy Illarionov19-25/+25
Similar to clang-tidy readability-container-size-empty Change-Id: Idefe55e37f5c837c889548ffe7c5711400012a4d Reviewed-on: https://gerrit.libreoffice.org/71667 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-29tdf#123472: Propagate getGFileInfo failure less aggressivelyStephan Bergmann2-23/+38
...from Content::getPropertyValues. ca0308797df86ebece19260f3ca438a0cb437208 "tdf#121337: Fail on GIO error in GIO UCP getPropertyValue" had made Content::getPropertyValues fail for every getGFileInfo failure. However, when saving to a not-yet exisiting file, SfxMedium::Transfer_Impl (sfx2/source/doc/docfile.cxx) requests the properties "Title" and "ObjectId" from the Content representing the not-yet existing file, and apparently expects those requests not to fail. So restructure Content::getPropertyValues to only call getGFileInfo when actually needed (that covers not failing for the unknown- anyway "ObjecdtId" property), and handle "Title" specially by not failing for a non-existing file. (The documentation at offapi/com/sun/star/ucb/Content.idl says for the "getPropertyValues" command that: "The execution will not be aborted, if there are properties requested, that are unknown to the content." But that leaves it somewhat unclear whether failure to obtain a known property should be propagated. It apparently should be in the context of tfd#121337 fixed previously, but apparently not for "Title" here.) Change-Id: I12a9a5bd93d661922ea3b7b19a84a7e73e7e4b50 Reviewed-on: https://gerrit.libreoffice.org/71515 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-23tdf#124635 MountOperation::Mount can be called with SolarMutex unlockedStephan Bergmann1-2/+9
Change-Id: I7a36dd235a100b0d283eec86646dc167ac224ba7 Reviewed-on: https://gerrit.libreoffice.org/71133 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-19optimise find/insert patternNoel Grandin3-16/+3
if we're doing a find/insert on a set or a map, it is better to just do a conditional insert/emplace operation than triggering two lookups. Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d Reviewed-on: https://gerrit.libreoffice.org/70937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15ucb: xmlns typoMichael Stahl1-1/+1
Change-Id: I3c26cc881ac6d157464ccdff5d71683fd7b1de4a Reviewed-on: https://gerrit.libreoffice.org/70682 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-15loplugin:sequentialassign in ucb..vbahelperNoel Grandin12-33/+16
Change-Id: I0fff9ee06225d4ff2e9c0611b1b11f1d3b896be2 Reviewed-on: https://gerrit.libreoffice.org/70733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 4Noel Grandin3-40/+30
Individually, these don't make much difference, but they add up to a halving the time to save on my machine. fileaccess::TaskManager was spending lots of time iterating over it's internal data, so flatten the structures here, to avoid cache-unfriendly pointer chasing. Change-Id: Ic1e2e3958d10f3266aad5ddbcbd68ef1c7285dc7 Reviewed-on: https://gerrit.libreoffice.org/70312 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-07Don't use resettable/clearable guard where plain guard is enoughMike Kaganski1-3/+4
Also use scope where possible. This allows to limit guard scope at language level; visualises the scope clearly; and helps avoiding errors like fixed in commit 61e4437c857854b331fa01da6f39b2b3b58a800b. Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41 Reviewed-on: https://gerrit.libreoffice.org/70376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-03Revert "add more append methods to *StringBuffer"Noel Grandin1-2/+2
This reverts commit 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73. comment from sberg: we already have 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 "Replace OUStringBuffer::appendCopy with append(std::u16string_view)" (which can be extended to OStringBuffer if needed) Change-Id: Ifcc550a8cf26ef38ad49fde8b067f53c999c9276 Reviewed-on: https://gerrit.libreoffice.org/70178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03add more append methods to *StringBufferNoel Grandin1-2/+2
which performs the append without needing the creation of a temporary *String Change-Id: If9ad3222275f26659db2e7df8d34f068977c4d17 Reviewed-on: https://gerrit.libreoffice.org/69826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-31tdf#120703 PVS: remove redundant static castsMike Kaganski5-15/+7
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I54976062dc3f62eaaa79f89eff54454f0b24ac2c Reviewed-on: https://gerrit.libreoffice.org/69989 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-17tdf#120703 PVS: remove redundant static castsMike Kaganski1-1/+1
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I6d1523e71b3e06be1cf41abaabb44e49fe11cd8e Reviewed-on: https://gerrit.libreoffice.org/69369 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-07log nice exception messages whereever possibleNoel Grandin3-3/+8
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28remove some unused typedefsNoel Grandin1-2/+0
Change-Id: I7775a7d86e9641cd514e58f03d3727d2ad846120 Reviewed-on: https://gerrit.libreoffice.org/68485 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin1-1/+0
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-22loplugin:unusedfields in ucb,ucbhelperNoel Grandin6-23/+4
Change-Id: Id15c92e54669bd5f26adfe0d0b9dda0e8894ccf3 Reviewed-on: https://gerrit.libreoffice.org/68161 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-20tdf#123293 sfx2: fix metadata loss when loading from streamMichael Stahl2-11/+29
The problem is that when loading from a stream, there is no BaseURL and also no storage for the document. Due to the lack of BaseURL, the sfx2::createBaseURI() throws and loading RDF metadata fails, which also pops up an annoying warning dialog. Try to handle this in a similar way than a newly created document (see GetDMA()), by using the vnd.sun.star.tdoc scheme URL for the document; this however currently requires that the document has a XStorage, which is also not the case here. So add another UNO method to tdoc UCP's tdoc_ucp::ContentProvider, to split out the creation of the tdoc schema URL from the creation of the ucb Content, to get rid of the XStorage requirement. Change-Id: Ica62743f9d21db0b1464b70db1a62ebc61989ef8 Reviewed-on: https://gerrit.libreoffice.org/67882 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-02-12tdf#120703 PVS: remove redundant static castsMike Kaganski2-4/+3
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I5fee1c4bebd1972fbb5e43da37149d4e2ff6ce0d Reviewed-on: https://gerrit.libreoffice.org/67664 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-11new loplugin writeonlyvarsNoel Grandin1-3/+1
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11loplugin:indentation in ucb..ucbhelperNoel Grandin13-64/+59
Change-Id: Ifa4b34065dacf9e144f076631c57f1d01aedaeeb Reviewed-on: https://gerrit.libreoffice.org/67608 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen4-9/+5
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-05Move dubious file: -> smb: conversion from INetURLObject to file UCPStephan Bergmann2-0/+20
The Linux-only conversion of file URLs with a non-empty (other than "localhost") authority to smb URLs had been added in 2010 with 0b9ef81ba5ff08d85f21275222458a5b9b9e484c "tools-urlobj-smb-scheme-patch.diff: migrated" (applying a Go-oo patch?) but giving no rationale beyond "process relative SMB paths (in hyperlinks) correctly". That makes it hard to tell whether that patch is (still) actively useful for anything, or was just a misguided hack from the beginning: * Why make this Linux only? What about other non-Windows OSs? (On Windows, such URLs can be resolved as UNC pathnames.) If the reason for Linux-only was that it is the only OS where LO can handle smb URLs via GIO, why not make it conditional on ENABLE_GIO? * Why map to smb? There are various remote file access protocols. Hardcoding smb looks arbitrary here. Anyway, INetURLObject is arguably at a wrong level for such a patch. To not drop the hack wholesale, reimplement it in the file UCP, forwarding to a potential other UCP that can handle smb URLs any file://<host>/... URLs (rewritten as smb URLs) that the file UCP cannot handle itself. (file://localhost/... URLs will already have been normalized to file:///... by INetURLObject when they reach the file UCP, and even if they were not, the osl/file.hxx functionality underlying fileaccess::TaskManager::getUnqFromUrl knows how to handle them, so they will not take the forward-to-smb code branch.) (The corresponding #ifdef WIN code from 0b9ef81ba5ff08d85f21275222458a5b9b9e484c has already been removed with 82034b04e81b74a048595b0eac0f73581ecbc9e4 "tdf#119326 crash when adding "Windows Share" File resource".) (I came across that 2010 patch while looking into <https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support 'file://' scheme with actual hostname". A next step would be to make the file UCP actually handle any file://<host>/... URLs that denote the local host.) Change-Id: I77242705dc4c6c1e9cb3a4f32253224ac6cb13cb Reviewed-on: https://gerrit.libreoffice.org/67372 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-02tdf#123067: fix assert when exporting templateJulien Nabet1-1/+1
See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=148772 Change-Id: I7bd6a7dcb7cf7677b92abe79abb781105dfb6019 Reviewed-on: https://gerrit.libreoffice.org/67285 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-01-24loplugin:constparams in ucb..xmlhelpNoel Grandin1-1/+1
Change-Id: I3c1e0bfbba1a1849075500882133aac3899de5c8 Reviewed-on: https://gerrit.libreoffice.org/66834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-23rhbz#1667364 Open doc as R/O for which open(...,O_RDWR) returns EOPNOTSUPPStephan Bergmann1-1/+3
Map that EOPNOTSUPP to osl_File_E_NOSYS (and intercept it in StillReadWriteInteraction, as used by MediaDescriptor::impl_openStreamWithURL in unotools/source/misc/mediadescriptor.cxx, which will retry opening it read-only then), instead of to osl_File_E_invalidError (which lead to the "General input/output error" box). Instead of "silently" opening the doc as read-only, this still pops up a box claiming that the doc is locked by somebody else, asking whether to open it read-only or to open a copy. That's probably because of the rDescriptor.erase( utl::MediaDescriptor::PROP_READONLY() ); in TypeDetection::impl_openStream (filter/source/config/cache/typedetection.cxx) where the comment already hints at the confusion among the different read-only and locking concepts. Changing that looks like it would easily cause regressions, so is left for a follow-up commit. (And ultimately LO wouldn't need to treat the doc as read-only at all; it would just need to not attempt to open it O_RDWR upfront, and save it via copy+rename, like other apps appear to commonly do.) Change-Id: I56e18f1864084ba222acaf0e38a604082edaf4c6 Reviewed-on: https://gerrit.libreoffice.org/66805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>