basic/source/runtime/methods.cxx | 8 ++ configmgr/source/partial.cxx | 2 cui/source/options/optdict.cxx | 4 - desktop/source/lib/init.cxx | 35 ++++++++ filter/source/t602/t602filter.cxx | 4 - include/svtools/ehdl.hxx | 10 +- include/svx/ehdl.hxx | 24 ++++++ sax/source/tools/CachedOutputStream.hxx | 11 +- sc/source/ui/drawfunc/fuins2.cxx | 5 - sc/source/ui/view/cellsh1.cxx | 5 - sc/uiconfig/scalc/ui/conditionaleasydialog.ui | 2 sd/source/ui/func/fuhhconv.cxx | 5 - sd/source/ui/func/futhes.cxx | 4 - sfx2/source/doc/objstor.cxx | 3 sfx2/source/doc/sfxbasemodel.cxx | 39 +++++----- svtools/source/misc/ehdl.cxx | 17 ++-- svx/Library_svx.mk | 1 svx/source/items/ehdl.cxx | 21 +++++ svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 9 +- svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx | 2 sw/source/core/layout/paintfrm.cxx | 13 ++- sw/source/filter/ww8/wrtw8nds.cxx | 23 +++-- sw/source/uibase/config/usrpref.cxx | 15 ++- sw/source/uibase/shells/annotsh.cxx | 5 - sw/source/uibase/table/chartins.cxx | 6 - sw/source/uibase/uiview/viewling.cxx | 12 +-- sw/source/uibase/wrtsh/wrtsh1.cxx | 10 ++ 27 files changed, 199 insertions(+), 96 deletions(-)
New commits: commit d639cbb95a28d3009a49316c8033f0a83b674ef7 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jan 29 17:36:37 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 avoid uno_type_sequence_construct cost Change-Id: I5ef2d5d0b88fdffa1e425ffb182586a897858fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180916 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit c82deb94f78d303fe82b4d689941028f0cb36184) diff --git a/sax/source/tools/CachedOutputStream.hxx b/sax/source/tools/CachedOutputStream.hxx index c66231140fbb..873ed51fe06a 100644 --- a/sax/source/tools/CachedOutputStream.hxx +++ b/sax/source/tools/CachedOutputStream.hxx @@ -11,6 +11,7 @@ #define INCLUDED_SAX_SOURCE_TOOLS_CACHEDOUTPUTSTREAM_HXX #include <sal/types.h> +#include <rtl/byteseq.hxx> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/uno/Sequence.hxx> @@ -34,7 +35,7 @@ class CachedOutputStream /// ForMerge structure is used for sorting elements in Writer std::shared_ptr< ForMergeBase > mpForMerge; - const css::uno::Sequence<sal_Int8> mpCache; + const rtl::ByteSequence maCache; /// Output stream, usually writing data into files. css::uno::Reference< css::io::XOutputStream > mxOutputStream; uno_Sequence *pSeq; @@ -42,8 +43,8 @@ class CachedOutputStream bool mbWriteToOutStream; public: - CachedOutputStream() : mpCache(mnMaximumSize) - , pSeq(mpCache.get()) + CachedOutputStream() : maCache(mnMaximumSize, rtl::BYTESEQ_NODEFAULT) + , pSeq(maCache.get()) , mnCacheWrittenSize(0) , mbWriteToOutStream(true) {} @@ -103,9 +104,9 @@ public: // resize the Sequence to written size pSeq->nElements = mnCacheWrittenSize; if (mbWriteToOutStream) - mxOutputStream->writeBytes( mpCache ); + mxOutputStream->writeBytes( css::uno::toUnoSequence(maCache) ); else - mpForMerge->append( mpCache ); + mpForMerge->append( css::uno::toUnoSequence(maCache) ); // and next time write to the beginning mnCacheWrittenSize = 0; } commit 0ccd81f416e00dd2aa475d398d0c6414ba4321e3 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jan 30 12:11:10 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 disable SbRtl_Shell by default in kit-mode Change-Id: I645c776bf59a718f4946c2c70edd9194f039e471 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180942 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit a6599458af8e3f2e4758aaef92bfd34b41b36ead) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 2b21da473676..c61bba9062f7 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -44,6 +44,7 @@ #include <rtl/string.hxx> #include <sal/log.hxx> #include <comphelper/DirectoryHelper.hxx> +#include <comphelper/lok.hxx> #include <runtime.hxx> #include <sbunoobj.hxx> @@ -3396,6 +3397,13 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool) } else { + // Just go straight to error in this case + if (comphelper::LibreOfficeKit::isActive()) + { + StarBASIC::Error(ERRCODE_BASIC_FILE_NOT_FOUND); + return; + } + oslProcessOption nOptions = osl_Process_SEARCHPATH | osl_Process_DETACHED; OUString aCmdLine = rPar.Get(1)->GetOUString(); commit 7b47beb3d98cf2ceedb2cf62817e35f2bbf9a749 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jan 30 14:33:39 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 ucbhelper::Content can do nothing with a "private:stream" so don't bother, and skip throwing exceptions in this case Change-Id: Ie5f4dc5fb24f117be7e671dc83766c7804a98005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180950 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit e8fe17a10aaccb3c73e4e3e9cc6883243af09fff) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 42f496fe53d6..8b73bbc5ae98 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2143,7 +2143,8 @@ bool SfxObjectShell::SaveTo_Impl aLockUIGuard.Unlock(); pImpl->bForbidReload = bOldStat; - if ( bOk ) + // ucbhelper::Content is unable to do anything useful with a private:stream + if (bOk && !rMedium.GetName().equalsIgnoreAsciiCase("private:stream")) { try { diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7ecfd1d9a60c..c0b143c290ca 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4054,27 +4054,30 @@ OUString SAL_CALL SfxBaseModel::getTitle() SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); if ( pMedium ) { - try { - ::ucbhelper::Content aContent( pMedium->GetName(), - utl::UCBContentHelper::getDefaultCommandEnvironment(), - comphelper::getProcessComponentContext() ); - const Reference < beans::XPropertySetInfo > xProps - = aContent.getProperties(); - if ( xProps.is() ) - { - static constexpr OUString aServerTitle( u"TitleOnServer"_ustr ); - if ( xProps->hasPropertyByName( aServerTitle ) ) + if (!pMedium->GetName().equalsIgnoreAsciiCase("private:stream")) + { + try { + ::ucbhelper::Content aContent( pMedium->GetName(), + utl::UCBContentHelper::getDefaultCommandEnvironment(), + comphelper::getProcessComponentContext() ); + const Reference < beans::XPropertySetInfo > xProps + = aContent.getProperties(); + if ( xProps.is() ) { - Any aAny = aContent.getPropertyValue( aServerTitle ); - aAny >>= aResult; + static constexpr OUString aServerTitle( u"TitleOnServer"_ustr ); + if ( xProps->hasPropertyByName( aServerTitle ) ) + { + Any aAny = aContent.getPropertyValue( aServerTitle ); + aAny >>= aResult; + } } } - } - catch (const ucb::ContentCreationException &) - { - } - catch (const ucb::CommandAbortedException &) - { + catch (const ucb::ContentCreationException &) + { + } + catch (const ucb::CommandAbortedException &) + { + } } if (pMedium->IsRepairPackage()) aResult += SfxResId(STR_REPAIREDDOCUMENT); commit be58f9ea0d9e5202739c89f31527d7c7da35fa91 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Jan 27 11:14:46 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 We don't need to broadcast these GrabBag changes no need to redo any layout, etc due to these Change-Id: Id0d849221527db26b196f07865722d450093f13c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180778 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit eb568de67b0671ac93d84ee8fbb659408b7e6d4a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180823 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit d280912840d8a459e96c5fc0fbd9fc97cff28432) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 314a2510fe07..8fc024b53975 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -3463,6 +3463,17 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode ) } } +// don't need to broadcast modification +static void SetAttrNoBroadcast(SwContentNode& rNode, const SfxPoolItem& rItem) +{ + const bool bModifyNotifyDisabled = rNode.IsModifyLocked(); + if (!bModifyNotifyDisabled) + rNode.LockModify(); + rNode.SetAttr(rItem); + if (!bModifyNotifyDisabled) + rNode.UnlockModify(); +} + // tdf#121561: During export of the ODT file with TOC inside into DOCX format, // the TOC title is being exported as regular paragraph. We should surround it // with <w:sdt><w:sdtPr><w:sdtContent> to make it (TOC title) recognizable @@ -3525,7 +3536,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect std::map<OUString, css::uno::Any>{{ u"SdtPr"_ustr, uno::Any(aSdtPrPropertyValues) }}); // set new attr to node - const_cast<SwContentNode*>(pNode)->SetAttr(aGrabBag); + SetAttrNoBroadcast(*const_cast<SwContentNode*>(pNode), aGrabBag); } // set flag for the next node after TOC @@ -3541,7 +3552,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect std::map<OUString, css::uno::Any>{{u"ParaSdtEndBefore"_ustr, uno::Any(true)}}); // set new attr to node - const_cast<SwContentNode*>(pNodeAfterToc)->SetAttr(aGrabBag); + SetAttrNoBroadcast(*const_cast<SwContentNode*>(pNodeAfterToc), aGrabBag); } } } commit 024b8f071d6976a48e46f260fe81d984f7fe0f7c Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Jan 24 15:49:03 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 We can use the PoolItem SetAttr rather than create an entire SfxItemSet presumably at least Change-Id: Ib8238322d64f91c0f64606c51806ace96696aa71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180777 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 4c1c507e5efffdf076ff21b5d49f70ec550a9c5e) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 622ad906b992..314a2510fe07 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -3524,12 +3524,8 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect SfxGrabBagItem aGrabBag(RES_PARATR_GRABBAG, std::map<OUString, css::uno::Any>{{ u"SdtPr"_ustr, uno::Any(aSdtPrPropertyValues) }}); - // create temp attr set - SwAttrSet aSet(pNode->GetSwAttrSet()); - aSet.Put(aGrabBag); - // set new attr to node - const_cast<SwContentNode*>(pNode)->SetAttr(aSet); + const_cast<SwContentNode*>(pNode)->SetAttr(aGrabBag); } // set flag for the next node after TOC @@ -3544,12 +3540,8 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect SfxGrabBagItem aGrabBag(RES_PARATR_GRABBAG, std::map<OUString, css::uno::Any>{{u"ParaSdtEndBefore"_ustr, uno::Any(true)}}); - // create temp attr set - SwAttrSet aSet(pNodeAfterToc->GetSwAttrSet()); - aSet.Put(aGrabBag); - // set new attr to node - const_cast<SwContentNode*>(pNodeAfterToc)->SetAttr(aSet); + const_cast<SwContentNode*>(pNodeAfterToc)->SetAttr(aGrabBag); } } } commit 7c4b87ddd6615afaadd93ffbc46d525c7dfd780e Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Jan 27 09:45:42 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 Resolves: cool#10952 use existing ComponentContext instead of unnecessarily bootstrapping an entirely new one See: https://github.com/CollaboraOnline/online/issues/10952 Change-Id: I625c539eb7272e152ee84a568f235751128bd96a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180775 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 2608fa7cbe8b3ca6d66fce03e6c592a905103e33) diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index 85c7fa0ba773..94c52f52bb0a 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -21,7 +21,6 @@ #include <strings.hrc> #include <cppuhelper/factory.hxx> -#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -30,6 +29,7 @@ #include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <comphelper/processfactory.hxx> #include <osl/diagnose.h> #include <rtl/ref.hxx> #include <rtl/character.hxx> @@ -883,7 +883,7 @@ bool T602ImportFilterDialog::OptionsDlg() any <<= _obj;\ _cont->insertByName( _nam, any ); - Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext(); + Reference < XComponentContext > rComponentContext = ::comphelper::getProcessComponentContext(); Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager(); Reference < XInterface > rInstance = rServiceManager->createInstanceWithContext(u"com.sun.star.awt.UnoControlDialogModel"_ustr, rComponentContext ); diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index a44532a05907..cc373117bfa2 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -57,7 +57,6 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> -#include <cppuhelper/bootstrap.hxx> #include <svtools/dialogclosedlistener.hxx> #include <officecfg/Office/Common.hxx> @@ -628,9 +627,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV rViewShell.ActivateObject(pObj.get(), embed::EmbedVerbs::MS_OLEVERB_SHOW); //open wizard - //@todo get context from calc if that has one - uno::Reference< uno::XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if(xContext.is()) { uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 3e1ca33cf55c..d270fcfa5b00 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -27,6 +27,7 @@ #include <basic/sberrors.hxx> #include <comphelper/lok.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <svl/stritem.hxx> #include <svl/numformat.hxx> @@ -95,7 +96,6 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/bootstrap.hxx> #include <o3tl/string_view.hxx> #include <memory> @@ -2004,8 +2004,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_CHINESE_CONVERSION: { //open ChineseTranslationDialog - Reference< XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if(xContext.is()) { Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() ); diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx index 95908e2e72b0..be40d46eea63 100644 --- a/sd/source/ui/func/fuhhconv.cxx +++ b/sd/source/ui/func/fuhhconv.cxx @@ -24,8 +24,8 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> -#include <cppuhelper/bootstrap.hxx> #include <svl/style.hxx> #include <editeng/eeitem.hxx> #include <editeng/langitem.hxx> @@ -187,8 +187,7 @@ void FuHangulHanjaConversion::ConvertStyles( LanguageType nTargetLanguage, const void FuHangulHanjaConversion::StartChineseConversion() { //open ChineseTranslationDialog - Reference< XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if(!xContext.is()) return; diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index d2abde7d9675..4f3be7e3cd5e 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -19,7 +19,6 @@ #include "chinese_dictionarydialog.hxx" -#include <cppuhelper/bootstrap.hxx> #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp> #include <com/sun/star/linguistic2/ConversionPropertyType.hpp> @@ -27,6 +26,7 @@ #include <com/sun/star/linguistic2/XConversionPropertyType.hpp> #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/lang/Locale.hpp> +#include <comphelper/processfactory.hxx> #include <o3tl/safeint.hxx> #include <unotools/lingucfg.hxx> #include <unotools/linguprops.hxx> @@ -326,11 +326,10 @@ ChineseDictionaryDialog::ChineseDictionaryDialog(weld::Window* pParent) Reference< linguistic2::XConversionDictionary > xDictionary_To_Traditional; //get dictionaries { - if(!m_xContext.is()) - m_xContext.set( ::cppu::defaultBootstrap_InitialComponentContext() ); - if(m_xContext.is()) + css::uno::Reference<css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); + if (xContext.is()) { - Reference< linguistic2::XConversionDictionaryList > xDictionaryList = linguistic2::ConversionDictionaryList::create(m_xContext); + Reference< linguistic2::XConversionDictionaryList > xDictionaryList = linguistic2::ConversionDictionaryList::create(xContext); Reference< container::XNameContainer > xContainer( xDictionaryList->getDictionaryContainer() ); if(xContainer.is()) { diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index fc05f397693d..53931f34706d 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -138,8 +138,6 @@ private: private: sal_Int32 m_nTextConversionOptions; //i18n::TextConversionOption - css::uno::Reference<css::uno::XComponentContext> m_xContext; - std::unique_ptr<weld::RadioButton> m_xRB_To_Simplified; std::unique_ptr<weld::RadioButton> m_xRB_To_Traditional; diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 0231546f1504..55d489bf7468 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -96,8 +96,8 @@ #include <swabstdlg.hxx> #include <comphelper/string.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> -#include <cppuhelper/bootstrap.hxx> #include <langhelper.hxx> @@ -1363,8 +1363,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) case SID_CHINESE_CONVERSION: { //open ChineseTranslationDialog - Reference< XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if(xContext.is()) { Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() ); diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index cb10778be9bb..f7290820da35 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -36,7 +36,7 @@ #include <cmdid.h> #include <anchoredobject.hxx> -#include <cppuhelper/bootstrap.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Size.hpp> @@ -159,9 +159,7 @@ SwInsertChart::SwInsertChart( const Link<css::ui::dialogs::DialogClosedEvent*, v xChartModel.set( SwTableFUNC( &rWrtShell ).InsertChart( xDataProvider, xDataProvider.is(), aRangeString, &pFlyFrameFormat )); //open wizard - //@todo get context from writer if that has one - uno::Reference< uno::XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if( !(xContext.is() && xChartModel.is() && xDataProvider.is())) return; diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 34a579b21fcd..ef7c2dfbc77c 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -76,7 +76,6 @@ #include <vcl/unohelp.hxx> #include <rtl/ustring.hxx> -#include <cppuhelper/bootstrap.hxx> #include <svtools/langtab.hxx> #include <editeng/editerr.hxx> @@ -107,8 +106,7 @@ void SwView::ExecLingu(SfxRequest &rReq) case SID_CHINESE_CONVERSION: { //open ChineseTranslationDialog - Reference< XComponentContext > xContext( - ::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); if(xContext.is()) { Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() ); commit 133d4c5ddd455ab34a049370697c551978b52c2a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jan 15 20:18:13 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:45 2025 +0000 defer creating std::locale until it is needed (if ever, seeing as it's only required if there is an error) Change-Id: Id8ba5ff495dfd2048401231023a09abba9bbf785 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180303 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit ec366ca472b65afd26cbd90da78940a353f5e2a4) diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index f383280e5bc9..98a3840ffbef 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -20,6 +20,7 @@ #include <editeng/unolingu.hxx> #include <o3tl/safeint.hxx> #include <svx/dialmgr.hxx> +#include <svx/ehdl.hxx> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/linguistic2/XDictionary.hpp> #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> @@ -183,8 +184,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, weld::Button&, void) { m_xNewDic = nullptr; // error: couldn't create new dictionary - SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(), - m_xDialog.get(), RID_SVXERRCTX, SvxResLocale() ); + SvxErrorContext aContext(ERRCTX_SVX_LINGU_DICTIONARY, OUString(), m_xDialog.get()); ErrorHandler::HandleError( ErrCodeMsg( ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) ); m_xDialog->response(RET_CANCEL); diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx index 1e70ee1ca55e..a8e7481e8c92 100644 --- a/include/svtools/ehdl.hxx +++ b/include/svtools/ehdl.hxx @@ -29,21 +29,21 @@ SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRCTX[]; namespace weld { class Window; } -class SVT_DLLPUBLIC SfxErrorContext final : private ErrorContext +class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext { public: SfxErrorContext( sal_uInt16 nCtxIdP, weld::Window *pWin=nullptr, - const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); + const ErrMsgCode* pIds = nullptr); SfxErrorContext( sal_uInt16 nCtxIdP, OUString aArg1, weld::Window *pWin=nullptr, - const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); + const ErrMsgCode* pIds = nullptr); bool GetString(const ErrCodeMsg& nErrId, OUString &rStr) override; - +private: + virtual OUString Translate(TranslateId aId) const; private: sal_uInt16 nCtxId; const ErrMsgCode* pIds; - std::locale aResLocale; OUString aArg1; }; diff --git a/include/svx/ehdl.hxx b/include/svx/ehdl.hxx new file mode 100644 index 000000000000..553f8420396f --- /dev/null +++ b/include/svx/ehdl.hxx @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <svx/svxdllapi.h> +#include <svtools/ehdl.hxx> + +class SVX_DLLPUBLIC SvxErrorContext : public SfxErrorContext +{ +public: + SvxErrorContext(sal_uInt16 nCtxIdP, OUString aArg1, weld::Window* pWin); + +private: + virtual OUString Translate(TranslateId aId) const; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx index 4c5cfedca69c..b77921830b51 100644 --- a/sd/source/ui/func/futhes.cxx +++ b/sd/source/ui/func/futhes.cxx @@ -21,6 +21,7 @@ #include <editeng/outliner.hxx> #include <sfx2/request.hxx> +#include <svx/ehdl.hxx> #include <svx/svdobj.hxx> #include <svx/svdotext.hxx> #include <editeng/eeitem.hxx> @@ -62,8 +63,7 @@ rtl::Reference<FuPoor> FuThesaurus::Create( ViewShell* pViewSh, ::sd::Window* pW void FuThesaurus::DoExecute(SfxRequest& rReq) { - SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(), - mpWindow->GetFrameWeld(), RID_SVXERRCTX, SvxResLocale()); + SvxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(), mpWindow->GetFrameWeld()); if (dynamic_cast< DrawViewShell *>( mpViewShell )) { diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index e740055a65df..f84ae9dfcc37 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -230,8 +230,8 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, OUString &rStr) const } SfxErrorContext::SfxErrorContext( - sal_uInt16 nCtxIdP, weld::Window *pWindow, const ErrMsgCode* pIdsP, const std::locale& rResLocaleP) -: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), aResLocale(rResLocaleP) + sal_uInt16 nCtxIdP, weld::Window *pWindow, const ErrMsgCode* pIdsP) +: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP) { if (!pIds) pIds = RID_ERRCTX; @@ -240,14 +240,19 @@ SfxErrorContext::SfxErrorContext( SfxErrorContext::SfxErrorContext( sal_uInt16 nCtxIdP, OUString aArg1P, weld::Window *pWindow, - const ErrMsgCode* pIdsP, const std::locale& rResLocaleP) -: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), aResLocale(rResLocaleP), + const ErrMsgCode* pIdsP) +: ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), aArg1(std::move(aArg1P)) { if (!pIds) pIds = RID_ERRCTX; } +OUString SfxErrorContext::Translate(TranslateId aId) const +{ + return SvtResId(aId); +} + bool SfxErrorContext::GetString(const ErrCodeMsg& nErr, OUString &rStr) /* [Description] @@ -261,7 +266,7 @@ bool SfxErrorContext::GetString(const ErrCodeMsg& nErr, OUString &rStr) { if (sal_uInt32(pItem->second) == nCtxId) { - rStr = Translate::get(pItem->first, aResLocale); + rStr = Translate(pItem->first); rStr = rStr.replaceAll("$(ARG1)", aArg1); bRet = true; break; @@ -277,7 +282,7 @@ bool SfxErrorContext::GetString(const ErrCodeMsg& nErr, OUString &rStr) { if (sal_uInt32(pItem->second) == nId) { - rStr = rStr.replaceAll("$(ERR)", Translate::get(pItem->first, aResLocale)); + rStr = rStr.replaceAll("$(ERR)", Translate(pItem->first)); break; } } diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index cddde28842eb..4dd372c5bda4 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/form/tbxform \ svx/source/items/algitem \ svx/source/items/autoformathelper \ + svx/source/items/ehdl \ svx/source/items/hlnkitem \ svx/source/items/numfmtsh \ svx/source/items/legacyitem \ diff --git a/svx/source/items/ehdl.cxx b/svx/source/items/ehdl.cxx new file mode 100644 index 000000000000..4cf6c4d3fa1c --- /dev/null +++ b/svx/source/items/ehdl.cxx @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include <svx/dialmgr.hxx> +#include <svx/ehdl.hxx> +#include <svx/svxerr.hxx> + +SvxErrorContext::SvxErrorContext(sal_uInt16 nCtxIdP, OUString aArgOne, weld::Window* pWin) + : SfxErrorContext(nCtxIdP, aArgOne, pWin, RID_SVXERRCTX) +{ +} + +OUString SvxErrorContext::Translate(TranslateId aId) const { return SvxResId(aId); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 0a237988fed0..34a579b21fcd 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -31,11 +31,11 @@ #include <comphelper/scopeguard.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/weld.hxx> -#include <svtools/ehdl.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/request.hxx> #include <svx/dialmgr.hxx> +#include <svx/ehdl.hxx> #include <svx/svxerr.hxx> #include <svx/svxdlg.hxx> #include <osl/diagnose.h> @@ -409,8 +409,7 @@ void SwView::HyphenateDocument() return; } - SfxErrorContext aContext( ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin->GetFrameWeld(), - RID_SVXERRCTX, SvxResLocale() ); + SvxErrorContext aContext(ERRCTX_SVX_LINGU_HYPHENATION, OUString(), m_pEditWin->GetFrameWeld()); Reference< XHyphenator > xHyph( ::GetHyphenator() ); if (!xHyph.is()) @@ -533,8 +532,7 @@ void SwView::StartThesaurus() if (!IsValidSelectionForThesaurus()) return; - SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin->GetFrameWeld(), - RID_SVXERRCTX, SvxResLocale() ); + SvxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(), m_pEditWin->GetFrameWeld()); // Determine language LanguageType eLang = m_pWrtShell->GetCurLang(); commit df0c22a49e5370c36cbf7fccbf33fae626525daa Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Dec 20 16:26:59 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 use member init list and initialize before member Loads Change-Id: Iaca646e1a36b20adb29b5ff25649d08fc7055e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178958 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 25de0024cb97b8cb0f92e33ab48267954c676644) diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 0dd805faf57d..212b7fa02832 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -43,10 +43,21 @@ void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy) *static_cast<SwViewOption*>(this) = rCopy; } +static FieldUnit lclGetFieldUnit() +{ + if (comphelper::IsFuzzing()) + return FieldUnit::CM; + MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); + return MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; +} + SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : m_eFieldUpdateFlags(AUTOUPD_OFF), m_nLinkUpdateMode(0), + m_eUserMetric(lclGetFieldUnit()), + m_eHScrollMetric(m_eUserMetric), m_bIsHScrollMetricSet(false), + m_eVScrollMetric(m_eUserMetric), m_bIsVScrollMetricSet(false), m_nDefTabInMm100( 2000 ), // 2 cm m_bIsSquaredPageMode(false), @@ -64,16 +75,12 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) : { if (comphelper::IsFuzzing()) { - m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric = FieldUnit::CM; // match defaults SetCore2Option(true, ViewOptCoreFlags2::CursorInProt); SetCore2Option(false, ViewOptCoreFlags2::HiddenPara); m_nDefTabInMm100 = 1250; return; } - MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - m_eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; - m_eHScrollMetric = m_eVScrollMetric = m_eUserMetric; m_aLayoutConfig.Load(); m_aCursorConfig.Load(); commit ffd35bdfaa73de6f65811e3eb2081e334cff7de8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Nov 26 20:24:56 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 add a way to update config from kit arg is a path to a "presets" dir similar to instdir/presets/ where autotext/wordbook/xcu may exist initially just update xcu if that is present, autotext itself typically is updated dynamically if a new file is found, while wordbooks are not and the diclist can be explicitly reinitialized here if there are wordbooks. Change-Id: Ibeb9d23d143c710f12e6c9d75b2861e0e6d44a01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177372 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 30f83f2dff9f80db0b4a467fb30f9a9b2531fa3c) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f8f4e585bd06..06729ea3c92f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -111,6 +111,7 @@ #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> +#include <com/sun/star/configuration/Update.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> #include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp> #include <com/sun/star/datatransfer/XTransferable2.hpp> @@ -5237,6 +5238,36 @@ static void lo_sendDialogEvent(LibreOfficeKit* /*pThis*/, unsigned long long int lcl_sendDialogEvent(nWindowId, pArguments); } +static void updateConfig(const OUString& rConfigPath) +{ + osl::Directory aScanRootDir(rConfigPath); + osl::FileBase::RC nRetCode = aScanRootDir.open(); + if (nRetCode != osl::Directory::E_None) + { + SAL_WARN("lok", "Failed to open config URL: " << rConfigPath); + return; + } + osl::DirectoryItem item; + osl::File::RC errorNext = osl::File::E_None; + while ((errorNext = aScanRootDir.getNextItem(item)) == ::osl::File::E_None) + { + osl::FileStatus stat(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL); + if (item.getFileStatus(stat) != osl::FileBase::E_None) + { + SAL_WARN("lok", "Failed to get directory item info"); + continue; + } + + OUString sFileName = stat.getFileName(); + if (sFileName == "xcu") + { + OUString aXcuPath(stat.getFileURL() + "/config.xcu"); + auto xUpdate(css::configuration::Update::get(comphelper::getProcessComponentContext())); + xUpdate->insertModificationXcuFile(aXcuPath, { u"/"_ustr }, {}); + } + } +} + static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const char* pValue) { static char* pCurrentSalLogOverride = nullptr; @@ -5267,6 +5298,10 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c else sal_detail_set_log_selector(pCurrentSalLogOverride); } + else if (strcmp(pOption, "addconfig") == 0) + { + updateConfig(OUString(pValue, strlen(pValue), RTL_TEXTENCODING_UTF8)); + } #ifdef LINUX else if (strcmp(pOption, "addfont") == 0) { commit a383d5a50a40db7ef0041a1ac21ee554786c7c24 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Dec 16 14:09:12 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 let insertModificationXcuFile accept "/" to indicate all nodes insertModificationXcuFile takes a set of paths to include and a set of paths to ignore from a given .xcu files adapt this to allow an include path of "/" to match all contents of the xcu. insertModificationXcuFile is more useful than insertExtensionXcuFile for the intended use case, because the latter inserts as an extension level layer, and cannot override higher layers. Change-Id: I8eabd9fb91184146a75b087cc31cee44f378d96d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178595 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 7a980e930d0fe0b5e93750afb141ae216543339c) diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx index 89643cb7ceb9..b7eecfefd632 100644 --- a/configmgr/source/partial.cxx +++ b/configmgr/source/partial.cxx @@ -72,7 +72,7 @@ Partial::Partial( for (Node * p = &root_;;) { OUString seg; bool end = parseSegment(includedPath, &n, &seg); - p = &p->children[seg]; + p = !seg.isEmpty() ? &p->children[seg] : p; if (p->startInclude) { break; } commit 1addd323cbaff259e785b811a6ba97383d2364a7 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Dec 13 16:27:32 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 Get the style color and number just once Change-Id: I4dfa6feb1f41f9c62bd025ff521adc011c655926 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178453 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 68486df83780..a24963e7afca 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4576,15 +4576,18 @@ void SwTextFrame::PaintParagraphStylesHighlighting() const pRenderContext->Push(vcl::PushFlags::ALL); - pRenderContext->SetFillColor(rParaStylesColorMap[sStyleName].first); - pRenderContext->SetLineColor(rParaStylesColorMap[sStyleName].first); + Color nStyleColor = rParaStylesColorMap[sStyleName].first; + int nStyleNumber = rParaStylesColorMap[sStyleName].second; + + pRenderContext->SetFillColor(nStyleColor); + pRenderContext->SetLineColor(nStyleColor); pRenderContext->DrawRect(aRect); // draw hatch pattern if paragraph has direct formatting if (SwDoc::HasParagraphDirectFormatting(SwPosition(*GetTextNodeForParaProps()))) { - Color aHatchColor(rParaStylesColorMap[sStyleName].first); + Color aHatchColor(nStyleColor); // make hatch line color 41% darker than the fill color aHatchColor.ApplyTintOrShade(-4100); Hatch aHatch(HatchStyle::Single, aHatchColor, 50, 450_deg10); @@ -4593,8 +4596,8 @@ void SwTextFrame::PaintParagraphStylesHighlighting() const pRenderContext->SetFont(aFont); pRenderContext->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); - pRenderContext->SetTextFillColor(rParaStylesColorMap[sStyleName].first); - pRenderContext->DrawText(aRect, OUString::number(rParaStylesColorMap[sStyleName].second), + pRenderContext->SetTextFillColor(nStyleColor); + pRenderContext->DrawText(aRect, OUString::number(nStyleNumber), DrawTextFlags::Center | DrawTextFlags::VCenter); pRenderContext->Pop(); commit 0d3ce6a639ce5c6c904ea4d8fe4f3e7f48205ec8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Dec 11 16:24:00 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 Defer broadcast of postit field update from layout until oTextPara has been applied to the field's associated postit window. This became a noticeable problem since: commit 2fba6df7242586870988b62909156538b42c2bc0 CommitDate: Thu Dec 5 15:31:06 2024 +0100 LOK: don't recreate the dialogs of an old view when loading new views In the broken situation the contents of the postit are sent back to kit as apparently empty, so newly inserted comments appear to be empty. The broadcast bt of this scenario is: #0 sw::annotation::SwAnnotationWin::GetSimpleHtml (this=0x19f38790) at sw/source/uibase/docvw/AnnotationWin.cxx:516 #1 0x00007f37d246283e in (anonymous namespace)::lcl_CommentNotification (pView=0x267cac40, nType=(anonymous namespace)::CommentNotificationType::Add, pItem=0x26baf4e0, nPostItId=0) at sw/source/uibase/docvw/PostItMgr.cxx:176 #2 0x00007f37d2467fef in SwPostItMgr::LayoutPostIts (this=0x266d7160) at sw/source/uibase/docvw/PostItMgr.cxx:1084 #3 0x00007f37d209dd1b in SwViewShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:1326 #4 0x00007f37d119030d in SwCursorShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/crsr/crsrsh.cxx:1788 #5 0x00007f37d276478b in SwView::SetVisArea (this=0x267cac40, rRect=..., bUpdateScrollbar=true) at sw/source/uibase/uiview/viewport.cxx:249 #6 0x00007f37d2764cc3 in SwView::SetVisArea (this=0x267cac40, rPt=..., bUpdateScrollbar=true) at sw/source/uibase/uiview/viewport.cxx:311 #7 0x00007f37d2765e2e in SwView::Scroll (this=0x267cac40, rRect=..., nRangeX=65535, nRangeY=65535) at sw/source/uibase/uiview/viewport.cxx:495 #8 0x00007f37d24d7708 in ScrollMDI (pVwSh=0x267cce90, rRect=..., nRangeX=65535, nRangeY=65535) at sw/source/uibase/docvw/edtwin3.cxx:41 #9 0x00007f37d209a896 in SwViewShell::MakeVisible (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:665 #10 0x00007f37d119a238 in SwCursorShell::MakeSelVisible (this=0x267cce90) at sw/source/core/crsr/crsrsh.cxx:3490 #11 0x00007f37d1837671 in SwFEShell::MakeSelVisible (this=0x267cce90) at sw/source/core/frmedt/feshview.cxx:2677 #12 0x00007f37d1192fcc in SwCursorShell::UpdateCursor (this=0x267cce90, eFlags=6, bIdleEnd=false) at sw/source/core/crsr/crsrsh.cxx:2345 #13 0x00007f37d11886f9 in SwCursorShell::EndAction (this=0x267cce90, bIdleEnd=false) at sw/source/core/crsr/crsrsh.cxx:280 #14 0x00007f37d178ed62 in SwEditShell::EndAllAction (this=0x267cce90) at sw/source/core/edit/edws.cxx:102 #15 0x00007f37d2503daf in SwFieldMgr::InsertField (this=0x7fff88937c00, rData=...) at sw/source/uibase/fldui/fldmgr.cxx:1561 #16 0x00007f37d292df75 in SwWrtShell::InsertPostIt (this=0x267cce90, rFieldMgr=..., rReq=...) while in the "working" case IsScrollMDI is false and MakeVisible returns early. 2fba6df7 causes the profile's desire to restore core's SID_SIDEBAR to be ignored and so the results of IsScrollMDI differ between the two scenarios. Which makes it more likely that IsScrollMDI is true when queried by SwViewShell::MakeVisible, and so LayoutPostIts triggers before pPostIt->SetTextObject, so the contents of that TextObject, while applied to the postit, are not broadcast back via the kit. put a StartAction/EndAction pairing when oTextPara is present to suppress the update until oTextPara is applied. Change-Id: Id42ff1be85fec4b1053e5a7726cf6d2ba8d7de84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178326 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Pranam Lashkari <lpra...@collabora.com> (cherry picked from commit c29a10b51db8027f90397d1bd9e31bd8a3571bc6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 73a5aeaf6b2a..23270ab97413 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2347,6 +2347,11 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq) } } + // Defer broadcast of postit field update from layout until oTextPara has been + // applied to the field's associated postit window + if (oTextPara) + StartAction(); + rFieldMgr.InsertField( aData ); Push(); @@ -2354,11 +2359,12 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq) pPostIt = static_cast<SwPostItField*>(rFieldMgr.GetCurField()); if (pPostIt && oTextPara) - { pPostIt->SetTextObject(*oTextPara); - } Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore cursor position + + if (oTextPara) + EndAction(); } // Client has disabled annotations rendering, no need to commit 67a593667e778ce8be9d4cf487c569dcd05b08e8 Author: Javiya Vivekkumar Dineshbhai <vivek.jav...@collabora.com> AuthorDate: Thu May 30 11:27:33 2024 +0530 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 10 11:45:44 2025 +0000 Improvement to conditional formatting naming Previously, the menu and submenu of conditional formatting options were technically correct but not very readable. We replaced 'Condition...' with 'Highlight cells with...'. Change-Id: I9f4c30506fee9b698f95608ace72f37dfd80f2b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168238 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Tested-by: Pedro Silva <pedro.si...@collabora.com> Reviewed-by: Pedro Silva <pedro.si...@collabora.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 18d295cb585c8dbed1860d10c1c22c10a15bee14) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168445 Tested-by: Jenkins Reviewed-by: vivek javiya <vivek.jav...@collabora.com> diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui index d2a32c99023a..d0a8dbc7c412 100644 --- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui +++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui @@ -5,7 +5,7 @@ <object class="GtkDialog" id="CondFormatEasyDlg"> <property name="can-focus">False</property> <property name="border-width">6</property> - <property name="title" translatable="yes" context="conditionaleasydialog|title">Apply conditional formatting...</property> + <property name="title" translatable="yes" context="conditionaleasydialog|title">Highlight cells...</property> <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox">