core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-05-18 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   78 +---
 1 file changed, 52 insertions(+), 26 deletions(-)

New commits:
commit 628f56a1802ad76cbe84a9a5590b04ed81a57a9e
Author: Michael Meeks 
AuthorDate: Fri May 17 21:25:29 2024 +0100
Commit: Noel Grandin 
CommitDate: Sat May 18 22:06:18 2024 +0200

lok: stop amazing waste of repeated font sizes in each font element.

These days all sensible fonts are scalable, so anything else is madness.

With the compact_fonts option we go from:

INCOMING: commandvalues: 
{"commandName":".uno:CharFontName","commandValues":
{"Albany 
AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16",
"18","20","21","22","24","26","28","32","36","40","42","44","48","54",
"60","66","72","80","88","96"],"Amiri":["6","7"



INCOMING: commandvalues: { "commandName": ".uno:CharFontName", 
"FontNames":
[ "Albany AMT", "Amiri", "Amiri Quran", "Amiri Quran Colored", "Andale 
Mono",
"Andale Sans", "Andy MT", "AR PL UMing CN", "AR PL UMing HK", "AR PL 
UMing TW",
"AR PL UMing TW MBE", "Arial",

   

An 8x size win.

Change-Id: I3dc9f5de876def6e4afc09a43105b1740f7c621f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167799
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9608c5374da7..cb487d641ac8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -267,11 +267,12 @@ extern "C" {
 
 #endif
 
-
 using LanguageToolCfg = 
officecfg::Office::Linguistic::GrammarChecking::LanguageTool;
 
+
 static LibLibreOffice_Impl *gImpl = nullptr;
 static bool lok_preinit_2_called = false;
+static bool gUseCompactFonts = false;
 static std::weak_ptr< LibreOfficeKitClass > gOfficeClass;
 static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass;
 
@@ -6080,7 +6081,7 @@ static char* getLanguages(const char* pCommand)
 return pJson;
 }
 
-static char* getFonts (const char* pCommand)
+static char* getFonts (const char* pCommand, const bool 
bBloatWithRepeatedSizes)
 {
 SfxObjectShell* pDocSh = SfxObjectShell::Current();
 if (!pDocSh)
@@ -6089,36 +6090,59 @@ static char* getFonts (const char* pCommand)
 pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST));
 const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr;
 
-boost::property_tree::ptree aTree;
-aTree.put("commandName", pCommand);
-boost::property_tree::ptree aValues;
-if ( pList )
+if (!bBloatWithRepeatedSizes)
 {
-sal_uInt16 nFontCount = pList->GetFontNameCount();
-for (sal_uInt16 i = 0; i < nFontCount; ++i)
+tools::JsonWriter aJson;
+aJson.put("commandName", pCommand);
+{
+auto aFontNames = aJson.startArray("FontNames");
+
+sal_uInt16 nFontCount = pList->GetFontNameCount();
+for (sal_uInt16 i = 0; i < nFontCount; ++i)
+aJson.putSimpleValue(pList->GetFontName(i).GetFamilyName());
+}
 {
-boost::property_tree::ptree aChildren;
-const FontMetric& rFontMetric = pList->GetFontName(i);
+auto aFontSizes = aJson.startArray("FontSizes");
 const int* pAry = FontList::GetStdSizeAry();
-sal_uInt16 nSizeCount = 0;
-while (pAry[nSizeCount])
+for (sal_uInt16 i = 0; pAry[i]; ++i)
+
aJson.putSimpleValue(OUString::number(static_cast(pAry[i]) / 10));
+}
+
+return convertOString(aJson.finishAndGetAsOString());
+}
+else // FIXME: remove nonsensical legacy version
+{
+boost::property_tree::ptree aTree;
+aTree.put("commandName", pCommand);
+boost::property_tree::ptree aValues;
+if ( pList )
+{
+sal_uInt16 nFontCount = pList->GetFontNameCount();
+for (sal_uInt16 i = 0; i < nFontCount; ++i)
 {
-boost::property_tree::ptree aChild;
-aChild.put("", static_cast(pAry[nSizeCount]) / 10);
-aChildren.push_back(std::make_pair("", aChild));
-nSizeCount++;
+boost::property_tree::ptree aChildren;
+const FontMetric& rFontMetric = pList->GetFontName(i);
+const int* pAry = FontList::GetStdSizeAry();
+sal_uInt16 nSizeCount = 0;
+while (pAry[nSizeCount])
+{
+boost::property_tree::ptree aChild;
+aChild.put("", static_cast(pAry[nSizeCount]) / 10);
+aChildren.push_back(std::make_pair("", aChild));
+nSizeCount++;
+}
+
aValues.add_child(rFontMetric.GetFamilyName().toUtf8().getStr(), aChildren);
 }
-

core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-05-17 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 457f24c004590a28d200fdda79bf468d363fff69
Author: Michael Meeks 
AuthorDate: Fri May 17 17:49:32 2024 +0100
Commit: Noel Grandin 
CommitDate: Fri May 17 20:42:26 2024 +0200

lok: stop amazing waste of pretty-printed JSON sent over the API.

before:

INCOMING: commandvalues: {
"commandName": ".uno:CharFontName",
"commandValues": {
"Albany AMT": [
"6",
"7",
"8",
"9",
"10",
"10.5",
"11",
"12",



after:

INCOMING: commandvalues: {"commandName":".uno:CharFontName","commandValues":
{"Albany AMT":["6","7","8","9","10","10.5","11","12","13","14","15","16",
"18","20","21","22","24","26","28","32","36","40","42","44","48","54",
"60","66","72","80","88","96"],"Amiri":["6","7"



A 3x size saving.

Change-Id: I574b8bdf790078c61b7605137a47a531dee16f1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167789
Reviewed-by: Noel Grandin 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 298d15b4ddf6..9608c5374da7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6013,7 +6013,7 @@ static char* getDocReadOnly(LibreOfficeKitDocument* pThis)
 aTree.put("success", pObjectShell->IsLoadReadonly());
 
 std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
+boost::property_tree::write_json(aStream, aTree, false /* pretty */);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
 if (!pJson)
 return nullptr;
@@ -6072,7 +6072,7 @@ static char* getLanguages(const char* pCommand)
 addLocale(aValues, rLocale);
 aTree.add_child("commandValues", aValues);
 std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
+boost::property_tree::write_json(aStream, aTree, false /* pretty */);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
 assert(pJson); // Don't handle OOM conditions
 strcpy(pJson, aStream.str().c_str());
@@ -6113,7 +6113,7 @@ static char* getFonts (const char* pCommand)
 }
 aTree.add_child("commandValues", aValues);
 std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
+boost::property_tree::write_json(aStream, aTree, false /* pretty */);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
 assert(pJson); // Don't handle OOM conditions
 strcpy(pJson, aStream.str().c_str());
@@ -6148,7 +6148,7 @@ static char* getFontSubset (std::string_view aFontName)
 
 aTree.add_child("commandValues", aValues);
 std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
+boost::property_tree::write_json(aStream, aTree, false /* pretty */);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
 assert(pJson); // Don't handle OOM conditions
 strcpy(pJson, aStream.str().c_str());
@@ -6271,7 +6271,7 @@ static char* getStyles(LibreOfficeKitDocument* pThis, 
const char* pCommand)
 
 aTree.add_child("commandValues", aValues);
 std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
+boost::property_tree::write_json(aStream, aTree, false /* pretty */);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
 assert(pJson); // Don't handle OOM conditions
 strcpy(pJson, aStream.str().c_str());


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/sfx2 include/vcl sfx2/source vcl/source

2024-05-17 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx   |2 +-
 include/sfx2/viewsh.hxx   |1 +
 include/vcl/IDialogRenderable.hxx |3 +++
 include/vcl/svapp.hxx |2 +-
 sfx2/source/view/lokhelper.cxx|3 ++-
 sfx2/source/view/viewsh.cxx   |   23 +++
 vcl/source/app/svapp.cxx  |   16 
 7 files changed, 47 insertions(+), 3 deletions(-)

New commits:
commit 8d979fae0c435b820302c76fcfdc2642b4820360
Author: Michael Meeks 
AuthorDate: Thu May 16 19:35:51 2024 +0100
Commit: Michael Meeks 
CommitDate: Fri May 17 17:41:40 2024 +0200

lok: dump more SfxViewShell state, and LOK notifier state on Windows.

This should help to associate the right view-ids, with the right
windows, and help to catch any stray / lingering windows from closed
sessions - hopefully.

Change-Id: I197a3280d5d2aeddd356ee037c51e4887f43278b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167765
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a61eb3ff0879..298d15b4ddf6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1660,7 +1660,7 @@ void 
CallbackFlushHandler::libreOfficeKitViewUpdatedCallbackPerViewId(int nType,
 void CallbackFlushHandler::dumpState(rtl::OStringBuffer )
 {
 // NB. no locking
-rState.append("
View:   ");
+rState.append("
View:   ");
 rState.append(static_cast(m_viewId));
 rState.append("
DisableCallbacks:   ");
 rState.append(static_cast(m_nDisableCallbacks));
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index e68f556c1072..d098d76d0031 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -274,6 +274,7 @@ public:
 
 // ILibreOfficeKitNotifier
 virtual voidnotifyWindow(vcl::LOKWindowId nLOKWindowId, 
const OUString& rAction, const std::vector& rPayload = 
std::vector()) const override;
+virtual OString dumpNotifyState() const override;
 
 // Focus, KeyInput, Cursor
 virtual voidShowCursor( bool bOn = true );
diff --git a/include/vcl/IDialogRenderable.hxx 
b/include/vcl/IDialogRenderable.hxx
index 49e22c3c5357..11a7adfb0f27 100644
--- a/include/vcl/IDialogRenderable.hxx
+++ b/include/vcl/IDialogRenderable.hxx
@@ -42,6 +42,9 @@ public:
 
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES.
 virtual void notifyInvalidation(tools::Rectangle const *) const = 0;
+
+/// Debugging
+virtual OString dumpNotifyState() const = 0;
 };
 
 } // namespace vcl
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 36d7eeb1fc06..be1e80090576 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1326,7 +1326,7 @@ public:
   const std::vector& rPayload 
= std::vector()) const override;
 virtual void libreOfficeKitViewCallback(int nType, const OString& 
pPayload) const override;
 virtual void notifyInvalidation(tools::Rectangle const *) const override;
-
+virtual OString dumpNotifyState() const override;
 
 private:
 DECL_DLLPRIVATE_STATIC_LINK( Application, PostEventHandler, void*, void );
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 8df19c359442..99f39fbf4e8b 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -733,7 +733,8 @@ void 
SfxLokHelper::notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc, in
 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
 while (pViewShell)
 {
-if (pViewShell->getPart() == nPart)
+if (// FIXME should really filter on pViewShell->GetDocId() too
+pViewShell->getPart() == nPart)
 SfxLokHelper::notifyDocumentSizeChanged(pViewShell, ""_ostr, pDoc, 
false);
 pViewShell = SfxViewShell::GetNext(*pViewShell);
 }
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 75731ecf1ccd..0b6c07c68d5c 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -3181,6 +3181,20 @@ SfxLokCallbackInterface* 
SfxViewShell::getLibreOfficeKitViewCallback() const
 
 void SfxViewShell::dumpLibreOfficeKitViewState(rtl::OStringBuffer )
 {
+rState.append("
SfxViewShell: ");
+rState.append(OString::number(reinterpret_cast(this), 16));
+rState.append("
DocId:  ");
+auto nDocId = static_cast(GetDocId());
+rState.append(static_cast(nDocId));
+rState.append("
ViewId: ");
+rState.append(static_cast(GetViewShellId()));
+rState.append("
Part:   ");
+rState.append(static_cast(getPart()));
+rState.append("
Lang:   ");
+rState.append(OUStringToOString(GetLOKLanguageTag().getBcp47(), 
RTL_TEXTENCODING_UTF8));
+rState.append("
A11y:   ");
+rState.append(GetLOKAccessibilityState() ? "enabled" : "disabled");
+
 if 

core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-05-17 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 63ba90e6aea1554d6ee2d50b9439312a4b7ee483
Author: Miklos Vajna 
AuthorDate: Fri May 17 13:54:26 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 17 15:24:31 2024 +0200

desktop: fix warning C4100: 'pThis': unreferenced formal parameter

SAL_UNUSED_PARAMETER expands to nothing in the Windows case, though not
sure why this started to matter only now.

Change-Id: I7f7369c650af0585cb742c1fb4e7a111e270df63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167775
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8edd138cc907..a61eb3ff0879 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7289,7 +7289,7 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*p
 }
 }
 
-static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
pThis, int nId, const bool readOnly)
+static void doc_setViewReadOnly(LibreOfficeKitDocument* /*pThis*/, int nId, 
const bool readOnly)
 {
 comphelper::ProfileZone aZone("doc_setViewReadOnly");
 
@@ -7299,7 +7299,7 @@ static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pTh
 SfxLokHelper::setViewReadOnly(nId, readOnly);
 }
 
-static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pThis, int nId, const bool allow)
+static void doc_setAllowChangeComments(LibreOfficeKitDocument* /*pThis*/, int 
nId, const bool allow)
 {
 comphelper::ProfileZone aZone("doc_setAllowChangeComments");
 


core.git: Branch 'distro/collabora/co-24.04' - desktop/source sfx2/source

2024-05-14 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |5 +
 sfx2/source/doc/objmisc.cxx |   11 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 44e79f02241fbc213462df03a37b621cb72f9d05
Author: Michael Meeks 
AuthorDate: Tue May 14 16:13:43 2024 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 14 21:01:06 2024 +0200

lok: get faster ModifiedStatus from the core.

Gives a more responsive UI, closes a number of races, and helps us
to make better decisions, more quickly on whether to save.

Change-Id: I6e2548f06f715ba56ba75fd746273bdd57dc20dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167635
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3ae89cf84ba1..8edd138cc907 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5160,6 +5160,11 @@ void LibLibreOffice_Impl::dumpState(rtl::OStringBuffer 
)
 rState.append(static_cast(mOptionalFeatures), 16);
 rState.append("
CallbackData:   0x");
 rState.append(reinterpret_cast(mpCallback), 16);
+rState.append("
IsModified: ");
+if (SfxObjectShell::Current())
+rState.append(SfxObjectShell::Current()->IsModified() ? "modified" : 
"unmodified");
+else
+rState.append("noshell");
 // TODO: dump mInteractionMap
 SfxLokHelper::dumpState(rState);
 vcl::lok::dumpState(rState);
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index e5a69d717657..ef7eed6b90fc 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -51,6 +51,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -102,6 +103,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "objstor.hxx"
@@ -325,7 +327,6 @@ void SfxObjectShell::ModifyChanged()
 // SetModified dispose of the models!
 return;
 
-
 SfxViewFrame* pViewFrame = SfxViewFrame::Current();
 if ( pViewFrame )
 pViewFrame->GetBindings().Invalidate( SID_SAVEDOCS );
@@ -335,6 +336,14 @@ void SfxObjectShell::ModifyChanged()
 Broadcast( SfxHint( SfxHintId::TitleChanged ) );// xmlsec05, signed 
state might change in title...
 
 SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::ModifyChanged, 
GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) );
+
+// Don't wait to get this important state via binding notification timeout.
+if ( comphelper::LibreOfficeKit::isActive() )
+{
+OString aStatus = ".uno:ModifiedStatus="_ostr;
+aStatus += IsModified() ? "true" : "false";
+SfxLokHelper::notifyAllViews(LOK_CALLBACK_STATE_CHANGED, aStatus);
+}
 }
 
 


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/LibreOfficeKit libreofficekit/source sw/source

2024-05-14 Thread Darshan-upadhyay1110 (via logerrit)
 desktop/source/lib/init.cxx  |2 ++
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   21 -
 libreofficekit/source/gtk/lokdocview.cxx |3 +++
 sw/source/uibase/inc/swruler.hxx |2 ++
 sw/source/uibase/misc/swruler.cxx|   14 +++---
 sw/source/uibase/uiview/view.cxx |   14 +-
 6 files changed, 47 insertions(+), 9 deletions(-)

New commits:
commit 11b936629dd4ef9308d63b312900b8b7c8ff19b4
Author: Darshan-upadhyay1110 
AuthorDate: Fri May 10 20:04:01 2024 +0530
Commit: Tomaž Vajngerl 
CommitDate: Tue May 14 11:59:58 2024 +0200

Add new LOK CALLBACK for vertical ruler

- We're adding a new LOK callback LOK_CALLBACK_VERTICAL_RULER_UPDATE.
- The reason is that we currently override the existing callback.
- Using the same callback for both vertical and horizontal rulers causes an 
issue.
- override will create problem like it will only send any one of the ruler 
orientation update.
- It results in online updates being limited to just one ruler orientation.
- By introducing a new callback, we ensure updates for both vertical and 
horizontal rulers both are captured correctly in online.

Change-Id: I02d0e3e7e4ac8a07a83644460aa0ba36e0f3c013
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167481
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 962d676694ac..3ae89cf84ba1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1547,6 +1547,7 @@ 
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
 m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL"_ostr);
 m_states.emplace(LOK_CALLBACK_TAB_STOP_LIST, "NIL"_ostr);
 m_states.emplace(LOK_CALLBACK_RULER_UPDATE, "NIL"_ostr);
+m_states.emplace(LOK_CALLBACK_VERTICAL_RULER_UPDATE, "NIL"_ostr);
 m_states.emplace(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, "NIL"_ostr);
 }
 
@@ -1878,6 +1879,7 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 case LOK_CALLBACK_SET_PART:
 case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
 case LOK_CALLBACK_RULER_UPDATE:
+case LOK_CALLBACK_VERTICAL_RULER_UPDATE:
 case LOK_CALLBACK_A11Y_FOCUS_CHANGED:
 case LOK_CALLBACK_A11Y_CARET_CHANGED:
 case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED:
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 9a6f34bbd846..516622722bb9 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -581,7 +581,7 @@ typedef enum
  */
 LOK_CALLBACK_CELL_ADDRESS = 34,
 /**
- * The key ruler related properties on change are reported by this.
+ * The key horizontal ruler related properties on change are reported by 
this.
  *
  * The payload format is:
  *
@@ -1051,6 +1051,23 @@ typedef enum
  *  Payload contains the rectangle details
  */
 LOK_CALLBACK_SHAPE_INNER_TEXT = 72,
+/**
+ * The key vertical ruler related properties on change are reported by 
this.
+ *
+ * The payload format is:
+ *
+ * {
+ *  "margin1": "...",
+ *  "margin2": "...",
+ *  "leftOffset": "...",
+ *  "pageOffset": "...",
+ *  "pageWidth": "...",
+ *  "unit": "..."
+ *  }
+ *
+ * Here all aproperties are same as described in svxruler.
+ */
+LOK_CALLBACK_VERTICAL_RULER_UPDATE = 73
 
 }
 LibreOfficeKitCallbackType;
@@ -1152,6 +1169,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_COMMENT";
 case LOK_CALLBACK_RULER_UPDATE:
 return "LOK_CALLBACK_RULER_UPDATE";
+case LOK_CALLBACK_VERTICAL_RULER_UPDATE:
+return "LOK_CALLBACK_VERTICAL_RULER_UPDATE";
 case LOK_CALLBACK_WINDOW:
 return "LOK_CALLBACK_WINDOW";
 case LOK_CALLBACK_VALIDITY_LIST_BUTTON:
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 60c3435ac28d..5dddaa2d0e37 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1376,6 +1376,9 @@ callback (gpointer pData)
 case LOK_CALLBACK_RULER_UPDATE:
 g_signal_emit(pCallback->m_pDocView, doc_view_signals[RULER], 0, 
pCallback->m_aPayload.c_str());
 break;
+case LOK_CALLBACK_VERTICAL_RULER_UPDATE:
+g_signal_emit(pCallback->m_pDocView, doc_view_signals[RULER], 0, 
pCallback->m_aPayload.c_str());
+break;
 case LOK_CALLBACK_WINDOW:
 g_signal_emit(pCallback->m_pDocView, doc_view_signals[WINDOW], 0, 
pCallback->m_aPayload.c_str());
 break;
diff --git a/sw/source/uibase/inc/swruler.hxx b/sw/source/uibase/inc/swruler.hxx
index 

core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/sfx2 sd/inc sd/qa sd/sdi sd/source sfx2/source

2024-05-14 Thread Justin Luth (via logerrit)
 desktop/source/app/app.cxx   |1 
 desktop/source/app/cmdlineargs.cxx   |4 ++-
 desktop/source/app/cmdlineargs.hxx   |2 +
 desktop/source/app/cmdlinehelp.cxx   |3 +-
 desktop/source/app/dispatchwatcher.cxx   |   10 
 desktop/source/app/dispatchwatcher.hxx   |2 -
 desktop/source/app/officeipcthread.cxx   |3 +-
 desktop/source/app/officeipcthread.hxx   |1 
 include/sfx2/sfxsids.hrc |2 -
 sd/inc/drawdoc.hxx   |8 +++---
 sd/qa/unit/tiledrendering/tiledrendering.cxx |2 -
 sd/sdi/sdraw.sdi |2 -
 sd/source/core/drawdoc.cxx   |6 ++--
 sd/source/ui/docshell/docshel4.cxx   |   33 ++-
 sd/source/ui/slideshow/slideshowimpl.cxx |7 +++--
 sd/source/ui/view/ViewShellBase.cxx  |   15 
 sd/source/ui/view/drviewse.cxx   |7 -
 sfx2/source/appl/appuno.cxx  |8 +++---
 sfx2/source/doc/objstor.cxx  |2 -
 19 files changed, 71 insertions(+), 47 deletions(-)

New commits:
commit 773fe1fe924110d36749a51645a4e44d27c939c8
Author: Justin Luth 
AuthorDate: Fri May 3 08:32:27 2024 -0400
Commit: Miklos Vajna 
CommitDate: Tue May 14 09:11:06 2024 +0200

tdf#69192: add StartingSlide to SID_PRESENTATION and cmdline show=

Allow the user to start the presentation at a specific slide
using command-line parameters.

This backport includes ddc4cd3d0cf9e8bde440df3e92e98a2a2017c797
NFC dispatchwatcher.hxx: rename aPrinterName to aParam

Change-Id: I87797cbccb463904e5d2fe9b078e3921be27c91a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167066
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167609
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 0d66a48daac7..7c81b0a3bbc1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2081,6 +2081,7 @@ void Desktop::OpenClients()
 aRequest.aConversionParams = rArgs.GetConversionParams();
 aRequest.aConversionOut = rArgs.GetConversionOut();
 aRequest.aImageConversionType = rArgs.GetImageConversionType();
+aRequest.aStartListParams = rArgs.GetStartListParams();
 aRequest.aInFilter = rArgs.GetInFilter();
 aRequest.bTextCat = rArgs.IsTextCat();
 aRequest.bScriptCat = rArgs.IsScriptCat();
diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index e7f315204048..3a3f876f6e90 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -538,10 +538,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 // open in viewmode
 eCurrentEvent = CommandLineEvent::View;
 }
-else if ( oArg == "show" )
+else if (oArg == "show" || oArg.startsWith("show=", ))
 {
 // open in viewmode
 eCurrentEvent = CommandLineEvent::Start;
+// start on the first slide unless a valid starting slide # 
was provided
+m_startListParams = rest.toUInt32() > 0 ? rest : "1";
 }
 else if ( oArg == "display" )
 {
diff --git a/desktop/source/app/cmdlineargs.hxx 
b/desktop/source/app/cmdlineargs.hxx
index 64a1bcfd0ccb..8e0c6e649584 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -113,6 +113,7 @@ class CommandLineArgs
 const OUString& GetConversionParams() const { return 
m_conversionparams;}
 OUStringGetConversionOut() const;
 OUString const &GetImageConversionType() const { return 
m_convertimages; }
+const OUString& GetStartListParams() const { return 
m_startListParams; }
 const OUString& GetPidfileName() const { return m_pidfile;}
 
 // Special analyzed states (does not match directly to a command line 
parameter!)
@@ -176,6 +177,7 @@ class CommandLineArgs
 OUString m_conversionparams;
 OUString m_conversionout; // contains external URIs
 OUString m_convertimages; // The format in which images should be 
converted
+OUString m_startListParams;
 std::vector< OUString > m_infilter;
 OUString m_language;
 OUString m_pidfile;
diff --git a/desktop/source/app/cmdlinehelp.cxx 
b/desktop/source/app/cmdlinehelp.cxx
index 9c9fd940f233..10b3e5c48cbb 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -145,8 +145,9 @@ namespace desktop
 "   not appear. If the file name contains spaces, 
then it   
"
 "   must be enclosed in quotation marks.   

core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/sfx2 sfx2/source

2024-04-26 Thread Gökay Şatır (via logerrit)
 desktop/source/lib/init.cxx|6 ++
 include/sfx2/lokhelper.hxx |4 
 sfx2/source/view/lokhelper.cxx |   30 ++
 3 files changed, 36 insertions(+), 4 deletions(-)

New commits:
commit 4d8c4a60105488be84ea80775dc04a24582752fb
Author: Gökay Şatır 
AuthorDate: Tue Apr 23 14:40:14 2024 +0300
Commit: Michael Meeks 
CommitDate: Fri Apr 26 16:08:38 2024 +0200

Use a for loop for setting view properties.

Since there may be no view with the given id, checking the list first is 
safer.

Signed-off-by: Gökay Şatır 
Change-Id: I4c305e0a0f6ce7cccdfea9889c414a6054ed3a88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166531
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ba9b45230093..79e5af2fdedd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7292,8 +7292,7 @@ static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pTh
 SolarMutexGuard aGuard;
 SetLastExceptionMsg();
 
-doc_setView(pThis, nId);
-SfxViewShell::Current()->SetLokReadOnlyView(readOnly);
+SfxLokHelper::setViewReadOnly(nId, readOnly);
 }
 
 static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pThis, int nId, const bool allow)
@@ -7303,8 +7302,7 @@ static void 
doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocume
 SolarMutexGuard aGuard;
 SetLastExceptionMsg();
 
-doc_setView(pThis, nId);
-SfxViewShell::Current()->SetAllowChangeComments(allow);
+SfxLokHelper::setAllowChangeComments(nId, allow);
 }
 
 static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pThis, int nId, bool nEnabled)
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 3cdc404a8e2a..96974417430e 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -119,6 +119,10 @@ public:
 static void setDefaultLanguage(const OUString& rBcp47LanguageTag);
 /// Enable/Disable AT support for the given view.
 static void setAccessibilityState(int nId, bool nEnabled);
+// Set the readonly state of the view.
+static void setViewReadOnly(int nId, bool readOnly);
+// In readonly view, can user add / modify comments or not.
+static void setAllowChangeComments(int nId, bool allow);
 /// Get the language used by the loading view (used for all save 
operations).
 static const LanguageTag & getLoadLanguage();
 /// Set the language used by the loading view (used for all save 
operations).
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 80bdb38aa13a..8df19c359442 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -341,6 +341,36 @@ void SfxLokHelper::setViewLanguage(int nId, const 
OUString& rBcp47LanguageTag)
 }
 }
 
+void SfxLokHelper::setViewReadOnly(int nId, bool readOnly)
+{
+std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
+
+for (SfxViewShell* pViewShell : rViewArr)
+{
+if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId))
+{
+LOK_INFO("lok.readonlyview", "SfxLokHelper::setViewReadOnly: view 
id: " << nId << ", readOnly: " << readOnly);
+pViewShell->SetLokReadOnlyView(readOnly);
+return;
+}
+}
+}
+
+void SfxLokHelper::setAllowChangeComments(int nId, bool allow)
+{
+std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
+
+for (SfxViewShell* pViewShell : rViewArr)
+{
+if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId))
+{
+LOK_INFO("lok.readonlyview", 
"SfxLokHelper::setAllowChangeComments: view id: " << nId << ", allow: " << 
allow);
+pViewShell->SetAllowChangeComments(allow);
+return;
+}
+}
+}
+
 void SfxLokHelper::setAccessibilityState(int nId, bool nEnabled)
 {
 std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();


core.git: Branch 'distro/collabora/co-24.04' - desktop/source sfx2/source

2024-04-25 Thread Hubert Figuière (via logerrit)
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit dd78abffa4ab89507310e3080be25586f21c2021
Author: Hubert Figuière 
AuthorDate: Thu Apr 25 14:01:11 2024 -0400
Commit: Caolán McNamara 
CommitDate: Thu Apr 25 20:42:57 2024 +0200

cool#8066: calc: enable .uno:ToggleSheetGrid

Signed-off-by: Hubert Figuière 
Change-Id: Ibe5bca4d0622c4015030a21d4ecccd41d5e9f483
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166647
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5f51d05615d8..ba9b45230093 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3900,7 +3900,8 @@ static void doc_iniUnoCommands ()
 u".uno:InsertPictureContentControl"_ustr,
 u".uno:DataFilterAutoFilter"_ustr,
 u".uno:CellProtection"_ustr,
-u".uno:MoveKeepInsertMode"_ustr
+u".uno:MoveKeepInsertMode"_ustr,
+u".uno:ToggleSheetGrid"_ustr,
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 37286cc2d71d..19bc307a1011 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -940,7 +940,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
 aEvent.FeatureURL.Path == "SpacePara15" ||
 aEvent.FeatureURL.Path == "SpacePara2" ||
 aEvent.FeatureURL.Path == "DataFilterAutoFilter" ||
-aEvent.FeatureURL.Path == "CellProtection")
+aEvent.FeatureURL.Path == "CellProtection" ||
+aEvent.FeatureURL.Path == "ToggleSheetGrid")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-25 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e2cbe31915c3ee98ae433894c8e08c3afe5f3bb8
Author: Caolán McNamara 
AuthorDate: Wed Apr 24 16:25:34 2024 +0100
Commit: Miklos Vajna 
CommitDate: Thu Apr 25 09:21:49 2024 +0200

line break "Preloading breakiterator: Preload icons"

so "Preloading breakiterator" is on its own line

Change-Id: If2dfb6e9c636346b8b425187c4faab311cf32131
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166589
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f0f6bb4a740e..5f51d05615d8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7637,7 +7637,7 @@ static void preloadData()
 }
 std::cerr << "
";
 
-std::cerr << "Preloading breakiterator: ";
+std::cerr << "Preloading breakiterator
";
 if (aLocales.getLength())
 {
 css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-22 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit cb1560d1c1c1fd17eaac64e10730842a472d1c82
Author: Caolán McNamara 
AuthorDate: Mon Apr 22 17:17:05 2024 +0100
Commit: Noel Grandin 
CommitDate: Mon Apr 22 18:48:28 2024 +0200

thesauri list can be empty at preload

if none of the dictionaries are installed, seen in a bare bones docker
image, giving a backtrace of:

/usr/bin/coolforkit(_ZN7SigUtil13dumpBacktraceEv+0x73)[0x632d83]
/usr/bin/coolforkit[0x6331a5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f48788b4980]

/opt/collaboraoffice/program/libuno_sal.so.3(rtl_uString_assign+0xc)[0x7f487070582c]
/opt/collaboraoffice/program/libmergedlo.so(+0x20f9478)[0x7f4873cbc478]
/opt/collaboraoffice/program/libmergedlo.so(+0x20fa3c4)[0x7f4873cbd3c4]
/opt/collaboraoffice/program/libmergedlo.so(+0x27e6d82)[0x7f48743a9d82]
/opt/collaboraoffice/program/libmergedlo.so(+0x27e8eac)[0x7f48743abeac]

/opt/collaboraoffice/program/libmergedlo.so(lok_preinit_2+0x1c)[0x7f48743ad31c]
/usr/bin/coolforkit(_Z13globalPreinitRKSs+0x1e8)[0x5dfdd8]
/usr/bin/coolforkit(_Z11forkit_mainiPPc+0x1582)[0x5aa482]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f48784d2c87]
/usr/bin/coolforkit[0x56c392]

Change-Id: Ib3a8ada7c22611e04e9db8dfa7cb0e227ece0f84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166467
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index cc909fa57c16..f0f6bb4a740e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7638,10 +7638,13 @@ static void preloadData()
 std::cerr << "
";
 
 std::cerr << "Preloading breakiterator: ";
-css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);
-css::i18n::LineBreakUserOptions aUserOptions;
-css::i18n::LineBreakHyphenationOptions aHyphOptions( 
LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 );
-xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], 
/*nMinBreakPos*/0, aHyphOptions, aUserOptions);
+if (aLocales.getLength())
+{
+css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);
+css::i18n::LineBreakUserOptions aUserOptions;
+css::i18n::LineBreakHyphenationOptions aHyphOptions( 
LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 );
+xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], 
/*nMinBreakPos*/0, aHyphOptions, aUserOptions);
+}
 
 css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = 
css::ui::GlobalAcceleratorConfiguration::create(
 comphelper::getProcessComponentContext());


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-20 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ddeec9754cb2871a709d22efb460e141ab4c6f33
Author: Michael Meeks 
AuthorDate: Fri Apr 19 21:13:18 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sat Apr 20 11:56:09 2024 +0200

lok: ensure our 'main thread' concept is updated post-fork.

Otherwise we fall foul of assertions and behavioral differences
around the main thread as the new forked main-thread has a
different thread-id.

Change-Id: I0bd97e5173767ac6c697326aaf0d0822037e480f
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166319
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fdf25b4cfeac..cc909fa57c16 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3405,6 +3405,8 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */)
 static void lo_setForkedChild(LibreOfficeKit* /* pThis */, bool bIsChild)
 {
 comphelper::LibreOfficeKit::setForkedChild(bIsChild);
+if (bIsChild)
+Application::UpdateMainThread();
 }
 
 static void lo_registerCallback (LibreOfficeKit* pThis,


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-16 Thread Noel Grandin (via logerrit)
 desktop/source/lib/init.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 83c5571bc6991749aa80aa87127dd56f53f9dee9
Author: Noel Grandin 
AuthorDate: Mon Apr 15 16:10:54 2024 +0200
Commit: Caolán McNamara 
CommitDate: Tue Apr 16 20:53:03 2024 +0200

preload BreakIterator for LOK

Change-Id: I22bea46d224f4020bb18d2826f23985fc2d8e492
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166129
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 
(cherry picked from commit 42e175060c28ef339e3c96b51baa9a8d84ef2c82)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166095
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 04c46306f12e..fdf25b4cfeac 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -134,6 +135,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -7633,6 +7635,12 @@ static void preloadData()
 }
 std::cerr << "
";
 
+std::cerr << "Preloading breakiterator: ";
+css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);
+css::i18n::LineBreakUserOptions aUserOptions;
+css::i18n::LineBreakHyphenationOptions aHyphOptions( 
LinguMgr::GetHyphenator(), css::uno::Sequence(), 1 );
+xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], 
/*nMinBreakPos*/0, aHyphOptions, aUserOptions);
+
 css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = 
css::ui::GlobalAcceleratorConfiguration::create(
 comphelper::getProcessComponentContext());
 xGlobalCfg->getAllKeyEvents();


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-16 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 95f1f2143ae53469417fcebc9b2020c34b53ff30
Author: Michael Meeks 
AuthorDate: Tue Apr 16 18:24:26 2024 +0100
Commit: Caolán McNamara 
CommitDate: Tue Apr 16 20:51:53 2024 +0200

lok: elide various unhelpful events during background save.

In particular TEXT_SELECTION and TABLE_SELECTED seem to be favorites,
but nothing good would come of getting these others either.

Change-Id: I1f014824452bffaeddb1dfaf6565542c3c7c9e91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166158
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1c047116a22d..04c46306f12e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1697,6 +1697,29 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 
 SAL_INFO("lok", "Queue: [" << type << "]: [" << aCallbackData.getPayload() 
<< "] on " << m_queue1.size() << " entries.");
 
+if (comphelper::LibreOfficeKit::isForkedChild())
+{
+// In background mode - avoid any extraneous or confusing messages
+switch (type)
+{
+case LOK_CALLBACK_INVALIDATE_TILES:
+case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
+case LOK_CALLBACK_TEXT_SELECTION:
+case LOK_CALLBACK_CURSOR_VISIBLE:
+case LOK_CALLBACK_GRAPHIC_SELECTION:
+case LOK_CALLBACK_TABLE_SELECTED:
+case LOK_CALLBACK_SET_PART:
+case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
+case LOK_CALLBACK_MOUSE_POINTER:
+case LOK_CALLBACK_INVALIDATE_HEADER:
+case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
+SAL_INFO("lok", "Elide event in background save mode");
+return;
+default:
+break;
+}
+}
+
 bool bIsChartActive = false;
 bool bIsComment = false;
 if (type == LOK_CALLBACK_GRAPHIC_SELECTION)


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-04-03 Thread Pranam Lashkari (via logerrit)
 desktop/source/lib/init.cxx |   35 ++-
 1 file changed, 26 insertions(+), 9 deletions(-)

New commits:
commit 4fcaf961e243fb0f03e42df380d9843ed2f2080c
Author: Pranam Lashkari 
AuthorDate: Wed Apr 3 00:08:45 2024 +0530
Commit: Caolán McNamara 
CommitDate: Wed Apr 3 14:26:01 2024 +0200

LOK: set creation date when online creates file from template

problem:
when online created file using WOPI clients, creation dates were never set.
in online files are created using templates, even empty files are created 
using
an empty template

Change-Id: I3f022427745de7204faac9418620e2a87f9cf684
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165705
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bfe4ff5fd699..2c4fba114092 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3382,6 +3382,19 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
 pApp->m_pCallbackData = pLib->mpCallbackData = pData;
 }
 
+static SfxObjectShell* getSfxObjectShell(LibreOfficeKitDocument* pThis)
+{
+LibLODocument_Impl* pDocument = static_cast(pThis);
+if (!pDocument)
+return nullptr;
+
+SfxBaseModel* pBaseModel = 
dynamic_cast(pDocument->mxComponent.get());
+if (!pBaseModel)
+return nullptr;
+
+return pBaseModel->GetObjectShell();
+}
+
 static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const 
char* pFormat, const char* pFilterOptions)
 {
 comphelper::ProfileZone aZone("doc_saveAs");
@@ -3531,6 +3544,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 const uno::Sequence aOptionSeq = 
comphelper::string::convertCommaSeparated(aFilterOptions);
 std::vector aFilteredOptionVec;
 bool bTakeOwnership = false;
+bool bCreateFromTemplate = false;
 MediaDescriptor aSaveMediaDescriptor;
 for (const auto& rOption : aOptionSeq)
 {
@@ -3538,10 +3552,21 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 bTakeOwnership = true;
 else if (rOption == "NoFileSync")
 aSaveMediaDescriptor[u"NoFileSync"_ustr] <<= true;
+else if (rOption == "FromTemplate")
+bCreateFromTemplate = true;
 else
 aFilteredOptionVec.push_back(rOption);
 }
 
+if (bCreateFromTemplate && bTakeOwnership)
+{
+if (SfxObjectShell* pObjectShell = getSfxObjectShell(pThis))
+{
+DateTime now( ::DateTime::SYSTEM );
+
pObjectShell->getDocProperties()->setCreationDate(now.GetUNODateTime());
+}
+}
+
 aSaveMediaDescriptor[u"Overwrite"_ustr] <<= true;
 aSaveMediaDescriptor[u"FilterName"_ustr] <<= aFilterName;
 
@@ -5931,15 +5956,7 @@ static void doc_resetSelection(LibreOfficeKitDocument* 
pThis)
 
 static char* getDocReadOnly(LibreOfficeKitDocument* pThis)
 {
-LibLODocument_Impl* pDocument = static_cast(pThis);
-if (!pDocument)
-return nullptr;
-
-SfxBaseModel* pBaseModel = 
dynamic_cast(pDocument->mxComponent.get());
-if (!pBaseModel)
-return nullptr;
-
-SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+SfxObjectShell* pObjectShell = getSfxObjectShell(pThis);
 if (!pObjectShell)
 return nullptr;
 


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/sfx2 sfx2/source

2024-03-28 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   13 +
 include/sfx2/objsh.hxx  |4 
 sfx2/source/doc/objxtor.cxx |5 +
 3 files changed, 22 insertions(+)

New commits:
commit 7d784910689172014b8cf6144e654402696d8801
Author: Michael Meeks 
AuthorDate: Thu Mar 28 09:38:15 2024 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 28 17:15:58 2024 +0100

lok: add method to allow explicit cleanup of temporary files.o

Special case fast destruction of background saving children.

Change-Id: I8fba4d0818d23a8b0e1bb4d074e1afae7dacde33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165448
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 52882a4a9f88..68191600f0f8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1471,6 +1471,19 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference 
 xC
 
 LibLODocument_Impl::~LibLODocument_Impl()
 {
+if (comphelper::LibreOfficeKit::isForkedChild())
+{
+// Touch the least memory possible, while trying to avoid leaking 
files.
+SfxBaseModel* pBaseModel = 
dynamic_cast(mxComponent.get());
+if (pBaseModel)
+{
+SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+if (pObjectShell)
+pObjectShell->InternalCloseAndRemoveFiles();
+}
+return;
+}
+
 try
 {
 mxComponent->dispose();
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 3175cb283642..32d9afd6ed6f 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -239,6 +239,7 @@ private:
 
 public:
 static const css::uno::Sequence& getUnoTunnelId();
+
 /* Stampit disable/enable cancel button for print jobs
default = true = enable! */
 voidStamp_SetPrintCancelState(bool bState);
@@ -699,6 +700,9 @@ public:
 bool bShowCloseButton = true);
 std::vector& getPendingInfobars();
 
+// Destruction of storages and streams
+void InternalCloseAndRemoveFiles();
+
 SAL_DLLPRIVATE bool CreatePreview_Impl(bool bFullContent, VirtualDevice* 
pDevice, GDIMetaFile* pFile) const;
 
 SAL_DLLPRIVATE static bool IsPackageStorageFormat_Impl(const SfxMedium &);
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 11b38ced10a0..434c0f17992d 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -306,6 +306,11 @@ SfxObjectShell::~SfxObjectShell()
 
 pImpl->pBaseModel.clear();
 
+InternalCloseAndRemoveFiles();
+}
+
+void SfxObjectShell::InternalCloseAndRemoveFiles()
+{
 // don't call GetStorage() here, in case of Load Failure it's possible 
that a storage was never assigned!
 if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( false ) 
== pImpl->m_xDocStorage )
 pMedium->CanDisposeStorage_Impl( false );


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/sfx2 sd/qa sfx2/source

2024-03-21 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx  |   54 ---
 include/sfx2/sidebar/Sidebar.hxx |2 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   38 ++-
 sfx2/source/sidebar/Sidebar.cxx  |   46 +++
 sfx2/source/sidebar/SidebarController.cxx|   10 -
 5 files changed, 103 insertions(+), 47 deletions(-)

New commits:
commit ccf6c869c3f61f410f608af007acb2f655f40985
Author: Miklos Vajna 
AuthorDate: Wed Mar 20 12:08:42 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Mar 21 10:43:29 2024 +0100

cool#8278 sfx2 lok: fix unexpected non-json sidebar status update

Open an Impress document via LOK, open the slide layout sidebar, click
the toggle icon so it gets closed: the toggle icon will signal that the
sidebar is open, when it's closed already.

This is a regression from commit
aaf6ce108e91b1504befe19afcee471e3316ae7a (cool#7492 sfx2 lok: set
language/locale on async sidebar update, 2024-01-11), previously we
always emitted LOK_CALLBACK_STATE_CHANGED callbacks with plain text
payloads for the sidebar, where the locale with implicit (with all its
issues), but the above scenario worked fine.

Fix the problem by making SidebarController::disposeDecks() consistent
with SwitchToDeck(), so now we always emit JSON payloads for the sidebar
deck changes.

An alternative would be to improve the code around extractUnoCommand()
in online.git to handle a mix of plain text and JSON payloads, but the
plain text payload is tricky to extend, so using more JSON payloads
sounds like a better fix.

(cherry picked from commit 55feb670ca28e0a48ac82a65b5559598704d993e)

Conflicts:
sd/qa/unit/tiledrendering/tiledrendering.cxx

Change-Id: I5b75c2987c230c6720181a1e95ae579727943235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165092
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 264d0515cf0e..437c904e0db2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -151,6 +151,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -991,49 +992,6 @@ void ExecuteOrientationChange()
 mxUndoManager->leaveUndoContext();
 }
 
-void setupSidebar(std::u16string_view sidebarDeckId = u"")
-{
-SfxViewShell* pViewShell = SfxViewShell::Current();
-SfxViewFrame* pViewFrame = pViewShell ? >GetViewFrame() : 
nullptr;
-if (pViewFrame)
-{
-if (!pViewFrame->GetChildWindow(SID_SIDEBAR))
-pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, 
true /* focus */);
-
-pViewFrame->ShowChildWindow(SID_SIDEBAR, true);
-
-// Force synchronous population of panels
-SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
-if (!pChild)
-return;
-
-auto pDockingWin = dynamic_cast(pChild->GetWindow());
-if (!pDockingWin)
-return;
-
-pViewFrame->ShowChildWindow( SID_SIDEBAR );
-
-const rtl::Reference& xController
-= pDockingWin->GetOrCreateSidebarController();
-
-xController->FadeIn();
-xController->RequestOpenDeck();
-
-if (!sidebarDeckId.empty())
-{
-xController->SwitchToDeck(sidebarDeckId);
-}
-else
-{
-xController->SwitchToDefaultDeck();
-}
-
-pDockingWin->SyncUpdate();
-}
-else
-SetLastExceptionMsg(u"No view shell or sidebar"_ustr);
-}
-
 void hideSidebar()
 {
 SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -5302,12 +5260,18 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 }
 else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage")
 {
-setupSidebar(u"WriterPageDeck");
+if (!sfx2::sidebar::Sidebar::Setup(u"WriterPageDeck"))
+{
+SetLastExceptionMsg(u"failed to set up sidebar"_ustr);
+}
 return;
 }
 else if (gImpl && aCommand == ".uno:SidebarShow")
 {
-setupSidebar();
+if (!sfx2::sidebar::Sidebar::Setup(u""))
+{
+SetLastExceptionMsg(u"failed to set up sidebar"_ustr);
+}
 return;
 }
 else if (gImpl && aCommand == ".uno:SidebarHide")
diff --git a/include/sfx2/sidebar/Sidebar.hxx b/include/sfx2/sidebar/Sidebar.hxx
index f4d0c1cc9bcb..93212a8ed557 100644
--- a/include/sfx2/sidebar/Sidebar.hxx
+++ b/include/sfx2/sidebar/Sidebar.hxx
@@ -61,6 +61,8 @@ public:
 static bool IsPanelVisible(
 std::u16string_view rsPanelId,
 const css::uno::Reference& rxFrame);
+
+static bool Setup(std::u16string_view sidebarDeckId = u"");
 };
 
 } // end of namespace sfx2::sidebar
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 

core.git: Branch 'distro/collabora/co-24.04' - desktop/source sfx2/source

2024-03-12 Thread Aron Budea (via logerrit)
 desktop/source/lib/init.cxx  |2 ++
 sfx2/source/control/unoctitm.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit ee979fc26c6509e077be0b746d907d6e13619954
Author: Aron Budea 
AuthorDate: Tue Mar 12 18:20:24 2024 +1030
Commit: Aron Budea 
CommitDate: Tue Mar 12 13:41:34 2024 +0100

lok: Send Accept / RejectTrackedChangedToNext state change

Change-Id: I194c0c3260fe90273f5b5f50c18a63e48ae85449
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164699
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 739ba2a42021..264d0515cf0e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3790,6 +3790,8 @@ static void doc_iniUnoCommands ()
 u".uno:ParaspaceDecrease"_ustr,
 u".uno:AcceptTrackedChange"_ustr,
 u".uno:RejectTrackedChange"_ustr,
+u".uno:AcceptTrackedChangeToNext"_ustr,
+u".uno:RejectTrackedChangeToNext"_ustr,
 u".uno:ShowResolvedAnnotations"_ustr,
 u".uno:InsertBreak"_ustr,
 u".uno:InsertEndnote"_ustr,
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 9b588293082b..fade31109f35 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1073,6 +1073,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "RejectAllTrackedChanges" ||
  aEvent.FeatureURL.Path == "AcceptTrackedChange" ||
  aEvent.FeatureURL.Path == "RejectTrackedChange" ||
+ aEvent.FeatureURL.Path == "AcceptTrackedChangeToNext" ||
+ aEvent.FeatureURL.Path == "RejectTrackedChangeToNext" ||
  aEvent.FeatureURL.Path == "NextTrackedChange" ||
  aEvent.FeatureURL.Path == "PreviousTrackedChange" ||
  aEvent.FeatureURL.Path == "FormatGroup" ||


core.git: Branch 'distro/collabora/co-24.04' - desktop/source sfx2/source

2024-03-08 Thread Gökay Şatır (via logerrit)
 desktop/source/lib/init.cxx  |3 +++
 sfx2/source/control/unoctitm.cxx |   15 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit b44a1fdd7e0f5f7be02665407ebbc15b977d2f7b
Author: Gökay Şatır 
AuthorDate: Fri Mar 8 13:51:01 2024 +0300
Commit: Michael Meeks 
CommitDate: Fri Mar 8 14:55:10 2024 +0100

Allow enabling saving when comment edit is allowed in readonly.

Signed-off-by: Gökay Şatır 
Change-Id: I88d535a5b23fb6d5de8e72eec61bdf3550bc757d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164570
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c98362b6ba63..739ba2a42021 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5124,6 +5124,9 @@ static bool isCommandAllowed(OUString& command) {
 return true;
 else
 {
+if (command == u".uno:Save"_ustr && SfxViewShell::Current() && 
SfxViewShell::Current()->IsAllowChangeComments())
+return true;
+
 for (size_t i = 0; i < std::size(nonAllowedList); i++)
 {
 if (nonAllowedList[i] == command)
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 7ddfd50a0796..9b588293082b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -547,7 +547,20 @@ static bool isCommandAllowedForViewType(const OUString& 
command)
 u"CopyHyperlinkLocation"_ustr
 };
 
-return std::find(std::begin(allowedCommandList), 
std::end(allowedCommandList), command) != std::end(allowedCommandList);
+bool allowed = std::find(std::begin(allowedCommandList), 
std::end(allowedCommandList), command) != std::end(allowedCommandList);
+
+if (!allowed && SfxViewShell::Current() && 
SfxViewShell::Current()->IsAllowChangeComments())
+{
+constexpr OUString allowedCommentCommandList[] = {
+u"InsertAnnotation"_ustr,
+u"DeleteComment"_ustr,
+u"DeleteAnnotation"_ustr,
+u"EditAnnotation"_ustr
+};
+allowed = std::find(std::begin(allowedCommentCommandList), 
std::end(allowedCommentCommandList), command) != 
std::end(allowedCommentCommandList);
+}
+
+return allowed;
 }
 
 return true;


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/LibreOfficeKit include/svx libreofficekit/source svx/source

2024-03-08 Thread Pranam Lashkari (via logerrit)
 desktop/source/lib/init.cxx  |1 
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 
 include/svx/svdmrkv.hxx  |2 
 libreofficekit/source/gtk/lokdocview.cxx |1 
 svx/source/svdraw/svdedxv.cxx|6 ++
 svx/source/svdraw/svdmrkv.cxx|   55 ++-
 6 files changed, 57 insertions(+), 17 deletions(-)

New commits:
commit 12fd51017dc45ba032a9788825d305e4a3e2e131
Author: Pranam Lashkari 
AuthorDate: Thu Mar 7 23:08:24 2024 +0530
Commit: Caolán McNamara 
CommitDate: Fri Mar 8 10:54:39 2024 +0100

LOK: send inner text boundry information of shapes/textbox on change

instroduced new callback for LOK LOK_CALLBACK_SHAPE_INNER_TEXT

now if innert text is changed LOK is instantly updated about new textarea

Change-Id: I0a88e1dd77556e47f14359ce0a98701a327aceda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164547
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 586d9b4d84cc..bde805eedce5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1876,6 +1876,7 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED:
 case LOK_CALLBACK_COLOR_PALETTES:
 case LOK_CALLBACK_TOOLTIP:
+case LOK_CALLBACK_SHAPE_INNER_TEXT:
 {
 if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
aCallbackData.getPayload() << "].");
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 2b499b091105..9a6f34bbd846 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -1045,6 +1045,13 @@ typedef enum
  */
 LOK_CALLBACK_TOOLTIP = 71,
 
+/**
+ * Used for sending the rectangle for text inside a shape/textbox
+ *
+ *  Payload contains the rectangle details
+ */
+LOK_CALLBACK_SHAPE_INNER_TEXT = 72,
+
 }
 LibreOfficeKitCallbackType;
 
@@ -1217,6 +1224,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_CORE_LOG";
 case LOK_CALLBACK_TOOLTIP:
 return "LOK_CALLBACK_TOOLTIP";
+case LOK_CALLBACK_SHAPE_INNER_TEXT:
+return "LOK_CALLBACK_SHAPE_INNER_TEXT";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 162581fc5def..6421b51b0dba 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -150,6 +150,7 @@ private:
 void UndirtyMrkPnt() const;
 
 void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell);
+OString CreateInnerTextRectString() const;
 bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree);
 
 protected:
@@ -246,6 +247,7 @@ public:
 /// whether all x coordinates in use are negated or not
 void SetNegativeX(bool bOn) { mbNegativeX = bOn; }
 bool IsNegativeX() const { return mbNegativeX; }
+void SetInnerTextAreaForLOKit() const;
 
 // migrate selections
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index f025cf99a140..60c3435ac28d 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1498,6 +1498,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_A11Y_SELECTION_CHANGED:
 case LOK_CALLBACK_CORE_LOG:
 case LOK_CALLBACK_TOOLTIP:
+case LOK_CALLBACK_SHAPE_INNER_TEXT:
 {
 // TODO: Implement me
 break;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c2d35cc75b6b..0efdd449e00e 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1964,7 +1964,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 if (mpTextEditOutlinerView->PostKeyEvent(rKEvt, pWin))
 {
 if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
+{
 GetModel().SetChanged();
+SetInnerTextAreaForLOKit();
+}
 
 /* Start chaining processing */
 ImpChainingEventHdl();
@@ -2155,7 +2158,10 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, 
vcl::Window* pWin)
 // It could execute CommandEventId::ExtTextInput, while 
SdrObjEditView::KeyInput
 // isn't called
 if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
+{
 GetModel().SetChanged();
+SetInnerTextAreaForLOKit();
+}
 }
 return true;
 }
diff --git 

core.git: Branch 'distro/collabora/co-24.04' - desktop/source editeng/source include/sfx2 sc/source sfx2/inc sfx2/source svx/sdi svx/source sw/source

2024-03-06 Thread Gökay Şatır (via logerrit)
 desktop/source/lib/init.cxx |   28 
 editeng/source/editeng/editview.cxx |3 -
 editeng/source/editeng/impedit2.cxx |   83 +++-
 include/sfx2/viewsh.hxx |1 
 sc/source/ui/app/inputhdl.cxx   |6 +-
 sc/source/ui/view/gridwin.cxx   |2 
 sfx2/inc/unoctitm.hxx   |1 
 sfx2/source/control/dispatch.cxx|   13 +++--
 sfx2/source/control/unoctitm.cxx|   39 
 sfx2/source/doc/objmisc.cxx |3 -
 sfx2/source/view/viewsh.cxx |7 +++
 svx/sdi/svx.sdi |2 
 svx/source/svdraw/svdedtv.cxx   |3 -
 sw/source/uibase/docvw/edtwin.cxx   |   68 +++--
 sw/source/uibase/inc/edtwin.hxx |2 
 sw/source/uibase/uiview/srcview.cxx |2 
 16 files changed, 180 insertions(+), 83 deletions(-)

New commits:
commit c60598390725cc23dc1401beec057f1386226ac8
Author: Gökay Şatır 
AuthorDate: Thu Feb 22 13:54:06 2024 +0300
Commit: Gökay ŞATIR 
CommitDate: Wed Mar 6 11:21:47 2024 +0100

Moving parts of readonly checks from model to view.

Summary for what's done with this commit:
init.cxx
* Add guards for modify commands.

viewsh:
* Add "IsCurrentLokViewReadOnly" for ease of use.

unocitm:
* Add guard for modify comamnds

dispatch.cxx
* Implement readonlyview.

objmisc:
* Modify IsReadOnlyUI check for LokReadOnly view.

svx.sdi:
* Disable TableChangeCurrentBorderPosition command for readOnly views.

sw-editwin:
* Treat mouse moves as readonly when the view is LokReadOnly.

gridwin:
* For autofilter.

impedit2, inputhdl:
* For text input.

svdedtc:
* For sdr object dragging.

Signed-off-by: Gökay Şatır 
Change-Id: I71fc353976256bce22042bbb6042ee464b65cc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163731
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gökay ŞATIR 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 939fe2afc09f..586d9b4d84cc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4726,6 +4726,10 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
 static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId, int nCharBefore, int nCharAfter)
 {
 SolarMutexGuard aGuard;
+
+if (SfxViewShell::IsCurrentLokViewReadOnly())
+return;
+
 VclPtr pWindow;
 if (nLOKWindowId == 0)
 {
@@ -5107,6 +5111,23 @@ void LibLibreOffice_Impl::dumpState(rtl::OStringBuffer 
)
 vcl::lok::dumpState(rState);
 }
 
+// We have special handling for some uno commands and it seems we need to 
check for readonly state.
+static bool isCommandAllowed(OUString& command) {
+static constexpr OUString nonAllowedList[] = { u".uno:Save"_ustr, 
u".uno:TransformDialog"_ustr, u".uno:SidebarShow"_ustr, 
u".uno:SidebarHide"_ustr };
+
+if (!SfxViewShell::IsCurrentLokViewReadOnly())
+return true;
+else
+{
+for (size_t i = 0; i < std::size(nonAllowedList); i++)
+{
+if (nonAllowedList[i] == command)
+return false;
+}
+return true;
+}
+}
+
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
 {
 comphelper::ProfileZone aZone("doc_postUnoCommand");
@@ -5116,6 +5137,10 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 
 SfxObjectShell* pDocSh = SfxObjectShell::Current();
 OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
+
+if (!isCommandAllowed(aCommand))
+return;
+
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
 std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
@@ -7167,6 +7192,9 @@ static void 
doc_sendContentControlEvent(LibreOfficeKitDocument* pThis, const cha
 return;
 }
 
+if (SfxViewShell::IsCurrentLokViewReadOnly())
+return;
+
 StringMap aMap(jsdialog::jsonToStringMap(pArguments));
 ITiledRenderable* pDoc = getTiledRenderable(pThis);
 if (!pDoc)
diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index a7d52c341bb6..e2f429bc7789 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -155,6 +155,7 @@ EditViewCallbacks::~EditViewCallbacks()
 EditView::EditView( EditEngine* pEng, vcl::Window* pWindow )
 {
 pImpEditView.reset( new ImpEditView( this, pEng, pWindow ) );
+pImpEditView->bReadOnly = pImpEditView->bReadOnly || 
SfxViewShell::IsCurrentLokViewReadOnly();
 }
 
 EditView::~EditView()
@@ -252,7 +253,7 @@ void EditView::Invalidate()
 
 void EditView::SetReadOnly( bool bReadOnly )
 {
-pImpEditView->bReadOnly = 

core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-02-26 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |   36 
 1 file changed, 36 insertions(+)

New commits:
commit 500d54ca97137473a9d78956381386d70c01ccbf
Author: Caolán McNamara 
AuthorDate: Mon Feb 26 11:57:43 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 26 14:48:41 2024 +0100

return early without error if no shape it selected on generating preview

of current selection. Which can arise in calc on repeatedly
double-clicking on a shape and pressing esc. Eventually there will
be a case where the shape isn't selected by the time the preview
generation is attempted.

Change-Id: Ic92149b5e12f35fe69265b6c8df289819313a899
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163847
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index da46761b085c..65e131cc48a3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -133,6 +133,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #ifdef IOS
@@ -4820,6 +4822,37 @@ static void 
doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n
 }
 }
 
+// To be an exportable selection, there must be something selected and that
+// selection can't be "ScCellObj" which doesn't can't provide a svg.
+//
+// Typically a problem arises when double clicking a shape in calc. The 1st
+// click selects the shape, triggering generation of a preview, but the second
+// shape engers into edit mode befoce doc_renderShapeSelection has a chance to
+// fire, at which point the shape is no longer selected. Rather than generate
+// an error just return a 0 length result if there is no shape selected, so we
+// continue to generate an error if a shape is selected, but could not provide
+// an svg.
+static bool doc_hasShapeSelection(const 
css::uno::Reference& rComponent)
+{
+uno::Reference xModel(rComponent, uno::UNO_QUERY);
+if (!xModel.is())
+return false;
+
+uno::Reference 
xController(xModel->getCurrentController());
+if (!xController.is())
+return false;
+
+uno::Reference xSelectionSupplier(xController, 
uno::UNO_QUERY);
+if (!xSelectionSupplier.is())
+return false;
+
+Any selection = xSelectionSupplier->getSelection();
+uno::Reference xSelection;
+selection >>= xSelection;
+
+return xSelection && xSelection->getImplementationName() != "ScCellObj";
+}
+
 static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** 
pOutput)
 {
 comphelper::ProfileZone aZone("doc_renderShapeSelection");
@@ -4836,6 +4869,9 @@ static size_t 
doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu
 {
 LibLODocument_Impl* pDocument = 
static_cast(pThis);
 
+if (!doc_hasShapeSelection(pDocument->mxComponent))
+return 0;
+
 uno::Reference xStorable(pDocument->mxComponent, 
uno::UNO_QUERY_THROW);
 
 SvMemoryStream aOutStream;


core.git: Branch 'distro/collabora/co-24.04' - desktop/source sc/source

2024-02-09 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx|   14 +++---
 sc/source/ui/view/gridwin4.cxx |4 ++--
 sc/source/ui/view/viewfunc.cxx |   10 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 0261aea9d821bda69eef67d5fc6725e8c1cda483
Author: Caolán McNamara 
AuthorDate: Fri Feb 9 14:05:17 2024 +
Commit: Andras Timar 
CommitDate: Fri Feb 9 17:52:16 2024 +0100

fix various loplugin warnings

Change-Id: I84c6487b025738f7e4fb8b38d731e19a91ce4451
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163168
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0085b2609800..0fd3e62a571c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7551,18 +7551,18 @@ static void preloadData()
 #pragma GCC diagnostic pop
 #endif
 
-static const OUString preloadComponents[] = {
-"private:factory/swriter",
-"private:factory/scalc",
-"private:factory/simpress",
-"private:factory/sdraw"
+static constexpr OUString preloadComponents[] = {
+u"private:factory/swriter"_ustr,
+u"private:factory/scalc"_ustr,
+u"private:factory/simpress"_ustr,
+u"private:factory/sdraw"_ustr
 };
 // getting the remote LibreOffice service manager
-uno::Reference 
xCompLoader(frame::Desktop::create(xContext), uno::UNO_QUERY);
+uno::Reference 
xCompLoader(frame::Desktop::create(xContext));
 
 // Preload and close each of the main components once to initialize global 
state
 uno::Sequence szEmptyArgs(0);
-for (auto component : preloadComponents)
+for (const auto& component : preloadComponents)
 {
 auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, 
szEmptyArgs);
 xComp->dispose();
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 1d747f709e50..4a9e92668b7e 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1153,8 +1153,8 @@ void ScGridWindow::DrawContent(OutputDevice , 
const ScTableInfo& rTableI
 
 // keep into account the zoom factor
 static const double twipFactor = 15 * 1.7639; // 26.4585
-Point aNewOrigin = Point((aOriginAbsPx.getX() * twipFactor) / 
static_cast(aDrawMode.GetScaleX()),
- (aOriginAbsPx.getY() * twipFactor) / 
static_cast(aDrawMode.GetScaleY()));
+Point aNewOrigin((aOriginAbsPx.getX() * twipFactor) / 
static_cast(aDrawMode.GetScaleX()),
+ (aOriginAbsPx.getY() * twipFactor) / 
static_cast(aDrawMode.GetScaleY()));
 
 MapMode aNewMM = rDevice.GetMapMode();
 aNewMM.SetOrigin(aNewOrigin);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 5d5d07b215c6..94cbb305c64e 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -134,6 +134,8 @@ ScViewFunc::~ScViewFunc()
 {
 }
 
+namespace {
+
 struct FormulaProcessingContext
 {
 std::shared_ptr aPos;
@@ -174,8 +176,6 @@ struct FormulaProcessingContext
 }
 };
 
-namespace {
-
 void collectUIInformation(std::map&& aParameters, const 
OUString& rAction)
 {
 EventDescription aDescription;
@@ -442,7 +442,7 @@ namespace
 {
 void runAutoCorrectQueryAsync(std::shared_ptr 
context);
 
-void performAutoFormatAndUpdate(const OUString& rString, const ScMarkData& 
rMark, SCCOL nCol,
+void performAutoFormatAndUpdate(std::u16string_view rString, const 
ScMarkData& rMark, SCCOL nCol,
 SCROW nRow, SCTAB nTab, bool 
bNumFmtChanged, bool bRecord,
 const 
std::shared_ptr& pModificator,
 ScViewFunc& rViewFunc)
@@ -456,7 +456,7 @@ namespace
 ScDocShell* pDocSh = rViewData.GetDocShell();
 pDocSh->UpdateOle(rViewData);
 
-const OUString aType(rString.isEmpty() ? u"delete-content" : 
u"cell-change");
+const OUString aType(rString.empty() ? u"delete-content" : 
u"cell-change");
 HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, rMark, nCol, 
nRow, aType);
 
 if (bRecord)
@@ -630,7 +630,7 @@ namespace
 void runAutoCorrectQueryAsync(std::shared_ptr 
context)
 {
 auto aQueryBox = 
std::make_shared(context->GetViewData().GetDialogParent(), 
context->aCorrectedFormula);
-aQueryBox->runAsync(aQueryBox, [context] (int nResult)
+weld::DialogController::runAsync(aQueryBox, [context] (int nResult)
 {
 if (nResult == RET_YES) {
 context->aFormula = context->aCorrectedFormula;


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-02-07 Thread Gabriel Masei (via logerrit)
 desktop/source/lib/init.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 8bad43079758460c0b65455bf9f7a2187d05e27b
Author: Gabriel Masei 
AuthorDate: Fri Jan 19 18:11:42 2024 +0200
Commit: Andras Timar 
CommitDate: Wed Feb 7 13:11:40 2024 +0100

lok: remove non-filter options from filter options

Filter options should be what remains after extracting any
other options from the original list of options.

Change-Id: Iad787b34aba58c3910118e94df66a102b44034c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162316
Tested-by: Jenkins
Reviewed-by: Henry Castro 
(cherry picked from commit 8c10c63388502322ac0ac6a7e5b14e657edbe630)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162451
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c76e7a014725..0085b2609800 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2765,8 +2765,6 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
  Application::SetDialogCancelMode(DialogCancelMode::LOKSilent);
 }
 
-const OUString sFilterOptions = aOptions;
-
 rtl::Reference const pInteraction(
 new LOKInteractionHandler("load"_ostr, pLib));
 auto const 
pair(pLib->mInteractionMap.insert(std::make_pair(aURL.toUtf8(), pInteraction)));
@@ -2802,7 +2800,7 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 // as regular files, otherwise we cannot save them; it will try
 // to bring saveas dialog which cannot work with LOK case
 uno::Sequence aFilterOptions{
-comphelper::makePropertyValue(u"FilterOptions"_ustr, 
sFilterOptions),
+comphelper::makePropertyValue(u"FilterOptions"_ustr, aOptions),
 comphelper::makePropertyValue(u"InteractionHandler"_ustr, 
xInteraction),
 comphelper::makePropertyValue(u"MacroExecutionMode"_ustr, 
nMacroExecMode),
 comphelper::makePropertyValue(u"AsTemplate"_ustr, false),


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-02-02 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit d85cb3832286ae1fdcf4a8494abb8212f21e4e9a
Author: Michael Meeks 
AuthorDate: Fri Feb 2 18:16:40 2024 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 2 22:47:28 2024 +0100

preload: open and close empty documents of main types in preinit.

Some quick testing suggest this saves ~800k for writer, ~3Mb for
impress each loading an ~empty hello-world document.

Change-Id: I9a7bc25d38d82b5556dfb04a99d5c145dd71ffec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162939
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 80442dc5ffa2..c76e7a014725 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7553,6 +7553,23 @@ static void preloadData()
 #pragma GCC diagnostic pop
 #endif
 
+static const OUString preloadComponents[] = {
+"private:factory/swriter",
+"private:factory/scalc",
+"private:factory/simpress",
+"private:factory/sdraw"
+};
+// getting the remote LibreOffice service manager
+uno::Reference 
xCompLoader(frame::Desktop::create(xContext), uno::UNO_QUERY);
+
+// Preload and close each of the main components once to initialize global 
state
+uno::Sequence szEmptyArgs(0);
+for (auto component : preloadComponents)
+{
+auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, 
szEmptyArgs);
+xComp->dispose();
+}
+
 // Set user profile's path back to the original one
 rtl::Bootstrap::set(u"UserInstallation"_ustr, sUserPath);
 }


core.git: Branch 'distro/collabora/co-24.04' - desktop/source

2024-01-23 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 4f404f2b18692276d157c4de9bfbb1f6370ad58d
Author: Caolán McNamara 
AuthorDate: Tue Jan 23 19:37:54 2024 +
Commit: Andras Timar 
CommitDate: Tue Jan 23 21:22:07 2024 +0100

preload sal_textenc

use RTL_TEXTENCODING_MS_1250 to trigger Impl_getTextEncodingData to
dlopen sal_textenclo early

Change-Id: Ie96b81615cbd4b479d731916518835b2f72adf6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162477
Reviewed-by: Neil Guertin 
Reviewed-by: Michael Meeks 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index faa6d44cd447..80442dc5ffa2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7435,6 +7435,12 @@ static void preloadData()
 if(bAbort)
 std::cerr << "CheckExtensionDependencies failed" << std::endl;
 
+std::cerr << "Preload textencodings"; // sal_textenc
+// Use RTL_TEXTENCODING_MS_1250 to trigger Impl_getTextEncodingData
+// to dlopen sal_textenclo
+(void)OUStringToOString(u"arbitrary string", RTL_TEXTENCODING_MS_1250);
+std::cerr << "
";
+
 // setup LanguageTool config before spell checking init
 setLanguageToolConfig();
 


core.git: Branch 'distro/collabora/co-24.04' - desktop/source include/LibreOfficeKit libreofficekit/source sfx2/source sw/qa sw/source

2024-01-16 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx|   28 +--
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |   14 +
 libreofficekit/source/gtk/lokdocview.cxx   |1 
 sfx2/source/view/lokhelper.cxx |3 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   45 ++
 sw/source/uibase/docvw/edtwin2.cxx |   60 -
 6 files changed, 116 insertions(+), 35 deletions(-)

New commits:
commit 6a20e8ae6c7d60ea39df4e2308f57880d64b7229
Author: Mike Kaganski 
AuthorDate: Tue Dec 26 14:08:07 2023 +0600
Commit: Michael Meeks 
CommitDate: Tue Jan 16 21:01:58 2024 +

Send tooltip text to LOK

Call vcl::Window::RequestHelp from LOKPostAsyncEvent for
mouse movement. Introduce LOK_CALLBACK_TOOLTIP callback
type, and send it from SwEditWin::RequestHelp.

Intention is, that the tooltip is shown by client at the
current mouse pointer position, which is hopefully not
far away from the point that generated the mouse event.
On the next movement, the client starts a timer to hide
the tooltip. If the next tooltip message arrives, the
tooltip would be updated in the new place.

Alternatively, the payload could contain the coordinates
from the HelpEvent.

Change-Id: I8e96eb6e6983ad8d13b4c5d7be4d51ff3fd11893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161302
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6d141aeca865..6701988a5c0a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1845,6 +1845,7 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
 case LOK_CALLBACK_INVALIDATE_TILES:
+case LOK_CALLBACK_TOOLTIP:
 if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
aCallbackData.getPayload() << "].");
 break;
@@ -1872,6 +1873,7 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED:
 case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED:
 case LOK_CALLBACK_COLOR_PALETTES:
+case LOK_CALLBACK_TOOLTIP:
 {
 if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
aCallbackData.getPayload() << "].");
@@ -1881,28 +1883,26 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 // These are safe to use the latest state and ignore previous
 // ones (if any) since the last overrides previous ones,
 // but only if the view is the same.
+case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
+// 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
+if (aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") 
== -1
+&& aCallbackData.getPayload().indexOf("\"hyperlink\": {}") 
== -1)
+break;
+[[fallthrough]];
 case LOK_CALLBACK_CELL_VIEW_CURSOR:
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
-case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
 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
-const bool hyperLinkException = type == 
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
-aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") 
== -1 &&
-aCallbackData.getPayload().indexOf("\"hyperlink\": {}") == 
-1;
-if(!hyperLinkException)
-{
-const int nViewId = aCallbackData.getViewId();
-removeAll(type, [nViewId] (const CallbackData& elemData) {
-return (nViewId == elemData.getViewId());
-}
-);
-}
+const int nViewId = aCallbackData.getViewId();
+removeAll(type, [nViewId] (const CallbackData& elemData) {
+return (nViewId == elemData.getViewId());
+}
+);