The grammar checker always wants to be started in DoIdleJobs(),
even if all paragraphs are already marked as checked.
This is because there is currently no call anywhere of
SwRootFrame::SetNeedGrammarCheck(false) to reset the flag
and prevent DoIdleJobs from trying to start the grammar checker.
This call was already there before but was removed without
any justification in commit 9160fe814a.
This has become an infinite loop in several Junit tests with commit
53da556c60.
Change-Id: Ibe7ad93442070aac0577725d044281912307d9e8
This refactors DocumentTimerManager to export the busy status
independent of the Idle function. This way it can be ignored in
the Scheduler while the document is busy,
Change-Id: Icec2075d3338ad8dd4440678eb0570d7fe887778
Reviewed-on: https://gerrit.libreoffice.org/43197
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
this bug was introduced in
commit a754294ac7
use rtl::Reference in SwDocFac instead of manual acquire/release
fix it by using automatic ref-counting (i.e. rtl::Reference) everywhere.
Note that the logic in SwViewShell::~SwViewShell is somewhat
interesting.
From my reading of it, it was previously potentially calling
getIDocumentLayoutAccess on an SwDoc that had just been deleted.
So if there is a problem with this commit I would look there first.
Change-Id: I95b6b7e7523689c8b56063af642c3a84cbdcd331
Reviewed-on: https://gerrit.libreoffice.org/43131
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This is a follow-up to 45a7f5b62d "Keep WID ranges
sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.
And in many cases the ranges are statically known, so that the checking can
happen at compile time. Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking. The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert). Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.
(At least some of the uses of the existing SfxItemSet overload taking a
const sal_uInt16* pWhichPairTable
can probably also be strengthened, but that is left for another day.)
This commit is the first in a series of two. Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap). That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.
There were three cases of necessary manual intervention:
* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.
* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
A few uses of the variadic form erroneously used nullptr instead of 0 for
termination. But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly,
some uses made the harmless error of using 0L instead of 0.
Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
This fix reverts commit 304d3856c1
Date: Wed Oct 16 07:55:09 2002 +0000
#103124# possible unremoved SwFmt object fixed
and commit fab98924e0
Date: Wed Oct 16 10:18:26 2002 +0000
#103152# possible unremoved SwFmt object fixed
as they are causing crashes:
http://crashreport.libreoffice.org/stats/signature
/SfxItemPool::Put(SfxPoolItem%20const%20&,unsigned%20short)
The comments suggest there was/is a use-after-free when
SwFormatCharFormat is changed with API. This happens in unoobj.cxx
and unostyle.cxx by SwFormatDrop::SetCharFormat().
With following changes:
commit bf2ae97a22
INTEGRATION: CWS os7 (1.64.4.3.34); FILE MERGED
2003/03/25 14:23:43 os 1.64.4.3.34.1: #104245# table mode added
to the SwXTextCursor::SetPropertyValue attribute list; 'Standard'
character format not allowed as drop cap char style
and commit 9625366d0b
INTEGRATION: CWS os8 (1.64.4.3.48); FILE MERGED
2003/04/09 09:11:53 os 1.64.4.3.48.3: #104245# Default not
allowed as DropCapCharStyleName, too
in unoobj.cxx, setting the documents' default SwFormatCharFormat is
rejected by throwing an exception. Likely to fix the same issue as
the first 2 commits.
So we do the same in unostyle.cxx now too.
Add an assert in SwFormatCharFormat::SetCharFormat and
SwFormatDrop::SetCharFormat, to uncover other changes to the default
SwFormatCharFormat or SwFormatDrop.
Such an case could happen in SwXTextDefaults::setPropertyValue
where we bail out now.
Change-Id: Iac59dffbd6285dd28d1000a8eacda8ffd3bdc962
Reviewed-on: https://gerrit.libreoffice.org/37499
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles
Link in the Timer class. Now there are two possible solution:
1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or
2. split the inheritance of Idle from Timer again to maintain
different Link<>s and move all common code into a TimerBase.
While the 1st is more correct, the 2nd has a better indicator for
Idles. This implements the first solution.
And while at it, this also converts all call sites of SetTimeoutHdl
and SetIdleHdl to SetInvokeHandler and gets rid of some local Link
objects, which are just passed to the SetInvokeHandler call.
It also introduces ClearInvokeHandler() and replaces the respective
call sites of SetInvokeHandler( Link<Timer *, void>() ).
Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
Moves all the "task-specific" stuff into a Task class and just
keeps the "real" static Scheduler functions in the original
Scheduler class.
Change-Id: I9eb02d46e2bcf1abb06af5bab1fa0ee734d1984c
We already treat the StartOfContent node special in the CopyRange
function to prevent merging of SwTextNodes.
For trailing sections, we have to expand the code to treat
EndOfContent special too, because the supplied SwPaM range is
handled as [mark, point[, so it previously missed the section end
node, which resulted in "unhiding" the last section, if it was the
last node in the document.
Change-Id: Ie094e2a0182647a49c9ba45d08a7dd2cabe667c6
This is a workaround to create correct SwPageFrm objects for
layouting, so the page break is actually visible when
copying nodes, so we create the correct SwPageFrm.
This is especially problematic for mail merge after the fix in
commit 60d34e1c84, which -
correctly - checks all later SwPageDesc for every fix done by
CheckPageDescs().
Change-Id: Ie6ea2e9a0587199be4dbaf3ed63a94c29b318ce2
This is almost the same situation as SwPageDescs. What makes this
more complicated is the fact, that actually duplicated draw objects
are allowed, in regard to the key values "type" and "name".
And actually for some types, duplicate names are not allowed, e.g.
SwDoc::FindFlyByName( const OUString& rName, sal_Int8 nNdTyp )
expects a single result!
Change-Id: I6e0ea1099c1c1e6cfe90926170e27179722e88b8
Page descriptions are exported via XIndexAccess, so they need a
stable array, currently a vector. On the other hand they are
referred by a unique name, so the lookup in the unsorted array is
O(n), not taking into account the amount of string comparisons.
The multi index container adds an ordered unique index, which
gets the lookup time down to O(log(n)) at the cost of a bit more
management overhead for most operations, which is largely
outweighted by the amount of lookup calls. These anyway have to be
done on insert to guarantee the unique naming.
Change-Id: I3fb892ff524f6a9804d9572c1825074c0810649e
Client code in sw, sd, sc and svx is adapted, the rest is just a
placeholder for now.
With this, e.g. the undo item for Writer's insert comment properly
tracks which window was used for the insertion.
Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab
Reviewed-on: https://gerrit.libreoffice.org/27781
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Based on suggestion from Aron Budea.
And do something similar to most other places keeping vectors
of weak references where the code looks like it will hold more than
a few entries.
Measurements:
the 26 page file file takes
51s without my path
15s with this patch
the 69 page file file takes
5m28 without my path
51s with this patch
the 84 page file file takes
8m28 without my path
58s with this patch
Change-Id: I8da94c525fc73ebd969e0343c6f074be4f0063b1
Reviewed-on: https://gerrit.libreoffice.org/27093
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
check for local variables which follow our member field naming
convention, which is highly confusing
Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
To get a unmodified document, the mail merge via File -> Print
used to write a document and reload it. This is not a problem with
normal documents, but with embedded databases this results in a
second database with the same name, which disposes the first
registered database and the xResultSet from the mail merge dialog.
As a workaround this just creates an internal copy, sets the
correct database settings and resets the modified status.
We still need a more general solution to handle documents with the
same embedded DB name in a sane way, probably by making the embedded
database a private object of the documents database manager.
We also need to keep the IsLabelDoc information, otherwise
cloning label documents breaks MM due to undetected, existing
section links. This is currently handled MM internal when creating
a document clone, but probably a reset function for the rest of the
document settings should be created and used.
Change-Id: I20ddea30196d65cb89f69977867f012816ec6001
If you append a doc, you want to handle styles correctly. So it's
actually the correct way to handle the styles in AppendDoc.
The nDocNo is used instead of a boolean to speed up finding better
unique names in the mail merge case.
Change-Id: I4b16e89588164b9e0763759c7d719dfc204b63a1
This commit renames the most annoying abbreviations in Writer (and
partially in the shared code too).
Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8