[Libreoffice-commits] core.git: desktop/source sw/source
desktop/source/lib/init.cxx|1 + sw/source/core/crsr/bookmrk.cxx| 26 +- sw/source/core/doc/docbm.cxx | 35 +++ sw/source/core/inc/MarkManager.hxx |2 ++ sw/source/core/inc/bookmrk.hxx |4 ++-- 5 files changed, 45 insertions(+), 23 deletions(-) New commits: commit 250eb2ee92f3f382c4a6ac3b643fc8e3b60c8be7 Author: Tamás Zolnai AuthorDate: Wed Feb 10 12:23:52 2021 +0100 Commit: Tamás Zolnai CommitDate: Thu Feb 11 17:07:21 2021 +0100 lok: rework form field button message handling. To make it work properly with more users editing the same document. Change-Id: I1f3d8ef9fc9c25b440a3dc36a40709723ed342f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110710 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai (cherry picked from commit 20335d5ed549af25f02467c7da21df10c8df956a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110759 Tested-by: Tamás Zolnai diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0931ffda08ac..95e76de18cdb 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1529,6 +1529,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_TEXT_VIEW_SELECTION: case LOK_CALLBACK_VIEW_CURSOR_VISIBLE: case LOK_CALLBACK_CALC_FUNCTION_LIST: +case LOK_CALLBACK_FORM_FIELD_BUTTON: { // deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place. // If the hyperlink is not empty we can bypass that to show the popup diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 5ea199607d5e..1c89089dd2bf 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -661,7 +661,6 @@ namespace sw::mark DropDownFieldmark::~DropDownFieldmark() { -SendLOKMessage("hide"); } void DropDownFieldmark::ShowButton(SwEditWin* pEditWin) @@ -672,13 +671,11 @@ namespace sw::mark m_pButton = VclPtr::Create(pEditWin, *this); m_pButton->CalcPosAndSize(m_aPortionPaintArea); m_pButton->Show(); -SendLOKMessage("show"); } } void DropDownFieldmark::RemoveButton() { -SendLOKMessage("hide"); FieldmarkWithDropDownButton::RemoveButton(); } @@ -689,32 +686,21 @@ namespace sw::mark { m_pButton->Show(); m_pButton->CalcPosAndSize(m_aPortionPaintArea); -SendLOKMessage("show"); } } -void DropDownFieldmark::SendLOKMessage(std::string_view sAction) +void DropDownFieldmark::SendLOKMessage(SfxViewShell* pViewShell, std::string_view sAction) { -const SfxViewShell* pViewShell = SfxViewShell::Current(); -if (!pViewShell || pViewShell->isLOKMobilePhone()) -{ - return; -} - if (!comphelper::LibreOfficeKit::isActive()) return; -if (!m_pButton) - return; - -SwEditWin* pEditWin = dynamic_cast(m_pButton->GetParent()); -if (!pEditWin) +if (!pViewShell || pViewShell->isLOKMobilePhone()) return; OStringBuffer sPayload; if (sAction == "show") { -if(m_aPortionPaintArea.IsEmpty()) +if (m_aPortionPaintArea.IsEmpty()) return; sPayload = OStringLiteral("{\"action\": \"show\"," @@ -750,12 +736,10 @@ namespace sw::mark } else { +assert(sAction == "hide"); sPayload = "{\"action\": \"hide\", \"type\": \"drop-down\"}"; } -if (sPayload.toString() != m_sLastSentLOKMsg) { -m_sLastSentLOKMsg = sPayload.toString(); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, m_sLastSentLOKMsg.getStr()); -} +pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, sPayload.toString().getStr()); } DateFieldmark::DateFieldmark(const SwPaM& rPaM) diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index c71178e1f005..2532406f9b1f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -47,6 +47,7 @@ #include #include +#include using namespace ::sw::mark; @@ -1517,6 +1518,8 @@ namespace sw::mark if(pNewActiveFieldmark) pNewActiveFieldmark->ShowButton(&rEditWin); } + +LOKUpdateActiveField(pSwView); } void MarkManager::ClearFieldActivation() @@ -1527,6 +1530,38 @@ namespace sw::mark m_pLastActiveFieldmark = nullptr; } +void MarkManager::LOKUpdateActiveField(SfxViewShell* pViewShell) +{ +if (!comphelper::
[Libreoffice-commits] core.git: desktop/source sw/source
desktop/source/lib/init.cxx |3 ++- sw/source/uibase/uiview/viewstat.cxx | 14 ++ 2 files changed, 16 insertions(+), 1 deletion(-) New commits: commit 97988a0705b95b6bf6d32f38c66e954d3012ec38 Author: Muhammet Kara AuthorDate: Sat Jan 25 04:10:38 2020 +0300 Commit: Andras Timar CommitDate: Wed Feb 12 11:43:35 2020 +0100 lok: Add LOK_CALLBACK_STATE_CHANGED for uno:Orientation Change-Id: Iab3aaf742bdb9fc4b9c5875fee7d769fa0581eeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87370 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea Tested-by: Aron Budea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88451 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ed3bc77c2667..90989c45df96 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2654,7 +2654,8 @@ static void doc_iniUnoCommands () OUString(".uno:OnlineAutoFormat"), OUString(".uno:InsertSymbol"), OUString(".uno:EditRegion"), -OUString(".uno:ThesaurusDialog") +OUString(".uno:ThesaurusDialog"), +OUString(".uno:Orientation") }; util::URL aCommandURL; diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index ca90d62f1528..caa3bd34a6a2 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -187,6 +187,20 @@ void SwView::GetState(SfxItemSet &rSet) } ::PageDescToItemSet( rDesc, rSet); + +if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive()) +{ +OString aPayload = ".uno:Orientation="; +if (rDesc.GetLandscape()) +{ +aPayload += "IsLandscape"; +} +else +{ +aPayload += "IsPortrait"; +} +libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr()); +} } break; case RES_BACKGROUND: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source sw/source
desktop/source/app/app.cxx| 18 ++ sw/source/filter/ww8/wrtw8num.cxx | 15 ++- 2 files changed, 12 insertions(+), 21 deletions(-) New commits: commit 130c1ae09451c268fcd4f2d55f65ac7dc9581342 Author: Mike Kaganski AuthorDate: Sat Nov 16 10:36:24 2019 +0200 Commit: Mike Kaganski CommitDate: Sat Nov 16 11:45:21 2019 +0100 Replace some std::once with static initializers Change-Id: I6234bc252dac5b1c29e3f1ef844cf51f56aaa7ac Reviewed-on: https://gerrit.libreoffice.org/82970 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index ef94b0d96da3..31f7abbf9b4e 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -394,18 +394,12 @@ namespace OUString ReplaceStringHookProc( const OUString& rStr ) { -const static OUString sBuildId(utl::Bootstrap::getBuildIdData("development")); -static OUString sBrandName, sVersion, sAboutBoxVersion, sAboutBoxVersionSuffix, sExtension; - -static std::once_flag aInitOnce; -std::call_once(aInitOnce, [] -{ -sBrandName = utl::ConfigManager::getProductName(); -sVersion = utl::ConfigManager::getProductVersion(); -sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion(); -sAboutBoxVersionSuffix = utl::ConfigManager::getAboutBoxProductVersionSuffix(); -sExtension = utl::ConfigManager::getProductExtension(); -} ); +const static OUString sBuildId(utl::Bootstrap::getBuildIdData("development")), +sBrandName(utl::ConfigManager::getProductName()), +sVersion(utl::ConfigManager::getProductVersion()), +sAboutBoxVersion(utl::ConfigManager::getAboutBoxProductVersion()), + sAboutBoxVersionSuffix(utl::ConfigManager::getAboutBoxProductVersionSuffix()), +sExtension(utl::ConfigManager::getProductExtension()); OUString sRet(rStr); if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1) diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index d9f284c3380b..35b8c60a89b7 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -40,6 +40,7 @@ #include "ww8par.hxx" #include +#include using namespace ::com::sun::star; using namespace sw::types; @@ -444,15 +445,11 @@ void MSWordExportBase::NumberingLevel( SwNumRule const& rRule, sal_uInt8 const nLvl) { // prepare the NodeNum to generate the NumString -static SwNumberTree::tNumberVector aNumVector; -static std::once_flag aInitOnce; -std::call_once(aInitOnce, [] -{ -for (int n = 0; n < WW8ListManager::nMaxLevel; ++n) -{ -aNumVector.push_back( n ); -} -}); +static const SwNumberTree::tNumberVector aNumVector = [] { +SwNumberTree::tNumberVector vec(WW8ListManager::nMaxLevel); +std::iota(vec.begin(), vec.end(), 0); +return vec; +}(); // write the static data of the SwNumFormat of this level sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source sw/source
desktop/source/deployment/registry/component/dp_component.cxx | 24 -- desktop/source/deployment/registry/configuration/dp_configuration.cxx | 23 - sw/source/core/unocore/unoportenum.cxx|6 -- sw/source/filter/ww8/ww8par.hxx |1 sw/source/filter/ww8/ww8par6.cxx |4 - 5 files changed, 25 insertions(+), 33 deletions(-) New commits: commit 38b14b248029ea65fc778ede06e8b426b74451da Author: Arkadiy Illarionov Date: Wed Jun 27 00:54:32 2018 +0300 tdf#96099 Remove some trivial std::deque typedefs Change-Id: I101c8a39344ab007640aec9ddad6f82d4fe64296 Reviewed-on: https://gerrit.libreoffice.org/56504 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 37c5d77b79aa..40ccfd8f6bef 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -62,8 +62,6 @@ namespace backend { namespace component { namespace { -typedef std::deque t_stringlist; - #define IMPLEMENTATION_NAME "com.sun.star.comp.deployment.component.PackageRegistryBackend" /** return a vector of bootstrap variables which have been provided @@ -241,13 +239,13 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend }; friend class OtherPlatformPackageImpl; -t_stringlist m_jar_typelibs; -t_stringlist m_rdb_typelibs; -t_stringlist m_components; +std::deque m_jar_typelibs; +std::deque m_rdb_typelibs; +std::deque m_components; enum RcItem { RCITEM_JAR_TYPELIB, RCITEM_RDB_TYPELIB, RCITEM_COMPONENTS }; -t_stringlist & getRcItemList( RcItem kind ) { +std::deque & getRcItemList( RcItem kind ) { switch (kind) { case RCITEM_JAR_TYPELIB: @@ -862,8 +860,8 @@ void BackendImpl::unorc_flush( Reference const & xCmdEnv ) if (! m_jar_typelibs.empty()) { -t_stringlist::const_iterator iPos( m_jar_typelibs.begin() ); -t_stringlist::const_iterator const iEnd( m_jar_typelibs.end() ); +auto iPos( m_jar_typelibs.cbegin() ); +auto const iEnd( m_jar_typelibs.cend() ); buf.append( "UNO_JAVA_CLASSPATH=" ); while (iPos != iEnd) { // encoded ASCII file-urls: @@ -878,8 +876,8 @@ void BackendImpl::unorc_flush( Reference const & xCmdEnv ) } if (! m_rdb_typelibs.empty()) { -t_stringlist::const_iterator iPos( m_rdb_typelibs.begin() ); -t_stringlist::const_iterator const iEnd( m_rdb_typelibs.end() ); +auto iPos( m_rdb_typelibs.cbegin() ); +auto const iEnd( m_rdb_typelibs.cend() ); buf.append( "UNO_TYPES=" ); while (iPos != iEnd) { buf.append( '?' ); @@ -972,7 +970,7 @@ void BackendImpl::addToUnoRc( RcItem kind, OUString const & url_, const OUString rcterm( dp_misc::makeRcTerm(url_) ); const ::osl::MutexGuard guard( getMutex() ); unorc_verify_init( xCmdEnv ); -t_stringlist & rSet = getRcItemList(kind); +std::deque & rSet = getRcItemList(kind); if (std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) { rSet.push_front( rcterm ); // prepend to list, thus overriding // write immediately: @@ -989,7 +987,7 @@ void BackendImpl::removeFromUnoRc( const OUString rcterm( dp_misc::makeRcTerm(url_) ); const ::osl::MutexGuard guard( getMutex() ); unorc_verify_init( xCmdEnv ); -t_stringlist & aRcItemList = getRcItemList(kind); +std::deque & aRcItemList = getRcItemList(kind); aRcItemList.erase(std::remove(aRcItemList.begin(), aRcItemList.end(), rcterm), aRcItemList.end()); // write immediately: m_unorc_modified = true; @@ -1002,7 +1000,7 @@ bool BackendImpl::hasInUnoRc( { const OUString rcterm( dp_misc::makeRcTerm(url_) ); const ::osl::MutexGuard guard( getMutex() ); -t_stringlist const & rSet = getRcItemList(kind); +std::deque const & rSet = getRcItemList(kind); return std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end(); } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index dc83fe547ba7..b9b8645dfc44 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -61,9 +61,6 @@ namespace backend { namespace configuration { namespace { -typedef std::deque t_stringlist; - - class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend { class PackageImpl : public ::dp_registry::backend::Package @@ -97,9 +94,9 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend };