Makefile.fetch | 8 Repository.mk | 8 android/source/src/main/play/listings/en-US/graphics/icon/icon.png | 1 configure.ac | 2 cui/source/tabpages/autocdlg.cxx | 4 desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 desktop/source/lib/init.cxx | 62 download.lst | 48 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 editeng/source/misc/svxacorr.cxx | 2 external/libcmis/UnpackedTarball_libcmis.mk | 1 external/libcmis/http-session-cleanup.patch.1 | 82 external/more_fonts/ExternalPackage_agdasima.mk | 17 external/more_fonts/ExternalPackage_bacasime_antique.mk | 16 external/more_fonts/ExternalPackage_belanosima.mk | 18 external/more_fonts/ExternalPackage_caprasimo.mk | 16 external/more_fonts/ExternalPackage_lugrasimo.mk | 16 external/more_fonts/ExternalPackage_lumanosimo.mk | 16 external/more_fonts/ExternalPackage_lunasima.mk | 17 external/more_fonts/ExternalPackage_sourcesans.mk | 27 external/more_fonts/Module_more_fonts.mk | 16 external/more_fonts/UnpackedTarball_agdasima.mk | 14 external/more_fonts/UnpackedTarball_bacasime_antique.mk | 14 external/more_fonts/UnpackedTarball_belanosima.mk | 14 external/more_fonts/UnpackedTarball_caprasimo.mk | 14 external/more_fonts/UnpackedTarball_lugrasimo.mk | 14 external/more_fonts/UnpackedTarball_lumanosimo.mk | 14 external/more_fonts/UnpackedTarball_lunasima.mk | 14 external/more_fonts/UnpackedTarball_sourcesans.mk | 14 external/more_fonts/fc_local.snippet | 49 extras/source/autocorr/lang/el/DocumentList.xml | 2 filter/source/xsltdialog/xmlfilterjar.cxx | 6 formula/inc/core_resource.hrc | 18 formula/source/core/api/FormulaCompiler.cxx | 5 include/LibreOfficeKit/LibreOfficeKit.h | 4 include/LibreOfficeKit/LibreOfficeKit.hxx | 5 include/formula/compiler.hxx | 5 include/formula/opcode.hxx | 6 include/sfx2/docmacromode.hxx | 1 include/sfx2/sidebar/SidebarController.hxx | 12 include/sfx2/sidebar/TabBar.hxx | 27 include/svtools/ruler.hxx | 11 include/svx/UniqueID.hxx | 40 include/svx/annotation/Annotation.hxx | 9 include/svx/svdmodel.hxx | 10 include/svx/svdobj.hxx | 2 include/svx/svdpage.hxx | 5 include/svx/unoshape.hxx | 2 include/vcl/filter/PDFiumLibrary.hxx | 1 officecfg/registry/data/org/openoffice/VCL.xcu | 115 package/inc/ZipFile.hxx | 3 package/source/zipapi/MemoryByteGrabber.hxx | 8 package/source/zipapi/ZipFile.cxx | 63 readlicense_oo/license/license.xml | 66 sc/README.md | 3 sc/inc/conditio.hxx | 56 sc/inc/document.hxx | 24 sc/inc/helpids.h | 3 sc/inc/scabstdlg.hxx | 1 sc/inc/scfuncs.hrc | 50 sc/inc/strings.hrc | 63 sc/qa/extras/scfunctionlistobj.cxx | 2 sc/qa/uitest/conditional_format/tdf100793.py | 4 sc/qa/uitest/conditional_format/tdf105544.py | 4 sc/qa/uitest/conditional_format/tdf96453.py | 5 sc/qa/uitest/pasteSpecial/tdf86253.py | 2 sc/qa/unit/data/functions/spreadsheet/fods/randarray.fods | 4106 ++++++++ sc/qa/unit/data/functions/spreadsheet/fods/sequence.fods | 4231 ++++++++ sc/qa/unit/data/functions/spreadsheet/fods/sort.fods | 537 - sc/qa/unit/data/functions/spreadsheet/fods/unique.fods | 5082 ++++++++++ sc/qa/unit/data/functions/spreadsheet/fods/xlookup.fods | 395 sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods | 1116 +- sc/qa/unit/ucalc.cxx | 3 sc/sdi/cellsh.sdi | 5 sc/source/core/data/conditio.cxx | 16 sc/source/core/data/documen2.cxx | 6 sc/source/core/data/funcdesc.cxx | 3 sc/source/core/inc/interpre.hxx | 4 sc/source/core/tool/interpr1.cxx | 249 sc/source/core/tool/interpr3.cxx | 22 sc/source/core/tool/interpr4.cxx | 12 sc/source/core/tool/interpr5.cxx | 61 sc/source/core/tool/parclass.cxx | 3 sc/source/core/tool/token.cxx | 3 sc/source/filter/excel/xlformula.cxx | 5 sc/source/filter/oox/formulabase.cxx | 5 sc/source/ui/attrdlg/scdlgfact.cxx | 5 sc/source/ui/attrdlg/scdlgfact.hxx | 1 sc/source/ui/condformat/condformatdlgentry.cxx | 200 sc/source/ui/condformat/condformateasydlg.cxx | 157 sc/source/ui/condformat/condformathelper.cxx | 199 sc/source/ui/condformat/condformatmgr.cxx | 162 sc/source/ui/inc/condformatdlgentry.hxx | 2 sc/source/ui/inc/condformateasydlg.hxx | 8 sc/source/ui/inc/condformathelper.hxx | 7 sc/source/ui/inc/condformatmgr.hxx | 10 sc/source/ui/inc/gridwin.hxx | 6 sc/source/ui/view/cellsh.cxx | 1 sc/source/ui/view/cellsh1.cxx | 31 sc/source/ui/view/cellsh3.cxx | 20 sc/source/ui/view/gridwin.cxx | 11 sc/uiconfig/scalc/ui/condformatmanager.ui | 116 sc/uiconfig/scalc/ui/conditionaleasydialog.ui | 32 sd/qa/unit/AnnotationTest.cxx | 32 sd/source/ui/app/sdmod1.cxx | 39 sd/source/ui/dlg/LayerTabBar.cxx | 53 sd/source/ui/dlg/sdtreelb.cxx | 15 sd/source/ui/func/fuinsert.cxx | 6 sd/source/ui/slideshow/slideshow.cxx | 8 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 26 sd/source/ui/table/TableDesignPane.cxx | 14 sd/source/ui/table/tablefunction.cxx | 15 sd/source/ui/unoidl/unomodel.cxx | 4 sd/source/ui/view/ViewShellBase.cxx | 4 sd/source/ui/view/ViewShellImplementation.cxx | 11 sd/source/ui/view/drviews5.cxx | 4 sd/source/ui/view/drviews7.cxx | 6 sd/source/ui/view/drviewsa.cxx | 11 sd/source/ui/view/grviewsh.cxx | 4 sd/source/ui/view/viewoverlaymanager.cxx | 10 sfx2/source/control/unoctitm.cxx | 1 sfx2/source/doc/docmacromode.cxx | 24 sfx2/source/doc/objmisc.cxx | 6 sfx2/source/doc/objserv.cxx | 10 sfx2/source/doc/objstor.cxx | 2 sfx2/source/sidebar/SidebarController.cxx | 71 sfx2/source/sidebar/TabBar.cxx | 109 sfx2/source/sidebar/uiobject.cxx | 2 solenv/flatpak-manifest.in | 7 starmath/source/node.cxx | 4 svgio/qa/cppunit/SvgImportTest.cxx | 8 svgio/qa/cppunit/data/fillContextStroke.svg | 8 svgio/source/svgreader/svgstyleattributes.cxx | 16 svgio/source/svgreader/svgtools.cxx | 1 svtools/source/control/ruler.cxx | 20 svx/sdi/svx.sdi | 1 svx/source/annotation/Annotation.cxx | 6 svx/source/svdraw/svdedtv1.cxx | 9 svx/source/svdraw/svdedxv.cxx | 6 svx/source/svdraw/svdmodel.cxx | 21 svx/source/svdraw/svdmrkv.cxx | 25 svx/source/svdraw/svdobj.cxx | 14 svx/source/svdraw/svdoedge.cxx | 4 svx/source/svdraw/svdpage.cxx | 8 svx/source/unodraw/unoshape.cxx | 31 svx/source/unodraw/unoshtxt.cxx | 12 sw/inc/cmdid.h | 1 sw/inc/strings.hrc | 2 sw/inc/swabstdlg.hxx | 1 sw/qa/core/text/itrform2.cxx | 56 sw/qa/extras/layout/data/tdf161718.docx |binary sw/qa/extras/layout/layout3.cxx | 24 sw/qa/extras/uiwriter/uiwriter6.cxx | 134 sw/qa/filter/ww8/ww8.cxx | 44 sw/sdi/_textsh.sdi | 4 sw/sdi/swriter.sdi | 17 sw/source/core/doc/textboxhelper.cxx | 20 sw/source/core/frmedt/fetab.cxx | 43 sw/source/core/text/inftxt.cxx | 7 sw/source/core/text/itrform2.cxx | 19 sw/source/core/text/portxt.cxx | 69 sw/source/core/text/txtftn.cxx | 7 sw/source/core/text/txttab.cxx | 7 sw/source/filter/ww8/docxattributeoutput.cxx | 13 sw/source/ui/dialog/swdlgfact.cxx | 5 sw/source/ui/dialog/swdlgfact.hxx | 1 sw/source/ui/misc/glossary.cxx | 2 sw/source/ui/misc/pagenumberdlg.cxx | 12 sw/source/uibase/docvw/edtwin3.cxx | 10 sw/source/uibase/inc/pagenumberdlg.hxx | 6 sw/source/uibase/inc/wrtsh.hxx | 2 sw/source/uibase/ribbar/workctrl.cxx | 2 sw/source/uibase/shells/textfld.cxx | 93 sw/source/uibase/shells/textsh1.cxx | 151 sw/source/uibase/uno/loktxdoc.cxx | 77 sw/source/uibase/uno/unotxdoc.cxx | 6 sw/source/uibase/wrtsh/select.cxx | 66 sw/uiconfig/swriter/ui/pagenumberdlg.ui | 26 toolkit/source/awt/vclxtoolkit.cxx | 4 translations | 2 vcl/inc/skia/osx/gdiimpl.hxx | 4 vcl/ios/DataFlavorMapping.cxx | 4 vcl/jsdialog/enabled.cxx | 1 vcl/jsdialog/jsdialogbuilder.cxx | 4 vcl/osx/salgdiutils.cxx | 98 vcl/osx/salmacos.cxx | 7 vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 10 vcl/quartz/CoreTextFontFace.cxx | 53 vcl/skia/gdiimpl.cxx | 9 vcl/skia/osx/gdiimpl.cxx | 142 vcl/source/bitmap/BitmapEx.cxx | 11 vcl/source/pdf/PDFiumLibrary.cxx | 6 vcl/source/window/dockwin.cxx | 15 vcl/source/window/window.cxx | 16 writerfilter/CppunitTest_writerfilter_dmapper.mk | 1 writerfilter/qa/cppunittests/dmapper/NumberingManager.cxx | 75 writerfilter/qa/cppunittests/dmapper/data/clipboard-bullets.rtf | 48 writerfilter/source/dmapper/DomainMapper.cxx | 5 writerfilter/source/dmapper/DomainMapper.hxx | 1 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 18 writerfilter/source/dmapper/NumberingManager.cxx | 33 writerfilter/source/dmapper/NumberingManager.hxx | 2 writerfilter/source/dmapper/PropertyMap.cxx | 18 xmloff/source/text/XMLTextFrameContext.cxx | 27 204 files changed, 18619 insertions(+), 1632 deletions(-)
New commits: commit 0fbf9a9d4ff69e8d2d1c1fd2821698cf8147212a Author: Caolán McNamara <[email protected]> AuthorDate: Tue Jul 9 20:45:21 2024 +0100 Commit: Michael Meeks <[email protected]> CommitDate: Tue Jul 9 22:20:27 2024 +0200 make query set ins mode dialog async Change-Id: I1951abc34cca59aaffb85540d38e2f002ddc3f09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170253 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Meeks <[email protected]> diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 741c28c8a648..d527fda5ca24 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -640,6 +640,8 @@ private: bool bSelect, bool bDontMoveRegion = false); SAL_DLLPRIVATE bool GoEnd(bool KeepArea = false, const bool * = nullptr); + SAL_DLLPRIVATE void ImplSetInsMode(bool bOn); + enum BookMarkMove { BOOKMARK_INDEX, diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index 3ae5842f6187..f5d01d196aae 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -713,27 +713,8 @@ void SwWrtShell::LeaveBlockMode() // Insert mode -void SwWrtShell::SetInsMode( bool bOn ) +void SwWrtShell::ImplSetInsMode(bool bOn) { - const bool bDoAsk = officecfg::Office::Common::Misc::QuerySetInsMode::get(); - if (!bOn && bDoAsk) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetView().GetFrameWeld(), "cui/ui/querysetinsmodedialog.ui")); - std::unique_ptr<weld::Dialog> xQuery(xBuilder->weld_dialog("SetInsModeDialog")); - std::unique_ptr<weld::Image> xImage(xBuilder->weld_image("imSetInsMode")); - std::unique_ptr<weld::CheckButton> xCheckBox(xBuilder->weld_check_button("cbDontShowAgain")); - - xImage->set_from_icon_name(RID_BMP_QUERYINSMODE); - - const int nResult = xQuery->run(); - - std::shared_ptr<comphelper::ConfigurationChanges> xChanges( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::QuerySetInsMode::set(!xCheckBox->get_active(), xChanges); - xChanges->commit(); - - if ( nResult == static_cast<int>(RET_NO) ) - return; - } m_bIns = bOn; SwCursorShell::SetOverwriteCursor( !m_bIns ); const SfxBoolItem aTmp( SID_ATTR_INSERT, m_bIns ); @@ -742,6 +723,51 @@ void SwWrtShell::SetInsMode( bool bOn ) EndAction(); Invalidate(); } + +namespace +{ + class QuerySetInsModeDialog : public weld::GenericDialogController + { + std::unique_ptr<weld::Image> m_xImage; + std::unique_ptr<weld::CheckButton> m_xCheckBox; + public: + QuerySetInsModeDialog(weld::Window* pParent) + : GenericDialogController(pParent, "cui/ui/querysetinsmodedialog.ui", "SetInsModeDialog") + , m_xImage(m_xBuilder->weld_image("imSetInsMode")) + , m_xCheckBox(m_xBuilder->weld_check_button("cbDontShowAgain")) + { + m_xImage->set_from_icon_name(RID_BMP_QUERYINSMODE); + } + bool GetDoNotShowAgain() const + { + return m_xCheckBox->get_active(); + } + }; +} + +void SwWrtShell::SetInsMode( bool bOn ) +{ + const bool bDoAsk = officecfg::Office::Common::Misc::QuerySetInsMode::get(); + if (!bOn && bDoAsk) + { + auto xDialog = std::make_shared<QuerySetInsModeDialog>(GetView().GetFrameWeld()); + weld::DialogController::runAsync(xDialog, [this, bOn, xDialog](sal_Int32 nResult){ + + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::QuerySetInsMode::set(!xDialog->GetDoNotShowAgain(), xChanges); + xChanges->commit(); + + if ( nResult == static_cast<int>(RET_NO) ) + return; + + ImplSetInsMode(bOn); + }); + return; + } + ImplSetInsMode(bOn); +} + //Overwrite mode is incompatible with red-lining void SwWrtShell::SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode ) { commit dcdd1551a333bbd3a7b8cb180047775ce36736d5 Author: Miklos Vajna <[email protected]> AuthorDate: Mon Jul 8 10:46:03 2024 +0200 Commit: Mike Kaganski <[email protected]> CommitDate: Tue Jul 9 16:54:36 2024 +0200 tdf#161771 sw content controls: fix DOCX export of empty dropdown list item Open the bugdoc, save as DOCX, try to open in Word: Word refuses to open, saying that the file is corrupted. Each dropdown item has a value and a display text, it seems it's OK to omit the display text, but the value really should not be empty. Fix the problem by first trying to copy the display text to the value if the value would be empty; and if both are empty, then just omit the dropdown item. Note that the trick used at display text won't work here, omitting the value attribute (instead of writing an empty one) is still invalid DOCX. (cherry picked from commit 62fb52cd43d7c0d41dd4e35a1c128947b6a14918) Change-Id: I4ae86aaf1a11cc8fd7c276634647f5737a9b04e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170222 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index 070565345a2d..d52055e40ae9 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -14,6 +14,8 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/WrapTextMode.hpp> +#include <comphelper/propertyvalue.hxx> + #include <docsh.hxx> #include <formatcontentcontrol.hxx> #include <wrtsh.hxx> @@ -594,6 +596,48 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) // i.e. the default position was used: document end. CPPUNIT_ASSERT_EQUAL(OUString("sectEnd"), aPos); } + +CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownEmptyItem) +{ + // Given a document with a dropdown content control, one item is empty, which can't be saved to + // a valid DOCX: + createSwDoc(); + uno::Reference<lang::XMultiServiceFactory> xMSF(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextDocument->getText(); + uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); + xText->insertString(xCursor, u"test"_ustr, /*bAbsorb=*/false); + xCursor->gotoStart(/*bExpand=*/false); + xCursor->gotoEnd(/*bExpand=*/true); + uno::Reference<text::XTextContent> xContentControl( + xMSF->createInstance(u"com.sun.star.text.ContentControl"_ustr), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY); + { + uno::Sequence<beans::PropertyValues> aListItems = { + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u"red"_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u"R"_ustr)), + }, + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u""_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u""_ustr)), + }, + }; + xContentControlProps->setPropertyValue(u"ListItems"_ustr, uno::Any(aListItems)); + } + xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); + + // When saving to DOCX: + save(u"Office Open XML Text"_ustr); + + // Then make sure we only emit 1 list item: + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 2 + // i.e. we emitted an empty list item, so the result can't be opened in Word. + assertXPath(pXmlDoc, "//w:dropDownList/w:listItem"_ostr, 1); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2f77cf07b06a..63be2289d99e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2719,12 +2719,25 @@ void DocxAttributeOutput::WriteContentControlStart() } for (const auto& rItem : m_pContentControl->GetListItems()) { + if (rItem.m_aDisplayText.isEmpty() && rItem.m_aValue.isEmpty()) + { + // Empty display text & value would be invalid DOCX, skip the item. + continue; + } + rtl::Reference<FastAttributeList> xAttributes = FastSerializerHelper::createAttrList(); if (!rItem.m_aDisplayText.isEmpty()) { // If there is no display text, need to omit the attribute, not write an empty one. xAttributes->add(FSNS(XML_w, XML_displayText), rItem.m_aDisplayText); } + + OUString aValue = rItem.m_aValue; + if (aValue.isEmpty()) + { + // Empty value would be invalid DOCX, default to the display text. + aValue = rItem.m_aDisplayText; + } xAttributes->add(FSNS(XML_w, XML_value), rItem.m_aValue); m_pSerializer->singleElementNS(XML_w, XML_listItem, xAttributes); } commit 5c513ef6178ae3ccb39bc40d7a971eb7808b4df0 Author: Szymon Kłos <[email protected]> AuthorDate: Mon Jul 8 14:58:22 2024 +0200 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Jul 9 09:25:29 2024 +0200 jsdialog: enable interaction handler without LOKNotifier cool#9453 When pasting content with URL to remote content behind basic authentication - we ask for user and password. That dialog didn't have LOKNotifier set. It's new case because we create the dialog controller and we setup the window id = 0, later when we run the dialog we did correct setup of LOKNotifier and id was changed to eg. 7. Then client had out of sync identifier because we already sent the old value. Setup the "default" notifier directly in weld_dialog to avoid that. Signed-off-by: Szymon Kłos <[email protected]> Change-Id: I7b6ceef722f7f9827b1fb41cc0229b0170693d1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170159 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index ab0fbdbd7751..39a06e325d7d 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -258,6 +258,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"svx/ui/themecoloreditdialog.ui" || rUIFile == u"svx/ui/themedialog.ui" // uui + || rUIFile == u"uui/ui/logindialog.ui" || rUIFile == u"uui/ui/macrowarnmedium.ui" // vcl || rUIFile == u"vcl/ui/wizard.ui" diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index c127f6c3b984..7a38aff47873 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -13,6 +13,7 @@ #include <comphelper/lok.hxx> #include <iconview.hxx> #include <utility> +#include <vcl/svapp.hxx> #include <vcl/tabpage.hxx> #include <vcl/toolbox.hxx> #include <vcl/toolkit/button.hxx> @@ -832,6 +833,9 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OUString& id) if (pDialog) { + if (!pDialog->GetLOKNotifier()) + pDialog->SetLOKNotifier(GetpApp()); + m_nWindowId = pDialog->GetLOKWindowId(); pDialog->SetLOKTunnelingState(false); commit e1cfc655e5112b4767da7c53000b859f3844b8e3 Author: Patrick Luby <[email protected]> AuthorDate: Sat Jul 6 08:20:51 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Sat Jul 6 21:19:17 2024 +0200 Move break inside conditional statement to match macOS code Commit 839346d3f20af0c6db1377486cbff3f2ff3e2387 for iOS was miscopied from commit e4cbe169bd1236698a573bf4758d8ae8519a1c08 so correct the copy error to bring the iOS code back in sync with the macOS code. Change-Id: I3bb8cc85465adf978e50fab1a802c3f062b7a728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170067 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Patrick Luby <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx index ded47097015c..f2d039f2d6a9 100644 --- a/vcl/ios/DataFlavorMapping.cxx +++ b/vcl/ios/DataFlavorMapping.cxx @@ -403,11 +403,11 @@ NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor sysFlavor = flavorMap[i].SystemFlavor; else sysFlavor = OUStringToNSString(oOOFlavor.MimeType); - } - // Flavor set, then break - if (sysFlavor != nullptr) - break; + // Flavor set, then break + if (sysFlavor != nullptr) + break; + } } if (!sysFlavor) commit 839346d3f20af0c6db1377486cbff3f2ff3e2387 Author: Peter Hagen <[email protected]> AuthorDate: Fri Jul 5 14:10:11 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Sat Jul 6 13:05:22 2024 +0200 Related tdf#161461: break out of loop once data flavor is set Change-Id: Ia56514e83e09c6747f582117e77de89f69495862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170056 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Patrick Luby <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx index 607f110222bb..ded47097015c 100644 --- a/vcl/ios/DataFlavorMapping.cxx +++ b/vcl/ios/DataFlavorMapping.cxx @@ -404,6 +404,10 @@ NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor else sysFlavor = OUStringToNSString(oOOFlavor.MimeType); } + + // Flavor set, then break + if (sysFlavor != nullptr) + break; } if (!sysFlavor) commit 4ff670389d83620e5151b5b827ebf510270e9107 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jul 5 13:05:25 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Jul 5 14:51:28 2024 +0200 return early if there is no m_pDocShell Change-Id: Id53115f9cb098b9b8ff1a529f5237054cdfd391e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170014 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 3d8164647c06..3ac436056d22 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3206,6 +3206,12 @@ void SwXTextDocument::setClipboard(const uno::Reference<datatransfer::clipboard: { SolarMutexGuard aGuard; + if (!IsValid()) + { + SAL_WARN("sw.uno", "no DocShell when attempting to setClipboard"); + return; + } + SwView* pView = m_pDocShell->GetView(); if (pView) pView->GetEditWin().SetClipboard(xClipboard); commit 2d400829e51b92c7e5d66ef791b418015baa489a Author: Andras Timar <[email protected]> AuthorDate: Wed Jul 3 11:09:34 2024 +0200 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Jul 5 14:08:03 2024 +0200 [cp] Revert "tdf#136604: Remove Source Sans Pro fonts" This reverts commit 5d42f4403d4e51f33ad8f2ce9efbed542978b521. Change-Id: I7699cf6d654ad61825123190ebb670976d9869f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169927 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/Makefile.fetch b/Makefile.fetch index 48262c0374f8..5844bd8819ed 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -183,6 +183,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_NARROW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LINLIBERTINEG_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_SOURCESANS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_KUFI_ARABIC_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_TARBALL) \ diff --git a/Repository.mk b/Repository.mk index f464f2c899ac..096d386e2fcf 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1071,6 +1071,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo_fonts,\ fonts_opendyslexic \ fonts_opensans \ fonts_reem \ + fonts_sourcesans \ fonts_scheherazade \ fonts_agdasima \ fonts_bacasime_antique \ diff --git a/download.lst b/download.lst index 148312b7ec1d..9ac795a648ef 100644 --- a/download.lst +++ b/download.lst @@ -170,6 +170,11 @@ FONT_LINLIBERTINEG_TARBALL := e7a384790b13c29113e22e596ade9687-LinLibertineG-201 # three static lines # so that git cherry-pick # will not run into conflicts +FONT_SOURCESANS_SHA256SUM := e7bc9a1fec787a529e49f5a26b93dcdcf41506449dfc70f92cdef6d17eb6fb61 +FONT_SOURCESANS_TARBALL := edc4d741888bc0d38e32dbaa17149596-source-sans-pro-2.010R-ro-1.065R-it.tar.gz +# three static lines +# so that git cherry-pick +# will not run into conflicts FONT_NOTO_KUFI_ARABIC_SHA256SUM := 1b6880e4b8df09c3b9e246d6084bfd94bf32a0ffff60cf2dcffd3622d0e2d79f FONT_NOTO_KUFI_ARABIC_TARBALL := NotoKufiArabic-v2.109.zip # three static lines diff --git a/external/more_fonts/ExternalPackage_sourcesans.mk b/external/more_fonts/ExternalPackage_sourcesans.mk new file mode 100644 index 000000000000..cd7ac29e92af --- /dev/null +++ b/external/more_fonts/ExternalPackage_sourcesans.mk @@ -0,0 +1,27 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_sourcesans,font_sourcesans)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourcesans,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + SourceSansPro-BlackIt.ttf \ + SourceSansPro-Black.ttf \ + SourceSansPro-BoldIt.ttf \ + SourceSansPro-Bold.ttf \ + SourceSansPro-ExtraLightIt.ttf \ + SourceSansPro-ExtraLight.ttf \ + SourceSansPro-It.ttf \ + SourceSansPro-LightIt.ttf \ + SourceSansPro-Light.ttf \ + SourceSansPro-Regular.ttf \ + SourceSansPro-SemiboldIt.ttf \ + SourceSansPro-Semibold.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index c20fc83f34ad..6cc170df8c74 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_liberation_narrow \ ExternalPackage_libertineg \ ExternalPackage_libre_hebrew \ + ExternalPackage_sourcesans \ ExternalPackage_noto_kufi_arabic \ ExternalPackage_noto_naskh_arabic \ ExternalPackage_noto_sans \ @@ -59,6 +60,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ UnpackedTarball_liberation_narrow \ UnpackedTarball_libertineg \ UnpackedTarball_libre_hebrew \ + UnpackedTarball_sourcesans \ UnpackedTarball_noto_kufi_arabic \ UnpackedTarball_noto_naskh_arabic \ UnpackedTarball_noto_sans \ diff --git a/external/more_fonts/UnpackedTarball_sourcesans.mk b/external/more_fonts/UnpackedTarball_sourcesans.mk new file mode 100644 index 000000000000..65ff325535a1 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_sourcesans.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_sourcesans)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_sourcesans,$(FONT_SOURCESANS_TARBALL))) + +# vim: set noet sw=4 ts=4: diff --git a/readlicense_oo/license/license.xml b/readlicense_oo/license/license.xml index 331f24837b79..34b01186ce5a 100644 --- a/readlicense_oo/license/license.xml +++ b/readlicense_oo/license/license.xml @@ -2749,6 +2749,15 @@ "Scheherazade" and "SIL". This license is copied below, and is also available with a FAQ at: <a href="http://scripts.sil.org/OFL">http://scripts.sil.org/OFL</a></p> <p><a href="#a__SIL_Open_Font_License__version_1_1">Jump to SIL Open Font License, Version 1.1</a></p> + <h2>Source Sans Pro</h2> + <p>The following software may be included in this product: Source Sans Pro fonts. Use of any of this software + is governed by the terms of the license below:</p> + <p>Copyright 2010, 2012 Adobe Systems Incorporated (<a href="http://www.adobe.com/">http://www.adobe.com/</a>), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in + the United States and/or other countries.</p> + <p>This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: <a href="http://scripts.sil.org/OFL">http://scripts.sil.org/OFL</a></p> + <p><a href="#a__SIL_Open_Font_License__version_1_1">Jump to SIL Open Font License, Version 1.1</a></p> </div> <div class="DICTIONARIES"> <hr /> diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in index b1d16b63f058..9de887dc08ae 100644 --- a/solenv/flatpak-manifest.in +++ b/solenv/flatpak-manifest.in @@ -172,6 +172,13 @@ "dest": "external/tarballs", "dest-filename": "@FONT_LINLIBERTINEG_TARBALL@" }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_SOURCESANS_TARBALL@", + "sha256": "@FONT_SOURCESANS_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_SOURCESANS_TARBALL@" + }, { "url": "https://dev-www.libreoffice.org/src/@BOOST_TARBALL@", "sha256": "@BOOST_SHA256SUM@", commit 3966e64367a92603eea09f6a6d57a0fdb14bd2b2 Author: Michael Stahl <[email protected]> AuthorDate: Thu Jul 4 12:10:29 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jul 5 10:22:18 2024 +0200 sfx2: fix signature infobar being shown for every repaired document (regression from commit 8b333575ee680664fa3d83249ccec90881754ad7) So it should only be set if the state is still UNKNOWN. But SfxObjectShell::ImplGetSignatureState() is called before the repair dialog is shown, so make sure that the second import (with RepairPackage) finds both members as SignatureState::UNKOWN. Change-Id: Ic914016dde6425a4d95fba7f6f66411305553930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169989 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 8d869b5fe47842df52965804db87db0941f4f2a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169997 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 97d8f790d24e..c6696c004e29 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -963,6 +963,12 @@ void SfxObjectShell::BreakMacroSign_Impl( bool bBreakMacroSign ) void SfxObjectShell::CheckSecurityOnLoading_Impl() { + if (GetErrorCode() == ERRCODE_IO_BROKENPACKAGE) + { // safety first: don't run any macros from broken package. + pImpl->aMacroMode.disallowMacroExecution(); + return; // do not get signature status - needs to be done after RepairPackage + } + // make sure LO evaluates the macro signatures, so it can be preserved GetScriptingSignatureState(); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index deb2cd45808c..3f29dff990e1 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1904,19 +1904,22 @@ SignatureState SfxObjectShell::ImplGetSignatureState( bool bScriptingContent ) { SignatureState* pState = bScriptingContent ? &pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState; - // repaired package cannot be trusted - SfxBoolItem const*const pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)}; - if (pRepairItem && pRepairItem->GetValue()) - { - *pState = SignatureState::BROKEN; - } - if ( *pState == SignatureState::UNKNOWN ) { *pState = SignatureState::NOSIGNATURES; uno::Sequence< security::DocumentSignatureInformation > aInfos = GetDocumentSignatureInformation( bScriptingContent ); *pState = DocumentSignatures::getSignatureState(aInfos); + + // repaired package cannot be trusted + if (*pState != SignatureState::NOSIGNATURES) + { + SfxBoolItem const*const pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)}; + if (pRepairItem && pRepairItem->GetValue()) + { + *pState = SignatureState::BROKEN; + } + } } if ( *pState == SignatureState::OK || *pState == SignatureState::NOTVALIDATED diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index ce548a81ea6a..724c9cc31743 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -401,6 +401,8 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl() // only for internal use pImpl->m_xDocStorage.clear(); pImpl->mxObjectContainer.reset(); + pImpl->nDocumentSignatureState = SignatureState::UNKNOWN; + pImpl->nScriptingSignatureState = SignatureState::UNKNOWN; pImpl->m_bIsInit = false; ResetError(); } commit dcc660fc56c94856afe8334459f5f3d356e4857b Author: Patrick Luby <[email protected]> AuthorDate: Fri Jun 28 18:31:14 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Fri Jul 5 10:22:18 2024 +0200 tdf#161833 treat semi-transparent pixels as opaque Limiting the contour wrapping polygon to only opaque pixels causes clipping of any shadows or other semi-transaprent areas in the image. So, instead of testing for fully opaque pixels, treat pixels that are not fully transparent as opaque. Also, tdf#161833 would cause semi-transparent pixels to be treated as fully transparent pixels when calculating the wrap contour for an image. To force the correct contour when loading a document, force the contour to be recalculated by ignoring the saved polygon if the contour is set to "recreate on edit". Change-Id: Ibe256f54e1c82de30c2b7d5b92a69344b4a7ba10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169745 Reviewed-by: Patrick Luby <[email protected]> Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins (cherry picked from commit 3da1d8a791cff6cf2dad29b64c9ad15b1a65d5b3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169956 diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 571f8d700836..2778a434b390 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1304,11 +1304,12 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, std::unique_ptr<Point[]> pPoints2; tools::Long nX, nY; sal_uInt16 nPolyPos = 0; - // tdf#161498 use COL_ALPHA_OPAQUE for finding opaque pixels - // Starting with commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, - // pixels now contain an alpha value instead of a transparency - // value. - const BitmapColor aTransparencyOpaque = pAcc->GetBestMatchingColor( COL_ALPHA_OPAQUE ); + // tdf#161833 treat semi-transparent pixels as opaque + // Limiting the contour wrapping polygon to only opaque pixels + // causes clipping of any shadows or other semi-transaprent + // areas in the image. So, instead of testing for fully opaque + // pixels, treat pixels that are not fully transparent as opaque. + const BitmapColor aTransparent = pAcc->GetBestMatchingColor( COL_ALPHA_TRANSPARENT ); pPoints1.reset(new Point[ nHeight ]); pPoints2.reset(new Point[ nHeight ]); @@ -1321,7 +1322,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, // scan row from left to right while( nX < nEndX1 ) { - if( aTransparencyOpaque == pAcc->GetPixelFromData( pScanline, nX ) ) + if( aTransparent != pAcc->GetPixelFromData( pScanline, nX ) ) { pPoints1[ nPolyPos ] = Point( nX, nY ); nX = nStartX2; @@ -1329,7 +1330,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, // this loop always breaks eventually as there is at least one pixel while( true ) { - if( aTransparencyOpaque == pAcc->GetPixelFromData( pScanline, nX ) ) + if( aTransparent != pAcc->GetPixelFromData( pScanline, nX ) ) { pPoints2[ nPolyPos ] = Point( nX, nY ); break; diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index b00b2b84d90e..575c7f95c23a 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -271,17 +271,26 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( const SdXMLImExViewBox aViewBox( sViewBox, GetImport().GetMM100UnitConverter()); basegfx::B2DPolyPolygon aPolyPolygon; - if( bPath ) + // Related tdf#161833: ignore saved polygon for "recreate on edit" contours + // tdf#161833 would cause semi-transparent pixels to be treated as fully + // transparent pixels when calculating the wrap contour for an image. To + // force the correct contour when loading a document, force the contour + // to be recalculated by ignoring the saved polygon if the contour is set + // to "recreate on edit". + if( !bAuto ) { - basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); - } - else - { - basegfx::B2DPolygon aPolygon; - - if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + if( bPath ) { - aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); + } + else + { + basegfx::B2DPolygon aPolygon; + + if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + { + aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + } } } commit 2f5dd9b2846362729f32b38e78657cbcf46568a3 Author: Michael Stahl <[email protected]> AuthorDate: Tue Jul 2 13:24:38 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jul 5 10:22:18 2024 +0200 sfx2: SfxObjectShell should not trust any signature on repaired package Change-Id: I0317f80989e9dabd23e88e3caab26ede3fb5bd56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169883 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 8b333575ee680664fa3d83249ccec90881754ad7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169930 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ba5310761e0c..deb2cd45808c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1904,6 +1904,13 @@ SignatureState SfxObjectShell::ImplGetSignatureState( bool bScriptingContent ) { SignatureState* pState = bScriptingContent ? &pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState; + // repaired package cannot be trusted + SfxBoolItem const*const pRepairItem{GetMedium()->GetItemSet().GetItem(SID_REPAIRPACKAGE, false)}; + if (pRepairItem && pRepairItem->GetValue()) + { + *pState = SignatureState::BROKEN; + } + if ( *pState == SignatureState::UNKNOWN ) { *pState = SignatureState::NOSIGNATURES; commit 8364610292d4218188b3705d9417a18ef13fd08f Author: Michael Stahl <[email protected]> AuthorDate: Tue Jul 2 11:50:09 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jul 5 10:21:55 2024 +0200 package: ZipFile: check Info-ZIP Unicode Path Extra Field Change-Id: I829eb449e8a0947341f066399be549f56b0f02da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169882 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 67dca5a47d1be1b38edee7d0d81fa9adfce5a22e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169929 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 2d42ed403136..8bc726af8457 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -86,7 +86,8 @@ class ZipFile void recover(); static void readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLen, sal_uInt64& nSize, sal_uInt64& nCompressedSize, - sal_uInt64* nOffset); + sal_uInt64* nOffset, + OUString const* pCENFilenameToCheck); public: diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx index d474be40cda5..dd876d66ebfa 100644 --- a/package/source/zipapi/MemoryByteGrabber.hxx +++ b/package/source/zipapi/MemoryByteGrabber.hxx @@ -49,6 +49,14 @@ public: mnCurrent += nBytesToSkip; } + sal_Int8 ReadUInt8() + { + if (mnCurrent + 1 > mnEnd) + return 0; + sal_uInt8 nInt8 = mpBuffer[mnCurrent++]; + return nInt8; + } + // XSeekable chained... sal_Int16 ReadInt16() { diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index b19ebaf2c5e2..e9a515bc85c7 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -36,6 +36,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/threadpool.hxx> #include <rtl/digest.h> +#include <rtl/crc.h> #include <sal/log.hxx> #include <o3tl/safeint.hxx> #include <o3tl/string_view.hxx> @@ -1132,7 +1133,7 @@ sal_Int32 ZipFile::readCEN() if (aEntry.nExtraLen>0) { - readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, nCompressedSize, &nOffset); + readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, nCompressedSize, &nOffset, &aEntry.sPath); } aEntry.nCompressedSize = nCompressedSize; aEntry.nSize = nSize; @@ -1176,7 +1177,8 @@ sal_Int32 ZipFile::readCEN() } void ZipFile::readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLen, - sal_uInt64& nSize, sal_uInt64& nCompressedSize, sal_uInt64* nOffset) + sal_uInt64& nSize, sal_uInt64& nCompressedSize, + sal_uInt64* nOffset, OUString const*const pCENFilenameToCheck) { while (nExtraLen > 0) // Extensible data fields { @@ -1201,6 +1203,35 @@ void ZipFile::readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLe if (dataSize > nReadSize) aMemGrabber.skipBytes(dataSize - nReadSize); } + // Info-ZIP Unicode Path Extra Field - pointless as we expect UTF-8 in CEN already + else if (nheaderID == 0x7075 && pCENFilenameToCheck) // ignore in recovery mode + { + if (aMemGrabber.remainingSize() < dataSize) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: invalid TSize"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + auto const nVersion = aMemGrabber.ReadUInt8(); + if (nVersion != 1) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: unexpected Version"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + // this CRC32 is actually of the pCENFilenameToCheck + // so it's pointless to check it if we require the UnicodeName + // to be equal to the CEN name anyway (and pCENFilenameToCheck + // is already converted to UTF-16 here) + (void) aMemGrabber.ReadUInt32(); + // this is required to be UTF-8 + OUString const unicodePath(reinterpret_cast<char const *>(aMemGrabber.getCurrentPos()), + dataSize - 5, RTL_TEXTENCODING_UTF8); + aMemGrabber.skipBytes(dataSize - 5); + if (unicodePath != *pCENFilenameToCheck) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: unexpected UnicodeName"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + } else { aMemGrabber.skipBytes(dataSize); @@ -1303,7 +1334,7 @@ void ZipFile::recover() if (aEntry.nExtraLen > 0) { readExtraFields(aMemGrabberExtra, aEntry.nExtraLen, nSize, - nCompressedSize, nullptr); + nCompressedSize, nullptr, nullptr); } } commit 889545a8cbc68b2688dc72047089db8466f83e23 Author: Michael Stahl <[email protected]> AuthorDate: Tue Jul 2 11:47:17 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jul 5 10:21:55 2024 +0200 package: ZipFile: don't accept duplicate CEN entries Change-Id: Ice341a11346b445c555cba276bf2284e4f9b6685 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169881 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 67cb6af482bc5b0f4d310f0a42a85057f3db0267) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169945 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 72788b625d00..b19ebaf2c5e2 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -1153,7 +1153,15 @@ sal_Int32 ZipFile::readCEN() continue; // This is a directory entry, not a stream - skip it } - aEntries[aEntry.sPath] = aEntry; + if (auto it = aEntries.find(aEntry.sPath); it == aEntries.end()) + { + aEntries[aEntry.sPath] = aEntry; + } + else + { + SAL_INFO("package", "Duplicate CEN entry: \"" << aEntry.sPath << "\""); + throw ZipException(u"Duplicate CEN entry"_ustr); + } } if (nCount != nTotal) commit ff7755a6e55af237e62f2173ddd5733a6e2b41fa Author: Mike Kaganski <[email protected]> AuthorDate: Thu Jul 4 23:43:31 2024 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Jul 5 07:32:19 2024 +0200 Make window's default mouse position a large negative Some operations, like DrawViewShell::Activate, trigger FuDraw::ForcePointer. The latter may call SdrView::PickAnything to test if the pointer is over an object. In SdrMarkView::CheckSingleSdrObjectHit, the bound rectangle of the object is tested first, which doesn't need the object's deep processing. If the point in in the rectangle, the object is processed further, which may render the object. The hit test is performed using a tolerance. Commit 56a1f9bea2f1b64dee4111ec6671caf42ef63c91 (sd: extend test to check the PDF pages aren't rendered when loaded, 2020-03-26) made sure that the rendering doesn't happen in the LOK mode. In that mode, the mouse position is unchanged from the values set in the ImplFrameData ctor. Previously it was enough for the test, that the initial position was [-1, -1], which made the point outside of the bounding rectangle of the objects. But an upcoming fix for the map mode calculations makes tolerance large enough to consider the point inside the rectangle, which triggers rendering and fails the test. This change makes the default position [-32767, -32737], which should be reliably outside of the tested rectangle. Change-Id: Ie1142729448f7ac3c628880140f123cde66b404e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 96c3d78f39ac4385880ae6f92f15f7ab3564ffcf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170026 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 0db0e6dae9c0..5c53312c09b6 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -781,14 +781,14 @@ ImplFrameData::ImplFrameData( vcl::Window *pWindow ) mxFontCache = pSVData->maGDIData.mxScreenFontCache; mnFocusId = nullptr; mnMouseMoveId = nullptr; - mnLastMouseX = -1; - mnLastMouseY = -1; - mnBeforeLastMouseX = -1; - mnBeforeLastMouseY = -1; - mnFirstMouseX = -1; - mnFirstMouseY = -1; - mnLastMouseWinX = -1; - mnLastMouseWinY = -1; + mnLastMouseX = -32767; + mnLastMouseY = -32767; + mnBeforeLastMouseX = -32767; + mnBeforeLastMouseY = -32767; + mnFirstMouseX = -32767; + mnFirstMouseY = -32767; + mnLastMouseWinX = -32767; + mnLastMouseWinY = -32767; mnModalMode = 0; mnMouseDownTime = 0; mnClickCount = 0; commit 1a3f03794512d34616fade0d3c4c8f27890f0674 Author: Andras Timar <[email protected]> AuthorDate: Thu Jul 4 13:31:49 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jul 4 13:31:49 2024 +0200 Bump version to 24.04.5.1 Change-Id: I08a1d569a59b2c4c190113a0e6fbe72d94a43c7f diff --git a/configure.ac b/configure.ac index 4a01a51f9389..a2c71eaf8509 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[24.04.4.2],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[24.04.5.1],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard commit d634731427c17555048835e1cb8adb79ea7ac6a2 Author: Christian Lohmaier <[email protected]> AuthorDate: Wed Jul 3 15:55:25 2024 +0200 Commit: Gerrit Code Review <[email protected]> CommitDate: Wed Jul 3 15:55:25 2024 +0200 Update git submodules * Update translations from branch 'distro/collabora/co-24.04' to 5fd34a953e6861cb8e392363c0a3500059ed6b01 - update translations for 24.2.5 rc1 and force-fix errors using pocheck Change-Id: If5f86442a5c64c40f13cb2d302a3c38aa9835541 - update translations for 24.2.5 rc1 and force-fix errors using pocheck Change-Id: I8421753b547b21af95fdc22c1554d90fdd115bde diff --git a/translations b/translations index 9676c33dfa2c..5fd34a953e68 160000 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 9676c33dfa2cf42e040c0c5f172fe9a3657ac9bc +Subproject commit 5fd34a953e6861cb8e392363c0a3500059ed6b01 commit a4cdd8f9581d5f61e122039b9388d83609d4ecef Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jul 1 11:43:51 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 crashtesting: divide by zero since: commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9 Date: Fri Jun 21 12:28:30 2024 +0200 tdf#161086 bitmap location wrong with SVG with an embedded PNG bodge it by using the requested width/height and not the possibly zero on fail actual sizes Change-Id: Ic55ba6ce3cc14fa598299cdd1f844ee7c63fb174 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169800 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins (cherry picked from commit af2175bb87b8e8a7184916e110e2b22ec542357d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169815 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 734ad392b161..8d199f696a40 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -1092,8 +1092,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D( mpOutputDevice->IntersectClipRegion(vcl::Region(aMask)); Wallpaper aWallpaper(aTileImage); aWallpaper.SetColor(COL_TRANSPARENT); - Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(), - aMaskRect.getY() % aTileImage.GetSizePixel().Height()); + Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % nTileHeight); tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel()); aWallpaper.SetRect(aPaperRect); mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper); @@ -1122,8 +1121,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D( { Wallpaper aWallpaper(aTileImage); aWallpaper.SetColor(COL_TRANSPARENT); - Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(), - aMaskRect.getY() % aTileImage.GetSizePixel().Height()); + Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % nTileHeight); tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel()); aWallpaper.SetRect(aPaperRect); mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper); commit d160ac57a90b5944505be11e04c31937d83c7dfd Author: Aron Budea <[email protected]> AuthorDate: Fri Jun 28 06:09:33 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 tdf#161310 Translate My AutoText in Insert toolbar Use same pattern as 42e6e26255b21c1bfde893f5aaf23d4a37ecee91 and dffdc0b1995e2b24304ce0651ca886bbf9cf4f95 Change-Id: If36ecdcbb771bfcde9836203e84586045d039c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169693 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 696eb4b4e55ce26cee9aee2c76a7125df91ae0d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169739 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 9a9b288e142f..f40b9e964b1d 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -91,6 +91,8 @@ void SwTbxAutoTextCtrl::CreatePopupWindow() for(size_t i = 1; i <= nGroupCount; ++i) { OUString sTitle = pGlossaryList->GetGroupTitle(i - 1); + if (sTitle == "My AutoText") + sTitle = SwResId(STR_MY_AUTOTEXT); const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1); auto const [it, _] = titles.insert(sTitle); size_t const menuIndex(::std::distance(titles.begin(), it)); commit 951c7d6748823a00fc6b1f62d17cac12cbdd1291 Author: László Németh <[email protected]> AuthorDate: Fri Jun 28 00:27:57 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 tdf#141773 AutoCorrect: fix broken [All] dictionaries This reverts commit ae56dc05b27f05ffcee99845d661a237e70a7a51 "tdf#96787: AutoCorrect: after deleting a replacement entry, it's still used". (Cherry-picked from 50be3fa1f0f3b8870af5bda88b65f835ef37d77e.) Change-Id: Ifb4cf1b359b852c7610337d4bd389a8ca5dce610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169735 Reviewed-by: Christian Lohmaier <[email protected]> Tested-by: Jenkins diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 676959d43dbe..cb1c157f23a0 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2021,8 +2021,6 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( rLang = aLanguageTag; return pRet; } - else - return nullptr; } // If it still could not be found here, then keep on searching commit 77ba58757a37691c68a20adea64b91d448ff47c9 Author: László Németh <[email protected]> AuthorDate: Fri Jun 28 15:49:22 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 tdf#96787 AutoCorrect: find item with ".*" and between :colons: It was very hard to disable autocorrection of (c)->© and other AutoCorrect items, because the searched Replace string "(c)" etc. didn't jump the list cursor to the corresponding ".*(c)" item. Now skip ".*" pattern matching marks, also colon (emoji replacement) characters, so the list cursor jumps to the line ".*(c)"->© typing only "(c" etc., allowing users to press Delete to disable its autocorrection without knowing about the special AutoCorrect patterns. Follow-up to commit 50be3fa1f0f3b8870af5bda88b65f835ef37d77e "tdf#141773 AutoCorrect: fix broken [All] dictionaries". Change-Id: I72be1ecb2fdc5ae67c72727ce7fbd70b28a4125b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169714 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> (cherry picked from commit e5507c8a003328f629ae924fbba14155c13e7a12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169734 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 282e8b5405a1..7b6567b4deaf 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1146,7 +1146,9 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, weld::Entry&, rEdt, void) else { aTestStr = pCharClass->lowercase( aTestStr ); - if( aTestStr.startsWith(aWordStr) && !bTmpSelEntry ) + if( !bTmpSelEntry && ( aTestStr.startsWith(aWordStr) + // find also with ".*" and between :colons: + || aTestStr.replaceAll(".*","").replaceAll(":", "").startsWith(aWordStr) ) ) { m_xReplaceTLB->scroll_to_row(rIter); bTmpSelEntry = true; commit 2f9899b87101154727b9d989377c7308f0f4888d Author: Miklos Vajna <[email protected]> AuthorDate: Fri Jun 28 08:42:37 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 Related: tdf#161708 sw content controls: fix custom default of dropdown to PDF Export the bugdoc to PDF without noticing that there is a content control around some of the content and notice how the PDF export lacks some words from the body text. What happens is that content controls are exported to PDF as PDF forms by default, and the selected option of a dropdown has to be an index, so in case the text of the dropdown content control is not one of the options, then the PDF will miss those words. Fix the problem by inserting the text of the dropdown at the start if there would be no valid index for it. Also add a bit of padding around the rectangle of the content controls, it turns out there is a default 1pt border in PDF, and this would lead to a cut-off text at the end if we don't compensate for that border. Change-Id: I99447894b320b42ad9ffe0d54d0190000621616b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169694 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit b3e01bd3bdd37961057026ab7f2b57cbfab35d4a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169671 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index a5d757414429..6d2a65a8fa38 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -117,6 +117,7 @@ public: PDFAnnotAActionType eEvent) = 0; virtual OUString getFormFieldValue(PDFiumDocument* pDoc) = 0; + virtual int getOptionCount(PDFiumDocument* pDoc) = 0; }; class PDFiumTextPage; diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx index 930be1b031f4..c9f9e3a9adcc 100644 --- a/sw/qa/core/text/itrform2.cxx +++ b/sw/qa/core/text/itrform2.cxx @@ -11,6 +11,9 @@ #include <memory> +#include <com/sun/star/text/XTextDocument.hpp> + +#include <comphelper/propertyvalue.hxx> #include <editeng/colritem.hxx> #include <IDocumentLayoutAccess.hxx> @@ -258,6 +261,59 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFFontColor) // i.e. the custom color was lost, the font color was black, not orange. CPPUNIT_ASSERT_EQUAL(nOrange, pAnnotation->getFontColor(pPdfDocument.get())); } + +CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownText) +{ + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + return; + + // Given a document with a dropdown: custom default text and 3 items: + createSwDoc(); + uno::Reference<lang::XMultiServiceFactory> xMSF(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextDocument->getText(); + uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); + xText->insertString(xCursor, u"test"_ustr, /*bAbsorb=*/false); + xCursor->gotoStart(/*bExpand=*/false); + xCursor->gotoEnd(/*bExpand=*/true); + uno::Reference<text::XTextContent> xContentControl( + xMSF->createInstance(u"com.sun.star.text.ContentControl"_ustr), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY); + { + uno::Sequence<beans::PropertyValues> aListItems = { + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u"red"_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u"R"_ustr)), + }, + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u"green"_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u"G"_ustr)), + }, + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u"blue"_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u"B"_ustr)), + }, + }; + xContentControlProps->setPropertyValue(u"ListItems"_ustr, uno::Any(aListItems)); + } + xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); + + // When exporting that to PDF: + save(u"writer_pdf_Export"_ustr); + + // Then make sure that the custom default is not lost: + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parsePDFExport(); + std::unique_ptr<vcl::pdf::PDFiumPage> pPage = pPdfDocument->openPage(0); + pPage->onAfterLoadPage(pPdfDocument.get()); + CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount()); + std::unique_ptr<vcl::pdf::PDFiumAnnotation> pAnnotation = pPage->getAnnotation(0); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 4 + // - Actual : 3 + // i.e. only the 3 colors were exported, the default "test" text was not. + CPPUNIT_ASSERT_EQUAL(4, pAnnotation->getOptionCount(pPdfDocument.get())); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index c3c1c770c031..221a23c5534a 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1040,13 +1040,24 @@ bool SwContentControlPortion::DescribePDFControl(const SwTextPaintInfo& rInf) co auto pListWidget = static_cast<vcl::PDFWriter::ListBoxWidget*>(pDescriptor.get()); pListWidget->DropDown = true; sal_Int32 nIndex = 0; + bool bTextFound = false; for (const auto& rItem : pContentControl->GetListItems()) { pListWidget->Entries.push_back(rItem.m_aDisplayText); if (rItem.m_aDisplayText == aText) + { pListWidget->SelectedEntries.push_back(nIndex); + bTextFound = true; + } ++nIndex; } + if (!aText.isEmpty() && !bTextFound) + { + // The selected entry has to be an index, if there is no index for it, insert one at + // the start. + pListWidget->Entries.insert(pListWidget->Entries.begin(), aText); + pListWidget->SelectedEntries.push_back(0); + } break; } case SwContentControlType::COMBO_BOX: @@ -1118,6 +1129,14 @@ bool SwContentControlPortion::DescribePDFControl(const SwTextPaintInfo& rInf) co aLocation = aStartRect; aLocation.Union(aEndRect); + + // PDF spec 12.5.2 Annotation Dictionaries says the default border with is 1pt wide, increase + // the rectangle to compensate for that, otherwise the text will be cut off at the end. + aLocation.AddTop(-20); + aLocation.AddBottom(20); + aLocation.AddLeft(-20); + aLocation.AddRight(20); + pDescriptor->Location = aLocation.SVRect(); pPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Form); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index a464798076ed..7da0dbc62f70 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -4657,11 +4657,11 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152246) CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size()); // Position array - constexpr double aPos[5][4] = { { 56.699, 707.701, 131.401, 721.499 }, - { 198.499, 707.701, 273.201, 721.499 }, - { 303.349, 680.101, 378.051, 693.899 }, - { 480.599, 680.101, 555.301, 693.899 }, - { 56.699, 652.501, 131.401, 666.299 } }; + constexpr double aPos[5][4] = { { 55.699, 706.701, 132.401, 722.499 }, + { 197.499, 706.701, 274.201, 722.499 }, + { 302.349, 679.101, 379.051, 694.899 }, + { 479.599, 679.101, 556.301, 694.899 }, + { 55.699, 651.501, 132.401, 667.299 } }; // Get page annotations. auto pAnnots = dynamic_cast<vcl::filter::PDFArrayElement*>(aPages[0]->Lookup("Annots"_ostr)); diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 0c1ee041a223..29d95338b004 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -303,6 +303,7 @@ public: OUString getFormAdditionalActionJavaScript(PDFiumDocument* pDoc, PDFAnnotAActionType eEvent) override; OUString getFormFieldValue(PDFiumDocument* pDoc) override; + int getOptionCount(PDFiumDocument* pDoc) override; }; class PDFiumPageObjectImpl final : public PDFiumPageObject @@ -1382,6 +1383,11 @@ OUString PDFiumAnnotationImpl::getFormFieldValue(PDFiumDocument* pDoc) } return aString; } +int PDFiumAnnotationImpl::getOptionCount(PDFiumDocument* pDoc) +{ + auto pDocImpl = static_cast<PDFiumDocumentImpl*>(pDoc); + return FPDFAnnot_GetOptionCount(pDocImpl->getFormHandlePointer(), mpAnnotation); +} OUString PDFiumAnnotationImpl::getFormAdditionalActionJavaScript(PDFiumDocument* pDoc, PDFAnnotAActionType eEvent) commit 8a3c802b2d0676a39aa57a3fbf8b72abb74ad593 Author: Patrick Luby <[email protected]> AuthorDate: Thu Jun 27 20:05:19 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 tdf#159680 fix memory leak of CTFontRef The CTFontRef in CoreTextFontFace::GetVariations() was never released and a new CTFontRef was allocated in every call to CoreTextFontFace::GetVariations(). So release the CTFontRef and only allocate it once when mxVariations is populated. Change-Id: I08999956501d5860fff67e48001ef85a62ca8079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169690 Tested-by: Jenkins Reviewed-by: Patrick Luby <[email protected]> (cherry picked from commit 2e87c644245751aea9f50faf16c4ca4d57b0c2f1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169676 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/vcl/quartz/CoreTextFontFace.cxx b/vcl/quartz/CoreTextFontFace.cxx index 662b439a9eae..47792fff7a58 100644 --- a/vcl/quartz/CoreTextFontFace.cxx +++ b/vcl/quartz/CoreTextFontFace.cxx @@ -46,43 +46,46 @@ sal_IntPtr CoreTextFontFace::GetFontId() const const std::vector<hb_variation_t>& CoreTextFontFace::GetVariations(const LogicalFontInstance&) const { - CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 0.0, nullptr); - if (!mxVariations) { mxVariations.emplace(); - CFArrayRef pAxes = CTFontCopyVariationAxes(pFont); - if (pAxes) + CTFontRef pFont = CTFontCreateWithFontDescriptor(mxFontDescriptor, 0.0, nullptr); + if (pFont) { - CFDictionaryRef pVariations = CTFontCopyVariation(pFont); - if (pVariations) + CFArrayRef pAxes = CTFontCopyVariationAxes(pFont); + if (pAxes) { - CFIndex nAxes = CFArrayGetCount(pAxes); - for (CFIndex i = 0; i < nAxes; ++i) + CFDictionaryRef pVariations = CTFontCopyVariation(pFont); + if (pVariations) { - auto pAxis = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(pAxes, i)); - if (pAxis) + CFIndex nAxes = CFArrayGetCount(pAxes); + for (CFIndex i = 0; i < nAxes; ++i) { - hb_tag_t nTag; - auto pTag = static_cast<CFNumberRef>( - CFDictionaryGetValue(pAxis, kCTFontVariationAxisIdentifierKey)); - if (!pTag) - continue; - CFNumberGetValue(pTag, kCFNumberIntType, &nTag); + auto pAxis = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(pAxes, i)); + if (pAxis) + { + hb_tag_t nTag; + auto pTag = static_cast<CFNumberRef>( + CFDictionaryGetValue(pAxis, kCTFontVariationAxisIdentifierKey)); + if (!pTag) + continue; + CFNumberGetValue(pTag, kCFNumberIntType, &nTag); - float fValue; - auto pValue - = static_cast<CFNumberRef>(CFDictionaryGetValue(pVariations, pTag)); - if (!pValue) - continue; - CFNumberGetValue(pValue, kCFNumberFloatType, &fValue); + float fValue; + auto pValue + = static_cast<CFNumberRef>(CFDictionaryGetValue(pVariations, pTag)); + if (!pValue) + continue; + CFNumberGetValue(pValue, kCFNumberFloatType, &fValue); - mxVariations->push_back({ nTag, fValue }); + mxVariations->push_back({ nTag, fValue }); + } } + CFRelease(pVariations); } - CFRelease(pVariations); + CFRelease(pAxes); } - CFRelease(pAxes); + CFRelease(pFont); } } commit c61898a30ad869bcada54ad3434efe3c4366d2ce Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Thu Jun 27 11:10:19 2024 +0200 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:53:32 2024 +0200 Fix autotext shortcut generation The first character was replaced with a number. Fallout from 1f93816dd5d75aca98f210017d0b58b7ef1d08da Change-Id: I3b9a39336d5f6f3c10c85231f86fd196a29e3644 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169621 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: Jenkins (cherry picked from commit c519de229627f3c6bb7736c810405b441c07f369) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169684 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 8b2860c20c29..e47f46798530 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -86,7 +86,7 @@ static OUString lcl_GetValidShortCut( const OUString& rName ) while( rName[nStart-1]==' ' && nStart < nSz ) nStart++; - OUStringBuffer aBuf(OUString::number(rName[nStart-1])); + OUStringBuffer aBuf(rName.subView(nStart-1, 1)); for( ; nStart < nSz; ++nStart ) { commit 4e7ac2acefc8cedf95be03d3145b6ef2e6027767 Author: Justin Luth <[email protected]> AuthorDate: Fri Jun 21 10:42:08 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:40:45 2024 +0200 tdf#161646 sw page number wizard: fit into existing margins Often page numbers are inserted when a document is finished, and at that point it would be annoying to repaginate everything, so offer this option of trying to fit the page number into the existing margins. I was tempted to enable it by default, except that it would then mismatch any pages that had header/footers created via other methods. Problem: -how to know which font is really needed: western, CTL, CJK? This patch depends on NFC b7fce2b26ee4ba585544457adc742807a2129d2c Change-Id: I285a99f8e2f12c87a8bdee20a9c86a1d79f80dd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169827 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Justin Luth <[email protected]> diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index a9ceb855b337..1f147255d6d8 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -240,6 +240,7 @@ public: virtual int GetPageNumberAlignment() const = 0; virtual bool GetMirrorOnEvenPages() const = 0; virtual bool GetIncludePageTotal() const = 0; + virtual bool GetFitIntoExistingMargins() const = 0; virtual SvxNumType GetPageNumberType() const = 0; virtual void SetPageNumberType(SvxNumType nSet) = 0; }; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index c70608b6f46a..8155bf7a825d 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -703,6 +703,11 @@ bool AbstractSwPageNumberDlg_Impl::GetIncludePageTotal() const return m_xDlg->GetIncludePageTotal(); } +bool AbstractSwPageNumberDlg_Impl::GetFitIntoExistingMargins() const +{ + return m_xDlg->GetFitIntoExistingMargins(); +} + SvxNumType AbstractSwPageNumberDlg_Impl::GetPageNumberType() const { return m_xDlg->GetPageNumberType(); diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 5dc47327daa5..6fb220ed1e41 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -168,6 +168,7 @@ public: virtual int GetPageNumberAlignment() const override; bool GetMirrorOnEvenPages() const override; bool GetIncludePageTotal() const override; + bool GetFitIntoExistingMargins() const override; SvxNumType GetPageNumberType() const override; void SetPageNumberType(SvxNumType nSet) override; }; diff --git a/sw/source/ui/misc/pagenumberdlg.cxx b/sw/source/ui/misc/pagenumberdlg.cxx index fe965d69db19..09d7bfc3390f 100644 --- a/sw/source/ui/misc/pagenumberdlg.cxx +++ b/sw/source/ui/misc/pagenumberdlg.cxx @@ -33,6 +33,8 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent) , m_xPageNumberAlignment(m_xBuilder->weld_combo_box("alignmentCombo")) , m_xMirrorOnEvenPages(m_xBuilder->weld_check_button("mirrorCheckbox")) , m_xIncludePageTotal(m_xBuilder->weld_check_button("pagetotalCheckbox")) + , m_xFitIntoExistingMargins( + m_xBuilder->weld_check_button(u"fitintoexistingmarginsCheckbox"_ustr)) , m_xPageNumberTypeLB(new SvxPageNumberListBox(m_xBuilder->weld_combo_box("numfmtlb"))) , m_xPreviewImage(m_xBuilder->weld_image("previewImage")) , m_aPageNumberPosition(1) // bottom @@ -47,6 +49,7 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent) m_xMirrorOnEvenPages->set_sensitive(false); m_xMirrorOnEvenPages->set_state(TRISTATE_TRUE); m_xIncludePageTotal->set_state(TRISTATE_FALSE); + m_xFitIntoExistingMargins->set_state(TRISTATE_FALSE); SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xPageNumberTypeLB->get_widget(), ::std::numeric_limits<sal_uInt16>::max()); m_xPageNumberTypeLB->connect_changed(LINK(this, SwPageNumberDlg, NumberTypeSelectHdl)); @@ -83,17 +86,22 @@ IMPL_LINK_NOARG(SwPageNumberDlg, IncludePageTotalChangeHdl, weld::Toggleable&, v updateImage(); } -bool SwPageNumberDlg::GetMirrorOnEvenPages() +bool SwPageNumberDlg::GetMirrorOnEvenPages() const { return m_xMirrorOnEvenPages->get_sensitive() && m_xMirrorOnEvenPages->get_state() == TRISTATE_TRUE; } -bool SwPageNumberDlg::GetIncludePageTotal() +bool SwPageNumberDlg::GetIncludePageTotal() const { return m_xIncludePageTotal->get_state() == TRISTATE_TRUE; } +bool SwPageNumberDlg::GetFitIntoExistingMargins() const +{ + return m_xFitIntoExistingMargins->get_state() == TRISTATE_TRUE; +} + void SwPageNumberDlg::SetPageNumberType(SvxNumType nSet) { m_nPageNumberType = nSet; diff --git a/sw/source/uibase/inc/pagenumberdlg.hxx b/sw/source/uibase/inc/pagenumberdlg.hxx index 169c9209dbf5..f097509b5a68 100644 --- a/sw/source/uibase/inc/pagenumberdlg.hxx +++ b/sw/source/uibase/inc/pagenumberdlg.hxx @@ -33,6 +33,7 @@ class SwPageNumberDlg final : public SfxDialogController std::unique_ptr<weld::ComboBox> m_xPageNumberAlignment; std::unique_ptr<weld::CheckButton> m_xMirrorOnEvenPages; std::unique_ptr<weld::CheckButton> m_xIncludePageTotal; + std::unique_ptr<weld::CheckButton> m_xFitIntoExistingMargins; std::unique_ptr<SvxPageNumberListBox> m_xPageNumberTypeLB; std::unique_ptr<weld::Image> m_xPreviewImage; @@ -53,8 +54,9 @@ public: SwPageNumberDlg(weld::Window* pParent); int GetPageNumberPosition() const { return m_aPageNumberPosition; } int GetPageNumberAlignment() const { return m_aPageNumberAlignment; } - bool GetMirrorOnEvenPages(); - bool GetIncludePageTotal(); + bool GetMirrorOnEvenPages() const; + bool GetIncludePageTotal() const; + bool GetFitIntoExistingMargins() const; SvxNumType GetPageNumberType() const { return m_nPageNumberType; } void SetPageNumberType(SvxNumType nSet); }; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 2707579230b7..6e3ff742cf20 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -37,10 +37,15 @@ #include <svx/hlnkitem.hxx> #include <svx/svxdlg.hxx> #include <osl/diagnose.h> +#include <charatr.hxx> +#include <fmtfsize.hxx> #include <fmthdft.hxx> #include <fmtinfmt.hxx> #include <fldwrap.hxx> +#include <frmatr.hxx> +#include <hfspacingitem.hxx> #include <redline.hxx> +#include <swfont.hxx> #include <view.hxx> #include <viewopt.hxx> #include <wrtsh.hxx> @@ -59,9 +64,9 @@ #include <svtools/strings.hrc> #include <svtools/svtresid.hxx> -#include <editeng/ulspitem.hxx> #include <xmloff/odffields.hxx> #include <IDocumentContentOperations.hxx> +#include <IDocumentLayoutAccess.hxx> #include <IDocumentRedlineAccess.hxx> #include <IDocumentUndoRedo.hxx> #include <svl/zforlist.hxx> @@ -1141,6 +1146,72 @@ FIELD_INSERT: rFormat.SetFormatAttr(aUL); rFormat.SetFormatAttr(aFill); + if (pDlg->GetFitIntoExistingMargins()) + { + SvxULSpaceItem aPageUL(aNewDesc.GetMaster().GetULSpace()); + tools::Long nPageMargin = bHeader ? aPageUL.GetUpper() : aPageUL.GetLower(); + + // most printers can't print to paper edge - use arbitrary ~14pt as minimum + if (nPageMargin > constTwips_5mm) + { + // reduce existing margin by the "Spacing" + nPageMargin -= constTwips_5mm; + + // also reduce by the "Height" (as calculated from the font) + tools::Long nFontHeight = constTwips_5mm; // appropriate for 12pt font + const OutputDevice* pOutDev = Application::GetDefaultDevice(); + const SwViewShell* pViewSh + = rDoc.getIDocumentLayoutAccess().GetCurrentViewShell(); + OUString sParaStyle(bHeader ? "Header" : "Footer"); + SwTextFormatColl* pStyle = rDoc.FindTextFormatCollByName(sParaStyle); + if (pStyle && pOutDev) + { + SwFont aFont( + &pStyle->GetAttrSet(), /*IDocumentSettingAccess=*/nullptr); + + // sledgehammer approach: since the in-use-font (Latin/CTL/CKJ) + // is not known, use the tallest of the three just to ensure fit. + sal_uInt16 nHeight = aFont.GetHeight(pViewSh, *pOutDev); // Latin + + aFont.SetActual(SwFontScript::CTL); + nHeight = std::max(nHeight, aFont.GetHeight(pViewSh, *pOutDev)); + + aFont.SetActual(SwFontScript::CJK); + nFontHeight = std::max(nHeight, aFont.GetHeight(pViewSh, *pOutDev)); + + // Spacing: above and below paragraph + const SvxULSpaceItem& rParaStyleUL = pStyle->GetULSpace(); + nFontHeight += rParaStyleUL.GetUpper() + rParaStyleUL.GetLower(); + + // Border padding: top and bottom + const SvxBoxItem rBorders = pStyle->GetBox(); + nFontHeight += rBorders.CalcLineSpace(SvxBoxItemLine::TOP, true); + nFontHeight += rBorders.CalcLineSpace(SvxBoxItemLine::BOTTOM, true); + } + nPageMargin -= nFontHeight; + + nPageMargin = std::max(nPageMargin, constTwips_5mm); + if (bHeader) + aPageUL.SetUpper(nPageMargin); + else + aPageUL.SetLower(nPageMargin); + aNewDesc.GetMaster().SetFormatAttr(aPageUL); + + // force aggressively calculated font height as minimum to ensure + // effective margin stays the same (instead of getting smaller) + SwFormatFrameSize aSize(rFormat.GetFrameSize()); + aSize.SetHeightSizeType(SwFrameSize::Minimum); + // frame size property includes both Spacing + Height + aSize.SetHeight(constTwips_5mm + nFontHeight); + rFormat.SetFormatAttr(aSize); + + // in case the calculated font height isn't actually large enough, + // eat into spacing first before pushing into the content area. + rFormat.SetFormatAttr(SwHeaderAndFooterEatSpacingItem( + RES_HEADER_FOOTER_EAT_SPACING, true)); + } + } + // Might as well turn on margin mirroring too - if appropriate if (pDlg->GetMirrorOnEvenPages() && !bHeaderAlreadyOn && !bFooterAlreadyOn && !bIsSinglePage diff --git a/sw/uiconfig/swriter/ui/pagenumberdlg.ui b/sw/uiconfig/swriter/ui/pagenumberdlg.ui index f014545da429..e876594c05c5 100644 --- a/sw/uiconfig/swriter/ui/pagenumberdlg.ui +++ b/sw/uiconfig/swriter/ui/pagenumberdlg.ui @@ -211,6 +211,28 @@ <property name="position">5</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="fitintoexistingmarginsCheckbox"> + <property name="label" translatable="yes" context="pagenumberdlg|fitintoexistingmarginsCheckbox">Fit into existing margins</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="margin-start">18</property> + <property name="margin-top">3</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="fitintoexistingmarginsCheckbox-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="pagenumberdlg|extended_tip|fitintoexistingmarginsCheckbox">Reduce the margin so that adding the page number will not change the page layout</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> <child> <object class="GtkLabel" id="numfmtLabel"> <property name="visible">True</property> @@ -232,7 +254,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">7</property> </packing> </child> <child> @@ -251,7 +273,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">7</property> + <property name="position">8</property> </packing> </child> </object> commit 574d5ce168cd0f628a361cd0689039daf8b82387 Author: Justin Luth <[email protected]> AuthorDate: Fri Jun 21 17:05:47 2024 -0400 Commit: Andras Timar <[email protected]> CommitDate: Wed Jul 3 15:40:36 2024 +0200 NFC sw textfld.cxx: make rDoc an actual reference Change-Id: I84d65e80f27cdc2cbfc4f56c89e5a391e0fd9e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169350 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169826 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 68561d8b8ded..2707579230b7 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -1080,12 +1080,12 @@ FIELD_INSERT: pDlg->StartExecuteAsync([pShell, &rSh, pDlg](int nResult) { if ( nResult == RET_OK ) { - auto rDoc = rSh.GetDoc(); + auto& rDoc = *rSh.GetDoc(); rSh.LockView(true); rSh.StartAllAction(); rSh.SwCursorShell::Push(); - rDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr); + rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr); const size_t nPageDescIndex = rSh.GetCurPageDesc(); const SwPageDesc& rDesc = rSh.GetPageDesc(nPageDescIndex); @@ -1105,7 +1105,7 @@ FIELD_INSERT: if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); - rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); + rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); } SwPageDesc aNewDesc(rDesc); @@ -1230,7 +1230,7 @@ FIELD_INSERT: if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); - rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); + rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); } SwTextNode* pTextNode = rSh.GetCursor()->GetPoint()->GetNode().GetTextNode(); @@ -1238,7 +1238,7 @@ FIELD_INSERT: // Insert new line if there is already text in header/footer if (pTextNode && !pTextNode->GetText().isEmpty()) { - rDoc->getIDocumentContentOperations().SplitNode(*rSh.GetCursor()->GetPoint(), false); + rDoc.getIDocumentContentOperations().SplitNode(*rSh.GetCursor()->GetPoint(), false); // Go back to start of header/footer if (bHeader) @@ -1280,7 +1280,7 @@ FIELD_INSERT: aMgr.InsertField(aData); if (pDlg->GetIncludePageTotal()) { - rDoc->getIDocumentContentOperations().InsertString(*rSh.GetCursor(), " / "); + rDoc.getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / "_ustr); SwInsertField_Data aPageTotalData(SwFieldTypesEnum::DocumentStatistics, DS_PAGE, OUString(), OUString(), SVX_NUM_PAGEDESC); aMgr.InsertField(aPageTotalData); @@ -1305,7 +1305,7 @@ FIELD_INSERT: if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); - rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); + rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); } pTextNode = rSh.GetCursor()->GetPoint()->GetNode().GetTextNode(); @@ -1313,7 +1313,7 @@ FIELD_INSERT: // Insert new line if there is already text in header/footer if (pTextNode && !pTextNode->GetText().isEmpty()) { - rDoc->getIDocumentContentOperations().SplitNode( + rDoc.getIDocumentContentOperations().SplitNode( *rSh.GetCursor()->GetPoint(), false); // Go back to start of header/footer rSh.SetCursorInHdFt(nPageDescIndex, bHeader, /*Even=*/true); @@ -1334,7 +1334,7 @@ FIELD_INSERT: aEvenMgr.InsertField(aData); if (pDlg->GetIncludePageTotal()) { - rDoc->getIDocumentContentOperations().InsertString(*rSh.GetCursor(), " / "); + rDoc.getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / "_ustr); SwInsertField_Data aPageTotalData(SwFieldTypesEnum::DocumentStatistics, DS_PAGE, OUString(), OUString(), SVX_NUM_PAGEDESC); @@ -1354,7 +1354,7 @@ FIELD_INSERT: rSh.SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent); rSh.EndAllAction(); rSh.LockView(false); - rDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr); + rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr); } pDlg->disposeOnce(); }); commit 954c34990a11abbea18951f2e200010fa760a2e2 Author: Michael Meeks <[email protected]> AuthorDate: Tue Jul 2 16:03:47 2024 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jul 2 20:25:39 2024 +0200 lok: Avoid launching an un-necessary thread. It seems this happens rather regularly with online; and yet we are running the main-loop, seems this was introduced to allow UNO usage without a main-loop, but this is not really our case. cf. commit 168a67f4b3ace8c4b46567651429e956547bc1f9 Author: mm <[email protected]> Date: Thu Feb 22 17:22:48 2001 +0000 VCL without main Change-Id: Ibd10a4966157f30557eff88c124e63ffae2e1f61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169887 Reviewed-by: Ashod Nakashian <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index fc6b7b9df8d9..eb143df4bdaf 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -137,6 +137,7 @@ #endif #include <awt/vclxspinbutton.hxx> #include <tools/debug.hxx> +#include <comphelper/lok.hxx> #include <comphelper/diagnose_ex.hxx> #include <comphelper/interfacecontainer3.hxx> #include <comphelper/processfactory.hxx> @@ -939,7 +940,8 @@ VCLXToolkit::VCLXToolkit(): #ifndef IOS osl::Guard< osl::Mutex > aGuard( getInitMutex() ); nVCLToolkitInstanceCount++; - if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) ) + if( nVCLToolkitInstanceCount == 1 && !Application::IsInMain() && + !comphelper::LibreOfficeKit::isActive() ) { // setup execute thread CreateMainLoopThread( ToolkitWorkerFunction, this ); commit 2d2c24d62c75d535efa5d1840cf3e72130b2d2ff Author: Jaume Pujantell <[email protected]> AuthorDate: Tue Jun 25 09:49:46 2024 +0200 Commit: Jaume Pujantell <[email protected]> CommitDate: Tue Jul 2 11:26:56 2024 +0200 lok calc: allow copy hyperlink outside of edit mode Right now .uno:CopyHyperlinkLocation only works on edit mode or inside a draw object, but LOK_CALLBACK_HYPERLINK_CLICKED is dispatched outside of edit mode and the copy command from the pop-up is ignored. Since there is no text cursor, the position of the hyperlink is needed to discriminate the correct field, since there could be multiple hyperlink fields inside the same cell. Change-Id: If545cf56e631adcdb914c4e799a309bc8bd0422f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169507 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 0533474cb0188aede59841bf4d547106949f2760) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169728 Reviewed-by: Szymon Kłos <[email protected]> diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index c46aa83b7349..f01bf7e93a64 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -182,6 +182,7 @@ interface CellSelection SID_PASTE_TEXTIMPORT_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_EXTERNAL_SOURCE [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + SID_COPY_HYPERLINK_LOCATION [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] FID_MERGE_ON [ ExecMethod = Execute; StateMethod = GetState; ] FID_MERGE_OFF [ ExecMethod = Execute; StateMethod = GetState; ] FID_MERGE_TOGGLE [ ExecMethod = Execute; StateMethod = GetState; ] diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index f7a64cafb86b..a2b8783fbac7 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -292,9 +292,6 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::DocWindow, public DropTarget void DrawHiddenIndicator( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext); void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, vcl::RenderContext& rRenderContext); - bool GetEditUrl( const Point& rPos, - OUString* pName=nullptr, OUString* pUrl=nullptr, OUString* pTarget=nullptr ); - bool HitRangeFinder( const Point& rMouse, RfCorner& rCorner, sal_uInt16* pIndex, SCCOL* pAddX, SCROW* pAddY ); @@ -391,6 +388,9 @@ public: /// Get the cell selection, coordinates are in logic units. void GetCellSelection(std::vector<tools::Rectangle>& rLogicRects); + bool GetEditUrl(const Point& rPos, OUString* pName = nullptr, OUString* pUrl = nullptr, + OUString* pTarget = nullptr); + virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; void FakeButtonUp(); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 1a866df3c881..25d7962f8ba4 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -295,6 +295,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) break; case SID_COPY: // copy + case SID_COPY_HYPERLINK_LOCATION: // not editable because of matrix only? Do not damage matrix //! is not called, when protected AND matrix, we will have //! to live with this... is caught in Copy-Routine, otherwise diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 500ad80f0781..7ef0b67efc8a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -35,6 +35,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <vcl/commandinfoprovider.hxx> +#include <vcl/unohelp2.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <svx/svxdlg.hxx> @@ -3196,6 +3197,29 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_COPY_HYPERLINK_LOCATION: + { + ScViewData& rData = GetViewData(); + ScGridWindow* pWindow = rData.GetActiveWin(); + const SfxInt32Item* pPosX = rReq.GetArg<SfxInt32Item>(FN_PARAM_1); + const SfxInt32Item* pPosY = rReq.GetArg<SfxInt32Item>(FN_PARAM_2); + if (pWindow && pPosX && pPosY) + { + const Point aPoint(pPosX->GetValue() * rData.GetPPTX(), + pPosY->GetValue() * rData.GetPPTY()); + OUString aName, aUrl; + if (pWindow->GetEditUrl(aPoint, &aName, &aUrl)) + { + uno::Reference<datatransfer::clipboard::XClipboard> xClipboard + = pWindow->GetClipboard(); + vcl::unohelper::TextDataObject::CopyStringTo(aUrl, xClipboard, + rData.GetViewShell()); + rReq.Done(); + } + } + } + break; + default: OSL_FAIL("incorrect slot in ExecuteEdit"); break; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 85816c5636b9..f7a9bd78108b 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2615,7 +2615,9 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) OString aCursor = pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY); double fPPTX = pViewShell->GetViewData().GetPPTX(); int mouseX = aPos.X() / fPPTX; - OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + ", " + OString::number(mouseX)); + int mouseY = aPos.Y() / fPPTX; + OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + ", " + + OString::number(mouseX) + ", " + OString::number(mouseY)); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); } else ScGlobal::OpenURL(aUrl, aTarget); @@ -2740,9 +2742,10 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if (pViewShell && nPosX == m_nDownPosX && nPosY == m_nDownPosY && GetEditUrl(aPos, &aName, &aUrl, &aTarget)) { - OString aMsg(aUrl.toUtf8() + " coordinates: " + - pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + - OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX())); + OString aMsg(aUrl.toUtf8() + " coordinates: " + + pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + + OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX()) + ", " + + OString::number(aPos.Y() / pViewShell->GetViewData().GetPPTY())); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); } } diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 182dcaca55c4..4d3fc88df97f 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -12424,6 +12424,7 @@ SfxVoidItem RemoveHyperlink SID_REMOVE_HYPERLINK ] SfxVoidItem CopyHyperlinkLocation SID_COPY_HYPERLINK_LOCATION +(SfxInt32Item PositionX FN_PARAM_1, SfxInt32Item PositionY FN_PARAM_2) [ AutoUpdate = FALSE, FastCall = FALSE, commit ae6067a77430f111a19f9ab912ff9c62d9ab722e Author: Mike Kaganski <[email protected]> AuthorDate: Fri May 31 14:29:02 2024 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Tue Jul 2 07:34:43 2024 +0200 LOK: Disable map mode in DrawViewShell's ctor This allows to use views other than normal and master (these two use the same shell, and are initialized in SdXImpressDocument::initializeForTiledRendering). Change-Id: I52f3ce46738f9feca1a16d008efca76cb478dceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168286 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit 94160cabee03ad1ea96bc28060d52f7b357df947) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169819 Tested-by: Mike Kaganski <[email protected]> Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 9572561482f1..df068e72c665 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -137,6 +137,17 @@ DrawViewShell::DrawViewShell( ViewShellBase& rViewShellBase, vcl::Window* pParen -e ... etc. - the rest is truncated
