summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2019-05-22New loplugin:dataStephan Bergmann1-1/+1
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-14Switch everyone to stricter GetColorErrorJan-Marek Glogowski2-19/+10
This replaces the variant in Color with the stricter one of BitmapColor. I couldn't find any reasoning for the lazy variant used in Color. Change-Id: I6dab3ab94a7f24ef5e80299d64267e3be8df888c Reviewed-on: https://gerrit.libreoffice.org/72234 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-13Make BitmapColor inherit from / merge into ColorJan-Marek Glogowski1-7/+0
BitmapColor itself is kept to distingish the Color usage as part of a color palette, which continues to store the offset in the blue value. The original special mbIndex handling is long gone since commit 1fefdd6f3b41 ("Alpha channel in BitmapColor - change bIndex to alpha"), so there is no data difference. This also results in the following changes: * now has a basic_ostream<charT, traits>& operator<< (that was my actual starting point... for an other bug fix) * there is a minimal difference for GetLiminance BGR(29,151,76) => BGR(28,151,77) * no more return values for Merge and Invert (previously returning *this) * replaces all GetBlueOrIndex with GetIndex This leaves one "problematic" part: the GetColorError handling. At first glance it should probably be virtual. The Color variant is less strict then the BitmapColor one - for whatever reason. BitmapColor is always used to search for the best match in a Palette. Currently I'm simply leaving both variants. Would be nice to have an explict for functions here. Change-Id: I251ba3024a1d60f2a9d9fde9cd0a60f08e8322a7 Reviewed-on: https://gerrit.libreoffice.org/72181 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-05-12regenerate PCH headersLuboš Luňák1-5/+3
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10Remove temporary config.ini after the testAurimas Fišeras1-0/+2
Change-Id: I7bc0c6554b4d5e870a49740b2b7243d9a9246ca8 Signed-off-by: Aurimas Fišeras <aurimas@members.fsf.org> Reviewed-on: https://gerrit.libreoffice.org/72063 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-10/+14
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-08AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete)Stephan Bergmann1-1/+2
__cxa_demangle uses malloc/free for memory management, see <http://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler> Change-Id: I57f8465d1c70fbef4537068fd3aefc52295e1c63 Reviewed-on: https://gerrit.libreoffice.org/71942 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-07fix leak in exceptionToStringNoel Grandin1-0/+3
need to release the pointer we get back from demangle Change-Id: I74f1065006fe0cd5da79d0ec5caa514d216be9a1 Reviewed-on: https://gerrit.libreoffice.org/71859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30tdf#42949 Fix IWYU warnings in tools/Gabor Kelemen31-89/+37
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I47974f5c24819eb60e6724f42d51bb206dc26d21 Reviewed-on: https://gerrit.libreoffice.org/71557 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-30improve loplugin:stringconstantNoel Grandin2-11/+10
to find more places we can elide the OUString() constructor at call sites Change-Id: Ie09f3c61f2c4b4959c97dc98ebcbaf7c51d5d713 Reviewed-on: https://gerrit.libreoffice.org/71514 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-27Decouple reading/writing of Color into GenericTypeSerializerTomaž Vajngerl4-114/+106
This adds GenericTypeSerializer, which is now responsible of serializing the Color into a stream (other types will follow), but only for the older version of the binary format. The new version we just write the sal_UInt32 mValue directly. This is a start of decoupling the serialization of generic types in tools and vcl module from the actual type, so we can in the future replace those with basegfx variant. Change-Id: I92738e7c178cac5cbca882dcbe45c80cc8269466 Reviewed-on: https://gerrit.libreoffice.org/71404 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-22cleanup and rename COLORDATA_RGB to color::extractRGBTomaž Vajngerl1-4/+4
Change-Id: I8d53c7010b4fea2a74e48f0649e944a498c211c7 Reviewed-on: https://gerrit.libreoffice.org/71003 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-22Replace compile time test with a static_assertTomaž Vajngerl1-20/+0
There is no need to check this in a test when we can do it directly in the header. static_assert will complain when compiling something that uses the header file instead of waiting that it finds a piece of code, where it is actually needed. The purpose of the test was the same (fail early). The main problem was that Color can be created and converted to sal_uInt32 string completely in compile time, so it can be used for "case" in a "switch" statement, which requires that in "case" it uses a constant. Normally this isn't possible unless we resolve and convert a Color to sal_uInt32 in compile time. This use-case is used somewhere in the code, but it takes a lot of (re)compiling to get to that piece of code, where it would eventually fail. Change-Id: I1f1f9b77c19a0e61f78ce703b380d98a569da833 Reviewed-on: https://gerrit.libreoffice.org/71060 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-21rework Color to have R,G,B,A public variablesTomaž Vajngerl3-25/+150
Color is a wrapper around a sal_uInt32 variable. With a union, separate channels R, G, B, A sal_uInt8 variables can be added that occupy the same memory. This makes it much easier to access each color component separately, which is used quite a lot by various algorithms. This also adds the variables to public so everyone can enjoy the benefits. Tests have been extended to make sure this doesn't break the existing algroithms. Change-Id: I2e78e12df68e8c7f0f49420eef5e659b335ee397 Reviewed-on: https://gerrit.libreoffice.org/71002 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-17Fix uses of variables before their lifetimes beginStephan Bergmann1-1/+1
All of those have been broken with recent loplugin:sequentialassign changes (and have been found with a new plugin to be commited). The code in SbUnoClass::Find (basic/source/classes/sbunoobj.cxx) looks suspicious, but has been effectively like that ever since at least c25ec0608a167bcf1d891043f02273761c351701 "initial import", so just marked it with a TODO comment for now. Change-Id: I0d691cb55ef317cf2b16b0490169de7ec97375cf Reviewed-on: https://gerrit.libreoffice.org/70874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin1-1/+1
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15loplugin:sequentialassign in test..toolsNoel Grandin1-4/+2
Change-Id: I3a6c5807c3262dde6756551e9e955c4ceae09b4f Reviewed-on: https://gerrit.libreoffice.org/70732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03Revert "add more append methods to *StringBuffer"Noel Grandin1-6/+6
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-6/+6
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-06loplugin:unnecessaryparen improve member expressionNoel Grandin1-1/+1
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-21loplugin:indentation (macOS)Stephan Bergmann1-2/+2
* Some .m/.mm files that still contained tabs instead of spaces have been cleaned up with Emacs' untabify (and apple_remote/source/HIDRemoteControlDevice.m needed further manual adaptions): apple_remote/source/GlobalKeyboardDevice.m apple_remote/source/HIDRemoteControlDevice.m apple_remote/source/KeyspanFrontRowControl.m apple_remote/source/RemoteControl.m vcl/osx/a11yrolehelper.mm * Some of the changes predate 0626e66d761de18f62e4d00d427903032da9d517 "Avoid loplugin:indentation after preproc conditional inclusion lines" and would likely have no longer been flagged since. Change-Id: Ibf5faffa743c7f79b36109d9879eb79d63c8c40f Reviewed-on: https://gerrit.libreoffice.org/68090 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-19pretty up logging of exceptionsNoel Grandin2-38/+319
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11loplugin:indentation in lingucomponent..toolsNoel Grandin2-3/+3
Change-Id: I96ed4c51ce3fe45c1cb69a7d7ff917f1e152462e Reviewed-on: https://gerrit.libreoffice.org/67607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09move and extend primitive2dxmldump to drawinglayerTomaž Vajngerl1-0/+5
Also needs extending the XmlWriter to output double numbers as the attribute content. Change-Id: Ie749ea990d856c8c90092ed8153c24efda99c444 Reviewed-on: https://gerrit.libreoffice.org/67573 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen3-9/+6
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-40/+5
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-02tools: use std::swap() in Rectangle::Justify()Miklos Vajna1-8/+3
Change-Id: If613c9e54f8b6178937f085c594d16a9b883ac10 Reviewed-on: https://gerrit.libreoffice.org/67263 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-31loplugin:unnecessaryparen (clang-cl)Stephan Bergmann1-1/+1
Change-Id: I0cd14e0ace9c9d2fcd880477b0485295e3010b71 Reviewed-on: https://gerrit.libreoffice.org/67138 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-25Disable test for Linux x86 CXXFLAGS=-O1 corner caseStephan Bergmann1-0/+7
Building the LO Flatpak for --arch=i386 (where CFLAGS and CXXFLAGS are both set to "-march=i686 -mtune=generic -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"). Even if that was due to a glitch of not disabling tests wholesale for that arch (which has meanwhile been addressed with <https://github.com/flathub/org.libreoffice.LibreOffice/pull/67/commits/ deda15380b436ca8fe62e2ebc1feec8bcb6dd43e> "org.freedesktop.Sdk//18.08 `uname -i` always returns 'unknown'"), lets document that failing corner case here. Change-Id: I8f78cced45e015331e23ae9c86bc286179278076 Reviewed-on: https://gerrit.libreoffice.org/66904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-23Test for XmlWalker to check it parses the xml as expectedTomaž Vajngerl3-0/+109
Change-Id: Icf6bc7eee09b469f460080b6937fad93de6dbd39 Reviewed-on: https://gerrit.libreoffice.org/66772 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-01-11Drop o3tl/clamp.hxx, use C++17 std::clamp insteadStephan Bergmann1-10/+10
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: https://gerrit.libreoffice.org/66177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-11o3tl::string_view -> std::string_view (in tools)Stephan Bergmann1-1/+1
Change-Id: Ic3952cf0f05752813f60199b7b2c8c8e8dc27427 Reviewed-on: https://gerrit.libreoffice.org/66118 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08fix buildRene Engelhard1-0/+5
no idea why this wasn't found on my (incremental) build Change-Id: I78079d4c3196584b171d7566245a7f71b9d43649
2018-12-08missing includeStephan Bergmann1-0/+1
Change-Id: Iec673ea13aba85ac8070a639722359f821cc5cdd
2018-12-08don't use deprecated boost/math/common_factor_rt.hppRene Engelhard1-0/+4
In file included from /data/rene/git/LibreOffice/master/tools/source/generic/fract.cxx:33: /usr/include/boost/math/common_factor_rt.hpp:13:63: note: #pragma message: This header is deprecated. Use <boost/integer/common_factor_rt.hpp> instead. BOOST_HEADER_DEPRECATED("<boost/integer/common_factor_rt.hpp>"); the BOOST_HEADER_DEPRECATED(..) was done in boost 1.67 so make it conditional on that one. Change-Id: I10cb0e4c25e1fa1497dea35c0fc3e5e719142123
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann2-4/+4
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05remove unused SvLockBytesStatFlag enumNoel Grandin1-2/+2
Change-Id: I90b82f1bbf4b51fc76cde10ec55448053345018c Reviewed-on: https://gerrit.libreoffice.org/64561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-03tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-3/+0
Change-Id: Id7af9a6eaefc8b49a790eb299620c4fa97067a11 Reviewed-on: https://gerrit.libreoffice.org/64429 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek1-1/+1
Change-Id: I651b7f202fa52ff5f5357a11aa72c43eb7dc7f95 Reviewed-on: https://gerrit.libreoffice.org/64102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin1-18/+18
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27remove unused PolyOptimizeFlags enum valuesNoel Grandin1-14/+2
Change-Id: I3a2145277212b7b45c25bea2e33aae3f6f4a7776 Reviewed-on: https://gerrit.libreoffice.org/64066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-1/+1
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae Reviewed-on: https://gerrit.libreoffice.org/63981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-22convert INetURLObject::PrefixInfo::Kind to scoped enumNoel Grandin1-50/+50
and drop unused ALIAS Change-Id: Ifc0c6aba681bb166c515380ebb1b0f45d232d2d2 Reviewed-on: https://gerrit.libreoffice.org/63741 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin1-2/+2
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-19loplugin:constantparamNoel Grandin1-8/+8
Change-Id: Ifc2a8db82bd8bb508bce7f226e2cb499d1e6f6f8 Reviewed-on: https://gerrit.libreoffice.org/63492 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16loplugin:buriedassign in sd..writerfilterNoel Grandin2-7/+10
Change-Id: I954c12d9e1c493be6ac8c7b15076077b5bff5b74 Reviewed-on: https://gerrit.libreoffice.org/62811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-11Replace uses of SAL_BOUND with o3tl::clampStephan Bergmann1-9/+10
Change-Id: I66a7aad64623d778b4bf2fea591f227fdac2fdc7 Reviewed-on: https://gerrit.libreoffice.org/63264 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-09SvStream::m_isConsistent is always trueNoel Grandin1-20/+8
ever since commit a3b0ee88be3c6bff94ec6fe908f209c1dbb9748d Date: Sun Jul 10 22:17:35 2011 +0100 strip out unused methods found by loplugin:singlevalfields Change-Id: I4feab1195f78549a48f4b1a9017bc5101474228f Reviewed-on: https://gerrit.libreoffice.org/63173 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08loplugin:collapseif in tools..xmloffNoel Grandin1-5/+2
Change-Id: Iea1227a9f13a0a618d9bb6b0bbedaa5ce8d1a4f5 Reviewed-on: https://gerrit.libreoffice.org/62732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-07tdf#120657 Pie chart saved as DOC doesn't preview in MSONoel Grandin1-6/+10
regression from commit 9ec8bf8f22fe74884185492ef2576ce79b41e4f1 add SvStream::TellEnd the problem is that in this stack trace sot/source/sdstor/stgelem.hxx:130 sot/source/sdstor/stgdir.cxx:300 sot/source/sdstor/stg.cxx:245 sot/source/sdstor/storage.cxx:187 tools/source/stream/stream.cxx:1908 sw/source/filter/ww8/ww8scan.cxx:6267 The StgEntry returns a size of 0. If we do something else to the SotStorageStream first, then it materialises a temporary stream, and that stream returns a valid size. Also implement suggestions from mike kaganski: IMO, it would be more robust to implement this new function as virtual (instead of the remainingSize()), and reimplement the latter as non-virtual one using the new one and doing the necessary correction. Change-Id: Id1462d918570a684ec67099c30181436a27d3c6a Reviewed-on: https://gerrit.libreoffice.org/62984 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>