external/gpgmepp/UnpackedTarball_gpgmepp.mk | 1 external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 | 32 ++++++++++ include/sal/log-areas.dox | 1 sw/source/uibase/dochdl/gloshdl.cxx | 16 +++++ sw/source/uibase/misc/glosdoc.cxx | 20 ++++++ sw/source/uibase/utlui/gloslst.cxx | 12 +++ 6 files changed, 81 insertions(+), 1 deletion(-)
New commits: commit 43fb1f75d237813f99c1322144bb10bd68ba461d Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Tue Feb 15 17:17:54 2022 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Tue Feb 15 17:17:54 2022 +0100 Try to fix .bau files being ignored Change-Id: I4248fb283d4399a8501a979cae7e6bcc6d8e8a2d diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 0d80082fd21c..7d4e183efbfd 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -299,7 +299,7 @@ void SwGlossaryList::Update() aGroupArr.push_back(std::unique_ptr<AutoTextGroup>(pFound)); } - else if( pFound->aDateModified < rDT ) + else if( pFound->aDateModified != rDT ) { FillGroup(pFound, pGlossaries); pFound->aDateModified = rDT; commit 1ff859236e4aeda1a97510a51cebf6ed6eff884f Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Tue Feb 15 17:16:37 2022 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Tue Feb 15 17:17:25 2022 +0100 Add logging to auotext functions Change-Id: Id7e69e764664978cc97016803773c1077cd15979 diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 904ba74b4425..9a0c43587bc9 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -514,6 +514,7 @@ certain functionality. @li @c sw @li @c sw.a11y - accessibility +@li @c sw.autotext - Autotext @li @c sw.calc - formula calculation @li @c sw.core - Writer core @li @c sw.createcopy diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index fc1f13dae296..30353d27f00c 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -349,12 +349,15 @@ bool SwGlossaryHdl::DelGlossary(const OUString &rShortName) // expand short name bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent) { + SAL_INFO("sw.autotext", "SwGlossaryHdl::ExpandGlossary"); OSL_ENSURE(pWrtShell->CanInsert(), "illegal"); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc(); OUString sGroupName( (*fnGetCurrGroup)() ); + SAL_INFO("sw.autotext", "current group name: " << sGroupName); if (sGroupName.indexOf(GLOS_DELIM)<0) FindGroupName(sGroupName); + SAL_INFO("sw.autotext", "new group name: " << sGroupName); std::unique_ptr<SwTextBlocks> pGlossary = rStatGlossaries.GetGroupDoc(sGroupName); OUString aShortName; @@ -378,6 +381,7 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent) if(pWrtShell->IsSelection()) aShortName = pWrtShell->GetSelText(); } + SAL_INFO("sw.autotext", "END SwGlossaryHdl::ExpandGlossary"); return pGlossary && Expand(pParent, aShortName, &rStatGlossaries, std::move(pGlossary)); } @@ -385,16 +389,19 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, SwGlossaries *pGlossaries, std::unique_ptr<SwTextBlocks> pGlossary) { + SAL_INFO("sw.autotext", "SwGlossaryHdl::Expand rShortName: " << rShortName); std::vector<TextBlockInfo_Impl> aFoundArr; OUString aShortName( rShortName ); bool bCancel = false; // search for text block // - don't prefer current group depending on configuration setting const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); + SAL_INFO("sw.autotext", "rCfg.IsSearchInAllCategories(): " << rCfg.IsSearchInAllCategories()); sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1; // if not found then search in all groups if( nFound == sal_uInt16(-1) ) { + SAL_INFO("sw.autotext", "not found"); const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); SwGlossaryList* pGlossaryList = ::GetGlossaryList(); const size_t nGroupCount = pGlossaryList->GetGroupCount(); @@ -402,11 +409,14 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, { // get group name with path-extension const OUString sGroupName = pGlossaryList->GetGroupName(i); + SAL_INFO("sw.autotext", "checking group " << sGroupName); if(sGroupName == pGlossary->GetName()) continue; + SAL_INFO("sw.autotext", "found group " << sGroupName); const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i); if(nBlockCount) { + SAL_INFO("sw.autotext", "found block"); const OUString sTitle = pGlossaryList->GetGroupTitle(i); for(sal_uInt16 j = 0; j < nBlockCount; j++) { @@ -414,6 +424,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, const OUString sShortName(pGlossaryList->GetBlockShortName(i, j)); if( rSCmp.isEqual( rShortName, sShortName )) { + SAL_INFO("sw.autotext", "found: sTitle: " << sTitle << " sLongName" << sLongName << " sGroupName " << sGroupName ); aFoundArr.emplace_back(sTitle, sLongName, sGroupName); } } @@ -421,9 +432,11 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, } if( !aFoundArr.empty() ) // one was found { + SAL_INFO("sw.autotext", "one was found"); pGlossary.reset(); if (1 == aFoundArr.size()) { + SAL_INFO("sw.autotext", "aFoundArr.size() == 1"); TextBlockInfo_Impl& rData = aFoundArr.front(); pGlossary = pGlossaries->GetGroupDoc(rData.sGroupName); nFound = pGlossary->GetIndex( aShortName ); @@ -459,6 +472,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, // not found if( nFound == sal_uInt16(-1) ) { + SAL_INFO("sw.autotext", "not found."); if( !bCancel ) { pGlossary.reset(); @@ -480,6 +494,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, } else { + SAL_INFO("sw.autotext", "inserting glossary."); SvxMacro aStartMacro(OUString(), OUString(), STARBASIC); SvxMacro aEndMacro(OUString(), OUString(), STARBASIC); GetMacros( aShortName, aStartMacro, aEndMacro, pGlossary.get() ); @@ -510,6 +525,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName, if( aFieldLst.BuildSortLst() ) pWrtShell->UpdateInputFields( &aFieldLst ); } + SAL_INFO("sw.autotext", "END SwGlossaryHdl::Expand"); return true; } diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index 08cab28a4304..1666cfac5905 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -347,11 +347,13 @@ static OUString lcl_makePath(const std::vector<OUString>& rPaths) void SwGlossaries::UpdateGlosPath(bool bFull) { + SAL_INFO("sw.autotext", "SwGlossaries::UpdateGlosPath bFull: " << true); SvtPathOptions aPathOpt; const OUString& aNewPath( aPathOpt.GetAutoTextPath() ); bool bPathChanged = m_aPath != aNewPath; if (bFull || bPathChanged) { + SAL_INFO("sw.autotext", "if (bFull || bPathChanged)"); m_aPath = aNewPath; m_PathArr.clear(); @@ -360,6 +362,7 @@ void SwGlossaries::UpdateGlosPath(bool bFull) std::vector<OUString> aInvalidPaths; if (!m_aPath.isEmpty()) { + SAL_INFO("sw.autotext", "if (!m_aPath.isEmpty())"); sal_Int32 nIndex = 0; do { @@ -374,19 +377,27 @@ void SwGlossaries::UpdateGlosPath(bool bFull) } aDirArr.push_back(sPth); if( !FStatHelper::IsFolder( sPth ) ) + { aInvalidPaths.push_back(sPth); + SAL_INFO("sw.autotext", "invalid path: " << sPth); + } else + { m_PathArr.push_back(sPth); + SAL_INFO("sw.autotext", "valid path: " << sPth); + } } while (nIndex>=0); } if (m_aPath.isEmpty() || !aInvalidPaths.empty()) { + SAL_INFO("sw.autotext", "if (m_aPath.isEmpty() || !aInvalidPaths.empty())"); std::sort(aInvalidPaths.begin(), aInvalidPaths.end()); aInvalidPaths.erase(std::unique(aInvalidPaths.begin(), aInvalidPaths.end()), aInvalidPaths.end()); if (bPathChanged || (m_aInvalidPaths != aInvalidPaths)) { + SAL_INFO("sw.autotext", "err condition!"); m_aInvalidPaths = aInvalidPaths; // wrong path, that means AutoText directory doesn't exist @@ -403,10 +414,12 @@ void SwGlossaries::UpdateGlosPath(bool bFull) if (!m_GlosArr.empty()) { + SAL_INFO("sw.autotext", "if (!m_GlosArr.empty())"); m_GlosArr.clear(); GetNameList(); } } + SAL_INFO("sw.autotext", "END SwGlossaries::UpdateGlosPath"); } void SwGlossaries::ShowError() @@ -591,16 +604,23 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( const OUString& rGroupName, const OUString& rEntryName ) { + SAL_INFO("sw.autotext", "SwGlossaries::GetAutoTextEntry rCompleteGroupName: " << rCompleteGroupName << " rGroupName: " << rGroupName << " rEntryName: " << rEntryName); //standard must be created bool bCreate = ( rCompleteGroupName == GetDefName() ); std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) ); if (!pGlosGroup || pGlosGroup->GetError()) + { + SAL_INFO("sw.autotext", "pGlosGroup empty!"); throw lang::WrappedTargetException(); + } sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName ); if ( USHRT_MAX == nIdx ) + { + SAL_INFO("sw.autotext", "rEntryName not found!"); throw container::NoSuchElementException(); + } Reference< text::XAutoTextEntry > xReturn; diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 6041dbd881d8..0d80082fd21c 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -82,6 +82,7 @@ IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl, weld::TreeView&, void) SwGlossaryList::SwGlossaryList() : bFilled(false) { + SAL_INFO("sw.autotext", "SwGlossaryList::SwGlossaryList"); SvtPathOptions aPathOpt; sPath = aPathOpt.GetAutoTextPath(); SetTimeout(GLOS_TIMEOUT); @@ -89,6 +90,7 @@ SwGlossaryList::SwGlossaryList() : SwGlossaryList::~SwGlossaryList() { + SAL_INFO("sw.autotext", "SwGlossaryList::~SwGlossaryList"); ClearGroups(); } @@ -225,6 +227,7 @@ OUString SwGlossaryList::GetBlockShortName(size_t nGroup, sal_uInt16 nBlock) void SwGlossaryList::Update() { + SAL_INFO("sw.autotext", "SwGlossaryList::Update"); if(!IsActive()) Start(); @@ -232,6 +235,7 @@ void SwGlossaryList::Update() const OUString& sTemp( aPathOpt.GetAutoTextPath() ); if(sTemp != sPath) { + SAL_INFO("sw.autotext", "sTemp != sPath"); sPath = sTemp; bFilled = false; ClearGroups(); @@ -241,6 +245,7 @@ void SwGlossaryList::Update() const OUString sExt( SwGlossaries::GetExtension() ); if(!bFilled) { + SAL_INFO("sw.autotext", "!bFilled"); const size_t nGroupCount = pGlossaries->GetGroupCnt(); for(size_t i = 0; i < nGroupCount; ++i) { @@ -266,6 +271,7 @@ void SwGlossaryList::Update() } else { + SAL_INFO("sw.autotext", "bFilled"); for( size_t nPath = 0; nPath < rPathArr.size(); nPath++ ) { std::vector<OUString> aFoundGroupNames; @@ -323,10 +329,12 @@ void SwGlossaryList::Update() } } } + SAL_INFO("sw.autotext", "END SwGlossaryList::Update"); } void SwGlossaryList::Invoke() { + SAL_INFO("sw.autotext", "SwGlossaryList::Invoke"); // Only update automatically if a SwView has the focus. if(::GetActiveView()) Update(); @@ -350,6 +358,7 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries) pGroup->sShortNames.clear(); if(pBlock) pGroup->sTitle = pBlock->GetName(); + SAL_INFO("sw.autotext", "SwGlossaryList::FillGroup " << pGroup->sTitle); for(sal_uInt16 j = 0; j < pGroup->nCount; j++) { @@ -358,6 +367,7 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries) pGroup->sShortNames += pBlock->GetShortName(j) + OUStringLiteral1(STRING_DELIM); } + SAL_INFO("sw.autotext", "END SwGlossaryList::FillGroup"); } // Give back all (not exceeding FIND_MAX_GLOS) found modules commit 2dbfa443e16b7e9045001310ae52d602ec1a0590 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 8 17:06:01 2021 +0300 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Tue Feb 15 17:04:11 2022 +0100 Fix gpgmepp build with glibc posix-io.c: In function '_gpgme_io_spawn': posix-io.c:492:23: error: void value not ignored as it ought to be 492 | while ((i = closefrom (fd)) && errno == EINTR) | ^ make[1]: *** [Makefile:964: posix-io.lo] Error 1 Change-Id: I0e7abc33200ca7436c72e925447e681fd241c6a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123260 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 5a0dab064150571ee30a5c32f45976d4130a42ec) diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index 4dfee72890b5..66206cea0939 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -30,5 +30,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \ external/gpgmepp/gcc9.patch \ external/gpgmepp/version.patch \ + external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 new file mode 100644 index 000000000000..538a5264bed4 --- /dev/null +++ b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 @@ -0,0 +1,32 @@ +From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001 +From: Jiri Kucera <sanc...@gmail.com> +Date: Sun, 25 Jul 2021 11:35:54 +0200 +Subject: [PATCH] core: Support closefrom also for glibc. + +* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom. +-- + +Since 2.34, glibc introduces closefrom (the implementation +follows *BSD standard). + +Signed-off-by: Werner Koch <w...@gnupg.org> +--- + src/posix-io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/posix-io.c b/src/posix-io.c +index e712ef28..2a3a81fc 100644 +--- a/src/posix-io.c ++++ b/src/posix-io.c +@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, + if (fd_list[i].fd > fd) + fd = fd_list[i].fd; + fd++; +-#ifdef __sun ++#if defined(__sun) || defined(__GLIBC__) + closefrom (fd); + max_fds = fd; + #else /*!__sun */ +-- +2.11.0 +