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>
and simplify some of the calculations that needed to be changed.
Which resulted in one unit test needing to change by one pixel,
let's hope not an indication of a real problem.
Change-Id: Ie56434f35f4e58d21ee6f671392e93dc7542fca3
Reviewed-on: https://gerrit.libreoffice.org/42240
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Translates leftovers found using a custom regex.
Additionally translated:
- One randomly found comment in /reportdesign
- Test strings in /stoc/test (let's see if it works)
Change-Id: I5f893c194c4b56b5365700928a3b8b63936d03e2
Reviewed-on: https://gerrit.libreoffice.org/41583
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
This commit add a minimal support for editing chart embedded in a
spreadsheet or a text document or a presentation.
Graphic objects can be moved and resized, text objects can be edited.
Change-Id: I8e637dabf328a94bd6bb0e309a245302cff421d8
Reviewed-on: https://gerrit.libreoffice.org/39342
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
results in inserting the english original so something can be found, now the
standard fallback of using the english original from the source key is used, so
partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
com::sun:⭐:resource::OfficeResourceLoader
com::sun:⭐:resource::XResourceBundleLoader
com::sun:⭐:resource::XResourceBundle
when translating strings via uno apis
com.sun.star.resource.StringResourceWithLocation
can continue to be used
Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
There is a reason this is off by default, make it a bit more easier for
users to not depend this option when they don't actually need it.
Change-Id: I21c5b942c6021fa21840779e1a9f53055fbf279f
Reviewed-on: https://gerrit.libreoffice.org/38081
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Mostly generated using
make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"
Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.
Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
As seen in JunitTest_toolkit_unoapi_1:
Method doAccessibleAction() finished with state OK
LOG> doAccessibleAction(): COMPLETED.OK
debug:27272:12: -SwAccessibleParagraph mutexwait 0x3fd9f50
debug:27272:9: SwAccessibleContext::Dispose 0x3872620 11SwRootFrame
debug:27272:9: SwAccessibleContext::DisposeChildren 0x4047c80 0x386d600 11SwPageFrame
debug:27272:9: SwAccessibleContext::DisposeChildren xAcc 0
debug:27272:9: SwAccessibleContext::DisposeChildren 0x4047c80 0x386cef0 11SwBodyFrame
debug:27272:9: SwAccessibleContext::DisposeChildren xAcc 0
debug:27272:9: SwAccessibleContext::DisposeChildren 0x4047c80 0x3878fe0 11SwTextFrame
debug:27272:9: SwAccessibleContext::DisposeChildren xAcc 0
debug:27272:9: SwAccessibleMap::RemoveContext erase 0x3872620
debug:27272:9: ~SwAccessibleMap: frame entry 0x3878fe0
debug:27272:9: ~SwAccessibleMap: mpFrameMap 0x3eb64a0
debug:27272:9: ~SwAccessibleMap: mpShapeMap 0
soffice.bin: sw/source/core/access/accmap.cxx:1726: virtual SwAccessibleMap::~SwAccessibleMap(): Assertion `(!mpFrameMap || mpFrameMap->empty()) && "Frame map should be empty after disposing the root frame"'
The problem here is that thread 12 is blocked on SolarMutex in
~SwAccessibleParagraph(), while thread 9 is in ~SwAccessibleMap().
This means that in SwAccessibleContext::DisposeChildren(), the
WeakReference to the SwAccessibleParagraph cannot create a
uno::Reference because its reference count is 0, so
SwAccessibleContext::Dispose() is not called on it and it remains
in the SwAccessibleMap::mpFrameMap.
This triggers the assert and later on ~SwAccessibleContext() would
access the deleted SwAccessibleMap and crash.
To fix this, introduce a weak reference from SwAccessibleContext to
SwAccessibleMap; use a std::weak_ptr because that is not derived from
OWeakObject.
The weak_ptr is only used in the dtor ~SwAccessibleContext(); as
long as the ref-count of SwAccessibleContext is > 0 it is guaranteed
that the SwAccessibleContext::m_pMap is either null or valid
as the recursive Dispose() will work fine.
It is possible that additional temporary owning references could delay
the destruction of SwAccessibleMap, and the order of destruction
of Writer documents is very fragile, so rely on the SolarMutex lock
to prevent that; the only shared_ptr that owns SwAccessibleMap while
SolarMutex is not locked is the one in SwViewShellImp.
(An alternative fix would be to represent the 3 lifecycle stages of
SwAccessibleContext by adding a C++-pointer to the
SwAccessibleMap::mpFrameMap, so that DisposeChildren() can, if
the WeakReference is no longer valid due to ref-count 0, use the
pointer and clear SwAccessibleContext::m_pMap - this and the
corresponding call to SwAccessibleMap::RemoveContext() from
~SwAccessibleContext() under a mutex that is shared_ptr-owned by
SwAccessibleMap and all SwAccessibleContext.)
Change-Id: If2b44c79189e3b3d276491a5c57d5404bb2be71a
Might be more of them left, I found these by looking for "is save" or
"it save".
Many more potential misspellings of "Safe" as "Save" in identifiers
are left. Need to check individually which of them actually mean
"Safe", which mean "Saved" perhaps.
Change-Id: I5d3791ea2df2e1d485f65400404972b72af45aec
The commits: 1c1747ac13 and 4a410dd147
make trailing spaces and their highlighting compatible with the Ms Word.
The option is enabled by default for imported MS Word formats: .doc, .docx, .rtf
For the ODF files the option is disabled by default
Also it allows saving and loading the option state to the ODF UserData.
It may be manually set in Tools->Options->LibreOffice Writer->Compatibility
Change-Id: I5a86359c52d18e50bbb54b9f37c79b672591c369
Reviewed-on: https://gerrit.libreoffice.org/33046
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
SwViewShellImp::UpdateAccessible() is called during scrolling and the
like, and if the a11y code doesn't catch the exceptions the document
view won't get repainted.
Change-Id: I4ec591aacf514bef8c5a66a7e674b0cee3b7201a
Since commit a4dee94afe Writer no
longer forces drawing objects to be entirely on one page. However since
there is only one SdrPage for the entire document, a drawing object
dangleing off the bottom of one page will be painted again on the next
page, which is clearly undesirable since Word doesn't do that
(and it also destroys the nice invariant that a fly on page N never
overlaps a fly on page N+1).
So force the SdrPageView code to ignore the drawing object on the next
page, by passing in the area of the page frame so that
ViewObjectContactOfSdrObj::isPrimitiveVisible() can verify that the
anchor position of the SdrObject is actually on the painted page.
This requires passing in another parameter; in the usual case the
DisplayInfo::maRedrawArea already contains the page frame since
commit 8af09bf332, but there are special
cases in SwFrame::Retouch() and SwFlyFrameFormat::MakeGraphic() where
some sub-area is passed in, which cannot be used to check the anchor.
Change-Id: Ia0476216ca41dbdaa3de1063fa18cb94fe2e5ae8
The problem here is that when switching to the print preview, there are
2 view shells, SwEditShell::UpdateTable() is called and the first one
does some layouting in ImplEndAction(); this creates a11y events for the
2nd print preview one (see loops in SwViewShellImp::Invalidate*) and
stores them in the SwAccessibleMap since there is an Action going on;
then SwViewShell::ImplEndAction() for the print preview shell is called
but it returns early without sending out the events, so they remain
until the ~SwAccessibleMap asserts about them.
Change-Id: Ie1c6b82fc5f2cdb2998d514a632295ad07e97517
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"
And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.
Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
And make it a static one. The primary point of that member function is
to prevent invalidations during paint, and since multiple views are
allowed, it wasn't extended to filter out invalidations from all views,
not just from the current one. (Same goes for other callback types.)
Change-Id: I23e6b2c2ff94227f2b72c481148b2d8279ae2905
This was read in the now removed SwViewShell::libreOfficeKitCallback(),
so add a similar flag to SfxViewShell instead, and restore the lost
condition.
This fixes paint/invalidation loops when inserting the first comment to
a Writer document in gtktiledviewer.
Change-Id: Iad5ef90848f3b309ef8db4553760dd36d9b8a37c
Reviewed-on: https://gerrit.libreoffice.org/28236
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>