and
cid#1635777 Dereference after null check
pass ScDocument& around when we know it can't be null,
drop mpDoc and redundant null checks
Change-Id: Ia7efe71c561ff084fbb2dc3cbabd02852a656099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178046
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Now that we discontinued support of Windows 7, PathCchCanonicalizeEx is
definitely available.
Change-Id: I38b0ff5b6810dfbd6ee6fe84693f71b8392a1808
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178086
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Use fractional lines scrolled to calculate distance to scroll view,
instead of jumping forward or backward a full page every call based on
sign. Also fixes existing bugs: horizontal pane can scroll too far to
right; and snapping pane from vertical to horizontal can break scrolling
if view partially scrolled.
Change-Id: I0ead4710a296aac26f1cf1a0fc48e6ea403271a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177836
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
This gets used in the "Tools" -> "XML Filter Settings" dialog
in Writer when selecting multiple rows in the tree view,
then clicking the "Save as Package" button.
The result with SAL_VCL_QT_USE_WELDED_WIDGETS=1 and the
qt6 VCL plugin in XMLFilterSettingsDialog::onSave looks
as expected with this change in place (variables `aFilters`
and `nFilters` contain the selected filters and total
count of these when observed with a breakpoint after the call to
`m_xFilterListBox->selected_foreach`).
The method still triggers an assert later in a WIP
branch where support for that dialog is declared,
because `QtInstanceWindow::GetXWindow` is called,
but not implemented yet.
Change-Id: Iab47f391106132b5a6ee03fd2ad1902d493c0999
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178070
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Add a new QtInstanceTreeIter struct as the weld::TreeIter
implementaton for QtInstanceTreeView.
It uses the QModelIndex of the item it points to.
Add QtInstanceTreeView::modelIndex helper methods
to convert both, an int row index and a QtInstanceTreeIter
to a QModelIndex.
This can be used to deduplicate code when (re)implementing
the methods that have two variants that either take an
int row index or a TreeIter input param.
For QtInstanceTreeView::get_id, add a new variant that
takes a QModelIndex and move the existing logic from
the implementation for the int param there and reuse
it to implemetnat the variant taking a TreeIter param
as well.
Implement a few more methods taking or returning
a weld::TreeIter.
Change-Id: I0508ad14a43214faccc6a3cba208400031bb231c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178069
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Side note: In Writer's "Tool" > "XML Filter Settings" dialog,
trying to always delete the first entry works 3 times
(when using a fresh profile), but doing it again after then
doesn't remove the entry from the treeview, but the entry is
still gone when closing and reopening the dialog.
That's the same with gtk3 however, weld::TreeView::remove
doesn't get called. So it's not a problem in the weld::TreeView
implementations, but probably in XMLFilterSettingsDialog
or some other underlying logic.
Change-Id: Ic91b3d1d62b66574b9e0710b17b2d9606d27a0fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178068
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Now that support for multiple columns has been implemented
in QtInstanceTreeView, iterating over all selected model
indices and appending their row index to the vector
results in the row being appended once fore each column
of the selected row. (Index seen twice in `aRows` in
XMLFilterSettingsDialog::updateStates while debugging
another issue in the "Tools" > "XML Filter Settings" dialog
with the qt6 VCL plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1).
Use QItemSelectionModel::selectedRows (with the default column
index of 0) instead of QItemSelectionModel::selectedIndexes
to prevent that.
Change-Id: Ic8caa299549d954ed844c39c4b2ba957edf2b404
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178067
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Set orientation to vertical if that's specified
in the .ui file instead of using the default of
horizontal.
This is used by the button box on the right hand side
of the "Tools" -> "XML Filter Settings" dialog.
Change-Id: I64460037649dcd24897c7a5d7148430836702edc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178064
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Make the `extractTitle` helper function used by
VclBuilder a static method in the BuilderBase
base class for reuse by QtBuilder.
In QtBuilder::makeObject, when encountering a "GtkTreeViewColumn"
object, add a new column to the QTreeView and set the
column title in the underlying model using
QStandardItemModel::setHeaderData.
Return the parent (tree view).
(Returning no object would cause WidgetBuilder::handleObject
to call WidgetBuilder::insertObject again, and thus result
in every column being processed twice, i.e. the double
amount of columns would be inserted).
Adjust QtInstanceTreeView::clear to no longer
call QStandardItemModel::clear [1], as that would
not only remove the "actual" items, but also the
header items, i.e. the column titles would get lost
as well. Remove all rows instead.
With this in place, the tree view in Writer's
"Tool" -> "XML Filter Settings" dialog has the
correct data + title set on open in a WIP branch
where support for that dialog is declared in
QtInstanceBuilder. (Other aspects in the dialog
still need to be addressed however.)
[1] https://doc.qt.io/qt-6/qstandarditemmodel.html#clear
Change-Id: I59956c007ed73cddb299ad2374afd88199ddc94d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178063
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
For now, require that the actual column index is passed.
The weld::TreeView::set_text doc mentions
// col index -1 sets the first text column
, but that is not supported yet, so assert a different
index is passed for now.
Revisit when implementing support for a dialog that actually
makes use of this.
Change-Id: I8ba6e965ba22542bf3151548200b92c8c6b085d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178061
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
...that were added in 59891cd398 "look at
'embedded' protocols for protocols that support them"
Change-Id: I42836d6fd27cd99e39ab07e626053f002a2651f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178047
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
There is no simple "Windows is 10 or newer" check in MSI, with the
Microsoft policy of "you don't need to know real Windows version".
See also https://developercommunity.visualstudio.com/t/detect-a-windows-version-from-msi/412198
The values that MSI sees (e.g. on my Win11) are:
Property(C): VersionNT = 603
Property(C): VersionNT64 = 603
Property(C): WindowsBuild = 9600
So those can't be used for the check. I use the WINMAJORVER that is
read from registry (Software\Microsoft\Windows NT\CurrentVersion).
There is no more need to check and install UCRT; it was dropped.
Change-Id: Ic02d6aeb965e9684bafd4357f969980f77000e73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178049
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This is a follow up to commit
55e86edcb3 to fix a crash that occurs
when importing a Basic library.
The change made to functions arguments passed to ImportLib in PS28
requires they be checked for nullptr before use. For further
understanding please see change to moduldl2.cxx at https://
gerrit.libreoffice.org/c/core/+/176254/27..28
Change-Id: I3f7ccc46134ddd2429c499d6e728e30331b51d7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177924
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
dialog contains percent symbols instead Cyrillic
Additionally use the same approach to make the expected symbols
appear in the description text view.
Change-Id: I89adafde4305dbe9a6e56481ed246376bc1d94a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177925
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
there is intended to be no logic change here, just rearrangement
and acknowledgement that SwOutlineNodesInline::Seek_Entry always
sets nEndPosInline to some value.
Change-Id: I10d694e20c8619ae297a61f612590556c9a9effa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178037
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins