... in the base class BuilderBase, in order to reuse it in
QtBuilder in an upcoming commit.
Change-Id: Ia115804a9d2bf22b47afb94d97109e9495b21cd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175530
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move the `toQString` helper function to
include/vcl/qt/QtUtils.hxx where it can be used from
multiple modules, instead of defining
it twice for both, avmedia (avmedia/source/qt6/QtPlayer.cxx)
and vcl (vcl/inc/qt5/QtTools.hxx).
Change-Id: I7ffe06eaa3aaf3e7c8cc7aa1a4ac41b14db5c20c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175526
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Introduce include/vcl/qt/QtUtils.hxx as a new header
for Qt-specific utility functions that can be used
in multiple modules, e.g. avmedia and the Qt VCL
plugins in vcl.
This is meant to be used only by code that already
links in Qt.
There's already vcl/inc/qt{5,6}/QtTools.hxx for
helpers needed in vcl only.
Initially, add a `loadQPixmapIcon` helper function
that can be used to retrieve a QPixmap for an icon name
and is extracted from QtPlayer::createMediaPlayerWidget
in avmedia.
It will be reused to implement the
QtInstanceButton::set_from_icon_name logic in an upcoming
commit.
Change-Id: I9f25aa5ca8f00da97d06ecdd164a8fae10e492dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175524
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
These changes improve const-correctness and reduce the need for const_cast
usage.
Change-Id: I1275edfbc0ca5d49a5e8339d1ed11148f6decd1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174701
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
avoids a bunch of broadcasting.
a similar mega-master-page scenario as reported in tdf#158773
9.1 - 7.0s
Some re-ordering of SVG output occurs, which means
tweaking some unit tests.
Change-Id: I447a4639a96c12c627a074f7e0f1ede8b3cbaf72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175299
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
1. Make it take string view: helps to avoid extra string allocation
e.g. in desktop::jsonToPropertyValuesVector, and will help more,
when C++26 stringstream ctor taking string view is available.
2. Factor out a function taking boost::property_tree::ptree, making
implementation simpler for [][]com.sun.star.beans.PropertyValue and
[]com.sun.star.beans.PropertyValue, without writing a child node to
a JSON string, and parsing it again.
Change-Id: I16ac2641633ea67a7c9c054c9df09a790500e6fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175361
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
We can searching without needing a std::map by sorting
the style list. Which also allows to do prefix
searching. Which we can use to dramatically reduce
the number of styles we need to loop through in
SdXMLStylesContext::ImpSetGraphicStyles.
a similar mega-master-page scenario as reported in tdf#158773
13.5 - 9.1s
Needed to adjust some unit tests because
the order of iteration through styles is
now different, which affects some file output.
Change-Id: Ia7240fe520b70839d2519eba1fb70819a3c3bf81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175281
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
the only place that references it, effectively ignores it.
I cant find anything that really uses it, as far back in the
git history as
commit 59bb5ba445
Author: Vladimir Glazounov <vg@openoffice.org>
Date: Wed Apr 11 18:36:28 2007 +0000
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
when it was introduced.
Removing this removes a bunch of expensive broadcast operations.
a similar mega-master-page scenario as reported in tdf#158773
20s -> 17s
Change-Id: I84ee269aa0ea96e9f77601b01d4795edd3294044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175175
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This ctor is meant to set the value of nTime directly; and that value
is not nanoseconds, but an encoded value, using SEC_/MIN_/HOUR_MASK.
But in some places, this ctor was misused for setting of nanoseconds,
which would only accidentally work for values less than one second.
All places that initialized tools::Time with 0, now use EMPTY.
This makes the ctor private; and for the very few cases where really
the encoded value of nTime is stored / restored, fromEncodedTime is
introduced.
Change-Id: I1f1994bd9aab1b51a41b1de637619049fe820da4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175283
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Currently, we use HarfBuzz-provided kashida insertion position
information to decide on positions to insert kashida. This data is used
both while ranking kashida insertion positions, and to avoid inserting
kashida in positions that would break shaping on a per-font basis.
Unfortunately, HarfBuzz cannot validate kashida insertion positions for
AAT fonts. As a result, kashida were previously not inserted for text
using AAT fonts.
This change updates kashida justification to skip validation against
HarfBuzz when AAT fonts are used.
Change-Id: If0d31512b1db0f1f8155963f9b1031eb01bacc45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175165
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
V595 The 'GetMenu()' pointer was utilized before it was verified against nullptr. Check lines: 1582, 1612.
Change-Id: I085320d3a5467e4e2c158bf2683b3156cb103e8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175125
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
The result of this patch is that a keyboard shortcut can now
set the font fore-/back-ground color using the
color shown in the toolbar/sidebar.
This is now possible thanks to Maxim's work in 7.6.2
tdf#154270 Sync toolbar button recent colors
and Andreas Heinisch's 24.8 commit 8c822b764b
tdf#72991 - Remember last used color depending in cui
This patch does 3 things:
1. SetRecentColor when the app initializes
2. Uses SID_ATTR_CHAR_COLOR's recentColor for .uno:FontColor
if no pItem was provided (i.e. a keyboard shortcut called it)
3. Uses SID_ATTR_CHAR_BACK_COLOR's recentColor for .uno:CharBackColor
if no pItem was provided
(Note that without a selection,
CharBackColor isn't so useful for a keyboard shortcut,
since it turns the drag-and-drop template on.)
Setting the recent color right away is critical for user acceptance.
Otherwise, it would only function after they first modified the color
in the toolbar/sidebar.
make CppunitTest_sw_uiwriter9 CPPUNIT_TEST_NAME=testTdf34804
Unfortunately, I can't reliably know if this request
came from an awt::KeyEvent or not, because in that case
we could just avoid CharBackColor's template altogether.
[While there is rReq.GetModifiers() as a good hint,
it is not a guarantee (in case assigned to a function key,
or CTRL held while clicking the toolbar, etc.)]
Change-Id: I7377f087dcdf7011205af005cd0d172100bade2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174804
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
When there is a grammar check error that it has no suggestions for, Duden
may return a JSON without suggestions, but still informing about the type
of the error, like
...
{
"offset": 468,
"length": 8,
"errorcode": 21,
"type": "orth",
"proposals": []
},
...
Before the change, we underlined the error, but right-clicking it would
only bring the normal Writer's context menu, as if there were no error.
This was made in commit 7697ef9d8f (Proof
reading suggestions:, 2023-11-28); before that change, the context menu
was shown, but since it had no suggestions, and no explanation text, it
was considered better to just not show the grammar check results. But
no menu for an underlined word is no better; so let's instead show the
explanation, based on the type of the error reported by Duden - that is
stored in SingleProofreadingError::aShortComment. Also set aFullComment,
which is used in the grammar check dialog.
Incidentally, it even improves popups with suggestions, because it now
has the explanation as well, where previously only was an icon without
any text.
It may be further improved in a follow-up, because there is "errorcode"
in the message, which we may use to add more details to the explanation.
tdf#160127 should be fixed with this, too; but if there are cases when
there are neither suggestions, nor explanation available, it will need
further work.
Change-Id: I62cde204e0142d6226c9c9486f1cdb5ffc20dca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175017
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
by using bulk_insert_for_each() more aggressively.
Reduces the open time from several minutes to 18s on my machine.
I had to pass down a flag, because the gtk and the gen weld
backends work differently, and the gen backend absolutely
has to know up front if the inserter function is going to
call set_text, otherwise it asserts in SvTreeListBox::SetEntryText
Change-Id: I84750888c0a80f4041cfe024e6570dd94f6d09db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174757
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Move the special handling for internal children in .ui files
from VclBuilder to the base class and set the "visible" property
to true for them, instead of directly
calling vcl::Window::Show.
This allows to have this special logic that
internal children are visible by default, even
if the "visible" property is not explicitly set
in one place, and thus reuse it for QtBuilder as well.
Change-Id: Ic7a932556e02f47ee6007b5167f82bef152e1ef0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174833
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
... in the base class BuilderBase, in order to reuse it in
QtBuilder in an upcoming commit.
Change-Id: I61e73f98be9e4f0e0fd15f92d6d16c4e6e617c0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174832
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.
Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Instead of iterating over the map of mnemonic widgets
in the VclBuilder ctor, split the logic:
Add a new purely virtual WidgetBuilder::setMnemonicWidget
method to the base class that passes the IDs of a single
pair of label + the corresponding mnemonic widget as params,
and let WidgetBuilder::processUIFile call the method
once for every pair in the map.
Implement that for VclBuilder (by moving the remaining
logic for that previously in the ctor) to the new
override VclBuilder::setMnemonicWidget and add a dummy
implementation for QtBuilder that only triggers a warning for now.
Change-Id: I32c922f91e5e1d06c003e6d26a4342cbb98942e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174509
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move the `m_aMnemonicWidgetMaps` member and related struct
and typedef from VclBuilder's `m_pVclParserState` to the base
class BuilderBase's `m_pParserState` and also move the
VclBuilder::extractMnemonicWidget method to the base class,
so the logic can later be reused by QtBuilder.
Add a new getter BuilderBase::getMnemonicWidgetMaps to
get access and use that in VclBuilder instead.
At least for now, VclBuilder::extractMnemonicWidget
still explicitly needs to be called by VclBuilder
(and other subclasses) when encountering a "GtkLabel"
object for the mnemonic widget relationship to
be added to the map in the base class.
Change-Id: I878eec7be5e82fac3e1b944d7fed7bf6711744ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174508
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The only thing that ImpTextView had were the
class members, and then all access to these was
done from TextView using `mpImpl->`.
Move the class members from ImpTextView directly
into TextView and drop ImpTextView.
Change-Id: I9fd6ebbdc497b87e2440d3d6a810b7c24488430b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174461
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins