Age | Commit message (Collapse) | Author |
|
which results in lots of nice string_view improvements picked up by the
plugins
Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...like it is also already done in LineParser::readDouble in
sdext/source/pdfimport/wrapper/wrapper.cxx (esp. since the code should be
changed to use C++17 std::from_chars once that is available in all our
baselines), reverting again the introduction of rtl_str_toDouble_WithLength in
b1df9c67349cf4cc5be4128d797aefb87f50e38f "[API CHANGE] reduce cost of numeric
conversion"
Change-Id: If7e3a15649f80093d3407157412fd3deb3a38b12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119318
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
|
|
...like it is also already done in LineParser::readInt32 in
sdext/source/pdfimport/wrapper/wrapper.cxx (esp. since the code should be
changed to use C++17 std::from_chars once that is available in all our
baselines), reverting again the introduction of rtl_str_toInt32_WithLength in
b1df9c67349cf4cc5be4128d797aefb87f50e38f "[API CHANGE] reduce cost of numeric
conversion"
Change-Id: I2789f8ec55c8d89150d1c68e6b353a1d2e1d1703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119301
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
|
|
on a hot path, since we already know the length of these strings.
Which requires adding some new variants of our string conversion
functions
Change-Id: I1877f8f3c72934c07f14eec7e73bbe8d7b0f1808
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119065
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...to not needlessly extend the sal ABI.
At least for now, o3tl::getToken has a simpler interface than its
OString::getToken counterpart (driven mainly by how it is used for now): it does
not support a `token` argument, and its `position` argument must not be npos.
To meet the latter requirement, the check for "subpath" in LineParser::readPath
has been reworked slightly.
Change-Id: I4428fe2d9aa03ca83a436fc6493fbc34665a8033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115742
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
update
commit 3669d4ec43a6aa2d410d8351d631548db45a5302
Date: Fri May 14 15:51:38 2021 +0200
add OString::getTokenView (tdf#42374 related)
with suggested changes from gerrit review
Change-Id: I861d960deaa010740a4aa964e402c4c76a85cbc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115706
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
small improvement to PDF import
no need to construct temporary string objects when we are just to
going to convert them into int/double.
So use a view and convert the data through the view.
Change-Id: I824fe88bf17142b48fe6032e10c0f3a111927e96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115616
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Add setOption(const char*, const char*)
At the moment this enables starting and stopping the ProfileZone event
recording and overriding the SAL_LOG environment variable.
Change-Id: Ic3a934bb4246c755a91eee8a8343fafc15815116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114439
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114656
Tested-by: Tor Lillqvist <tml@collabora.com>
|
|
...instead of having individual overloads for OUString, OUStringLiteral, and
literal char16_t const[N]. (The variants taking OUString are still needed for
!LIBO_INTERNAL_ONLY, though. The variants taking ASCII-only literal char
const[N] are also left in place.)
This nicely reduces the number of needed overloads. std::u16string_view allows
to pass as arguments:
* OUString
* OUStringLiteral
* OUStringChar (with the necessary conversion added now)
* OUStringNumber
* u"..." char16_t string literals
* u"..."sv std::u16string_view literals
* std::u16string, plain char16_t*, and more
A notable exceptions is OUStringConcat, which now needs to be wrapped in
OUString(...), see the handful of places that needed to be adapted.
One caveat is the treatment of embedded NUL characters, as
std::u16string_view(u"x\0y")
constructs a view of size 1, while only
u"x\0y"sv
constructs a view of size 3 (which matches the old behavior of overloads for
literal char16_t const[N] via the ConstCharArrayDetector<>::TypeUtf16
machinery). See the new checkEmbeddedNul in
sal/qa/rtl/strings/test_oustring_stringliterals.cxx.
The functions that have been changed are generally those that:
* already take a string of determined length, so that using std::u16string_view,
which is always constructed with a determined length, is no pessimization
(e.g., there are operator == overloads taking plain pointers, which do not
need to determine the string length upfront);
* could not benefit from the fact that the passed-in argument is an OUString
(e.g., the corresponding operator = overload can reuse the passed-in
OUString's rtl_uString pData member);
* do not run into overload resolution ambiguity issues, like the comparison
operators would do.
One inconsistency that showed up is that while the original
replaceAll(OUString const &, OUString const &, sal_Int32 fromIndex = 0)
overload takes an optional third fromIndex argument, the existing replaceAll
overloads taking OUStringLiteral and literal char16_t const[N] arguments did
not. Fixing that required a new (LIBO_INTERNAL_ONLY)
rtl_uString_newReplaceAllFromIndexUtf16LUtf16L (with test code in
sal/qa/rtl/strings/test_strings_replace.cxx).
Another issue was posed by test code in
sal/qa/rtl/strings/test_oustring_stringliterals.cxx that used the
RTL_STRING_UNITTEST-only OUString(Except*CharArrayDetector) ctors to verify that
certain function calls should not compile (and would compile under
RTL_STRING_UNITTEST by taking those Except*CharArrayDetector converted to
OUString as arguments). Those problematic "should fail to compile" tests have
been converted into a new CompilerTest_sal_rtl_oustring.
Change-Id: Id72e8c4cc338258cadad00ddc6ea5b9da2e1f780
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102020
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
by 10%, by avoiding an OUString construction in a hot path
through
XMLTextColumnContext_Impl::XMLTextColumnContext_Impl
-> sax::Convert::convertNumber
Also changed XMLTextAnimationStepPropertyHdl::importXML
to take advantage of the modified convertNumber passing
convention.
Change-Id: I4e5503dbb094c88a09af8b6dc8c22b6c53f9eb75
Reviewed-on: https://gerrit.libreoffice.org/81726
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Regression from 2157a3536f97ff5ae7c82611a801fef7e3708983
sfx2 store: try rename before copying
Rename is cheaper then copying the content over manually, so try that
first.
On Windows, we need to keep the file's dentity, including metadata (e.g.,
creation time, which is kept in FS). WinAPI has ReplaceFileW specifically
for this, and it keeps ACLs of the original file, and otherwise makes the
changed file not a separate entry, but updated old file from system's PoV.
Eventually, we could try to restructure creating backup copies (e.g., for
documents when configured so) to take advantage of this function being able
to do that.
Change-Id: I6001a2a3af5e10bc010f5ef129f4bb6f83ee1581
Reviewed-on: https://gerrit.libreoffice.org/60163
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
|
|
They were introduced with 9399c662f36c385b0c705eb34e636a9aec450282 "initial
import" without any trace of being exported DLLPUBLIC-style, and were probably
included in error in the initial sal/util/sal.map when that was introduced in
92b0714c409bd3cffcefd338371ee000fa1b5805 "new".
That means the functions themselves can be moved from extern "C" to an unnamed
namespace (and the resulting loplugin:salbool warnings be fixed).
Change-Id: Ida99540edce9560e69081f507e41db2af34966fb
Reviewed-on: https://gerrit.libreoffice.org/60469
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
This saves several megabytes of dirtied pages for each LOK
client of Online.
Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa
|
|
Was missing in commit bc9a2ba677ce3fcd46c2bbef6e8faeacb14292c1.
Change-Id: I9b270d2363aee847afccb1a5d8f4c3d0af16fc27
|
|
Change-Id: Id78e9c0ca29ff2e52591f3d446431ac23c20ab7a
Reviewed-on: https://gerrit.libreoffice.org/41926
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
To enable finding the source of the duplicate calls, I add new SAL
API (only for internal use) to retrieve and symbolise stack
backtraces.
The theory is that it relatively cheap to just store a backtrace,
but quite expense to symbolise it to strings. Note that the
backtrace() library we use on Linux does not do a particularly
good job, but it gives enough information that developers can use
the addr2line tool to get more precise info.
Explanation of fixes in the code that triggered the assert:
In SwFrameHolder, we need to only call StartListening() if the
pFrame member is actually changing. We also need to call
EndListening() on the old values when pFrame changes.
In SwNavigationPI, there is already a StartListening() call in
the only place we assign to m_pCreateView.
In ImpEditEngine, we need to ignore duplicates, because it is
doing a ref-counting thing. By storing duplicates on the listener
list, it doesn't need to keep track of which stylesheets its
child nodes are using. Given that it therefore will see
duplicate events, there is probably some performance optimisation
opportunities here.
In MasterPageObserver::Implementation::RegisterDocument, we
seem to be getting called multiple times with the same
SdDrawDocument, so just check if we've been registered already
before calling StartListening()
In SvxShape::impl_initFromSdrObject, do the same thing we do
elsewhere in this class, i.e. only call StartListening()
if the model has changed.
Change-Id: I7eae5c774e1e8d56f0ad7bec80e4df0017b287ac
Reviewed-on: https://gerrit.libreoffice.org/41045
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...the latter is LO-privately exported from sal, so it should be OK to add one
more parameter to it.
Change-Id: If6bf3458433aac2cc8b4e0cbd1602306051a777b
Reviewed-on: https://gerrit.libreoffice.org/34080
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I8a5b1665660b0679439f07d3924bb90cb4c4075c
Reviewed-on: https://gerrit.libreoffice.org/33848
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
since "trace" is such a generic term, this makes it easier to actually find the feature when you need it.
And add feature to limit stack depth of the reported backtrace.
Change-Id: Iab3e4ceb2e8480e7b5e2b920eb6c5d7631e21c43
Reviewed-on: https://gerrit.libreoffice.org/31752
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
follow-up to 2135eae2a97c17d89cb47a2074830fd2d7b2226f "let approxEqual() not
scale too early for large representable integer values"
Change-Id: I628e01297fea08915d0ca1c95f3ba13f7ce15db8
|
|
And since this is now too much code for inline move implementation to math.cxx
Which again made it necessary to give libreofficekit lokdocview.cxx its own
implementation that doesn't even claim to build against sal ...
Change-Id: I0f80be9d9172ee20693b9babde715206f2c3d8c1
Reviewed-on: https://gerrit.libreoffice.org/29428
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
|
|
The long-term benefit will be support of C++11 char16_t string literals (for
cases of string literals with non-ASCII content) once we drop any compilers that
don't support those yet. The short-term benefit is support for an improved
OUStringLiteral1 that accepts any sal_Unicode value, not just ASCII ones (see
next commit).
Change-Id: I3f8f6697d7eb62b5176b7e812b5a5113c53b83a4
Reviewed-on: https://gerrit.libreoffice.org/28445
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
This allows to use the username as a placeholder in the config paths (Autotext, Gallery, etc)
Change-Id: I76434e980cd8ec8785a5587d0bc5fdd67dc42de2
Reviewed-on: https://gerrit.libreoffice.org/22901
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ib34196185f90204a71598f2c659c3fddce7a0e4d
|
|
Change-Id: I5f525d91ce24d1d2653a6855f1c4fffc039ae398
|
|
Change-Id: Idb2e46fcaa080d6763d2e3ed963f7673a2353eb2
|
|
Let's see where it actually will be needed. Sal is a "picky" place for
new API, even inside LIBO_INTERNAL_ONLY.
Change-Id: Ia0c5ee8cfc6ee526c5ad34d2f8aab0b14b5f805b
|
|
LibreOffice code, when used in a program through LibreOfficeKit, needs to be
aware of that in certain crucial spots, to avoid behaviour and functionality
that makes no sense in a LibreOfficeKit scenario. As LibreOfficeKit uses a
normal LibreOffice installation to perform its job, this can't be a
compile-time choice. Also, none of the existing run-time "headlessness" modes
fully match what is needed.
Change-Id: Iaccf7f958c549f019b508854800519f54dcadb11
|
|
Change-Id: Id28046eb318cd3b2ed0b813fd266617547cf6ee2
|
|
This fixes up 3d403f2af2e5b7d26254d45590764f279450fab6, by not
removing public API.
Change-Id: I60a4b7284661238bdf32a1600f27a7e507c5374a
|
|
This was unused since the earlier cleanup.
Change-Id: Ia56641c4242037a0ce501e43939b8dc862499f0e
|
|
We cannot call osl_setCommandArgs twice, however there is currently
no way to determine whether or not this has already been done. This is
necessary e.g. for LibreOfficeKit where we may also be using UNO
separately (and also for unit tests where LO is already set-up prior
to the unit test running, and therefore we can't set up osl again
from within LOK).
Change-Id: Id1f357ef604eb2b6b7814c9a04ac6933a39fd3eb
|
|
...so that utl::TempFile can pass osl_File_OpenFlag_Private and doesn't have to
resort to umask (the calls to umask around Directory::create had somewhat
erroneously been removed recently with 1d72a0262c4570631d0aa8f98e34e21fb9d6ae42
"Related fdo#60338: Create missing temp file dir with user's original umask,"
mistaking this for creation of intermediate directories in the hierarchy).
On Windows, the flags argument to osl_createDirectoryWithFlags is ignored
completely for now.
Change-Id: Iac56a5049d579be729a3f338aa62105123edb6cb
|
|
...introduced with a64db11b6ca1c0c99937cd99129758dbbe575ac2 "Add some non-public
API to be used by SvFileStream" and e541105b45d5da8df296883111194e3a0297a2e7
"Use osl API to access files in the SvFileStream code" but subsequently
identified as dead code with ab02fa6552fb098990e74f2787cf02b01c0e532b
"callcatcher: update list," 05a8216d03b5db559e01dd1808f2805df31c970a
"STAR_ENABLE_FILE_LOCKING was a secret," and
1d3483ed279982278b2f9fb1bab63485523e48c5 "Remove some unused code from
unusedcode.easy."
Change-Id: I9c8584890270a87e58b8d8021080ffe54bc97b93
|
|
Change-Id: I36734b0e5e1c0b15ed4f0845450b444b23579ffe
|
|
Change-Id: I248d002d2ed0e61f97a35ea0d329c64832252ad7
|
|
OpenCL devices require this else we would get a performance hit.
Change-Id: I6b1db6320fa84f933b6446022a0fd02ba267bf21
|
|
8f8bc0dcf3bc253ae49159d52db049767f476ced "Move string hash function into String
class" had introduced a new getHash64 that, besides returning sal_uInt64 instead
of just sal_Int32, didn't do sampling of only a handful of characters, but
always computed the hash over all characters (as the usage in SfxItemSet and
SdPage appears to require for either performance or approximated correctness).
However, it would be advantageous to keep the stable URE interface as small as
possible. Now, O(1) sampling was apparently considered state of the art when
the rtl string classes were first created, closely copying java.lang.String,
which at that time demanded sampling for hashCode(), too---but never sampling
more than 15 characters, with the obvious (in hindsight, at least) performance
catastrophes, so they changed it to O(n) somewhere along the way.
Based on that, this commit changes the existing hash functions to not do
sampling any more, and removes the newly introduced -64 variants again. (Where
the extended value range of sal_uInt64 compared to sal_Int32 was hopefully not
vital to the existing uses.)
The old implementation used sampling only for strings of length >= 256, so I did
a "make check" build with an instrumented hash function that flagged all uses
with inputs of length >= 256, and grepped workdir/{Cppunit,Junit,Python}Test for
hits. Of the 2849 hits encountered, 2845 where in the range from 256 to 295
characters, and only the remaining four where of 2472 characters. Those four
were from CppunitTest_sc_subsequent_filters_test, importing long text into a
cell, causing ScDocumentImport::setStringCell to call
svl::SharedStringPool::intern, which internally uses an unordered_set. These
results appear to justify the change.
Change-Id: I78fcc3b0f07389bdf36a21701b95a1ff0a0d970f
|
|
Change-Id: Ibebf394d69ed4845d91176727f291187ba35ed34
|
|
hashCode() seems to do sampling while creating the hash.
hashCode64() will not.
Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be
|
|
...which has become necessary since bd60d41176da540b01d7583cfe00637431967f39
"Handle oveflow in O(U)String::toInt() functions" reduces values in the range
(SAL_MAX_INT32 .. SAL_MAX_UINT32] to zero, but some calls of toInt32(16) relied
on getting a correct (unsigned) value for the whole input range ["0" ..
"FFFFFFFF"] (see libreoffice-4-1 commit 9bf6c83367cedb7be81bf67f30d2147d26c7a8c3
"Revert overflow checks in O[U]String::toInt{32,64} again").
Audited all uses of toInt32/64 with non-decimal radix. (There is still a TODO
comment in oox/source/helper/attributelist.cxx, and
stoc/source/typeconv/convert.cxx will still need some love and test code.)
Change-Id: Iadaca1c0e41dab553687d0ce41c20c10cd657a95
|
|
Change-Id: Ic908cb5cc9169ab1baae2c1c52070adfb9afba39
|
|
Change-Id: I2051e161219d424d2c2b69faf6f939cfe21fa5f7
Reviewed-on: https://gerrit.libreoffice.org/1980
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
|
|
- add sal_uInt64 valueOf helper to handle its full value range
- group deprecated valueOf() together
- forward to the number() taking the largest type instead of repeating
the same code every time
- various doc improvements:
- add missing @since
- do not refer to non-existent number() overloads in docs
- "use number" - "huh, of course I use a number?"
- "code your own" - my own function? why?
- + or += operators are not, strictly speaking, replacements for valueOf()
Change-Id: Ib138a06c4ac4365cfffc534e6ab115d55180a70d
|
|
No point in hidding something useful like this in some helper lib.
Change-Id: I7332d7f6bd428378cd19e7e95ad130771a541140
|
|
Ensure there will be enough extra space in a string, to be used for string
appending. A bit like rtl_(u)String_newConcat(), but without the function
actually appending anything. Unlike the stringbuffer variant this does
not allocate any extra.
Change-Id: Ic6f84bf014a713f9912c81d8f1405c593978822d
|
|
There will be no 3.7.
Change-Id: Ib2808aa259baaa7eac42c7ec7a640105fc8c07a1
|
|
We don't want to change sal SONAME just yet.
Change-Id: I3a9de9a53a4ba845c00a26450e281534ca5d97f6
|
|
osl::semaphore was not portable & thusly long-deprecated. Also
killing further unused clients of that code in salhelper.
Change-Id: Ie1c1924e06e8ce3be33fd1dc2c6933f2de8b5217
|
|
Patch contributed by Herbert Duerr:
#i118662# remove berkeleyDB from module xmlhelp (author=orwitt)
http://svn.apache.org/viewvc?view=revision&revision=1213188
#i119141# remove ISCII converter for now
http://svn.apache.org/viewvc?view=revision&revision=1306246
make exceptions for cppunittester verbose
http://svn.apache.org/viewvc?view=revision&revision=1174831
Patches contributed by Pedro Giffuni:
Avoid some uses of non portable #!/bin/bash in shell scripts.
http://svn.apache.org/viewvc?view=revision&revision=1235297
Patch contributed by Oliver-Rainer Wittmann
88652: applied patch, remove unicows deps
http://svn.apache.org/viewvc?view=revision&revision=1177585
drop OS/2 code, remove in-line assembler ARM atomics,
and obsolete armarch header.
|