[Libreoffice-commits] core.git: include/LibreOfficeKit include/sfx2 libreofficekit/source sfx2/source

2023-11-11 Thread Marco Cecchetti (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   12 +-
 include/sfx2/lokhelper.hxx   |   31 
 libreofficekit/source/gtk/lokdocview.cxx |1 
 sfx2/source/view/lokhelper.cxx   |   33 +
 sfx2/source/view/viewsh.cxx  |   51 +--
 5 files changed, 102 insertions(+), 26 deletions(-)

New commits:
commit 96ed41755b82cd47c27f40d4231e6ed9f915a976
Author: Marco Cecchetti 
AuthorDate: Wed Nov 1 22:49:07 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat Nov 11 22:22:52 2023 +0100

lok: a11y: implemented support for notifying core log to client

In this way core log can be printed to the browser console.
This may help in understanding if some core event occurs earlier or
later wrt a client event.

Change-Id: I720ef9b149e98ddbc252aa069649019e79ef6cb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158780
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 
(cherry picked from commit d8dc138be7e69750d1a346b3b49cecc1201e8d46)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159331
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 378347108de6..5eb0602e38f5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -1025,7 +1025,15 @@ typedef enum
  *  "text": text content if any
  *  }
  */
-LOK_CALLBACK_A11Y_SELECTION_CHANGED = 69
+LOK_CALLBACK_A11Y_SELECTION_CHANGED = 69,
+
+/**
+ * Forwarding logs from core to client can be useful
+ * for keep track of the real core/client event sequence
+ *
+ * Payload is the log to be sent
+ */
+LOK_CALLBACK_CORE_LOG = 70
 
 }
 LibreOfficeKitCallbackType;
@@ -1195,6 +1203,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE";
 case LOK_CALLBACK_A11Y_SELECTION_CHANGED:
 return "LOK_CALLBACK_A11Y_SELECTION_CHANGED";
+case LOK_CALLBACK_CORE_LOG:
+return "LOK_CALLBACK_CORE_LOG";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index bd2014f9c9d9..f73312c56417 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -26,6 +26,35 @@
 #include 
 #include 
 
+#define LOK_NOTIFY_LOG_TO_CLIENT 1
+
+#define LOK_LOG_STREAM(level, area, stream) \
+do { \
+::std::ostringstream lok_detail_stream; \
+lok_detail_stream << level << ':'; \
+if (std::strcmp(level, "debug") != 0) \
+lok_detail_stream << area << ':'; \
+const char* const where = SAL_WHERE; \
+lok_detail_stream << where << stream; \
+SfxLokHelper::notifyLog(lok_detail_stream); \
+} while (false)
+
+#if LOK_NOTIFY_LOG_TO_CLIENT > 0
+#define LOK_INFO(area, stream) \
+LOK_LOG_STREAM("info", area, stream) \
+
+#define LOK_WARN(area, stream) \
+LOK_LOG_STREAM("warn", area, stream)
+
+#else
+#define LOK_INFO(area, stream) \
+SAL_INFO(area, stream) \
+
+#define LOK_WARN(area, stream) \
+SAL_WARN(area, stream)
+
+#endif
+
 struct SFX2_DLLPUBLIC LokMouseEventData
 {
 int mnType;
@@ -195,6 +224,8 @@ public:
 
 static VclPtr getInPlaceDocWindow(SfxViewShell* pViewShell);
 
+static void notifyLog(const std::ostringstream& stream);
+
 private:
 static int createView(SfxViewFrame& rViewFrame, ViewShellDocId docId);
 };
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 6c7e6dbfc652..bd2cec88f071 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1496,6 +1496,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET:
 case LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE:
 case LOK_CALLBACK_A11Y_SELECTION_CHANGED:
+case LOK_CALLBACK_CORE_LOG:
 {
 // TODO: Implement me
 break;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index e7fdc3d024be..31981159ca02 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -9,7 +9,9 @@
 
 #include 
 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -79,6 +81,8 @@ LanguageTag g_loadLanguageTag("en-US", true); //< The 
language used to load.
 LOKDeviceFormFactor g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
 bool g_isDefaultTimezoneSet = false;
 OUString g_DefaultTimezone;
+const std::size_t g_logNotifierCacheMaxSize = 50;
+::std::list<::std::string> g_logNotifierCache;
 }
 
 int SfxLokHelper::createView(SfxViewFrame& rViewFrame, ViewShellDocId docId)
@@ -322,6 +326,7 @@ void SfxLokHelper::setAccessibilityState(int nId, bool 
nEnabled)
 {
 if 

[Libreoffice-commits] core.git: include/LibreOfficeKit sfx2/source sw/source

2023-10-22 Thread Marco Cecchetti (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 
 sfx2/source/view/viewsh.cxx  |   74 +--
 sw/source/core/access/accpara.cxx|   14 +
 sw/source/core/unocore/unomapproperties.hxx  |1 
 4 files changed, 86 insertions(+), 5 deletions(-)

New commits:
commit 70cddea8cb780f2fe0acdd15b72d13ce2d1ad649
Author: Marco Cecchetti 
AuthorDate: Sun Sep 3 18:47:30 2023 +0200
Commit: Caolán McNamara 
CommitDate: Sun Oct 22 15:25:19 2023 +0200

lok: a11y: send list item prefix length to client

Implemented getListPrefixSize function which relies on
UNO_NAME_NUMBERING_LEVEL, UNO_NAME_NUMBERING character attributes.
The former provides the list item level, the latter is a boolean that
says if a prefix (bullet/number) is present or not for the list item.
It has been needed to modify
SwAccessibleParagraph::_getSupplementalAttributesImpl so that it
returns such properties for list item only and not for simple
paragraph too. In fact for a simple paragraph the default value for
the level property was returned which is 0 exactly the same value for
top list item.

Change-Id: Ia651af4d4b2372eed42c90b0752e16fd47a4fdec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156816
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gökay ŞATIR 
(cherry picked from commit 038903d2e066de9525a3baffdd232484ef44ff51)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157780
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index e7f31c2a14fe..883a68ce09c6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -932,9 +932,11 @@ typedef enum
  *   "position": N
  *   "start": N1
  *   "end": N2
+ *   "listPrefixLength": L
  *   }
  *   where N is the position of the text cursor inside the focused 
paragraph,
  *   and [N1,N2] is the range of the text selection inside the focused 
paragraph.
+ *   In case the paragraph is a list item, L is the length of the 
bullet/number prefix.
  */
 LOK_CALLBACK_A11Y_FOCUS_CHANGED = 62,
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 5e437b45269a..68c99691fb4c 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -67,6 +67,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -409,6 +410,42 @@ void aboutEvent(std::string msg, const 
accessibility::AccessibleEventObject& aEv
 }
 }
 
+sal_Int32 getListPrefixSize(const 
uno::Reference& xAccText)
+{
+if (!xAccText.is())
+return 0;
+
+OUString sText = xAccText->getText();
+sal_Int32 nLength = sText.getLength();
+if (nLength <= 0)
+return 0;
+
+css::uno::Sequence< css::beans::PropertyValue > aRunAttributeList;
+css::uno::Sequence< OUString > aRequestedAttributes = 
{UNO_NAME_NUMBERING_LEVEL, UNO_NAME_NUMBERING};
+aRunAttributeList = xAccText->getCharacterAttributes(0, 
aRequestedAttributes);
+
+sal_Int16 nLevel = -1;
+bool bIsCounted = false;
+for (const auto& attribute: aRunAttributeList)
+{
+if (attribute.Name.isEmpty())
+continue;
+if (attribute.Name == UNO_NAME_NUMBERING_LEVEL)
+   attribute.Value >>= nLevel;
+else if (attribute.Name == UNO_NAME_NUMBERING)
+   attribute.Value >>= bIsCounted;
+}
+if (nLevel < 0 || !bIsCounted)
+return 0;
+
+css::accessibility::TextSegment aTextSegment =
+xAccText->getTextAtIndex(0, 
css::accessibility::AccessibleTextType::ATTRIBUTE_RUN);
+
+SAL_INFO("lok.a11y", "getListPrefixSize: prefix: " << 
aTextSegment.SegmentText << ", level: " << nLevel);
+
+return aTextSegment.SegmentEnd;
+}
+
 void aboutTextFormatting(std::string msg, const 
uno::Reference& xAccText)
 {
 if (!xAccText.is())
@@ -483,6 +520,22 @@ void aboutTextFormatting(std::string msg, const 
uno::Reference>= nValue;
 sValue = OUString::number(nValue);
 }
+else if (attribute.Name == UNO_NAME_NUMBERING_LEVEL)
+{
+sal_Int16 nValue(-1);
+attribute.Value >>= nValue;
+sValue = OUString::number(nValue);
+}
+else if (attribute.Name == UNO_NAME_NUMBERING)
+{
+bool bValue(false);
+attribute.Value >>= bValue;
+sValue = OUString::boolean(bValue);
+}
+else if (attribute.Name == UNO_NAME_NUMBERING_RULES)
+{
+attribute.Value >>= sValue;
+}
 
 if (!sValue.isEmpty())
 {
@@ -501,12 +554,14 @@ void aboutTextFormatting(std::string msg, const 

[Libreoffice-commits] core.git: include/LibreOfficeKit sw/source

2023-06-28 Thread Paris Oplopoios (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |3 +--
 sw/source/uibase/app/apphdl.cxx  |2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 367e9205e10d10cb564bb462dea821ce554b99da
Author: Paris Oplopoios 
AuthorDate: Wed Jun 28 16:23:16 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Wed Jun 28 17:14:40 2023 +0200

Send writer document background color on theme change

Send the doc background color to the kit on theme change

Change-Id: Ic025e542417da004c1c4a2bfd58a858deb4caa58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153715
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 0325e62399a5..b7a43acf7d27 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -774,8 +774,7 @@ typedef enum
 LOK_CALLBACK_VALIDITY_INPUT_HELP = 51,
 
 /**
- * This is currently Calc only. Indicates the document background
- * color in the payload as a RGB hex string (RRGGBB).
+ * Indicates the document background color in the payload as a RGB hex 
string (RRGGBB).
  */
 LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR = 52,
 
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index d7ab78d6e392..26a08b03c00b 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -996,6 +996,8 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
 {
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
 
aViewColors.m_aAppBackgroundColor.AsRGBHexString().toUtf8());
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR,
+
aViewColors.m_aAppBackgroundColor.AsRGBHexString().toUtf8());
 }
 }
 if(pSwView !=  nullptr ||


[Libreoffice-commits] core.git: include/LibreOfficeKit

2023-06-09 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 286e3d3fd10bdbec4954aab46eea198e9f0b9602
Author: Andrea Gelmini 
AuthorDate: Fri Jun 9 13:27:21 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Jun 9 18:00:05 2023 +0200

Fix typo

Change-Id: Ica639513051c843bf8065f209427ba4054993463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152791
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 13351b672d51..0325e62399a5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -964,7 +964,7 @@ typedef enum
 
 /**
  * Informs that the document password has been successfully changed.
- * The payload contains the the new password and the type.
+ * The payload contains the new password and the type.
 */
 LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66
 }


[Libreoffice-commits] core.git: include/LibreOfficeKit

2023-06-09 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bcd076c22c5af0993641e719ea01559548acbc38
Author: Andrea Gelmini 
AuthorDate: Fri Jun 9 13:26:05 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Jun 9 17:59:31 2023 +0200

Fix typo

Change-Id: I4b8e65b686942a20df2d0133ff1208737e272e42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152790
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index d2a03c8ce9b6..13351b672d51 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -963,7 +963,7 @@ typedef enum
 LOK_CALLBACK_COLOR_PALETTES = 65,
 
 /**
- * Informs that the document password has been succesfully changed.
+ * Informs that the document password has been successfully changed.
  * The payload contains the the new password and the type.
 */
 LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sfx2/source

2023-06-09 Thread Jaume Pujantell (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   10 +-
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 sfx2/source/dialog/dinfdlg.cxx   |8 
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit bbf5f97967fb3cde25829e1c428ace31d7d5b8c7
Author: Jaume Pujantell 
AuthorDate: Wed May 10 23:19:04 2023 +0200
Commit: Andras Timar 
CommitDate: Fri Jun 9 09:50:10 2023 +0200

notify async password change

Change-Id: I2d16c9804e65f093239e810d466de35286b28dee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151651
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index d6e46e96aee1..d2a03c8ce9b6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -960,7 +960,13 @@ typedef enum
 /**
  * Informs the LibreOfficeKit client that the color palettes have changed.
 */
-LOK_CALLBACK_COLOR_PALETTES = 65
+LOK_CALLBACK_COLOR_PALETTES = 65,
+
+/**
+ * Informs that the document password has been succesfully changed.
+ * The payload contains the the new password and the type.
+*/
+LOK_CALLBACK_DOCUMENT_PASSWORD_RESET = 66
 }
 LibreOfficeKitCallbackType;
 
@@ -1121,6 +1127,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED";
 case LOK_CALLBACK_COLOR_PALETTES:
 return "LOK_CALLBACK_COLOR_PALETTES";
+case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET:
+return "LOK_CALLBACK_DOCUMENT_PASSWORD_RESET";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 305ac5a477d2..7245c8e2096f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1492,6 +1492,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_A11Y_CARET_CHANGED:
 case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED:
 case LOK_CALLBACK_COLOR_PALETTES:
+case LOK_CALLBACK_DOCUMENT_PASSWORD_RESET:
 {
 // TODO: Implement me
 break;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 7d97ab8b3ba8..f702c2ec10c1 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -39,6 +39,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -71,6 +73,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -792,6 +795,11 @@ IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, 
weld::Button&, void)
 {
 sfx2::SetPassword(pFilter, pMedSet, 
m_xPasswordDialog->GetPasswordToOpen(),
   m_xPasswordDialog->GetPasswordToOpen(), 
true);
+tools::JsonWriter payloadJson;
+payloadJson.put("password", 
m_xPasswordDialog->GetPasswordToOpen());
+payloadJson.put("isToModify", false);
+pShell->GetViewShell()->libreOfficeKitViewCallback(
+LOK_CALLBACK_DOCUMENT_PASSWORD_RESET, 
payloadJson.finishAndGetAsOString());
 pShell->SetModified();
 }
 m_xPasswordDialog->disposeOnce();


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2023-04-01 Thread Paris Oplopoios (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   10 +-
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8d0cab477904091f3d663e6d90aca95a66d199b0
Author: Paris Oplopoios 
AuthorDate: Wed Mar 29 13:47:06 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sat Apr 1 13:03:22 2023 +0200

Add LoKit callback for application color change

Change-Id: I9d0fe4ab878c9d3a4a6d842be5cd534b97bf77a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149822
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 
(cherry picked from commit 48650acef94147c2100eade8c583fddc770b94ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149876
Tested-by: Jenkins

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 6e02c92596f1..f57e00afa185 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -916,7 +916,13 @@ typedef enum
  * Payload is an opaque string that matches this set of states.
  * this will be emitted after creating a new view.
  */
-LOK_CALLBACK_VIEW_RENDER_STATE = 60
+LOK_CALLBACK_VIEW_RENDER_STATE = 60,
+
+/**
+ * Informs the LibreOfficeKit client that the background color surrounding
+ * the document has changed.
+*/
+   LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR = 61
 }
 LibreOfficeKitCallbackType;
 
@@ -1067,6 +1073,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_EXPORT_FILE";
 case LOK_CALLBACK_VIEW_RENDER_STATE:
 return "LOK_CALLBACK_VIEW_RENDER_STATE";
+case LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR:
+return "LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 8fcbe9a404fc..76f94293956b 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1487,6 +1487,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_MEDIA_SHAPE:
 case LOK_CALLBACK_EXPORT_FILE:
 case LOK_CALLBACK_VIEW_RENDER_STATE:
+case LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR:
 {
 // TODO: Implement me
 break;


[Libreoffice-commits] core.git: include/LibreOfficeKit

2023-03-13 Thread Tor Lillqvist (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 42e94211ad6dc2125a411c1768d0b3a677dba34d
Author: Tor Lillqvist 
AuthorDate: Mon Mar 13 11:23:05 2023 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Mar 13 11:34:35 2023 +

Improve documentation of lok::Document::getPartPageRectangles()

Change-Id: Ic507749064ff27b36cac8e01a54fb58dd10cdda5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148779
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index bc3bbb98cc10..501b10bb61f9 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -84,10 +84,11 @@ public:
 }
 
 /**
- * Get the logical rectangle of each part in the document.
+ * Get the extent of each page in the document.
  *
- * A part refers to an individual page in Writer and has no relevant for
- * Calc or Impress.
+ * This function is relevant for Writer documents only. It is a
+ * mistake that the API has "part" in its name as Writer documents
+ * don't have parts.
  *
  * @return a rectangle list, using the same format as
  * LOK_CALLBACK_TEXT_SELECTION.


[Libreoffice-commits] core.git: include/LibreOfficeKit include/sfx2 include/vcl libreofficekit/source sfx2/source sw/inc sw/qa sw/source

2023-03-10 Thread Paris Oplopoios (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |   12 ++
 include/sfx2/lokhelper.hxx |3 ++
 include/vcl/ITiledRenderable.hxx   |6 +
 libreofficekit/source/gtk/lokdocview.cxx   |1 
 sfx2/source/view/lokhelper.cxx |5 
 sw/inc/unotxdoc.hxx|3 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   30 +
 sw/source/core/view/viewsh.cxx |3 ++
 sw/source/uibase/uno/unotxdoc.cxx  |   18 +++
 9 files changed, 81 insertions(+)

New commits:
commit c1d6af3e9a8937cef192e2764ad4afb572743d86
Author: Paris Oplopoios 
AuthorDate: Thu Mar 2 02:24:59 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Mar 10 08:48:23 2023 +

sw lok: notify clients about view option changes

Send a string of the view options to the kit when the view changes

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 38b3e5e62a40..6e02c92596f1 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -907,6 +907,16 @@ typedef enum
  * "file:///tmp/hello-world.pdf"
  */
 LOK_CALLBACK_EXPORT_FILE = 59,
+
+/**
+ * Some attribute of this view has changed, that will cause it
+ * to completely re-render, eg. non-printing characters or
+ * or dark mode was toggled, and then distinct from other views.
+ *
+ * Payload is an opaque string that matches this set of states.
+ * this will be emitted after creating a new view.
+ */
+LOK_CALLBACK_VIEW_RENDER_STATE = 60
 }
 LibreOfficeKitCallbackType;
 
@@ -1055,6 +1065,8 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 return "LOK_CALLBACK_MEDIA_SHAPE";
 case LOK_CALLBACK_EXPORT_FILE:
 return "LOK_CALLBACK_EXPORT_FILE";
+case LOK_CALLBACK_VIEW_RENDER_STATE:
+return "LOK_CALLBACK_VIEW_RENDER_STATE";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index f7de18112c04..b572ddf076b5 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -140,6 +140,9 @@ public:
 /// Notify about the editing context change.
 static void notifyContextChange(const css::ui::ContextChangeEventObject& 
rEvent);
 
+/// Emits an LOK_CALLBACK_VIEW_RENDER_STATE
+static void notifyViewRenderState(SfxViewShell const* pViewShell, 
vcl::ITiledRenderable* pDoc);
+
 // Notify about the given type needing an update.
 static void notifyUpdate(SfxViewShell const* pViewShell, int nType);
 // Notify about the given type needing a per-viewid update.
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index d110e33f7e19..9fa61258fc7a 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -376,6 +376,12 @@ public:
 virtual void getCommandValues(tools::JsonWriter& /*rJsonWriter*/, 
std::string_view /*rCommand*/)
 {
 }
+
+/**
+ * Returns an opaque string reflecting the render state of a component
+ * eg. 'PD' - P for non-printing-characters, D for dark-mode.
+ */
+virtual OString getViewRenderState() { return rtl::OString(); }
 };
 } // namespace vcl
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index ff40e4929781..8fcbe9a404fc 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1486,6 +1486,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_FONTS_MISSING:
 case LOK_CALLBACK_MEDIA_SHAPE:
 case LOK_CALLBACK_EXPORT_FILE:
+case LOK_CALLBACK_VIEW_RENDER_STATE:
 {
 // TODO: Implement me
 break;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index ddcad7bab42d..70d18b54edae 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -557,6 +557,11 @@ void SfxLokHelper::sendUnoStatus(const SfxViewShell* 
pShell, const SfxPoolItem*
 }
 }
 
+void SfxLokHelper::notifyViewRenderState(const SfxViewShell* pShell, 
vcl::ITiledRenderable* pDoc)
+{
+pShell->libreOfficeKitViewCallback(LOK_CALLBACK_VIEW_RENDER_STATE, 
pDoc->getViewRenderState().getStr());
+}
+
 void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView,
 vcl::LOKWindowId nLOKWindowId,
 std::u16string_view rAction,
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 57cb3ccca589..056013d75056 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -462,6 +462,9 @@ public:
 /// @see 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2023-03-07 Thread Tor Lillqvist (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f3a0ed5d63823a1a111de7330d4ddbaf4e0b6d41
Author: Tor Lillqvist 
AuthorDate: Tue Mar 7 13:03:14 2023 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Mar 7 11:06:11 2023 +

Fix Doxygen comment thinko: dumpState() is in lok::Office, not in 
lok::Document

Change-Id: I87626370fdd8cbe906ed31d1b8c92234696e9708
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148414
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 09d3e91e8640..a54c364737c6 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -119,7 +119,7 @@ struct _LibreOfficeKitClass
 /// @see lok::Office::setOption
 void (*setOption) (LibreOfficeKit* pThis, const char* pOption, const char* 
pValue);
 
-/// @see lok::Document::dumpState
+/// @see lok::Office::dumpState
 /// @since LibreOffice 7.5
 void (*dumpState) (LibreOfficeKit* pThis, const char* pOptions, char** 
pState);
 


[Libreoffice-commits] core.git: include/LibreOfficeKit

2022-11-28 Thread Michael Stahl (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ccd6a95eaaa8c8c4af1f2efa388a25aca2877cc1
Author: Michael Stahl 
AuthorDate: Fri Nov 11 13:51:43 2022 +0100
Commit: Michael Stahl 
CommitDate: Mon Nov 28 19:00:47 2022 +0100

WASM LibreOfficeKit add EMSCRIPTEN to ifdef

Change-Id: Ib6f3a6bd6b8703cd9eb24707531c01153cd2f8de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143391
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 2ceeab052e33..08feb42c1e18 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -20,7 +20,7 @@
 
 #if defined(__linux__) || defined (__FreeBSD__) || defined(_AIX) ||\
 defined(_WIN32) || defined(__APPLE__) || defined (__NetBSD__) ||\
-defined (__sun) || defined(__OpenBSD__)
+defined (__sun) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 
 #include 
 #include 


[Libreoffice-commits] core.git: include/LibreOfficeKit

2022-10-24 Thread Mike Kaganski (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fe0795c52f783a0cfb9e90aab4ae6fac4eac68df
Author: Mike Kaganski 
AuthorDate: Mon Oct 24 13:46:56 2022 +0200
Commit: Mike Kaganski 
CommitDate: Mon Oct 24 16:09:18 2022 +0200

lok: Undefine DELETE after including Windows headers

This identifier is used e.g. in offapi/com/sun/star/awt/Key.idl,
include/vcl/keycod.hxx, and that silly define in Windows headers
conflicts when building gtktiledviewer on Windows.

This is similar to include/postwin.h.

Change-Id: I177ab720864468e36b4f4b437a304cfe6ee09e35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141737
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 5bbb722b5b18..2ceeab052e33 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -54,6 +54,8 @@
 #define SEPARATOR '\\'
 #define UNOPATH   "\\..\\URE\\bin"
 
+#undef DELETE
+
 #endif
 
 #ifdef __cplusplus


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2022-10-20 Thread Miklos Vajna (via logerrit)
 dev/null   |binary
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |1 
 libreofficekit/source/gtk/lokdocview.cxx   |   34 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   17 +++-
 sw/source/core/crsr/viscrs.cxx |5 +++
 5 files changed, 56 insertions(+), 1 deletion(-)

New commits:
commit e368d26a7f24dc25f3d855511baabc128bc151e6
Author: Miklos Vajna 
AuthorDate: Thu Oct 20 08:52:02 2022 +0200
Commit: Miklos Vajna 
CommitDate: Thu Oct 20 11:39:04 2022 +0200

sw content controls, alias: add LOK API

And implement sample handling of it in lokdocview.

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 825d9791b806..3bc0ad940b18 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -803,6 +803,7 @@ typedef enum
  * Entered a rich text content control:
  * {
  * "action": "show",
+ * "alias": "my alias", // omitted if empty
  * "rectangles": "1418, 1694, 720, 551; 10291, 1418, 1099, 275"
  * }
  *
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 4c5dbdd9f595..eb06f2608520 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -127,6 +127,8 @@ struct LOKDocViewPrivateImpl
 std::vector m_aTextSelectionRectangles;
 /// Rectangles of the current content control.
 std::vector m_aContentControlRectangles;
+/// Alias/title of the current content control.
+std::string m_aContentControlAlias;
 /// Rectangles of view selections. The current view can only see
 /// them, can't modify them. Key is the view id.
 std::map m_aTextViewSelectionRectangles;
@@ -1406,10 +1408,21 @@ callback (gpointer pData)
 {
 auto aRectangles = aTree.get("rectangles");
 priv->m_aContentControlRectangles = payloadToRectangles(pDocView, 
aRectangles.c_str());
+
+auto it = aTree.find("alias");
+if (it == aTree.not_found())
+{
+priv->m_aContentControlAlias.clear();
+}
+else
+{
+priv->m_aContentControlAlias = 
it->second.get_value();
+}
 }
 else if (aAction == "hide")
 {
 priv->m_aContentControlRectangles.clear();
+priv->m_aContentControlAlias.clear();
 }
 else if (aAction == "change-picture")
 {
@@ -1872,6 +1885,27 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
 twipToPixel(rRectangle.height, priv->m_fZoom));
 cairo_fill(pCairo);
 }
+
+if (!priv->m_aContentControlAlias.empty())
+{
+cairo_text_extents_t aExtents;
+cairo_text_extents(pCairo, priv->m_aContentControlAlias.c_str(), 
);
+// Blue with 75% transparency.
+cairo_set_source_rgba(pCairo, 0, 0, 1, 0.25);
+cairo_rectangle(pCairo,
+
twipToPixel(priv->m_aContentControlRectangles[0].x, priv->m_fZoom) + 
aExtents.x_bearing,
+
twipToPixel(priv->m_aContentControlRectangles[0].y, priv->m_fZoom) + 
aExtents.y_bearing,
+aExtents.width,
+aExtents.height);
+cairo_fill(pCairo);
+
+cairo_move_to(pCairo,
+twipToPixel(priv->m_aContentControlRectangles[0].x, 
priv->m_fZoom),
+twipToPixel(priv->m_aContentControlRectangles[0].y, 
priv->m_fZoom));
+cairo_set_source_rgb(pCairo, 0, 0, 0);
+cairo_show_text(pCairo, priv->m_aContentControlAlias.c_str());
+cairo_fill(pCairo);
+}
 }
 
 // Selections of other views.
diff --git a/sw/qa/extras/tiledrendering/data/content-control.odt 
b/sw/qa/extras/tiledrendering/data/content-control.odt
deleted file mode 100644
index 624063fbd606..
Binary files a/sw/qa/extras/tiledrendering/data/content-control.odt and 
/dev/null differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 9aa5fc7e2fb3..5cb98bc928c7 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -3505,7 +3505,17 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testRedlinePortions)
 CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl)
 {
 // Given a document with a content control:
-SwXTextDocument* pXTextDocument = createDoc("content-control.odt");
+SwXTextDocument* pXTextDocument = createDoc();
+

[Libreoffice-commits] core.git: include/LibreOfficeKit offapi/com

2022-09-12 Thread Mike Kaganski (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h  |2 +-
 offapi/com/sun/star/task/ErrorCodeIOException.idl |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8b5a989dcdcf4edd50c9fdb092d4180432ce4b6a
Author: Mike Kaganski 
AuthorDate: Mon Sep 12 19:14:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 13 06:35:52 2022 +0200

Fix path in comments

include/tools/errcode.hxx was moved to include/vcl/errcode.hxx in
commit f9f045e7830d184497554e0e438cc478fa990eb6
  Date Mon Apr 24 01:06:41 2017 +1000
tools: move errcode.hxx to the vcl module

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 9a591413f2dd..555d8ef5a397 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -371,7 +371,7 @@ typedef enum
  * {
  * "classification": "error" | "warning" | "info"
  * "kind": "network" etc.
- * "code": a structured 32-bit error code, the ErrCode from 
LibreOffice's 
+ * "code": a structured 32-bit error code, the ErrCode from 
LibreOffice's 
  * "message": freeform description
  * }
  */
diff --git a/offapi/com/sun/star/task/ErrorCodeIOException.idl 
b/offapi/com/sun/star/task/ErrorCodeIOException.idl
index 09475fc59992..1e3288a5e62d 100644
--- a/offapi/com/sun/star/task/ErrorCodeIOException.idl
+++ b/offapi/com/sun/star/task/ErrorCodeIOException.idl
@@ -25,7 +25,7 @@
  */
 exception ErrorCodeIOException : com::sun::star::io::IOException
 {
-/** specifies the error code; see tools/errcode.hxx for details.
+/** specifies the error code; see vcl/errcode.hxx for details.
  */
 
 long ErrCode;


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa sw/qa sw/source

2022-06-01 Thread Miklos Vajna (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx   |6 
 include/LibreOfficeKit/LibreOfficeKitEnums.h|7 +
 libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx |3 
 libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx   |4 
 libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.hxx   |1 
 libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx|   27 
 libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx|1 
 libreofficekit/qa/gtktiledviewer/gtv.ui |   45 
+++
 sw/qa/extras/tiledrendering/tiledrendering.cxx  |   57 
+
 sw/source/core/crsr/viscrs.cxx  |5 
 sw/source/uibase/uno/unotxdoc.cxx   |   61 
++
 11 files changed, 217 insertions(+)

New commits:
commit 9cb1a07dc2760a30d7f321aa7fa4ce2a460dfa6c
Author: Miklos Vajna 
AuthorDate: Wed Jun 1 08:30:03 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jun 1 09:09:40 2022 +0200

sw content controls, date: add LOK API

- send a LOK_CALLBACK_CONTENT_CONTROL with date=true when entering a
  date content control

- extend lok::Document::sendContentControlEvent() to be able to set the
  date of a date content control (after the client's date picker is
  closed)

- update gtktiledviewer to work with these

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

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 993654c88345..6dbfbf964b29 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -851,6 +851,12 @@ public:
  * "type": "picture",
  * "changed": "file:///path/to/test.png"
  * }
+ *
+ * To select a date of the current date content control:
+ * {
+ * "type": "date",
+ * "selected": "2022-05-29T00:00:00Z"
+ * }
  */
 void sendContentControlEvent(const char* pArguments)
 {
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 63ddec957be0..f1b2328510b3 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -822,6 +822,13 @@ typedef enum
  * {
  * "action": "change-picture"
  * }
+ *
+ * Entered a date content control:
+ * {
+ * "action": "show",
+ * "rectangles": "...",
+ * "date": "true"
+ * }
  */
 LOK_CALLBACK_CONTENT_CONTROL = 55,
 
diff --git 
a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
index 4e702364a6a9..8d1b3eb67e10 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
@@ -229,6 +229,9 @@ void LOKDocViewSigHandlers::contentControl(LOKDocView* 
pDocView, gchar* pJson, g
 }
 }
 
+boost::optional oDate = 
aTree.get_child_optional("date");
+
gtk_widget_set_sensitive(GTK_WIDGET(toolbar->m_pContentControlDateSelector), 
bool(oDate));
+
 gtv_application_window_set_part_broadcast(window, true);
 }
 
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx
index afe6162f76fc..84c5335b32c2 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-main-toolbar.cxx
@@ -118,6 +118,8 @@ gtv_main_toolbar_init(GtvMainToolbar* toolbar)
 toolbar->m_pFormulabar = GTK_WIDGET(gtk_builder_get_object(builder.get(), 
"formulabar_entry"));
 toolbar->m_pContentControlSelector
 = GTK_WIDGET(gtk_builder_get_object(builder.get(), 
"combo_contentcontrolselector"));
+toolbar->m_pContentControlDateSelector
+= GTK_WIDGET(gtk_builder_get_object(builder.get(), 
"menu_contentcontroldateselector"));
 
 // TODO: compile with -rdynamic and get rid of it
 gtk_builder_add_callback_symbol(builder.get(), "btn_clicked", 
G_CALLBACK(btn_clicked));
@@ -132,6 +134,8 @@ gtv_main_toolbar_init(GtvMainToolbar* toolbar)
 gtk_builder_add_callback_symbol(builder.get(), "changePart", 
G_CALLBACK(changePart));
 gtk_builder_add_callback_symbol(builder.get(), "changeContentControl",
 G_CALLBACK(changeContentControl));
+gtk_builder_add_callback_symbol(builder.get(), "changeDateContentControl",
+G_CALLBACK(changeDateContentControl));
 gtk_builder_add_callback_symbol(builder.get(), "changeZoom", 
G_CALLBACK(changeZoom));
 gtk_builder_add_callback_symbol(builder.get(), 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sc/inc sc/source

2022-05-21 Thread Dennis Francis (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   31 ++
 libreofficekit/source/gtk/lokdocview.cxx |1 
 sc/inc/prnsave.hxx   |3 ++
 sc/source/core/tool/prnsave.cxx  |   32 +++
 sc/source/ui/undo/undotab.cxx|   15 
 sc/source/ui/view/viewfun2.cxx   |   11 +
 6 files changed, 93 insertions(+)

New commits:
commit b846fb660a91130aceee52fed11170a95b2f3934
Author: Dennis Francis 
AuthorDate: Thu May 12 13:13:35 2022 +0530
Commit: Dennis Francis 
CommitDate: Sat May 21 09:14:42 2022 +0200

lok-calc: new callback for print ranges

With this callback the lok clients can read and draw the print ranges on
each sheet of the Calc document.

Conflicts:
include/LibreOfficeKit/LibreOfficeKitEnums.h
libreofficekit/source/gtk/lokdocview.cxx

Change-Id: Ie19351d4420e0f3d4191f6a354ce99ab830aede2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134375
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
(cherry picked from commit 172bc7a8f4eeab907adac077407186fbbd046a77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134527
Reviewed-by: Gökay ŞATIR 
(cherry picked from commit 29b7b25d454e0a6cd07c00e13fdb83cc8a381583)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134614
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 0fda66777a09..05544b5473a5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -811,6 +811,35 @@ typedef enum
  * }
  */
 LOK_CALLBACK_CONTENT_CONTROL = 55,
+
+/**
+ * This is Calc specific. The payload contains print ranges of all
+ * sheets in the document.
+ *
+ * Payload example:
+ * {
+ * "printranges" : [
+ * {
+ * "sheet": 0,
+ * "ranges": [
+ * [0, 0, 4, 5],
+ * [5, 100, 8, 150]
+ * ]
+ * },
+ * {
+ * "sheet": 3,
+ * "ranges": [
+ * [1, 0, 6, 10],
+ * [3, 200, 6, 230]
+ * ]
+ * }
+ * ]
+ * }
+ *
+ * The format of the inner "ranges" array for each sheet is
+ * [, , , ]
+ */
+LOK_CALLBACK_PRINT_RANGES = 56,
 }
 LibreOfficeKitCallbackType;
 
@@ -951,6 +980,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_SC_FOLLOW_JUMP";
 case LOK_CALLBACK_CONTENT_CONTROL:
 return "LOK_CALLBACK_CONTENT_CONTROL";
+case LOK_CALLBACK_PRINT_RANGES:
+return "LOK_CALLBACK_PRINT_RANGES";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index b20cc85af875..aafaa084be9c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1439,6 +1439,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
 case LOK_COMMAND_BLOCKED:
 case LOK_CALLBACK_SC_FOLLOW_JUMP:
+case LOK_CALLBACK_PRINT_RANGES:
 {
 // TODO: Implement me
 break;
diff --git a/sc/inc/prnsave.hxx b/sc/inc/prnsave.hxx
index ef6f50d587dc..af2824b40cf8 100644
--- a/sc/inc/prnsave.hxx
+++ b/sc/inc/prnsave.hxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 
+namespace tools { class JsonWriter; }
+
 class ScPrintSaverTab
 {
 typedef ::std::vector< ScRange > ScRangeVec;
@@ -59,6 +61,7 @@ public:
 SCTAB   GetTabCount() const { return nTabCount; }
 ScPrintSaverTab&GetTabData(SCTAB nTab);
 const ScPrintSaverTab&  GetTabData(SCTAB nTab) const;
+void GetPrintRangesInfo(tools::JsonWriter& rPrintRanges) const;
 
 booloperator==( const ScPrintRangeSaver& rCmp ) const;
 };
diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx
index e5a2e92f1a44..f5700cbd3e08 100644
--- a/sc/source/core/tool/prnsave.cxx
+++ b/sc/source/core/tool/prnsave.cxx
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 
 //  Data per table
 
@@ -86,6 +87,37 @@ const ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB 
nTab) const
 return pData[nTab];
 }
 
+void ScPrintRangeSaver::GetPrintRangesInfo(tools::JsonWriter& rPrintRanges) 
const
+{
+// Array for sheets in the document.
+auto printRanges = rPrintRanges.startArray("printranges");
+for (SCTAB nTab = 0; nTab < nTabCount; nTab++)
+{
+auto sheetNode = rPrintRanges.startStruct();
+const ScPrintSaverTab& rPsTab = pData[nTab];
+const std::vector& rRangeVec = rPsTab.GetPrintRanges();
+
+rPrintRanges.put("sheet", 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2022-04-22 Thread Miklos Vajna (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   18 ++
 libreofficekit/source/gtk/lokdocview.cxx |   55 +++
 sw/qa/extras/tiledrendering/data/content-control.odt |binary
 sw/qa/extras/tiledrendering/tiledrendering.cxx   |   44 +++
 sw/source/core/crsr/viscrs.cxx   |   22 +++
 5 files changed, 139 insertions(+)

New commits:
commit e4d1731ba3e8bac2801d1b76cfb66bf7f9795468
Author: Miklos Vajna 
AuthorDate: Fri Apr 22 12:25:31 2022 +0200
Commit: Miklos Vajna 
CommitDate: Fri Apr 22 13:20:09 2022 +0200

sw content controls: add LOK API

This is somewhat similar to LOK_CALLBACK_FORM_FIELD_BUTTON: if the
cursor enters or leaves a content control, then we send this message, so
the LOK client can render some kind of shading and/or border around the
content control to indicate the boundaries of the object.

Similar to selections, this can be multiple rectangles in case the
string is long enough that the layout breaks it into multiple lines.

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index d15e0e5a70ba..0fda66777a09 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -795,6 +795,22 @@ typedef enum
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
 LOK_CALLBACK_SC_FOLLOW_JUMP = 54,
+
+/**
+ * Sends all information for displaying metadata for a text based content 
control.
+ *
+ * The payload example:
+ * {
+ *  "action": "show",
+ *  "rectangles": "1418, 1694, 720, 551; 10291, 1418, 1099, 275"
+ * }
+ *
+ * or
+ * {
+ *  "action": "hide"
+ * }
+ */
+LOK_CALLBACK_CONTENT_CONTROL = 55,
 }
 LibreOfficeKitCallbackType;
 
@@ -933,6 +949,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_COMMAND_BLOCKED";
 case LOK_CALLBACK_SC_FOLLOW_JUMP:
 return "LOK_CALLBACK_SC_FOLLOW_JUMP";
+case LOK_CALLBACK_CONTENT_CONTROL:
+return "LOK_CALLBACK_CONTENT_CONTROL";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 45c9cacedff6..1bf7e7301d7c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -124,6 +124,8 @@ struct LOKDocViewPrivateImpl
 guint32 m_nKeyModifier;
 /// Rectangles of the current text selection.
 std::vector m_aTextSelectionRectangles;
+/// Rectangles of the current content control.
+std::vector m_aContentControlRectangles;
 /// Rectangles of view selections. The current view can only see
 /// them, can't modify them. Key is the view id.
 std::map m_aTextViewSelectionRectangles;
@@ -281,6 +283,7 @@ enum
 ADDRESS_CHANGED,
 FORMULA_CHANGED,
 TEXT_SELECTION,
+CONTENT_CONTROL,
 PASSWORD_REQUIRED,
 COMMENT,
 RULER,
@@ -1392,6 +1395,27 @@ callback (gpointer pData)
 break;
 }
 
+case LOK_CALLBACK_CONTENT_CONTROL:
+{
+std::stringstream aStream(pCallback->m_aPayload);
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+auto aAction = aTree.get("action");
+if (aAction == "show")
+{
+auto aRectangles = aTree.get("rectangles");
+priv->m_aContentControlRectangles = payloadToRectangles(pDocView, 
aRectangles.c_str());
+}
+else if (aAction == "hide")
+{
+priv->m_aContentControlRectangles.clear();
+}
+bool bIsTextSelected = !priv->m_aContentControlRectangles.empty();
+g_signal_emit(pDocView, doc_view_signals[CONTENT_CONTROL], 0, 
bIsTextSelected);
+gtk_widget_queue_draw(GTK_WIDGET(pDocView));
+}
+break;
+
 case LOK_CALLBACK_STATUS_INDICATOR_START:
 case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
 case LOK_CALLBACK_STATUS_INDICATOR_FINISH:
@@ -1809,6 +1833,21 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
 }
 }
 
+if (!priv->m_aContentControlRectangles.empty())
+{
+for (const GdkRectangle& rRectangle : 
priv->m_aContentControlRectangles)
+{
+// Black with 75% transparency.
+cairo_set_source_rgba(pCairo, (double(0x7f))/255, 
(double(0x7f))/255, (double(0x7f))/255, 0.25);
+cairo_rectangle(pCairo,
+twipToPixel(rRectangle.x, priv->m_fZoom),
+twipToPixel(rRectangle.y, priv->m_fZoom),
+twipToPixel(rRectangle.width, priv->m_fZoom),
+

[Libreoffice-commits] core.git: include/LibreOfficeKit

2022-02-16 Thread Tor Lillqvist (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a6760a0fc4461ba58c9ddb089c7ceb8c962f5dc5
Author: Tor Lillqvist 
AuthorDate: Wed Feb 16 11:10:25 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Feb 16 20:30:07 2022 +0100

Don't confusingly use the term "gesture" for plain old mouse events

"Gesture" is a term typically used for finger input on touch
devices. The LibreOfficeKitMouseEventType type is for traditional
mouse events.

Change-Id: Id14ab725567546e33f3dd1277fb4380b9f81d59b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129985
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 006713447aed..d15e0e5a70ba 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -941,11 +941,11 @@ static inline const char* lokCallbackTypeToString(int 
nType)
 
 typedef enum
 {
-/// A pressed gesture has started.
+/// A mouse button has been pressed down.
 LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
-/// A pressed gesture has finished.
+/// A mouse button has been let go.
 LOK_MOUSEEVENT_MOUSEBUTTONUP,
-/// A change has happened during a press gesture.
+/// The mouse has moved while a button is pressed.
 LOK_MOUSEEVENT_MOUSEMOVE
 }
 LibreOfficeKitMouseEventType;


[Libreoffice-commits] core.git: include/LibreOfficeKit

2021-10-12 Thread Stephan Bergmann (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitInit.h |   38 
 1 file changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 5dd9990a12509ec9326c061544b228652e495fe5
Author: Stephan Bergmann 
AuthorDate: Tue Oct 12 11:40:05 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 12 13:37:02 2021 +0200

Don't #include within extern "C"

At least when building against trunk libstdc++ on Fedora 35 beta now, that
caused failures like

> In file included from ~/lo/core/libreofficekit/qa/unit/checkapi.cxx:18:
> In file included from 
~/lo/core/workdir/UnpackedTarball/cppunit/include/cppunit/plugin/TestPlugIn.h:8:
> In file included from 
~/lo/core/workdir/UnpackedTarball/cppunit/include/cppunit/plugin/PlugInParameters.h:8:
> In file included from 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/deque:70:
> In file included from 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/deque:40:
> In file included from 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/safe_sequence.h:35:
> In file included from 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/safe_base.h:32:
> In file included from 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ext/concurrence.h:34:
> 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/exception:83:8:
 error: declaration of 'terminate' has a different language linkage
>   void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));
>^
> 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-pc-linux-gnu/bits/c++config.h:302:10:
 note: previous declaration is here
> void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));
>  ^

Change-Id: I81cf87d13c16fd10ce3e2435509ab462852fce2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123447
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 8a48bd8392be..ccd42863ba25 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -12,11 +12,6 @@
 
 #include 
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #if defined __GNUC__ || defined __clang__
 #  define LOK_TOLERATE_UNUSED __attribute__((used))
 #else
@@ -48,6 +43,26 @@ extern "C"
 #endif
 #define SEPARATOR '/'
 
+#else
+
+#if !defined WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include  
+#define TARGET_LIB"sofficeapp" ".dll"
+#define TARGET_MERGED_LIB "mergedlo" ".dll"
+#define SEPARATOR '\\'
+#define UNOPATH   "\\..\\URE\\bin"
+
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifndef _WIN32
+
 #if !defined(IOS)
 static void *lok_loadlib(const char *pFN)
 {
@@ -88,15 +103,6 @@ extern "C"
 
 
 #else
-#if !defined WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include  
-#define TARGET_LIB"sofficeapp" ".dll"
-#define TARGET_MERGED_LIB "mergedlo" ".dll"
-#define SEPARATOR '\\'
-#define UNOPATH   "\\..\\URE\\bin"
-
 static void *lok_loadlib(const char *pFN)
 {
 return (void *) LoadLibraryA(pFN);
@@ -345,12 +351,12 @@ int lok_preinit( const char *install_path,  const char 
*user_profile_url )
 
 #undef SEPARATOR // It is used at least in enum class MenuItemType
 
-#endif // defined(__linux__) || defined (__FreeBSD__) || defined(_AIX) || 
defined(_WIN32) || defined(__APPLE__)
-
 #ifdef __cplusplus
 }
 #endif
 
+#endif // defined(__linux__) || defined (__FreeBSD__) || defined(_AIX) || 
defined(_WIN32) || defined(__APPLE__)
+
 #endif // INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sc/source

2021-09-07 Thread Dennis Francis (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   11 +--
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 sc/source/ui/unoobj/docuno.cxx   |   19 +++
 3 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit e70399e5bd4a41a2989030ddfb0404b6248f655d
Author: Dennis Francis 
AuthorDate: Thu Aug 12 15:58:15 2021 +0530
Commit: Dennis Francis 
CommitDate: Tue Sep 7 08:11:22 2021 +0200

sc: lok: introduce LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR callback

to send the document background color (Calc only for now).

Change-Id: Ibd2f042a81c9bb714bed947c4ef92f82ff3e6f50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120524
Reviewed-by: Szymon Kłos 
Tested-by: Dennis Francis 
(cherry picked from commit 5f2d669a51a91b21196eecb935aa55d3fc1aa7be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120738
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 4090fc8abbac..497a5eacc804 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -773,6 +773,12 @@ typedef enum
  */
 LOK_CALLBACK_VALIDITY_INPUT_HELP = 51,
 
+/**
+ * This is currently Calc only. Indicates the document background
+ * color in the payload as a RGB hex string (RRGGBB).
+ */
+LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR = 52,
+
 /**
  * The position of the cell cursor jumped to.
  *
@@ -783,8 +789,7 @@ typedef enum
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_SC_FOLLOW_JUMP = 52,
-
+LOK_CALLBACK_SC_FOLLOW_JUMP = 53,
 }
 LibreOfficeKitCallbackType;
 
@@ -917,6 +922,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_FORM_FIELD_BUTTON";
 case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
 return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY";
+case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
+return "LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR";
 case LOK_CALLBACK_SC_FOLLOW_JUMP:
 return "LOK_CALLBACK_SC_FOLLOW_JUMP";
 }
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 3edc58bfe141..68c23ffa4e55 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1414,6 +1414,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_TAB_STOP_LIST:
 case LOK_CALLBACK_FORM_FIELD_BUTTON:
 case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
+case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
 case LOK_CALLBACK_SC_FOLLOW_JUMP:
 {
 // TODO: Implement me
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a320a76f5ae9..40d2b639738f 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -957,6 +958,19 @@ bool ScModelObj::isMimeTypeSupported()
 return EditEngine::HasValidData(aDataHelper.GetTransferable());
 }
 
+static void lcl_sendLOKDocumentBackground(const ScViewData* pViewData)
+{
+ScDocShell* pDocSh = pViewData->GetDocShell();
+ScDocument& rDoc = pDocSh->GetDocument();
+const ScPatternAttr *pAttr = rDoc.GetDefPattern();
+const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
+const SvxBrushItem& rBackground = static_cast(rItem);
+const Color& rColor = rBackground.GetColor();
+
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR, 
rColor.AsRGBHexString().toUtf8().getStr());
+}
+
 void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, 
int nTileTwipWidth_, int nTileTwipHeight_)
 {
 ScViewData* pViewData = ScDocShell::GetViewData();
@@ -964,6 +978,11 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int 
nTilePixelHeight_, int
 if (!pViewData)
 return;
 
+// Currently in LOK clients the doc background cannot be changed, so send 
this sparingly as possible but for every view.
+// FIXME: Find a better place to trigger this callback where it would be 
called just once per view creation.
+// Doing this in ScTabViewShell init code does not work because callbacks 
do not work at that point for the first view.
+lcl_sendLOKDocumentBackground(pViewData);
+
 const Fraction newZoomX(nTilePixelWidth_ * TWIPS_PER_PIXEL, 
nTileTwipWidth_);
 const Fraction newZoomY(nTilePixelHeight_ * TWIPS_PER_PIXEL, 
nTileTwipHeight_);
 


[Libreoffice-commits] core.git: include/LibreOfficeKit include/vcl sc/source sd/source sw/source vcl/source

2020-12-10 Thread gokaysatir (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 include/vcl/unohelp2.hxx |3 ++-
 sc/source/ui/view/editsh.cxx |8 +---
 sd/source/ui/view/drviews2.cxx   |   12 +---
 sw/source/uibase/shells/textsh1.cxx  |8 +---
 vcl/source/app/unohelp2.cxx  |6 +++---
 6 files changed, 9 insertions(+), 30 deletions(-)

New commits:
commit 56f708b3449230c328f3640709217f9aa802e4c1
Author: gokaysatir 
AuthorDate: Wed Oct 7 12:57:13 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Thu Dec 10 09:27:22 2020 +0100

Online: "Copy hyperlink location" feature improvement.

Lambda functions are replaced with class pointers.

Change-Id: I48628d3105533aad2463bd8ade1f65cf5b154b0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104058
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 9a0eb01ca840..ae8eacd9151f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -646,7 +646,7 @@ typedef enum
  *
  * Payload is optional. When payload is empty, Online gets string from 
selected text.
  * Payload format is JSON.
- * Example: { "mimeType": "string", "content": "some content" }
+ * Example: { "mimeType": "text/plain", "content": "some content" }
  */
 LOK_CALLBACK_CLIPBOARD_CHANGED = 38,
 
diff --git a/include/vcl/unohelp2.hxx b/include/vcl/unohelp2.hxx
index 91c4ce6ce0e2..a0e03a04e2a1 100644
--- a/include/vcl/unohelp2.hxx
+++ b/include/vcl/unohelp2.hxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::datatransfer::clipboard {
 class XClipboard;
@@ -60,7 +61,7 @@ namespace vcl::unohelper {
 static  voidCopyStringTo(
 const OUString& rContent,
 const css::uno::Reference< 
css::datatransfer::clipboard::XClipboard >& rxClipboard,
-std::function *callback = nullptr
+const vcl::ILibreOfficeKitNotifier* pNotifier = nullptr
 );
 };
 
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index e12c5460c09d..619001a27d8c 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -642,13 +642,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
 {
 uno::Reference 
xClipboard = GetSystemClipboard();
 
-if (comphelper::LibreOfficeKit::isActive())
-{
-std::function callback = [&] 
(int callbackType, const char* text) { 
rViewData.GetViewShell()->libreOfficeKitViewCallback(callbackType, text); } ;
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
);
-}
-else
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
nullptr);
+
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
SfxViewShell::Current());
 }
 }
 break;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 11f42901b9fd..33203efef9b9 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2251,17 +2251,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 uno::Reference 
xClipboard
 = pOutView->GetWindow()->GetClipboard();
 
-if (comphelper::LibreOfficeKit::isActive())
-{
-std::function callback = [&] 
(int callbackType, const char* text)
-{
-SfxViewFrame* pFrame = GetViewFrame();
-
pFrame->GetViewShell()->libreOfficeKitViewCallback(callbackType, text);
-};
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
);
-}
-else
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard);
+
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
SfxViewShell::Current());
 }
 }
 
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 7ac52d334ce1..1344ecacf894 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1346,13 +1346,7 @@ void SwTextShell::Execute(SfxRequest )
 OUString hyperlinkLocation = rINetFormat.GetValue();
 ::uno::Reference< datatransfer::clipboard::XClipboard > 
xClipboard = GetView().GetEditWin().GetClipboard();
 
-if (comphelper::LibreOfficeKit::isActive())
-

[Libreoffice-commits] core.git: include/LibreOfficeKit solenv/bin

2020-10-24 Thread Gleb Popov (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 solenv/bin/concat-deps.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4e94fe97236e9dd169f00801980e369d67c6cda6
Author: Gleb Popov <6year...@gmail.com>
AuthorDate: Fri Oct 23 12:34:24 2020 +0400
Commit: Mike Kaganski 
CommitDate: Sat Oct 24 11:04:21 2020 +0200

Fix remaining invalid usages of __FreeBSD_kernel__ define.

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ff541fb2c113..8a48bd8392be 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -345,7 +345,7 @@ int lok_preinit( const char *install_path,  const char 
*user_profile_url )
 
 #undef SEPARATOR // It is used at least in enum class MenuItemType
 
-#endif // defined(__linux__) || defined (__FreeBSD_kernel__) || defined(_AIX) 
|| defined(_WIN32) || defined(__APPLE__)
+#endif // defined(__linux__) || defined (__FreeBSD__) || defined(_AIX) || 
defined(_WIN32) || defined(__APPLE__)
 
 #ifdef __cplusplus
 }
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 09416f103515..155328bf9360 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -32,7 +32,7 @@
 #define CORE_LITTLE_ENDIAN
 #endif /* Def _MSC_VER */
 
-#if defined(__linux) || defined(__FreeBSD_kernel__)
+#if defined(__linux) || defined(__FreeBSD__)
 #include 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #undef CORE_BIG_ENDIAN
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2020-10-16 Thread Gleb Popov (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bebecd0e9a1076a5aeed951e7e5ee57a33d1c3b8
Author: Gleb Popov <6year...@gmail.com>
AuthorDate: Thu Oct 15 15:10:02 2020 +0400
Commit: Tor Lillqvist 
CommitDate: Fri Oct 16 09:40:07 2020 +0200

Fix another misuse of __FreeBSD_kernel__ define in LibreOfficeKitInit.h.

The #if in question clearly checks for an operating system, not the kernel 
only.
Fixes build on FreeBSD.

Change-Id: Ib9452056a0d28f685fbae0b4bca65ed814cfd1cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104371
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index c00c33193648..ff541fb2c113 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -23,7 +23,7 @@ extern "C"
 #  define LOK_TOLERATE_UNUSED
 #endif
 
-#if defined(__linux__) || defined (__FreeBSD_kernel__) || defined(_AIX) ||\
+#if defined(__linux__) || defined (__FreeBSD__) || defined(_AIX) ||\
 defined(_WIN32) || defined(__APPLE__) || defined (__NetBSD__) ||\
 defined (__sun) || defined(__OpenBSD__)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit include/vcl sc/source sd/source sw/source vcl/source

2020-10-06 Thread gokaysatir (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |7 +++
 include/vcl/unohelp2.hxx |6 +-
 sc/source/ui/view/editsh.cxx |9 -
 sd/source/ui/view/drviews2.cxx   |   13 -
 sw/source/uibase/shells/textsh1.cxx  |   13 ++---
 vcl/source/app/unohelp2.cxx  |   13 -
 6 files changed, 50 insertions(+), 11 deletions(-)

New commits:
commit 19a0fbf456129e011cb9ab9ab6ab730cba274bbd
Author: gokaysatir 
AuthorDate: Tue Sep 22 13:00:44 2020 +0300
Commit: Gökay ŞATIR 
CommitDate: Tue Oct 6 18:47:39 2020 +0200

Online: Copy hyperlink location. / Core side.

Payload format is added to LOK_CALLBACK_CLIPBOARD_CHANGED.
Clipboard changed event is not fired when "copy hyperlink location" command 
is issued.
So i added a call to LOK_CALLBACK_CLIPBOARD_CHANGED inside 
TextDataObject::CopyStringTo function.

Change-Id: I8157572288da88b5522662e13abe151ef8548b34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103164
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103872
Tested-by: Jenkins

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 750e64f529f9..9a0eb01ca840 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -644,10 +644,9 @@ typedef enum
  * Notification that the clipboard contents have changed.
  * Typically fired in response to copying to clipboard.
  *
- * The payload currently is empty and it's up to the
- * client to get the contents, if necessary. However,
- * in the future the contents might be included for
- * convenience.
+ * Payload is optional. When payload is empty, Online gets string from 
selected text.
+ * Payload format is JSON.
+ * Example: { "mimeType": "string", "content": "some content" }
  */
 LOK_CALLBACK_CLIPBOARD_CHANGED = 38,
 
diff --git a/include/vcl/unohelp2.hxx b/include/vcl/unohelp2.hxx
index a95474417cf6..91c4ce6ce0e2 100644
--- a/include/vcl/unohelp2.hxx
+++ b/include/vcl/unohelp2.hxx
@@ -25,6 +25,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace com::sun::star::datatransfer::clipboard {
 class XClipboard;
@@ -56,7 +59,8 @@ namespace vcl::unohelper {
 /// copies a given string to a given clipboard
 static  voidCopyStringTo(
 const OUString& rContent,
-const css::uno::Reference< 
css::datatransfer::clipboard::XClipboard >& rxClipboard
+const css::uno::Reference< 
css::datatransfer::clipboard::XClipboard >& rxClipboard,
+std::function *callback = nullptr
 );
 };
 
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 9e8768fe27d6..83e4adaf815f 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -641,7 +641,14 @@ void ScEditShell::Execute( SfxRequest& rReq )
 {
 uno::Reference 
xClipboard
 = pEditView->GetWindow()->GetClipboard();
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+std::function callback = [&] 
(int callbackType, const char* text) { 
rViewData.GetViewShell()->libreOfficeKitViewCallback(callbackType, text); } ;
+
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
);
+}
+else
+
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
nullptr);
 }
 }
 break;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 8f511aab3922..f32acb5d3182 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2250,7 +2250,18 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 {
 uno::Reference 
xClipboard
 = pOutView->GetWindow()->GetClipboard();
-
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+std::function callback = [&] 
(int callbackType, const char* text)
+{
+SfxViewFrame* pFrame = GetViewFrame();
+
pFrame->GetViewShell()->libreOfficeKitViewCallback(callbackType, text);
+};
+
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
);
+}
+else
+ 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sc/source

2020-09-18 Thread gokaysatir (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 sc/source/ui/inc/gridwin.hxx |1 +
 sc/source/ui/view/gridwin.cxx|   14 ++
 sc/source/ui/view/tabview3.cxx   |1 +
 5 files changed, 26 insertions(+)

New commits:
commit 433996f47b5354c0d936b07ba95440ac3354c620
Author: gokaysatir 
AuthorDate: Tue Sep 15 11:35:16 2020 +0300
Commit: Miklos Vajna 
CommitDate: Fri Sep 18 13:00:34 2020 +0200

Online: Show input help on Online / Core part.

Change-Id: I9d10179f266a725b770fdae50045fdb5d77178ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102708
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit 110069adbba4d272450b30fa03c56efbd478e84c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102935
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 780b9b7ab373..750e64f529f9 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -766,6 +766,13 @@ typedef enum
  * and row-groups data have changed.
  */
 LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY = 50,
+
+/**
+ * When for the current cell is defined an input help text.
+ *
+ * The payload format is JSON: { "title": "title text", "content": 
"content text" }
+ */
+LOK_CALLBACK_VALIDITY_INPUT_HELP = 51,
 }
 LibreOfficeKitCallbackType;
 
@@ -870,6 +877,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_WINDOW";
 case LOK_CALLBACK_VALIDITY_LIST_BUTTON:
 return "LOK_CALLBACK_VALIDITY_LIST_BUTTON";
+case LOK_CALLBACK_VALIDITY_INPUT_HELP:
+return "LOK_CALLBACK_VALIDITY_INPUT_HELP";
 case LOK_CALLBACK_CLIPBOARD_CHANGED:
 return "LOK_CALLBACK_CLIPBOARD_CHANGED";
 case LOK_CALLBACK_CONTEXT_CHANGED:
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 559b03fcc189..6af262bb8df2 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1389,6 +1389,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_DOCUMENT_PASSWORD:
 case LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY:
 case LOK_CALLBACK_VALIDITY_LIST_BUTTON:
+case LOK_CALLBACK_VALIDITY_INPUT_HELP:
 case LOK_CALLBACK_SIGNATURE_STATUS:
 case LOK_CALLBACK_CONTEXT_MENU:
 case LOK_CALLBACK_PROFILE_FRAME:
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 8bdee8a55190..a3ddbc84bac1 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -475,6 +475,7 @@ public:
 virtual FactoryFunction GetUITestFactory() const override;
 
 void updateLOKValListButton(bool bVisible, const ScAddress& rPos) const;
+void updateLOKInputHelp(const OUString& title, const OUString& content) 
const;
 
 protected:
 void ImpCreateOverlayObjects();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 7ee10d644e9e..e858a9337041 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -137,6 +137,7 @@
 #include 
 
 #include 
+#include 
 
 using namespace css;
 using namespace css::uno;
@@ -4730,6 +4731,19 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, 
const ScRange& rMarkRange)
 }
 }
 
+void ScGridWindow::updateLOKInputHelp(const OUString& title, const OUString& 
content) const
+{
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+
+boost::property_tree::ptree aTree;
+aTree.put("title", title);
+aTree.put("content", content);
+
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree);
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_VALIDITY_INPUT_HELP, 
aStream.str().c_str());
+}
+
 void ScGridWindow::updateLOKValListButton( bool bVisible, const ScAddress& 
rPos ) const
 {
 SCCOL nX = rPos.Col();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 30986e02d044..ace30689b743 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -833,6 +833,7 @@ void ScTabView::TestHintWindow()
 if (pWindow == pWin)
 {
 xOverlayManager->add(*pOverlay);
+pWindow->updateLOKInputHelp(aTitle, aMessage);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2020-07-29 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5230b2e475f4d967dcbe2d4c7fd71dc4ce1312de
Author: Andrea Gelmini 
AuthorDate: Wed Jul 29 16:31:04 2020 +0200
Commit: Julien Nabet 
CommitDate: Wed Jul 29 16:45:13 2020 +0200

Fix typo

Change-Id: I2abdfc45dac226ee177209655d9f92cb88f0fdfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99704
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index dfafd94656d9..780b9b7ab373 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -216,7 +216,7 @@ typedef enum
 LOK_CALLBACK_GRAPHIC_SELECTION = 6,
 
 /**
- * User clicked on an hyperlink that should be handled by other
+ * User clicked on a hyperlink that should be handled by other
  * applications accordingly.
  */
 LOK_CALLBACK_HYPERLINK_CLICKED = 7,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2020-05-22 Thread Tamás Zolnai (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit af6561532832615f39b5ea82aa5d9b3e240784e8
Author: Tamás Zolnai 
AuthorDate: Fri May 22 11:39:12 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Fri May 22 12:52:13 2020 +0200

lok: MSForms: update callback's documentation.

Change-Id: I1bf41986f63a18abada7d268dc610df24b4c1144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94661
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 32fd9f657a5a..8a741d5f62e2 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -737,7 +737,12 @@ typedef enum
  * {
  *  "action": "show",
  *  "type": "drop-down",
- *  "textArea": "1418, 3906, 3111, 919"
+ *  "textArea": "1418, 3906, 3111, 919",
+ *  "params": {
+ *   "items": ["January", "February", "July"],
+ *   "selected": "2",
+ *   "placeholder": "No items specified"
+ *  }
  * }
  *
  * or
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2020-05-10 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 42a949bdcfb87f45197f0d692b64e74f70f2c2e1
Author: Andrea Gelmini 
AuthorDate: Fri May 8 14:29:34 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun May 10 23:04:53 2020 +0200

Fix typo

Change-Id: I8bf39ad18f20199241cb3cdf4e1fec5592d61943
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93725
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index b0b6d59e62a2..32fd9f657a5a 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -728,7 +728,7 @@ typedef enum
 LOK_CALLBACK_TAB_STOP_LIST = 48,
 
 /**
- * Sends all informations for displaying form field button for a text 
based field.
+ * Sends all information for displaying form field button for a text based 
field.
  *
  * It contains the position where the frame with the button should be 
displayed and
  * also contains all information that the popup window needs.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sfx2/source sw/qa sw/source

2020-05-08 Thread Tamás Zolnai (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h  |   23 +++
 libreofficekit/source/gtk/lokdocview.cxx  |1 
 sfx2/source/view/viewsh.cxx   |5 
 sw/qa/extras/tiledrendering/data/drop_down_form_field.odt |binary
 sw/qa/extras/tiledrendering/tiledrendering.cxx|   81 ++
 sw/source/core/crsr/bookmrk.cxx   |   45 +++
 sw/source/core/inc/bookmrk.hxx|8 +
 7 files changed, 160 insertions(+), 3 deletions(-)

New commits:
commit 7aedeab27cbef89fd3f831b4a1ef2c06f24c9790
Author: Tamás Zolnai 
AuthorDate: Tue Apr 28 15:51:02 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Fri May 8 14:06:04 2020 +0200

lok: MSForms: Add callback for form field button.

Show and hide the button and send the button area, where
it should be displayed.

Change-Id: I5922eb9f5e544483dd4efd12e4218d2e51270632
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93657
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 53bc3099e282..b0b6d59e62a2 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -726,6 +726,27 @@ typedef enum
  * Sends the tab stop list for the current of the current cursor position.
  */
 LOK_CALLBACK_TAB_STOP_LIST = 48,
+
+/**
+ * Sends all informations for displaying form field button for a text 
based field.
+ *
+ * It contains the position where the frame with the button should be 
displayed and
+ * also contains all information that the popup window needs.
+ *
+ * The payload example:
+ * {
+ *  "action": "show",
+ *  "type": "drop-down",
+ *  "textArea": "1418, 3906, 3111, 919"
+ * }
+ *
+ * or
+ * {
+ *  "action": "hide",
+ *  "type": "drop-down"
+ * }
+ */
+LOK_CALLBACK_FORM_FIELD_BUTTON = 49,
 }
 LibreOfficeKitCallbackType;
 
@@ -852,6 +873,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_CALC_FUNCTION_LIST";
 case LOK_CALLBACK_TAB_STOP_LIST:
 return "LOK_CALLBACK_TAB_STOP_LIST";
+case LOK_CALLBACK_FORM_FIELD_BUTTON:
+return "LOK_CALLBACK_FORM_FIELD_BUTTON";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index c9235f41b2a4..75deee7a38a0 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1399,6 +1399,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_JSDIALOG:
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
 case LOK_CALLBACK_TAB_STOP_LIST:
+case LOK_CALLBACK_FORM_FIELD_BUTTON:
 {
 // TODO: Implement me
 break;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index bc2ca6a447f6..00a5e527599e 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1457,7 +1457,10 @@ void 
SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa
 
 void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) 
const
 {
-if (!comphelper::LibreOfficeKit::isActive() || 
comphelper::LibreOfficeKit::isTiledPainting())
+if (!comphelper::LibreOfficeKit::isActive())
+return;
+
+if (comphelper::LibreOfficeKit::isTiledPainting() && nType != 
LOK_CALLBACK_FORM_FIELD_BUTTON)
 return;
 
 if (pImpl->m_bTiledSearching)
diff --git a/sw/qa/extras/tiledrendering/data/drop_down_form_field.odt 
b/sw/qa/extras/tiledrendering/data/drop_down_form_field.odt
new file mode 100644
index ..7793aff4e91b
Binary files /dev/null and 
b/sw/qa/extras/tiledrendering/data/drop_down_form_field.odt differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 355ae56cc29f..efe714d74388 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -128,6 +128,7 @@ public:
 void testRedlineNotificationDuringSave();
 void testHyperlink();
 void testFieldmark();
+void testDropDownFormFieldButton();
 
 CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -194,6 +195,7 @@ public:
 CPPUNIT_TEST(testRedlineNotificationDuringSave);
 CPPUNIT_TEST(testHyperlink);
 CPPUNIT_TEST(testFieldmark);
+CPPUNIT_TEST(testDropDownFormFieldButton);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -214,6 +216,7 @@ private:
 int m_nTrackedChangeIndex;
 OString m_sHyperlinkText;
 OString m_sHyperlinkLink;
+OString m_aFormFieldButton;
 };
 
 SwTiledRenderingTest::SwTiledRenderingTest()
@@ -365,6 +368,11 @@ void SwTiledRenderingTest::callbackImpl(int nType, const 

[Libreoffice-commits] core.git: include/LibreOfficeKit include/svx libreofficekit/source svx/sdi sw/sdi sw/source

2020-04-14 Thread Tomaž Vajngerl (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +++
 include/svx/svxids.hrc   |3 +
 libreofficekit/source/gtk/lokdocview.cxx |1 
 svx/sdi/svx.sdi  |   19 +++
 sw/sdi/_viewsh.sdi   |4 +
 sw/source/uibase/uiview/viewtab.cxx  |   72 ++-
 6 files changed, 105 insertions(+), 3 deletions(-)

New commits:
commit a60b18a8c5d5c11c87dbbaaf884de138dfeb6c8f
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 14 07:35:02 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 14 15:03:04 2020 +0200

lok: add tabstop changing and callback to send tabstop updates

This adds callback LOK_CALLBACK_TAB_STOP_LIST to send the tabstops
for the current paragraph.
In addition it adds .uno:ChangeTabStop action, with which it is
possible to change just one tabstop identified by the index.

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

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 5ad801a7a74f..53bc3099e282 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -720,7 +720,12 @@ typedef enum
  * Send the list of functions whose name starts with the characters entered
  * by the user in the formula input bar.
  */
-LOK_CALLBACK_CALC_FUNCTION_LIST = 47
+LOK_CALLBACK_CALC_FUNCTION_LIST = 47,
+
+/**
+ * Sends the tab stop list for the current of the current cursor position.
+ */
+LOK_CALLBACK_TAB_STOP_LIST = 48,
 }
 LibreOfficeKitCallbackType;
 
@@ -845,6 +850,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_JSDIALOG";
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
 return "LOK_CALLBACK_CALC_FUNCTION_LIST";
+case LOK_CALLBACK_TAB_STOP_LIST:
+return "LOK_CALLBACK_TAB_STOP_LIST";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 32b0f5ba8350..1aa3111beeba 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -533,6 +533,9 @@ class SvxSetItem;
 #define SID_ATTR_ALIGN_DEGREES  ( SID_SVX_START + 577 )
 #define SID_ATTR_ALIGN_LOCKPOS  ( SID_SVX_START + 578 )
 #define SID_ATTR_NUMBERFORMAT_ONE_AREA  ( SID_SVX_START + 580 )
+#define SID_TABSTOP_ADD_OR_CHANGE   ( SID_SVX_START + 581 )
+#define SID_TABSTOP_ATTR_INDEX  ( SID_SVX_START + 582 )
+#define SID_TABSTOP_ATTR_POSITION   ( SID_SVX_START + 583 )
 
 // CAUTION! Range <587 .. 587> used by EditEngine (!)
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 0d7ad9b9e7a6..c9235f41b2a4 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1398,6 +1398,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_TABLE_SELECTED:
 case LOK_CALLBACK_JSDIALOG:
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
+case LOK_CALLBACK_TAB_STOP_LIST:
 {
 // TODO: Implement me
 break;
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 75d2993297ee..ad31871008af 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -7207,6 +7207,25 @@ SfxVoidItem RulerChangeState SID_RULER_CHANGE_STATE
 GroupId = ;
 ]
 
+SfxVoidItem ChangeTabStop SID_TABSTOP_ADD_OR_CHANGE
+(SfxInt32Item Index SID_TABSTOP_ATTR_INDEX,
+ SfxInt32Item Position SID_TABSTOP_ATTR_POSITION)
+[
+AutoUpdate = FALSE,
+FastCall = TRUE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+
+AccelConfig = FALSE,
+MenuConfig = FALSE,
+ToolBoxConfig = FALSE,
+GroupId = ;
+]
+
 SfxVoidItem TableChangeCurrentBorderPosition 
SID_TABLE_CHANGE_CURRENT_BORDER_POSITION
 (SfxStringItem BorderType SID_TABLE_BORDER_TYPE,
  SfxUInt16Item Index SID_TABLE_BORDER_INDEX,
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index acef4c75f26a..47b95ab80409 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -643,6 +643,10 @@ interface BaseTextEditView
 StateMethod = StateTabWin ;
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
+SID_TABSTOP_ADD_OR_CHANGE // status()
+[
+ExecMethod = ExecTabWin;
+]
 // from here  Export = FALSE;
 FID_SEARCH_ON // status()
 [
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 844bbfce782b..6b7dee96379b 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -55,6 +55,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 

[Libreoffice-commits] core.git: include/LibreOfficeKit vcl/source

2020-04-07 Thread Tamás Zolnai (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |1 +
 vcl/source/window/floatwin.cxx   |7 ++-
 vcl/source/window/winproc.cxx|   10 --
 3 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit f91745c82128bfd6bf795f4e2e1cc290448f1cdb
Author: Tamás Zolnai 
AuthorDate: Tue Apr 7 10:31:51 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Tue Apr 7 18:17:24 2020 +0200

lok: Use a different window type for tooltips.

Change-Id: I211cd6bc2249475dbacd80f944e22465b19aff77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91829
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index e1321898bd2d..5ad801a7a74f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -614,6 +614,7 @@ typedef enum
  *  - "dialog" - window is a dialog
  *  - "child" - window is a floating window (combo boxes, etc.)
  *  - "deck" - window is a docked/floating deck (i.e. the sidebar)
+ *  - "tooltip" - window is a tooltip popup
  *
  * "action" can take following values:
  * - "created" - window is created in the backend, client can render it now
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index a010533c79aa..749ceacd09d0 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -653,7 +654,11 @@ void FloatingWindow::StateChanged( StateChangedType nType )
 else
 {
 SetLOKNotifier(pParent->GetLOKNotifier());
-aItems.emplace_back("type", "child");
+if (dynamic_cast(this))
+aItems.emplace_back("type", "tooltip");
+else
+aItems.emplace_back("type", "child");
+
 aItems.emplace_back("parentId", 
OString::number(pParent->GetLOKWindowId()));
 if (mbInPopupMode)
 aItems.emplace_back("position", 
mpImplData->maPos.toString()); // pixels
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index e0fad45bf34f..6ae5be59debb 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -160,16 +160,6 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, 
const Point& rMousePo
 
 static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& 
rMousePos )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Ignore tooltips in popup color palettes
-// (e.g. Character Properties dialog -> Font Effects -> Font Color)
-if(pChild->GetType() == WindowType::CONTROL &&
-   pChild->GetParent() && pChild->GetParent()->GetParent() &&
-   pChild->GetParent()->GetParent()->GetType() == 
WindowType::DOCKINGWINDOW)
-return;
-}
-
 ImplSVHelpData& aHelpData = ImplGetSVHelpData();
 if ( !aHelpData.mpHelpWin ||
  !( aHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit include/registry include/rtl include/sfx2 include/svx

2020-01-26 Thread iakarsu (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx |5 +
 include/registry/registry.hxx |6 +-
 include/rtl/strbuf.hxx|6 +-
 include/sfx2/sfxbasemodel.hxx |5 +
 include/svx/msdffdef.hxx  |5 +
 5 files changed, 5 insertions(+), 22 deletions(-)

New commits:
commit 9accb3c4b5e1861d9a03c655242da5b629f5a6d6
Author: iakarsu 
AuthorDate: Sat Jan 25 16:21:43 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Jan 26 20:27:42 2020 +0100

tdf#124176: Use pragma once instead of include guards

Change-Id: I6a7f7711fa931657dd97c9c0bc1bdce671b69b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87405
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 19f0b2663552..28a603e02203 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_HXX
-#define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_HXX
+#pragma once
 
 #include 
 
@@ -972,6 +971,4 @@ inline Office* lok_cpp_init(const char* pInstallPath, const 
char* pUserProfileUr
 
 }
 
-#endif // INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
index 9e264f4a30bd..c71e7dc804c4 100644
--- a/include/registry/registry.hxx
+++ b/include/registry/registry.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_REGISTRY_REGISTRY_HXX
-#define INCLUDED_REGISTRY_REGISTRY_HXX
+#pragma once
 
 #include 
 #include 
@@ -1055,7 +1054,4 @@ inline RegError Registry::mergeKey(RegistryKey& rKey,
  bool bReport)
 {  return m_pApi->mergeKey(m_hImpl, rKey.m_hImpl, keyName.pData, 
regFileName.pData, false/*bWarnings*/, bReport); }
 
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 3be06a31e120..780f00dddbb5 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_RTL_STRBUF_HXX
-#define INCLUDED_RTL_STRBUF_HXX
+#pragma once
 
 #include "sal/config.h"
 
@@ -1068,7 +1067,4 @@ typedef rtlunittest::OStringBuffer OStringBuffer;
 using ::rtl::OStringBuffer;
 #endif
 
-#endif // INCLUDED_RTL_STRBUF_HXX
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
index 7d3be53fd515..3dbdb80c3aff 100644
--- a/include/sfx2/sfxbasemodel.hxx
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SFX2_SFXBASEMODEL_HXX
-#define INCLUDED_SFX2_SFXBASEMODEL_HXX
+#pragma once
 
 #include 
 #include 
@@ -745,6 +744,4 @@ private:
 
 } ; // class SfxBaseModel
 
-#endif // INCLUDED_SFX2_SFXBASEMODEL_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/msdffdef.hxx b/include/svx/msdffdef.hxx
index b722e95be8b3..373974e67b31 100644
--- a/include/svx/msdffdef.hxx
+++ b/include/svx/msdffdef.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SVX_MSDFFDEF_HXX
-#define INCLUDED_SVX_MSDFFDEF_HXX
+#pragma once
 
 #include 
 #include 
@@ -856,6 +855,4 @@ enum MSO_TextGeometryProperties {
 //ALT_TXT_MSINTEROP
 #define MSPROP_DESCRIPTION_MAX_LEN  4096
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2019-12-17 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b523838ecd07b3e6694a3b761b6848a209c5bfb9
Author: Andrea Gelmini 
AuthorDate: Tue Dec 17 17:20:43 2019 +0100
Commit: Julien Nabet 
CommitDate: Tue Dec 17 18:19:45 2019 +0100

Fix typos

Change-Id: I363cd336389865a9aae3a5d7eb92919a3bd9
Reviewed-on: https://gerrit.libreoffice.org/85316
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index e162620403f5..e1321898bd2d 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -134,9 +134,9 @@ typedef enum
  * Old format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  * New format is a JSON with 3 elements the 'viewId' element represented by
  * an integer value, a 'rectangle' element in the format "x, y, width, 
height",
- * and a 'mispelledWord' element represented by an integer value: '1' when
- * a mispelled word is at the cursor position, '0' when the word is
- * not mispelled.
+ * and a 'misspelledWord' element represented by an integer value: '1' when
+ * a misspelled word is at the cursor position, '0' when the word is
+ * not misspelled.
  */
 LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1,
 /**
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2019-11-19 Thread Corentin Noël (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitGtk.h |   12 
 libreofficekit/source/gtk/lokdocview.cxx   |   14 ++
 2 files changed, 26 insertions(+)

New commits:
commit 4e14163ceff6bc05ed372358ed66272caa1b35c2
Author: Corentin Noël 
AuthorDate: Sun Nov 10 11:46:37 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Nov 19 09:55:25 2019 +0100

lokdocview: Add support for get_command_values

Change-Id: I6a007724de8aea0e4de035313855acd6e9342ee7
Reviewed-on: https://gerrit.libreoffice.org/82377
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index fb18aae8aab6..15958e35644b 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -235,6 +235,18 @@ void   lok_doc_view_post_command   
(LOKDocView*
 const 
gchar* pArguments,
 gboolean 
bNotifyWhenFinished);
 
+/**
+ * lok_doc_view_get_command_values:
+ * @pDocView: the #LOKDocView instance
+ * @pCommand: the command to issue to LO core
+ *
+ * Get a json mapping of the possible values for the given command.
+ * In the form of: {commandName: unoCmd, commandValues: {possible_values}}
+ *
+ * Returns: A json mapping of the possible values for the given command
+ */
+gchar *lok_doc_view_get_command_values 
(LOKDocView* pDocView,
+const 
gchar* pCommand);
 
 /**
  * lok_doc_view_find_next:
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 8dc4516d0ca5..f6fc2d8160ea 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -3742,6 +3742,20 @@ lok_doc_view_post_command (LOKDocView* pDocView,
 g_info ("LOK_POST_COMMAND: ignoring commands in view-only mode");
 }
 
+SAL_DLLPUBLIC_EXPORT gchar *
+lok_doc_view_get_command_values (LOKDocView* pDocView,
+ const gchar* pCommand)
+{
+g_return_val_if_fail (LOK_IS_DOC_VIEW (pDocView), nullptr);
+g_return_val_if_fail (pCommand != nullptr, nullptr);
+
+LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pDocView);
+if (!pDocument)
+return nullptr;
+
+return pDocument->pClass->getCommandValues(pDocument, pCommand);
+}
+
 SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_find_prev (LOKDocView* pDocView,
 const gchar* pText,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2019-09-30 Thread Szymon Kłos (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |8 
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 2 files changed, 9 insertions(+)

New commits:
commit 2e347c94503321c2102c6f78f5f5bcb771727e69
Author: Szymon Kłos 
AuthorDate: Tue Sep 24 17:29:53 2019 +0200
Commit: Szymon Kłos 
CommitDate: Mon Sep 30 11:25:23 2019 +0200

jsdialogs: add callback LOK_CALLBACK_JSDIALOG

Change-Id: Ie79e24ae3a376e0de3d82daff4a1263c7ce3b33a
Reviewed-on: https://gerrit.libreoffice.org/79825
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 17e1c3e27740..829eca07e500 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -703,6 +703,12 @@ typedef enum
  * }
  */
 LOK_CALLBACK_REFERENCE_MARKS = 45,
+
+/**
+ * Callback related to native dialogs generated in JavaScript from
+ * the description.
+ */
+LOK_CALLBACK_JSDIALOG = 46,
 }
 LibreOfficeKitCallbackType;
 
@@ -823,6 +829,8 @@ static inline const char* lokCallbackTypeToString(int nType)
 return "LOK_CALLBACK_TABLE_SELECTED";
 case LOK_CALLBACK_REFERENCE_MARKS:
 return "LOK_CALLBACK_REFERENCE_MARKS";
+case LOK_CALLBACK_JSDIALOG:
+return "LOK_CALLBACK_JSDIALOG";
 }
 
 assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index f2b35617c952..96e2c12b17ba 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1391,6 +1391,7 @@ callback (gpointer pData)
 case LOK_CALLBACK_CELL_SELECTION_AREA:
 case LOK_CALLBACK_CELL_AUTO_FILL_AREA:
 case LOK_CALLBACK_TABLE_SELECTED:
+case LOK_CALLBACK_JSDIALOG:
 {
 // TODO: Implement me
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit

2019-09-25 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d8d6b03eb136c5d98bb74fbb6f435e650f9e4939
Author: Andrea Gelmini 
AuthorDate: Wed Sep 25 18:02:28 2019 +0200
Commit: Julien Nabet 
CommitDate: Wed Sep 25 18:45:22 2019 +0200

Fix typo

Change-Id: Iec98bb5446782dc50223bb49b4c305046960c751
Reviewed-on: https://gerrit.libreoffice.org/79567
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index bf8f9a4ee5ea..17e1c3e27740 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -263,7 +263,7 @@ typedef enum
  * Payload format is "width, height", i.e. clients get the new size without
  * having to do an explicit lok::Document::getDocumentSize() call.
  *
- * A size change is always preceeded by a series of
+ * A size change is always preceded by a series of
  * LOK_CALLBACK_INVALIDATE_TILES events invalidating any areas
  * need re-rendering to adapt.
  */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2019-08-16 Thread Ashod Nakashian (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |  103 ++
 libreofficekit/source/gtk/lokdocview.cxx |  105 ---
 2 files changed, 105 insertions(+), 103 deletions(-)

New commits:
commit 6c80baa5c2aa33aa39f65f6223bf380e9e4e3c94
Author: Ashod Nakashian 
AuthorDate: Fri Aug 16 09:08:10 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Sat Aug 17 00:28:50 2019 +0200

LOK: move LOK callback-type-to-string helper to header

This is a very common function that is used by clients
as well as LO Core, so makes sense to have it implemented
once and updated when new callback-types are added,
all in one place.

Change-Id: Id6a1d6bcf5585d7be440b62a0c3a9c993e46e5e0
Reviewed-on: https://gerrit.libreoffice.org/77587
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 43762cc54c48..44bf83eab205 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITENUMS_H
 #define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITENUMS_H
 
+#include 
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -706,6 +708,107 @@ typedef enum
 }
 LibreOfficeKitExtTextInputType;
 
+/// Returns the string representation of a LibreOfficeKitCallbackType 
enumeration element.
+static inline const char* lokCallbackTypeToString(int nType)
+{
+switch (static_cast(nType))
+{
+case LOK_CALLBACK_INVALIDATE_TILES:
+return "LOK_CALLBACK_INVALIDATE_TILES";
+case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
+return "LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR";
+case LOK_CALLBACK_TEXT_SELECTION:
+return "LOK_CALLBACK_TEXT_SELECTION";
+case LOK_CALLBACK_TEXT_SELECTION_START:
+return "LOK_CALLBACK_TEXT_SELECTION_START";
+case LOK_CALLBACK_TEXT_SELECTION_END:
+return "LOK_CALLBACK_TEXT_SELECTION_END";
+case LOK_CALLBACK_CURSOR_VISIBLE:
+return "LOK_CALLBACK_CURSOR_VISIBLE";
+case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
+return "LOK_CALLBACK_VIEW_CURSOR_VISIBLE";
+case LOK_CALLBACK_GRAPHIC_SELECTION:
+return "LOK_CALLBACK_GRAPHIC_SELECTION";
+case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
+return "LOK_CALLBACK_GRAPHIC_VIEW_SELECTION";
+case LOK_CALLBACK_CELL_CURSOR:
+return "LOK_CALLBACK_CELL_CURSOR";
+case LOK_CALLBACK_HYPERLINK_CLICKED:
+return "LOK_CALLBACK_HYPERLINK_CLICKED";
+case LOK_CALLBACK_MOUSE_POINTER:
+return "LOK_CALLBACK_MOUSE_POINTER";
+case LOK_CALLBACK_STATE_CHANGED:
+return "LOK_CALLBACK_STATE_CHANGED";
+case LOK_CALLBACK_STATUS_INDICATOR_START:
+return "LOK_CALLBACK_STATUS_INDICATOR_START";
+case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
+return "LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE";
+case LOK_CALLBACK_STATUS_INDICATOR_FINISH:
+return "LOK_CALLBACK_STATUS_INDICATOR_FINISH";
+case LOK_CALLBACK_SEARCH_NOT_FOUND:
+return "LOK_CALLBACK_SEARCH_NOT_FOUND";
+case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
+return "LOK_CALLBACK_DOCUMENT_SIZE_CHANGED";
+case LOK_CALLBACK_SET_PART:
+return "LOK_CALLBACK_SET_PART";
+case LOK_CALLBACK_SEARCH_RESULT_SELECTION:
+return "LOK_CALLBACK_SEARCH_RESULT_SELECTION";
+case LOK_CALLBACK_DOCUMENT_PASSWORD:
+return "LOK_CALLBACK_DOCUMENT_PASSWORD";
+case LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY:
+return "LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY";
+case LOK_CALLBACK_CONTEXT_MENU:
+return "LOK_CALLBACK_CONTEXT_MENU";
+case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
+return "LOK_CALLBACK_INVALIDATE_VIEW_CURSOR";
+case LOK_CALLBACK_TEXT_VIEW_SELECTION:
+return "LOK_CALLBACK_TEXT_VIEW_SELECTION";
+case LOK_CALLBACK_CELL_VIEW_CURSOR:
+return "LOK_CALLBACK_CELL_VIEW_CURSOR";
+case LOK_CALLBACK_CELL_ADDRESS:
+return "LOK_CALLBACK_CELL_ADDRESS";
+case LOK_CALLBACK_CELL_FORMULA:
+return "LOK_CALLBACK_CELL_FORMULA";
+case LOK_CALLBACK_UNO_COMMAND_RESULT:
+return "LOK_CALLBACK_UNO_COMMAND_RESULT";
+case LOK_CALLBACK_ERROR:
+return "LOK_CALLBACK_ERROR";
+case LOK_CALLBACK_VIEW_LOCK:
+return "LOK_CALLBACK_VIEW_LOCK";
+case LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED:
+return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED";
+case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED:
+return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED";
+case LOK_CALLBACK_INVALIDATE_HEADER:
+return "LOK_CALLBACK_INVALIDATE_HEADER";
+case LOK_CALLBACK_COMMENT:
+return "LOK_CALLBACK_COMMENT";
+case LOK_CALLBACK_RULER_UPDATE:
+return "LOK_CALLBACK_RULER_UPDATE";
+case LOK_CALLBACK_WINDOW:
+return "LOK_CALLBACK_WINDOW";
+case LOK_CALLBACK_VALIDITY_LIST_BUTTON:
+ 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sc/source

2019-07-28 Thread Tomaž Vajngerl (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   18 +
 libreofficekit/source/gtk/lokdocview.cxx |4 ++
 sc/source/ui/view/gridwin.cxx|   50 +++
 3 files changed, 57 insertions(+), 15 deletions(-)

New commits:
commit 23ed3a19cb0d53639d817af9b802a44977e89c65
Author: Tomaž Vajngerl 
AuthorDate: Sun Jul 28 10:04:58 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jul 28 12:35:39 2019 +0200

lok: send cell selection rectangle and cell area fill rectangle

Instead of text selection start/end for cell selection we send a
cell selection rectangle event. This is needed so we're able to
differentiate when to draw cell selection and text selection
markers.

In addition send cell fill area rectangle, which is the area where
we need to hit to trigger area fill functionality in Calc.

Change-Id: I54af958932815818a1a4d48364192ba43f1df7de
Reviewed-on: https://gerrit.libreoffice.org/76491
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index a256a9629ac8..4277adbe6dbc 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -648,7 +648,23 @@ typedef enum
  * Profiling tracing information single string of multiple lines
  * containing   and zone start/stop information
  */
-LOK_CALLBACK_PROFILE_FRAME = 41
+LOK_CALLBACK_PROFILE_FRAME = 41,
+
+/**
+ * The position and size of the cell selection area. It is used to
+ * draw the selection handles for cells in Calc documents.
+ *
+ * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
+ */
+LOK_CALLBACK_CELL_SELECTION_AREA = 42,
+
+/**
+ * The position and size of the cell auto fill area. It is used to
+ * trigger auto fill functionality if that area is hit.
+ *
+ * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
+ */
+LOK_CALLBACK_CELL_AUTO_FILL_AREA = 43,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 6aa77469ed41..aedff8870a28 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -453,6 +453,10 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_SIGNATURE_STATUS";
 case LOK_CALLBACK_PROFILE_FRAME:
 return "LOK_CALLBACK_PROFILE_FRAME";
+case LOK_CALLBACK_CELL_SELECTION_AREA:
+return "LOK_CALLBACK_CELL_SELECTION_AREA";
+case LOK_CALLBACK_CELL_AUTO_FILL_AREA:
+return "LOK_CALLBACK_CELL_AUTO_FILL_AREA";
 }
 g_assert(false);
 return nullptr;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d7c23d5696dc..cb5c6a3bab7f 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5912,23 +5912,41 @@ static void updateLibreOfficeKitSelection(const 
ScViewData* pViewData, const std
 return;
 
 // selection start handle
-tools::Rectangle aStart(aBoundingBox.Left() / nPPTX, aBoundingBox.Top() / 
nPPTY,
-aBoundingBox.Left() / nPPTX, (aBoundingBox.Top() / nPPTY) + 256);
-
-// selection end handle
-tools::Rectangle aEnd(aBoundingBox.Right() / nPPTX, (aBoundingBox.Bottom() 
/ nPPTY) - 256,
+tools::Rectangle aRectangle(
+aBoundingBox.Left()  / nPPTX, aBoundingBox.Top() / nPPTY,
 aBoundingBox.Right() / nPPTX, aBoundingBox.Bottom() / nPPTY);
 
 // the selection itself
 OString aSelection = comphelper::string::join("; ", aRectangles).getStr();
 
 ScTabViewShell* pViewShell = pViewData->GetViewShell();
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, 
aStart.toString().getStr());
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, 
aEnd.toString().getStr());
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, 
aRectangle.toString().getStr());
 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, 
aSelection.getStr());
 SfxLokHelper::notifyOtherViews(pViewShell, 
LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", aSelection.getStr());
 }
 
+namespace
+{
+
+void updateLibreOfficeKitAutoFill(const ScViewData* pViewData, 
tools::Rectangle const & rRectangle)
+{
+if (!comphelper::LibreOfficeKit::isActive())
+return;
+
+double nPPTX = pViewData->GetPPTX();
+double nPPTY = pViewData->GetPPTY();
+
+// selection start handle
+tools::Rectangle aLogicRectangle(
+rRectangle.Left()  / nPPTX, rRectangle.Top() / nPPTY,
+rRectangle.Right() / nPPTX, rRectangle.Bottom() / nPPTY);
+
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_AUTO_FILL_AREA, 
aLogicRectangle.toString().getStr());
+}

[Libreoffice-commits] core.git: include/LibreOfficeKit

2019-07-24 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 46272359af4676ce3a66f90c74bf49077161000f
Author: Andrea Gelmini 
AuthorDate: Thu Jul 11 22:25:34 2019 +
Commit: Andrea Gelmini 
CommitDate: Wed Jul 24 08:27:40 2019 +0200

Fix typo

Change-Id: Ia095c30e6ca4e7b9d6ba0dcf5b796353bfd088be
Reviewed-on: https://gerrit.libreoffice.org/75559
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 0290e6f8efb3..3bd1c50bb0be 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -685,7 +685,7 @@ public:
 }
 
 /**
- * Loads a document from an URL.
+ * Loads a document from a URL.
  *
  * @param pUrl the URL of the document to load
  * @param pFilterOptions options for the import filter, e.g. SkipImages.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit

2019-06-26 Thread Andrea Gelmini (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ae823e4633a76d13cebc6432b9e44b9b2862326b
Author: Andrea Gelmini 
AuthorDate: Wed Jun 26 21:17:25 2019 +
Commit: Julien Nabet 
CommitDate: Wed Jun 26 23:34:24 2019 +0200

Fix typos

Change-Id: I8163ad2712522e79d236a3e682b2bbce79dc16e7
Reviewed-on: https://gerrit.libreoffice.org/74760
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 70fdab298e86..d1a3106b7d6b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -386,7 +386,7 @@ public:
 /**
  * Returns a json mapping of the possible values for the given command
  * e.g. {commandName: ".uno:StyleApply", commandValues: {"familyName1" : 
["list of style names in the family1"], etc.}}
- * @param pCommand a uno command for which the possible values are 
requested
+ * @param pCommand a UNO command for which the possible values are 
requested
  * @return {commandName: unoCmd, commandValues: {possible_values}}
  */
 char* getCommandValues(const char* pCommand)
@@ -626,7 +626,7 @@ public:
 /**
  * Gets an image of the selected shapes.
  * @param pOutput contains the result; use free to deallocate.
- * @return the size ouf *pOutput in bytes.
+ * @return the size of *pOutput in bytes.
  */
 size_t renderShapeSelection(char** pOutput)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit vcl/source

2019-05-03 Thread Szymon Kłos (via logerrit)
 include/LibreOfficeKit/LibreOfficeKitEnums.h |2 ++
 vcl/source/window/dialog.cxx |   10 ++
 2 files changed, 12 insertions(+)

New commits:
commit e575a5e8f89beb3ce1df5a1d83edc0f9d1d8ac43
Author: Szymon Kłos 
AuthorDate: Mon Apr 29 16:58:03 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Fri May 3 18:26:17 2019 +0200

libreofficekit: send show/hide messages for dialogs

Change-Id: I2b3ff5e5122b2be099be500ac544bf81f8d1b2ae
Reviewed-on: https://gerrit.libreoffice.org/71544
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 33d235af827b..af4952566dbd 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -575,6 +575,8 @@ typedef enum
  * - "cursor_visible" - cursor visible status is changed. Status is 
available
  *in "visible" field
  * - "close" - window is closed
+ * - "show" - show the window
+ * - "hide" - hide the window
  */
 LOK_CALLBACK_WINDOW = 36,
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e34ff81f6148..1219b312a26b 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -799,6 +799,16 @@ void Dialog::StateChanged( StateChangedType nType )
 ImplInitSettings();
 Invalidate();
 }
+
+if (!mbModalMode && nType == StateChangedType::Visible)
+{
+if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+{
+std::vector aPayload;
+aPayload.emplace_back("title", GetText().toUtf8());
+pNotifier->notifyWindow(GetLOKWindowId(), IsVisible()? 
OUString("show"): OUString("hide"), aPayload);
+}
+}
 }
 
 void Dialog::DataChanged( const DataChangedEvent& rDCEvt )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa

2019-05-02 Thread Jan Holesovsky (via logerrit)
 include/LibreOfficeKit/LibreOfficeKit.hxx |2 +-
 libreofficekit/qa/tilebench/tilebench.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a6d146074dce236f84e0194539413e7d551b5065
Author: Jan Holesovsky 
AuthorDate: Thu May 2 11:14:40 2019 +0200
Commit: Michael Meeks 
CommitDate: Thu May 2 11:39:30 2019 +0200

lok: We changed the (unstable) ABI, but let's allow the older C++ API.

Helps building the Online before the appropriate patch gets merged.

Change-Id: I9983d546bb0cb7fb472806622a0a10e3a4d3ab87
Reviewed-on: https://gerrit.libreoffice.org/71665
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 47983e68fa27..64aac1b361c5 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -188,7 +188,7 @@ public:
  *
  * @param nWindowid
  */
-void postWindow(unsigned nWindowId, int nAction, const char* pData)
+void postWindow(unsigned nWindowId, int nAction, const char* pData = 
nullptr)
 {
 return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction, pData);
 }
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx 
b/libreofficekit/qa/tilebench/tilebench.cxx
index d0fc87283d35..61d337f6c518 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -286,7 +286,7 @@ static void testDialog( Document *pDocument, const char 
*uno_cmd )
 }
 
 aTimes.emplace_back("post close dialog");
-pDocument->postWindow(nDialogId, LOK_WINDOW_CLOSE, nullptr);
+pDocument->postWindow(nDialogId, LOK_WINDOW_CLOSE);
 aTimes.emplace_back();
 
 pDocument->destroyView(view);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-12-10 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKit.hxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5f0dda8e9f2e35e1fdb5750089a70543478fa8a1
Author: Tor Lillqvist 
AuthorDate: Mon Dec 10 19:41:08 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Dec 10 19:41:08 2018 +0200

Add inline implementations of the C++ translate functions

Change-Id: I749fa9d647bf55925fad862152b673ced312ee34

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 93a0717ae588..923af7136b93 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -801,7 +801,10 @@ public:
  * @param pPrefixName the prefix passed to Translate::Create()
  * @param pBcp47LanguageTag the locale into which the string should be 
translated
  */
-char* translateGet( const char* pId, const char* pPrefixName, const char* 
pBcp47LanguageTag );
+char* translateGet( const char* pId, const char* pPrefixName, const char* 
pBcp47LanguageTag )
+{
+return mpThis->pClass->translateGet( mpThis, pId, pPrefixName, 
pBcp47LanguageTag );
+}
 
 /**
  * Fetch translation for a string corresponding to a specific number of 
something.
@@ -813,7 +816,10 @@ public:
  * @param pPrefixName the prefix passed to Translate::Create()
  * @param pBcp47LanguageTag the locale into which the string should be 
translated
  */
-char* translateNGet( const char* pId, int n, const char* pPrefixName, 
const char* pBcp47LanguageTag );
+char* translateNGet( const char* pId, int n, const char* pPrefixName, 
const char* pBcp47LanguageTag )
+{
+return mpThis->pClass->translateNGet( mpThis, pId, n, pPrefixName, 
pBcp47LanguageTag );
+}
 };
 
 /// Factory method to create a lok::Office instance.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit include/sfx2 sfx2/source svx/source

2018-11-06 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +
 include/sfx2/lokhelper.hxx   |4 
 sfx2/source/sidebar/ContextChangeBroadcaster.cxx |   10 ++
 sfx2/source/view/lokhelper.cxx   |9 +
 svx/source/sidebar/ContextChangeEventMultiplexer.cxx |9 +
 5 files changed, 41 insertions(+)

New commits:
commit df4f2b117d5925fa9e1fa4f9b3aec424022a583f
Author: Jan Holesovsky 
AuthorDate: Tue Nov 6 11:20:27 2018 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Nov 6 17:35:06 2018 +0100

lok: Notify about the current editing context.

Change-Id: I47e67b680a6abdb66020b295f55ee6a73b7b5608
Reviewed-on: https://gerrit.libreoffice.org/62956
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index c3ccc6aa0e10..e34efb3576ca 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -594,6 +594,15 @@ typedef enum
  * convenience.
  */
 LOK_CALLBACK_CLIPBOARD_CHANGED = 38,
+
+/**
+ * When the (editing) context changes - like the user switches from
+ * editing textbox in Impress to editing a shape there.
+ *
+ * Payload is the application ID and context, delimited by space.
+ * Eg. com.sun.star.presentation.PresentationDocument TextObject
+ */
+LOK_CALLBACK_CONTEXT_CHANGED = 39,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index ef50a4bb5167..be68f2e91044 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -53,6 +53,10 @@ public:
 static void notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle);
 /// Notifies all views with the given type and payload.
 static void notifyAllViews(int nType, const OString& rPayload);
+
+/// Notify about the editing context change.
+static void notifyContextChange(SfxViewShell const* pViewShell, const 
OUString& aApplication, const OUString& aContext);
+
 /// A special value to signify 'infinity'.
 /// This value is chosen such that sal_Int32 will not overflow when 
manipulated.
 static const long MaxTwips = 1e9;
diff --git a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx 
b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
index 716cb84fcfc4..3a182d14f368 100644
--- a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
+++ b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
@@ -22,7 +22,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 using namespace css;
 using namespace css::uno;
@@ -86,6 +89,13 @@ void ContextChangeBroadcaster::BroadcastContextChange (
 return;
 }
 
+// notify the LOK too
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (SfxViewShell* pViewShell = 
SfxViewShell::Get(rxFrame->getController()))
+SfxLokHelper::notifyContextChange(pViewShell, rsModuleName, 
rsContextName);
+}
+
 const css::ui::ContextChangeEventObject aEvent(
 rxFrame->getController(),
 rsModuleName,
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 20481ac61e15..374abf900936 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -228,4 +228,13 @@ void SfxLokHelper::notifyAllViews(int nType, const 
OString& rPayload)
 }
 }
 
+void SfxLokHelper::notifyContextChange(SfxViewShell const* pViewShell, const 
OUString& aApplication, const OUString& aContext)
+{
+OStringBuffer aBuffer;
+aBuffer.append(OUStringToOString(aApplication.replace(' ', '_'), 
RTL_TEXTENCODING_UTF8));
+aBuffer.append(' ');
+aBuffer.append(OUStringToOString(aContext.replace(' ', '_'), 
RTL_TEXTENCODING_UTF8));
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_CHANGED, 
aBuffer.makeStringAndClear().getStr());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx 
b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
index 230ced107676..0c53ae140629 100644
--- a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
+++ b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
@@ -23,7 +23,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 
@@ -37,6 +39,13 @@ void ContextChangeEventMultiplexer::NotifyContextChange (
 {
 if (rxController.is() && rxController->getFrame().is())
 {
+// notify the LOK too
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (SfxViewShell* pViewShell = SfxViewShell::Get(rxController))
+SfxLokHelper::notifyContextChange(pViewShell, 
GetModuleName(rxController->getFrame()), 
vcl::EnumContext::GetContextName(eContext));
+}
+
 const css::ui::ContextChangeEventObject 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-11-03 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKitInit.h |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit a3eb2aa471bcf0573d373edfa46a6b642fe5cdb1
Author: Tor Lillqvist 
AuthorDate: Fri Nov 2 23:54:38 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Sat Nov 3 15:32:07 2018 +0100

No need to mark libreofficekit_hook_2 with default visibility for iOS

Change-Id: Ib7b54ebed1c66324c79c116bd4d1e08ebaa1eac9
Reviewed-on: https://gerrit.libreoffice.org/62797
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ae779f468350..5dbf2f83f988 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -250,8 +250,7 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char 
*install_path, const char
 typedef int (LokHookPreInit)  ( const char *install_path, const 
char *user_profile_url );
 
 #if defined(IOS)
-extern __attribute__ ((visibility("default")))
-LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const 
char* user_profile_path);
+LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path);
 #endif
 
 static LibreOfficeKit *lok_init_2( const char *install_path,  const char 
*user_profile_url )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-10-25 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKitInit.h |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 88014e265a91753b69b70b5f4b246921d16051de
Author: Tor Lillqvist 
AuthorDate: Thu Oct 25 15:39:50 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 25 15:43:03 2018 +0300

Verify that we are actually passed a URL, not a pathname

Sure, the test could be even more strict and actually do a
case-insensitive check for an initial "file:" or
"vnd.sun.star.pathname:".

Change-Id: Ic252aeccdec708138530075d1f38fa348d1e469e

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index a4befd405cb1..ae779f468350 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -291,6 +291,15 @@ static LibreOfficeKit *lok_init_2( const char 
*install_path,  const char *user_p
 return pSym( install_path );
 }
 
+if (user_profile_url != NULL && user_profile_url[0] == '/')
+{
+// It should be either a file: URL or a vnd.sun.star.pathname: URL.
+fprintf( stderr, "second parameter to lok_init_2 '%s' should be a URL, 
not a pathname\n", user_profile_url );
+lok_dlclose( dlhandle );
+free( imp_lib );
+return NULL;
+}
+
 free( imp_lib );
 // dlhandle is "leaked"
 // coverity[leaked_storage] - on purpose
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit include/sfx2 include/svx include/vcl instsetoo_native/inc_ooohelppack instsetoo_native/inc_openoffice instsetoo_native/inc_sdkoo jurt/com offapi/

2018-08-29 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKitEnums.h|2 +-
 include/sfx2/shell.hxx  |2 +-
 include/svx/svdedtv.hxx |2 +-
 include/vcl/task.hxx|2 +-
 instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt |2 +-
 instsetoo_native/inc_openoffice/windows/msi_templates/_Validat.idt  |2 +-
 instsetoo_native/inc_sdkoo/windows/msi_templates/_Validat.idt   |2 +-
 jurt/com/sun/star/comp/connections/PipedConnection.java |2 +-
 offapi/com/sun/star/chart2/XTransformation.idl  |2 +-
 offapi/com/sun/star/form/FormComponentType.idl  |2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit dd6c80e4336d4c30e733f126f968b8fb7152851c
Author: Andrea Gelmini 
AuthorDate: Wed Aug 15 14:18:38 2018 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 29 17:12:35 2018 +0200

Fix typo: s/an other/another/g

Change-Id: Ifd83affcb16209f4134c725640fbd95077c8ab0f
Reviewed-on: https://gerrit.libreoffice.org/59099
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 74d49fa15824..c3ccc6aa0e10 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -349,7 +349,7 @@ typedef enum
 
 /**
  * The size and/or the position of the view cursor changed. A view cursor
- * is a cursor of an other view, the current view can't change it.
+ * is a cursor of another view, the current view can't change it.
  *
  * The payload format:
  *
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index d2d72093338a..0887c4f3dfe9 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -97,7 +97,7 @@ enum class SfxShellFeature
 FormTBMoreControls  = 0x0800,
 FormTBDesign= 0x1000,
 FormShowDataNavigator   = 0x2000,
-// masks to make sure modules don't use flags from an other
+// masks to make sure modules don't use flags from another
 SwMask  = 0x0001,
 BasicMask   = 0x0004,
 FormMask= 0x3ff8
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 27eb85e8c607..4e7f7e63eb56 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -194,7 +194,7 @@ public:
 void DeleteLayer(const OUString& rName);
 
 // Marked objects which are outside a page
-// are assigned to an other page; at the moment without undo!!!
+// are assigned to another page; at the moment without undo!!!
 void ForceMarkedObjToAnotherPage();
 void ForceMarkedToAnotherPage()   { ForceMarkedObjToAnotherPage(); }
 
diff --git a/include/vcl/task.hxx b/include/vcl/task.hxx
index 2711d4343932..7c450099c830 100644
--- a/include/vcl/task.hxx
+++ b/include/vcl/task.hxx
@@ -61,7 +61,7 @@ protected:
  *
  * Simply return Scheduler::ImmediateTimeoutMs if you're ready, like an
  * Idle. If you have to return Scheduler::InfiniteTimeoutMs, you probably
- * need an other mechanism to wake up the Scheduler or rely on other
+ * need another mechanism to wake up the Scheduler or rely on other
  * Tasks to be scheduled, or simply use a polling Timer.
  *
  * @param nMinPeriod the currently expected sleep time
diff --git 
a/instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt 
b/instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt
index 789a6d5d979b..499c013e343d 100644
--- a/instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt
+++ b/instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt
@@ -88,7 +88,7 @@ Condition Feature_N   Feature 
1   Identifier  Reference to a Feature entry in Fea
 Condition  Level   N   0   32767   
New selection Level to set in Feature table if Condition evaluates to TRUE.
 ControlAttributes  Y   0   2147483647  
A 32-bit word that specifies the attribute flags to be applied 
to this control.
 ControlControl N   Identifier  
Name of the control. This name must be unique within a dialog, but can 
repeat on different dialogs. 
-ControlControl_NextY   Control 2   
Identifier  The name of an other control on the same dialog. This 
link defines the tab order of the controls. The links have to form one or more 
cycles!
+ControlControl_NextY   Control 2   
Identifier  The name of another control on the same dialog. This 
link defines 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-07-19 Thread Libreoffice Gerrit user
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit efe42fca7c386340575088ecf94952f3ba0447de
Author: Tor Lillqvist 
AuthorDate: Thu Jul 19 11:51:14 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Jul 19 12:36:44 2018 +0200

Avoid gcc: "specified bound depends on the length of the source argument"

Just use memcpy().

Change-Id: Icb705acb6c12baf28684c763a77da7abc514ea6d
Reviewed-on: https://gerrit.libreoffice.org/57714
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 103c11be926c..687090a58b9f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -200,7 +200,7 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 return NULL;
 }
 
-strncpy(imp_lib, install_path, imp_lib_size);
+memcpy(imp_lib, install_path, partial_length);
 
 extendUnoPath(install_path);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit sc/source

2018-04-03 Thread Marco Cecchetti
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   11 ++
 sc/source/ui/inc/gridwin.hxx |2 +
 sc/source/ui/view/gridwin.cxx|   35 -
 sc/source/ui/view/gridwin4.cxx   |   43 ---
 4 files changed, 46 insertions(+), 45 deletions(-)

New commits:
commit 00d5cbf5f2a47c1614891c071b35f4a9e0b54354
Author: Marco Cecchetti 
Date:   Tue Apr 3 16:49:08 2018 +0200

lok - sc: validity list drop down button callback

Change-Id: Iaedc7f15147ea7f09e71877b592f932e3ecb37d5
Reviewed-on: https://gerrit.libreoffice.org/51596
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 020bbff90f20..300d91e1c8c4 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -570,6 +570,15 @@ typedef enum
 LOK_CALLBACK_WINDOW = 36,
 
 /**
+ * When for the current cell is defined a validity list we need to show
+ * a drop down button in the form of a marker.
+ *
+ * The payload format is: "x, y, visible" where x, y are the current
+ * cell cursor coordinates and visible is set to 0 or 1.
+ */
+LOK_CALLBACK_VALIDITY_LIST_BUTTON = 37,
+
+/**
  * Notification that the clipboard contents have changed.
  * Typically fired in response to copying to clipboard.
  *
@@ -578,7 +587,7 @@ typedef enum
  * in the future the contents might be included for
  * convenience.
  */
-LOK_CALLBACK_CLIPBOARD_CHANGED = 37,
+LOK_CALLBACK_CLIPBOARD_CHANGED = 38,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 958dc7849691..1775114c27c8 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -447,6 +447,8 @@ public:
 ScViewData* getViewData();
 virtual FactoryFunction GetUITestFactory() const override;
 
+void updateLOKValListButton(bool bVisible, const ScAddress& rPos) const;
+
 protected:
 void ImpCreateOverlayObjects();
 void ImpDestroyOverlayObjects();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 79c987e8942f..309ef81bb842 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4571,6 +4571,16 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, 
const ScRange& rMarkRange)
 }
 }
 
+void ScGridWindow::updateLOKValListButton( bool bVisible, const ScAddress& 
rPos ) const
+{
+SCCOL nX = rPos.Col();
+SCROW nY = rPos.Row();
+std::stringstream ss;
+ss << nX << ", " << nY << ", " << static_cast(bVisible);
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_VALIDITY_LIST_BUTTON, 
ss.str().c_str());
+}
+
 void ScGridWindow::UpdateListValPos( bool bVisible, const ScAddress& rPos )
 {
 bool bOldButton = bListValButton;
@@ -4584,7 +4594,14 @@ void ScGridWindow::UpdateListValPos( bool bVisible, 
const ScAddress& rPos )
 if ( !bOldButton || aListValPos != aOldPos )
 {
 // paint area of new button
-Invalidate( PixelToLogic( GetListValButtonRect( aListValPos ) ) );
+if ( comphelper::LibreOfficeKit::isActive() )
+{
+updateLOKValListButton( true, aListValPos );
+}
+else
+{
+Invalidate( PixelToLogic( GetListValButtonRect( aListValPos ) 
) );
+}
 }
 }
 if ( bOldButton )
@@ -4592,7 +4609,14 @@ void ScGridWindow::UpdateListValPos( bool bVisible, 
const ScAddress& rPos )
 if ( !bListValButton || aListValPos != aOldPos )
 {
 // paint area of old button
-Invalidate( PixelToLogic( GetListValButtonRect( aOldPos ) ) );
+if ( comphelper::LibreOfficeKit::isActive() )
+{
+updateLOKValListButton( false, aOldPos );
+}
+else
+{
+Invalidate( PixelToLogic( GetListValButtonRect( aOldPos ) ) );
+}
 }
 }
 }
@@ -5631,9 +5655,16 @@ void ScGridWindow::updateLibreOfficeKitCellCursor(const 
SfxViewShell* pOtherShel
 if (pOtherShell)
 {
 if (pOtherShell == pViewShell)
+{
 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, 
aCursor.getStr());
+
+if (bListValButton && aListValPos == pViewData->GetCurPos())
+updateLOKValListButton(true, aListValPos);
+}
 else
+{
 SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, 
LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor);
+}
 }
 else
 {
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 

[Libreoffice-commits] core.git: include/LibreOfficeKit sfx2/source

2018-03-16 Thread Ashod Nakashian
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   11 +++
 sfx2/source/view/viewsh.cxx  |   16 +++-
 2 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit de774e261a59625336fe4d744d8c8e2966b570d2
Author: Ashod Nakashian 
Date:   Sun Feb 25 14:14:40 2018 -0500

lok: notify clients of clipboard changes

Change-Id: I93d8eacc0defb1176ec5d767f49356812cf90ff6
Reviewed-on: https://gerrit.libreoffice.org/50327
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index b90aa6279c41..020bbff90f20 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -568,6 +568,17 @@ typedef enum
  * - "close" - window is closed
  */
 LOK_CALLBACK_WINDOW = 36,
+
+/**
+ * Notification that the clipboard contents have changed.
+ * Typically fired in response to copying to clipboard.
+ *
+ * The payload currently is empty and it's up to the
+ * client to get the contents, if necessary. However,
+ * in the future the contents might be included for
+ * convenience.
+ */
+LOK_CALLBACK_CLIPBOARD_CHANGED = 37,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 41ac335237ad..3b742b0a56d6 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -156,12 +156,18 @@ SfxClipboardChangeListener::SfxClipboardChangeListener( 
SfxViewShell* pView, con
 void SfxClipboardChangeListener::ChangedContents()
 {
 const SolarMutexGuard aGuard;
-if( m_pViewShell )
+if (m_pViewShell)
 {
 SfxBindings& rBind = m_pViewShell->GetViewFrame()->GetBindings();
-rBind.Invalidate( SID_PASTE );
-rBind.Invalidate( SID_PASTE_SPECIAL );
-rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
+rBind.Invalidate(SID_PASTE);
+rBind.Invalidate(SID_PASTE_SPECIAL);
+rBind.Invalidate(SID_CLIPBOARD_FORMAT_ITEMS);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// In the future we might send the payload as well.
+SfxLokHelper::notifyAllViews(LOK_CALLBACK_CLIPBOARD_CHANGED, "");
+}
 }
 }
 
@@ -823,7 +829,7 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
 if ( !pClients )
 return nullptr;
 
-bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
+const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
 
 for (SfxInPlaceClient* pIPClient : *pClients)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-02-01 Thread Mike Kaganski
 include/LibreOfficeKit/LibreOfficeKitInit.h |1 -
 1 file changed, 1 deletion(-)

New commits:
commit f365bca51e5ef5f28fb9f8c1cb972a6b719dfdb9
Author: Mike Kaganski 
Date:   Wed Jan 31 20:45:05 2018 +0300

LibreOfficeKit: MSVC: pragma warning: make more specific, remove obsolete

Change-Id: Id8dd284a9db04eae458593d8e411b44223d16a8e
Reviewed-on: https://gerrit.libreoffice.org/49040
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 69316f524130..ce5054ac91c4 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -82,7 +82,6 @@ extern "C"
 
 
 #else
-#pragma warning(disable:4996)
 #if !defined WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-01-12 Thread jan Iversen
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 2a80ce62d373d734db26741858b4bee1c3994564
Author: jan Iversen 
Date:   Fri Jan 12 14:03:55 2018 +0100

Repair windows build break.

Forgot to isolate extern declaration, mac/linux had no problem,
but windows breaks.

Change-Id: Ib09119661225193d9cfb1cd9118b78cf7d9bd2f4

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index f33a9868cf26..69316f524130 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -244,8 +244,10 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char 
*install_path, const char
 
 typedef int (LokHookPreInit)  ( const char *install_path, const 
char *user_profile_url );
 
+#if defined(IOS)
 extern __attribute__ ((visibility("default")))
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const 
char* user_profile_path);
+#endif
 
 static LibreOfficeKit *lok_init_2( const char *install_path,  const char 
*user_profile_url )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2018-01-10 Thread Tor Lillqvist
 include/LibreOfficeKit/LibreOfficeKit.hxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 4e5716b57c4ce75d35c76ea26a16d8d0acadaa76
Author: Tor Lillqvist 
Date:   Wed Jan 10 17:28:20 2018 +0200

Mention that the getError() semantics are unclear

Change-Id: Ifd5b04cc13085749f0f800bdb69cc3fdd5581916

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 310b9cfcee88..e158ee62cab7 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -583,6 +583,11 @@ public:
 }
 
 /// Returns the last error as a string, the returned pointer has to be 
freed by the caller.
+
+/// Exact semantics somewhat unclear (sometimes the code clears the string 
that the next call to
+/// getError() will return if no error happens in another function, 
sometimes not), and
+/// unfortunately cleaning up that is harder than it seems, because of 
lovely global variables
+/// and a unit test that uses the LibreOfficeKit API in an untypical 
manner.
 char* getError()
 {
 return mpThis->pClass->getError(mpThis);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-10-25 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKit.hxx |   51 +-
 1 file changed, 50 insertions(+), 1 deletion(-)

New commits:
commit f2e707baa762e9a4d80116cc6d6fc246eafeca3e
Author: Pranav Kant 
Date:   Wed Oct 25 09:31:46 2017 -0700

lokdialog: Add more dialog related methods to LOK API

Change-Id: I0e4abb38e1ea9450ae9c50f71ac6e8f9150868ae

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 9e897c5ffb85..e573a88249a9 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -175,6 +175,25 @@ public:
 }
 
 /**
+ * Renders the active floating window of a dialog
+ *
+ * Client must truncate pBuffer according to the nWidth and nHeight 
returned after the call.
+ *
+ * @param pDialogId Unique dialog id
+ * @param pBuffer Buffer with enough memory allocated to render any dialog
+ * @param nWidth output parameter returning the width of the rendered 
dialog.
+ * @param nHeight output parameter returning the height of the rendered 
dialog
+ */
+void paintActiveFloatingWindow(const char* pDialogId,
+   unsigned char* pBuffer,
+   int& nWidth,
+   int& nHeight)
+{
+return mpDoc->pClass->paintActiveFloatingWindow(mpDoc, pDialogId, 
pBuffer,
+, );
+}
+
+/**
  * Gets the tile mode: the pixel format used for the pBuffer of 
paintTile().
  *
  * @return an element of the LibreOfficeKitTileMode enum.
@@ -240,6 +259,19 @@ public:
 }
 
 /**
+ * Posts a keyboard event to the dialog
+ *
+ * @param pDialogId Dialog id on which key event should be posted
+ * @param nType Event type, like press or release.
+ * @param nCharCode contains the Unicode character generated by this event 
or 0
+ * @param nKeyCode contains the integer code representing the key of the 
event (non-zero for control keys)
+ */
+void postDialogKeyEvent(const char* pDialogId, int nType, int nCharCode, 
int nKeyCode)
+{
+mpDoc->pClass->postDialogKeyEvent(mpDoc, pDialogId, nType, nCharCode, 
nKeyCode);
+}
+
+/**
  * Posts a mouse event to the document.
  *
  * @param nType Event type, like down, move or up.
@@ -257,7 +289,7 @@ public:
 /**
  * Posts a mouse event to the dialog with given id.
  *
- * @param aDialogId Dialog id where mouse event is to be posted
+ * @param pDialogId Dialog id where mouse event is to be posted
  * @param nType Event type, like down, move or up.
  * @param nX horizontal position in document coordinates
  * @param nY vertical position in document coordinates
@@ -271,6 +303,23 @@ public:
 }
 
 /**
+ * Posts a mouse event to the child of a dialog with given id.
+ *
+ * @param aDialogId Dialog id
+ * @param nType Event type, like down, move or up.
+ * @param nX horizontal position in document coordinates
+ * @param nY vertical position in document coordinates
+ * @param nCount number of clicks: 1 for single click, 2 for double click
+ * @param nButtons: which mouse buttons: 1 for left, 2 for middle, 4 right
+ * @param nModifier: which keyboard modifier: (see include/vcl/vclenum.hxx 
for possible values)
+ */
+void postDialogChildMouseEvent(const char* pDialogId, int nType, int nX, 
int nY, int nCount, int nButtons, int nModifier)
+{
+mpDoc->pClass->postDialogChildMouseEvent(mpDoc, pDialogId, nType, nX, 
nY, nCount, nButtons, nModifier);
+}
+
+
+/**
  * Posts an UNO command to the document.
  *
  * Example argument string:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-10-19 Thread Stephan Bergmann
 include/LibreOfficeKit/LibreOfficeKit.hxx   |4 ++--
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e19c4b54d129db356d44ede66aba51c789d2445f
Author: Stephan Bergmann 
Date:   Tue Oct 17 14:47:21 2017 +0200

Consistently use #include  in include/LibreOfficeKit

Some of the include files there had used

  #include "..."

while others had used

  #include 

for references among those include files.  In preparation for
loplugin:includeform, consolidate on the latter (even if that's clearly a
misuse of the <...> form).

Change-Id: If142c844863e4e63b6fd8f2200732972860befd3
Reviewed-on: https://gerrit.libreoffice.org/43558
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index d4e891af218a..9e897c5ffb85 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -12,8 +12,8 @@
 
 #include 
 
-#include "LibreOfficeKit.h"
-#include "LibreOfficeKitInit.h"
+#include 
+#include 
 
 /*
  * The reasons this C++ code is not as pretty as it could be are:
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index f9610f1f02fc..9642411ce367 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
 #define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
 
-#include "LibreOfficeKit.h"
+#include 
 
 #ifdef __cplusplus
 extern "C"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-09-29 Thread Mike Kaganski
 include/LibreOfficeKit/LibreOfficeKitInit.h |   21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 36535c2bef619b3a4090f6f880b975cb6d4dcb11
Author: Mike Kaganski 
Date:   Sat Sep 16 22:16:14 2017 +0200

LibreOfficeKitInit.h: release memory after lok_dlerror() on Windows

When _WIN32 is defined, lok_dlerror() uses FormatMessageA() call with
FORMAT_MESSAGE_ALLOCATE_BUFFER flag [1] to get returned error string.
This string is required to be released after use with LocalFree() (or
HeapFree(), since LocalFree() is not available in recent SDKs).

However, there is no mention in the header that this is required, nor
lok_dlopen() that uses it does any cleanup. If the calling application
is expected to be terminated in case of error, then that is no problem;
but the header might be used in any external client application which
we know nothing of.

This adds corresponding cleanup function.

Change-Id: I1f14cc5d9e10fe086c3646faaf0e19f2a7a6dd56
Reviewed-on: https://gerrit.libreoffice.org/42360
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 1e34e608d6ba..73e2bbb83dfd 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -57,6 +57,13 @@ extern "C"
 return dlerror();
 }
 
+// This function must be called to release memory allocated by 
lok_dlerror()
+static void lok_dlerror_free(char *pErrMessage)
+{
+(void)pErrMessage;
+// Do nothing for return of dlerror()
+}
+
 static void extendUnoPath(const char *pPath)
 {
 (void)pPath;
@@ -97,6 +104,12 @@ extern "C"
 return buf;
 }
 
+// This function must be called to release memory allocated by 
lok_dlerror()
+static void lok_dlerror_free(char *pErrMessage)
+{
+HeapFree(GetProcessHeap(), 0, pErrMessage);
+}
+
 static void *lok_dlsym(void *Hnd, const char *pName)
 {
 return reinterpret_cast(GetProcAddress((HINSTANCE) Hnd, 
pName));
@@ -198,8 +211,10 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 struct stat st;
 if (stat(imp_lib, ) == 0 && st.st_size > 100)
 {
+char *pErrMessage = lok_dlerror();
 fprintf(stderr, "failed to open library '%s': %s\n",
-imp_lib, lok_dlerror());
+imp_lib, pErrMessage);
+lok_dlerror_free(pErrMessage);
 free(imp_lib);
 return NULL;
 }
@@ -209,8 +224,10 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 dlhandle = lok_loadlib(imp_lib);
 if (!dlhandle)
 {
+char *pErrMessage = lok_dlerror();
 fprintf(stderr, "failed to open library '%s': %s\n",
-imp_lib, lok_dlerror());
+imp_lib, pErrMessage);
+lok_dlerror_free(pErrMessage);
 free(imp_lib);
 return NULL;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-09-13 Thread Thorsten Behrens
 include/LibreOfficeKit/LibreOfficeKit.h  |   37 ---
 include/LibreOfficeKit/LibreOfficeKit.hxx|   13 +++--
 include/LibreOfficeKit/LibreOfficeKitTypes.h |5 ++-
 3 files changed, 36 insertions(+), 19 deletions(-)

New commits:
commit f70e0ec6b3c61a7c7caa469949b0ac8016c89854
Author: Thorsten Behrens 
Date:   Wed Sep 13 14:50:47 2017 +0200

lokit: make parts of unstable API public for 6.0

[API CHANGE] publish all of LibreOfficeKitClass, and the
getDocumentType callback for the LibreOfficeKitDocumentClass

Change-Id: I4d6529a71b29a0014053b797c67255df53a6ccde
Reviewed-on: https://gerrit.libreoffice.org/42243
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index a4035c7351f0..34b67ac092b1 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -12,13 +12,11 @@
 
 #include 
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
-# ifndef _WIN32
+#ifndef _WIN32
 // the unstable API needs C99's bool
-#  include 
-# endif
-# include 
+# include 
 #endif
+#include 
 
 #include 
 
@@ -62,28 +60,37 @@ struct _LibreOfficeKitClass
 /// @since LibreOffice 5.2
 void (*freeError) (char* pFree);
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
+/// @since LibreOffice 6.0
 void (*registerCallback) (LibreOfficeKit* pThis,
   LibreOfficeKitCallback pCallback,
   void* pData);
 
-/// @see lok::Office::getFilterTypes().
+/** @see lok::Office::getFilterTypes().
+@since LibreOffice 6.0
+ */
 char* (*getFilterTypes) (LibreOfficeKit* pThis);
 
-/// @see lok::Office::setOptionalFeatures().
+/** @see lok::Office::setOptionalFeatures().
+@since LibreOffice 6.0
+ */
 void (*setOptionalFeatures)(LibreOfficeKit* pThis, uint64_t features);
 
-/// @see lok::Office::setDocumentPassword().
+/** @see lok::Office::setDocumentPassword().
+@since LibreOffice 6.0
+ */
 void (*setDocumentPassword) (LibreOfficeKit* pThis,
 char const* pURL,
 char const* pPassword);
 
-/// @see lok::Office::getVersionInfo().
+/** @see lok::Office::getVersionInfo().
+@since LibreOffice 6.0
+ */
 char* (*getVersionInfo) (LibreOfficeKit* pThis);
 
+/** @see lok::Office::runMacro().
+@since LibreOffice 6.0
+ */
 bool (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
-#endif
-
 };
 
 #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) 
LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
@@ -104,10 +111,12 @@ struct _LibreOfficeKitDocumentClass
const char* pFormat,
const char* pFilterOptions);
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
-/// @see lok::Document::getDocumentType().
+/** @see lok::Document::getDocumentType().
+@since LibreOffice 6.0
+ */
 int (*getDocumentType) (LibreOfficeKitDocument* pThis);
 
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /// @see lok::Document::getParts().
 int (*getParts) (LibreOfficeKitDocument* pThis);
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 46a32a406934..18122a7e3b05 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -62,10 +62,10 @@ public:
 /// Gives access to the underlying C pointer.
 LibreOfficeKitDocument *get() { return mpDoc; }
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /**
  * Get document type.
  *
+ * @since LibreOffice 6.0
  * @return an element of the LibreOfficeKitDocumentType enum.
  */
 int getDocumentType()
@@ -73,6 +73,7 @@ public:
 return mpDoc->pClass->getDocumentType(mpDoc);
 }
 
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /**
  * Get number of part that the document contains.
  *
@@ -513,11 +514,11 @@ public:
 mpThis->pClass->freeError(pFree);
 }
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /**
  * Registers a callback. LOK will invoke this function when it wants to
  * inform the client about events.
  *
+ * @since LibreOffice 6.0
  * @param pCallback the callback to invoke
  * @param pData the user data, will be passed to the callback on invocation
  */
@@ -539,6 +540,8 @@ public:
  * "MediaType": "application/vnd.oasis.opendocument.spreadsheet"
  * }
  * }
+ *
+ * @since LibreOffice 6.0
  */
 char* getFilterTypes()
 {
@@ -548,6 +551,7 @@ public:
 /**
  * Set bitmask of optional features supported by 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-05-29 Thread jan Iversen
 include/LibreOfficeKit/LibreOfficeKitInit.h |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 68ca63cf2c830d3a1ddbbcac9cc7edaa23b71c51
Author: jan Iversen 
Date:   Sun May 28 13:46:28 2017 +0200

LibreOfficeKit, changed test for iOS.

Replaced __APPLE__ && __arm*__ with
TARGET_OS_IPHONE, which is set by xCode when compiling for iOS independent 
of CPU.

Change-Id: Icd3418894841de45c731c21e5211b1cc4ff2e54a
Reviewed-on: https://gerrit.libreoffice.org/38106
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 9da7ad0ee0bd..8206d91f03f3 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -42,7 +42,8 @@ extern "C"
 #endif
 #define SEPARATOR '/'
 
-static void *lok_loadlib(const char *pFN)
+#if !defined(TARGET_OS_IPHONE)
+static void *lok_loadlib(const char *pFN)
 {
 return dlopen(pFN, RTLD_LAZY
 #if defined LOK_LOADLIB_GLOBAL
@@ -56,6 +57,12 @@ extern "C"
 return dlerror();
 }
 
+static void extendUnoPath(const char *pPath)
+{
+(void)pPath;
+}
+#endif // TARGERT_OS_IPHONE
+
 static void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
@@ -66,10 +73,6 @@ extern "C"
 return dlclose(Hnd);
 }
 
-static void extendUnoPath(const char *pPath)
-{
-(void)pPath;
-}
 
 #else
 #pragma warning(disable:4996)
@@ -150,7 +153,7 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 char *imp_lib;
 void *dlhandle;
 
-#if !(defined(__APPLE__) && (defined(__arm__) || defined(__arm64__)))
+#if !defined(TARGET_OS_IPHONE)
 size_t partial_length, imp_lib_size;
 struct stat dir_st;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-04-06 Thread Thorsten Behrens
 include/LibreOfficeKit/LibreOfficeKitInit.h |   30 ++--
 1 file changed, 16 insertions(+), 14 deletions(-)

New commits:
commit d49dcc7ccc67f5c8fbb6fa5a0d9a09aa634c588f
Author: Thorsten Behrens 
Date:   Thu Apr 6 04:30:58 2017 +0200

lokit: this was supposed to be plain C functions

Change-Id: I22c568edd297fcc53a8d4fb826e12ee0cea59432
Reviewed-on: https://gerrit.libreoffice.org/36176
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 0c9555afe174..9da7ad0ee0bd 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -103,29 +103,31 @@ extern "C"
 
 static void extendUnoPath(const char *pPath)
 {
+char *sNewPath = NULL, *sEnvPath = NULL;
+size_t size_sEnvPath = 0, buffer_size = 0;
+DWORD cChars;
+
 if (!pPath)
 return;
 
-char* sEnvPath = NULL;
-DWORD  cChars = GetEnvironmentVariableA("PATH", sEnvPath, 0);
+cChars = GetEnvironmentVariableA("PATH", sEnvPath, 0);
 if (cChars > 0)
 {
-sEnvPath = new char[cChars];
+sEnvPath = (char *) malloc(cChars);
 cChars = GetEnvironmentVariableA("PATH", sEnvPath, cChars);
 //If PATH is not set then it is no error
 if (cChars == 0 && GetLastError() != ERROR_ENVVAR_NOT_FOUND)
 {
-delete[] sEnvPath;
+free(sEnvPath);
 return;
 }
 }
 //prepare the new PATH. Add the Ure/bin directory at the front.
 //note also adding ';'
-size_t size_sEnvPath = 0;
 if(sEnvPath)
 size_sEnvPath = strlen(sEnvPath);
-size_t buffer_size = size_sEnvPath + 2*strlen(pPath) + strlen(UNOPATH) 
+ 4;
-char* sNewPath = new char[buffer_size];
+buffer_size = size_sEnvPath + 2*strlen(pPath) + strlen(UNOPATH) + 4;
+sNewPath = (char *) malloc(buffer_size);
 sNewPath[0] = L'\0';
 strcat_s(sNewPath, buffer_size, pPath); // program to PATH
 strcat_s(sNewPath, buffer_size, ";");
@@ -138,8 +140,8 @@ extern "C"
 
 SetEnvironmentVariableA("PATH", sNewPath);
 
-delete[] sEnvPath;
-delete[] sNewPath;
+free(sNewPath);
+free(sEnvPath);
 }
 #endif
 
@@ -148,15 +150,15 @@ static void *lok_dlopen( const char *install_path, char 
** _imp_lib )
 char *imp_lib;
 void *dlhandle;
 
-*_imp_lib = NULL;
-
 #if !(defined(__APPLE__) && (defined(__arm__) || defined(__arm64__)))
-size_t partial_length;
+size_t partial_length, imp_lib_size;
+struct stat dir_st;
+
+*_imp_lib = NULL;
 
 if (!install_path)
 return NULL;
 
-struct stat dir_st;
 if (stat(install_path, _st) != 0)
 {
 fprintf(stderr, "installation path \"%s\" does not exist\n", 
install_path);
@@ -165,7 +167,7 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 
 // allocate large enough buffer
 partial_length = strlen(install_path);
-size_t imp_lib_size = partial_length + sizeof(TARGET_LIB) + 
sizeof(TARGET_MERGED_LIB) + 2;
+imp_lib_size = partial_length + sizeof(TARGET_LIB) + 
sizeof(TARGET_MERGED_LIB) + 2;
 imp_lib = (char *) malloc(imp_lib_size);
 if (!imp_lib)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-04-06 Thread Thorsten Behrens
 include/LibreOfficeKit/LibreOfficeKit.h |6 --
 include/LibreOfficeKit/LibreOfficeKitInit.h |   15 ---
 2 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit a016ac1667cdf7fb81a78b51a6aaab455e376782
Author: Thorsten Behrens 
Date:   Thu Apr 6 04:07:18 2017 +0200

lokit: make this build on windows, silence extra warnings

Change-Id: I78d5ce58d55d27eaa0256a0c1ddffed3a5f2cf91
Reviewed-on: https://gerrit.libreoffice.org/36175
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 2a5dbcabb817..a4035c7351f0 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -13,9 +13,11 @@
 #include 
 
 #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
+# ifndef _WIN32
 // the unstable API needs C99's bool
-#include 
-#include 
+#  include 
+# endif
+# include 
 #endif
 
 #include 
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 08b3e1c32947..0c9555afe174 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -72,7 +72,7 @@ extern "C"
 }
 
 #else
-
+#pragma warning(disable:4996)
 #include  
 #define TARGET_LIB"sofficeapp" ".dll"
 #define TARGET_MERGED_LIB "mergedlo" ".dll"
@@ -124,15 +124,16 @@ extern "C"
 size_t size_sEnvPath = 0;
 if(sEnvPath)
 size_sEnvPath = strlen(sEnvPath);
-char* sNewPath = new char[size_sEnvPath + 2*strlen(pPath) + 
strlen(UNOPATH) + 4];
+size_t buffer_size = size_sEnvPath + 2*strlen(pPath) + strlen(UNOPATH) 
+ 4;
+char* sNewPath = new char[buffer_size];
 sNewPath[0] = L'\0';
-strcat(sNewPath, pPath); // program to PATH
-strcat(sNewPath, ";");
-strcat(sNewPath, UNOPATH);   // UNO to PATH
+strcat_s(sNewPath, buffer_size, pPath); // program to PATH
+strcat_s(sNewPath, buffer_size, ";");
+strcat_s(sNewPath, buffer_size, UNOPATH);   // UNO to PATH
 if (size_sEnvPath > 0)
 {
-strcat(sNewPath, ";");
-strcat(sNewPath, sEnvPath);
+strcat_s(sNewPath, buffer_size, ";");
+strcat_s(sNewPath, buffer_size, sEnvPath);
 }
 
 SetEnvironmentVariableA("PATH", sNewPath);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-04-06 Thread Gabriel Herrera
 include/LibreOfficeKit/LibreOfficeKitInit.h |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0840bc7957117b8913e3d7d5848bbc4524b4949e
Author: Gabriel Herrera 
Date:   Wed Apr 5 17:34:54 2017 +0200

lokit: avoid null pointer access w/ undefined LOPath var

Change-Id: I777fa58a138d453a108b0c65dcfd667d3da25999
Reviewed-on: https://gerrit.libreoffice.org/36174
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 4dafe180cdb6..08b3e1c32947 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -121,12 +121,15 @@ extern "C"
 }
 //prepare the new PATH. Add the Ure/bin directory at the front.
 //note also adding ';'
-char * sNewPath = new char[strlen(sEnvPath) + strlen(pPath) * 2 + 
strlen(UNOPATH) + 4];
+size_t size_sEnvPath = 0;
+if(sEnvPath)
+size_sEnvPath = strlen(sEnvPath);
+char* sNewPath = new char[size_sEnvPath + 2*strlen(pPath) + 
strlen(UNOPATH) + 4];
 sNewPath[0] = L'\0';
 strcat(sNewPath, pPath); // program to PATH
 strcat(sNewPath, ";");
 strcat(sNewPath, UNOPATH);   // UNO to PATH
-if (strlen(sEnvPath))
+if (size_sEnvPath > 0)
 {
 strcat(sNewPath, ";");
 strcat(sNewPath, sEnvPath);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit ios/experimental

2017-03-22 Thread Stephan Bergmann
 include/LibreOfficeKit/LibreOfficeKitInit.h|   45 ++---
 ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c |2 
 2 files changed, 10 insertions(+), 37 deletions(-)

New commits:
commit 587e9c2d15119927c89d052835ce495af9ff7d19
Author: Stephan Bergmann 
Date:   Mon Mar 20 21:45:35 2017 +0100

Consistently mark function definitions in LibreOfficeKitInit.h as static

...to give them internal linkage in both C and C++.  Of those definitions 
that
were not marked as static:

* Those that had not been marked as inline had external linkage in both C 
and
  C++, so would have caused ODR violations were LibreOfficeKitInit.h 
included in
  multiple translation units.

* Those that had been marked as inline lacked an external defintion in C.
  (Which 3f02b2aa51e32c46d5b6610480bc1ba22156a3ec "LOK init: avoid 
non-inline
  function definition in header file" had apparently faied to take into
  account.)

(IOS_SWIFTCBRIDGE introduced in 028ef4748e53aa8f72c6464ce6bbeeb28c61d30c
"LibreOfficeKitInit.h modified to avoid ODR" becomes unnecessary again.)

Change-Id: Ibb8033cdbac87b20fa0e3b203b99571c1a7e7234
Reviewed-on: https://gerrit.libreoffice.org/35491
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ce8daaf28892..4dafe180cdb6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -42,12 +42,7 @@ extern "C"
 #endif
 #define SEPARATOR '/'
 
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
-inline
-#endif
-#endif
-void *lok_loadlib(const char *pFN)
+static void *lok_loadlib(const char *pFN)
 {
 return dlopen(pFN, RTLD_LAZY
 #if defined LOK_LOADLIB_GLOBAL
@@ -56,42 +51,22 @@ extern "C"
   );
 }
 
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
-inline
-#endif
-#endif
-char *lok_dlerror(void)
+static char *lok_dlerror(void)
 {
 return dlerror();
 }
 
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
-inline
-#endif
-#endif
-void *lok_dlsym(void *Hnd, const char *pName)
+static void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
 }
 
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
-inline
-#endif
-#endif
-int lok_dlclose(void *Hnd)
+static int lok_dlclose(void *Hnd)
 {
 return dlclose(Hnd);
 }
 
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
-inline
-#endif
-#endif
-void extendUnoPath(const char *pPath)
+static void extendUnoPath(const char *pPath)
 {
 (void)pPath;
 }
@@ -104,29 +79,29 @@ extern "C"
 #define SEPARATOR '\\'
 #define UNOPATH   "\\..\\URE\\bin"
 
-void *lok_loadlib(const char *pFN)
+static void *lok_loadlib(const char *pFN)
 {
 return (void *) LoadLibraryA(pFN);
 }
 
-char *lok_dlerror(void)
+static char *lok_dlerror(void)
 {
 LPSTR buf = NULL;
 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, 
reinterpret_cast(), 0, NULL);
 return buf;
 }
 
-void *lok_dlsym(void *Hnd, const char *pName)
+static void *lok_dlsym(void *Hnd, const char *pName)
 {
 return reinterpret_cast(GetProcAddress((HINSTANCE) Hnd, 
pName));
 }
 
-int lok_dlclose(void *Hnd)
+static int lok_dlclose(void *Hnd)
 {
 return FreeLibrary((HINSTANCE) Hnd);
 }
 
-void extendUnoPath(const char *pPath)
+static void extendUnoPath(const char *pPath)
 {
 if (!pPath)
 return;
diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c 
b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
index 539713d95160..748c601f268e 100755
--- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
+++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
@@ -7,9 +7,7 @@
 //
 #include 
 #define LOK_USE_UNSTABLE_API
-#define IOS_SWIFTCBRIDGE
 #include 
-#undef  IOS_SWIFTCBRIDGE
 
 // pointers to our instance
 static LibreOfficeKit* kit;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit ios/experimental

2017-03-20 Thread jan Iversen
 include/LibreOfficeKit/LibreOfficeKitInit.h|   10 +-
 ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c |2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 028ef4748e53aa8f72c6464ce6bbeeb28c61d30c
Author: jan Iversen 
Date:   Mon Mar 20 15:38:39 2017 +0100

LibreOfficeKitInit.h modified to avoid ODR.

As discussed in IRC, the prev. version would cause an ODR

the use of _cplusplus have been changed to IOS_SWIFTCBRIDGE

Change-Id: If18610858cb56780347bb28f909619db4aac85b0

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index d19aa0fae9ef..ce8daaf28892 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -43,7 +43,7 @@ extern "C"
 #define SEPARATOR '/'
 
 #ifndef __OBJC__
-#ifdef __cplusplus
+#ifndef IOS_SWIFTCBRIDGE
 inline
 #endif
 #endif
@@ -57,7 +57,7 @@ extern "C"
 }
 
 #ifndef __OBJC__
-#ifdef __cplusplus
+#ifndef IOS_SWIFTCBRIDGE
 inline
 #endif
 #endif
@@ -67,7 +67,7 @@ extern "C"
 }
 
 #ifndef __OBJC__
-#ifdef __cplusplus
+#ifndef IOS_SWIFTCBRIDGE
 inline
 #endif
 #endif
@@ -77,7 +77,7 @@ extern "C"
 }
 
 #ifndef __OBJC__
-#ifdef __cplusplus
+#ifndef IOS_SWIFTCBRIDGE
 inline
 #endif
 #endif
@@ -87,7 +87,7 @@ extern "C"
 }
 
 #ifndef __OBJC__
-#ifdef __cplusplus
+#ifndef IOS_SWIFTCBRIDGE
 inline
 #endif
 #endif
diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c 
b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
index 748c601f268e..539713d95160 100755
--- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
+++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
@@ -7,7 +7,9 @@
 //
 #include 
 #define LOK_USE_UNSTABLE_API
+#define IOS_SWIFTCBRIDGE
 #include 
+#undef  IOS_SWIFTCBRIDGE
 
 // pointers to our instance
 static LibreOfficeKit* kit;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit ios/CustomTarget_LibreOfficeLight_app.mk ios/experimental ios/Module_ios.mk

2017-03-19 Thread jan Iversen
 include/LibreOfficeKit/LibreOfficeKitInit.h
|   10 
 ios/CustomTarget_LibreOfficeLight_app.mk   
|   30 
 ios/Module_ios.mk  
|1 
 ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj   
|  130 ++
 ios/experimental/LibreOfficeLight/LibreOfficeLight/LO.swift
|2 
 ios/experimental/LibreOfficeLight/LibreOfficeLight/LibreOfficeLight-Prefix.pch 
|   22 
 ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h 
|   11 
 ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c 
|  491 ++
 8 files changed, 693 insertions(+), 4 deletions(-)

New commits:
commit c1f46c54a62030efb93443c025487d2caade5b9c
Author: jan Iversen 
Date:   Thu Feb 23 12:47:34 2017 +0100

ios LibreOfficeLight LOkit integration

Integrated LibreOfficeLight into gbuild.
added lo.xcconfig and Resources (needed to link with LO and run LO)
added swift --> C interface for LOkit
add known commands from JS client

added C++ condition in LibreOfficekitInit.h (inline no good in a C file)

Change-Id: I19ebe8912546408bf701c96c0c63541d6e37cad8
Reviewed-on: https://gerrit.libreoffice.org/35430
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index f4ab9cdf2082..d19aa0fae9ef 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -43,8 +43,10 @@ extern "C"
 #define SEPARATOR '/'
 
 #ifndef __OBJC__
+#ifdef __cplusplus
 inline
 #endif
+#endif
 void *lok_loadlib(const char *pFN)
 {
 return dlopen(pFN, RTLD_LAZY
@@ -55,32 +57,40 @@ extern "C"
 }
 
 #ifndef __OBJC__
+#ifdef __cplusplus
 inline
 #endif
+#endif
 char *lok_dlerror(void)
 {
 return dlerror();
 }
 
 #ifndef __OBJC__
+#ifdef __cplusplus
 inline
 #endif
+#endif
 void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
 }
 
 #ifndef __OBJC__
+#ifdef __cplusplus
 inline
 #endif
+#endif
 int lok_dlclose(void *Hnd)
 {
 return dlclose(Hnd);
 }
 
 #ifndef __OBJC__
+#ifdef __cplusplus
 inline
 #endif
+#endif
 void extendUnoPath(const char *pPath)
 {
 (void)pPath;
diff --git a/ios/CustomTarget_LibreOfficeLight_app.mk 
b/ios/CustomTarget_LibreOfficeLight_app.mk
new file mode 100644
index ..ed61f279e2cf
--- /dev/null
+++ b/ios/CustomTarget_LibreOfficeLight_app.mk
@@ -0,0 +1,30 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#- Env 
+BUILDID:=$(shell cd $(SRCDIR) && git log -1 
--format=%H)
+
+#- Targets 
+
+.PHONY: LibreOfficeLight_setup
+
+# Register target
+$(eval $(call gb_CustomTarget_CustomTarget,ios/LibreOfficeLight))
+
+# Build
+# Depend on the custom target that sets up lo.xcconfig
+$(call gb_CustomTarget_get_target,ios/LibreOfficeLight): $(call 
gb_CustomTarget_get_target,ios/Lo_Xcconfig)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
+   $(call IOSbuild,LibreOfficeLight, clean build)
+
+# Clean
+$(call gb_CustomTarget_get_clean_target,ios/LibreOfficeLight):
+   $(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
+   $(call IOSbuild,LibreOfficeLight, clean)
+
+# vim: set noet sw=4 ts=4:
diff --git a/ios/Module_ios.mk b/ios/Module_ios.mk
index 13c607b9d497..22b551214631 100644
--- a/ios/Module_ios.mk
+++ b/ios/Module_ios.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_Module_add_targets,ios,\
CustomTarget_Lo_Xcconfig \
CustomTarget_TiledLibreOffice_app \
CustomTarget_Prototype_app \
+   CustomTarget_LibreOfficeLight_app \
 ))
 
 endif
diff --git 
a/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 837aa290bfee..73e789d2311b 100644
--- 
a/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ 
b/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -21,6 +21,17 @@
3992D85E1E5B764A00BEA987 /* ViewFileManager.swift in Sources */ 
= {isa = PBXBuildFile; fileRef = 3992D85C1E5B764A00BEA987 /* 
ViewFileManager.swift */; };

[Libreoffice-commits] core.git: include/LibreOfficeKit

2017-03-15 Thread Mike Gorse
 include/LibreOfficeKit/LibreOfficeKitGtk.h |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2ba485158bfa089e931c0c3e29389fe64a42dd4d
Author: Mike Gorse 
Date:   Fri Mar 10 17:34:27 2017 -0600

tdf#102511: Fix gobject-introspection annotation syntax

Change-Id: I43a3ee21bd2db9ace809084d3ab888008243c97f
Reviewed-on: https://gerrit.libreoffice.org/35155
Tested-by: Jenkins 
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index a2312d6..dd35505 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -42,7 +42,7 @@ GType  lok_doc_view_get_type  
 (void) G_GNUC
 
 /**
  * lok_doc_view_new:
- * @pPath: (nullable): (allow-none): LibreOffice install path. Pass null to 
set it to default
+ * @pPath: (nullable) (allow-none): LibreOffice install path. Pass null to set 
it to default
  * path which in most cases would be $libdir/libreoffice/program
  * @cancellable: The cancellable object that you can use to cancel this
  * operation.
@@ -56,9 +56,9 @@ GtkWidget* lok_doc_view_new   
 (const gchar*
 
 /**
  * lok_doc_view_new_from_user_profile:
- * @pPath: (nullable): (allow-none): LibreOffice install path. Pass null to 
set it to default
+ * @pPath: (nullable) (allow-none): LibreOffice install path. Pass null to set 
it to default
  * path which in most cases would be $libdir/libreoffice/program
- * @pUserProfile: (nullable): (allow-none): User profile URL. Must be either a 
file URL or a
+ * @pUserProfile: (nullable) (allow-none): User profile URL. Must be either a 
file URL or a
  * special vnd.sun.star.pathname URL. Pass non-null to be able to use this
  * widget and LibreOffice itself in parallel.
  * @cancellable: The cancellable object that you can use to cancel this
@@ -75,7 +75,7 @@ GtkWidget* 
lok_doc_view_new_from_user_profile  (const gchar*
 /**
  * lok_doc_view_new_from_widget:
  * @pDocView: The #LOKDocView instance
- * @pRenderingArguments: (nullable): (allow-none): 
lok::Document::initializeForRendering() arguments.
+ * @pRenderingArguments: (nullable) (allow-none): 
lok::Document::initializeForRendering() arguments.
  *
  * Returns: (transfer none): The #LOKDocView widget instance.
  */
@@ -86,7 +86,7 @@ GtkWidget* lok_doc_view_new_from_widget   
 (LOKDocView*
  * lok_doc_view_open_document:
  * @pDocView: The #LOKDocView instance
  * @pPath: (transfer full): The path of the document that #LOKDocView widget 
should try to open
- * @pRenderingArguments: (nullable): (allow-none): 
lok::Document::initializeForRendering() arguments.
+ * @pRenderingArguments: (nullable) (allow-none): 
lok::Document::initializeForRendering() arguments.
  * @cancellable:
  * @callback:
  * @userdata:
@@ -309,7 +309,7 @@ gbooleanlok_doc_view_paste  
   (LOKDocView*
  * lok_doc_view_set_document_password:
  * @pDocView: The #LOKDocView instance
  * @pUrl: the URL of the document to set password for, as sent with signal 
`password-required`
- * @pPassword: (nullable): (allow-none): the password, NULL for no password
+ * @pPassword: (nullable) (allow-none): the password, NULL for no password
  *
  * Set the password for password protected documents
  */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/inc sw/source

2017-01-27 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   26 
 libreofficekit/source/gtk/lokdocview.cxx |4 
 sw/inc/PostItMgr.hxx |2 
 sw/source/uibase/docvw/PostItMgr.cxx |  158 +--
 4 files changed, 154 insertions(+), 36 deletions(-)

New commits:
commit 5f5073a84518e4a8660e0153c2e218fb75a85ec4
Author: Pranav Kant 
Date:   Tue Jan 24 14:07:45 2017 +0530

lok: Implement new callbacks for comment notifications

Change-Id: I298183b295c68c4a39cb1f6fffe4b89b4eaee0f3
Reviewed-on: https://gerrit.libreoffice.org/33469
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index f3dccd0..8a59b4c 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -467,6 +467,32 @@ typedef enum
  * - 'action' is 'Modify'.
  */
 LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED = 31,
+
+/**
+ * There is some change in comments in the document
+ *
+ * The payload example:
+ * {
+ * "comment": {
+ * "action": "Add",
+ * "id": "11",
+ * "parent": "4",
+ * "author": "Unknown Author",
+ * "text": "",
+ * "dateTime": "2016-08-18T13:13:00",
+ * "anchorPos": "4529, 3906",
+ * "textRange": "1418, 3906, 3111, 919"
+ * }
+ * }
+ *
+ * The format is the same as an entry of
+ * lok::Document::getCommandValues('.uno:ViewAnnotations'), extra
+ * fields:
+ *
+ * - 'action' can be 'Add', 'Remove' or 'Modify' depending on whether
+ *comment has been added, removed or modified.
+ */
+LOK_CALLBACK_COMMENT = 32
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index c9c32af..1cd2c05 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -426,6 +426,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED";
 case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED:
 return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED";
+case LOK_CALLBACK_COMMENT:
+return "LOK_CALLBACK_COMMENT";
 }
 g_assert(false);
 return nullptr;
@@ -1395,6 +1397,8 @@ callback (gpointer pData)
 {
 break;
 }
+case LOK_CALLBACK_COMMENT:
+break;
 default:
 g_assert(false);
 break;
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 68887aa..97448fd 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -186,7 +186,7 @@ class SwPostItMgr: public SfxListener
 
 sw::sidebarwindows::SwSidebarWin* GetSidebarWin(const SfxBroadcaster* 
pBroadcaster) const;
 
-voidInsertItem( SfxBroadcaster* pItem, bool 
bCheckExistance, bool bFocus);
+SwSidebarItem*  InsertItem( SfxBroadcaster* pItem, bool 
bCheckExistance, bool bFocus);
 voidRemoveItem( SfxBroadcaster* pBroadcast );
 
 public:
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index d169a89..43b1b55 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -17,11 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
 #include "PostItMgr.hxx"
 #include 
 
-#include 
 #include 
+#include 
 #include 
 #include 
 
@@ -53,6 +55,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -75,6 +78,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "annotsh.hxx"
 #include "swabstdlg.hxx"
@@ -94,37 +99,89 @@
 
 using namespace sw::sidebarwindows;
 
-bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
-{
-// sort by anchor position
-SwPosition aPosAnchorA = a->GetAnchorPosition();
-SwPosition aPosAnchorB = b->GetAnchorPosition();
+namespace {
 
-bool aAnchorAInFooter = false;
-bool aAnchorBInFooter = false;
+enum class CommentNotificationType { Add, Remove, Modify };
 
-// is the anchor placed in Footnote or the Footer?
-if( aPosAnchorA.nNode.GetNode().FindFootnoteStartNode() || 
aPosAnchorA.nNode.GetNode().FindFooterStartNode() )
-aAnchorAInFooter = true;
-if( aPosAnchorB.nNode.GetNode().FindFootnoteStartNode() || 
aPosAnchorB.nNode.GetNode().FindFooterStartNode() )
-aAnchorBInFooter = true;
+bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
+{
+// sort by anchor position
+SwPosition aPosAnchorA = a->GetAnchorPosition();
+SwPosition aPosAnchorB = b->GetAnchorPosition();
 
-// fdo#34800
-// if AnchorA is in footnote, and AnchorB isn't
-// we do not want to change over the position

[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-11-26 Thread Ashod Nakashian
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   64 +--
 1 file changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 719f7cb94ce783349fb1cf366a78edd9996d3e37
Author: Ashod Nakashian 
Date:   Sat Nov 26 21:12:58 2016 -0500

Lok: number callback enum for easier debugging

Since the entries and their order are part of the
public API, and will not change, numbering them
makes it easier to trap particular callbacks by
their number (as that's what shows in logs and
the debugger).

Change-Id: Ife2fe3e601ce3dce0939363d748fcb54d3c85fd4
Reviewed-on: https://gerrit.libreoffice.org/31257
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 187fa98..d2ccc0f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -93,13 +93,13 @@ typedef enum
  *
  * @see LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK.
  */
-LOK_CALLBACK_INVALIDATE_TILES,
+LOK_CALLBACK_INVALIDATE_TILES = 0,
 /**
  * The size and/or the position of the visible cursor changed.
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR,
+LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1,
 /**
  * The list of rectangles representing the current text selection changed.
  *
@@ -108,7 +108,7 @@ typedef enum
  * LOK_CALLBACK_INVALIDATE_TILES. When there is no selection, an empty
  * string is provided.
  */
-LOK_CALLBACK_TEXT_SELECTION,
+LOK_CALLBACK_TEXT_SELECTION = 2,
 /**
  * The position and size of the cursor rectangle at the text
  * selection start. It is used to draw the selection handles.
@@ -118,7 +118,7 @@ typedef enum
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_TEXT_SELECTION_START,
+LOK_CALLBACK_TEXT_SELECTION_START = 3,
 /**
  * The position and size of the cursor rectangle at the text
  * selection end. It is used to draw the selection handles.
@@ -128,7 +128,7 @@ typedef enum
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_TEXT_SELECTION_END,
+LOK_CALLBACK_TEXT_SELECTION_END = 4,
 /**
  * The blinking text cursor is now visible or not.
  *
@@ -137,26 +137,26 @@ typedef enum
  * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR once it becomes false. Payload is
  * either the "true" or the "false" string.
  */
-LOK_CALLBACK_CURSOR_VISIBLE,
+LOK_CALLBACK_CURSOR_VISIBLE = 5,
 /**
  * The size and/or the position of the graphic selection changed.
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_GRAPHIC_SELECTION,
+LOK_CALLBACK_GRAPHIC_SELECTION = 6,
 
 /**
  * User clicked on an hyperlink that should be handled by other
  * applications accordingly.
  */
-LOK_CALLBACK_HYPERLINK_CLICKED,
+LOK_CALLBACK_HYPERLINK_CLICKED = 7,
 
 /**
  * Emit state update to the client.
  * For example, when cursor is on bold text, this callback is triggered
  * with payload: ".uno:Bold=true"
  */
-LOK_CALLBACK_STATE_CHANGED,
+LOK_CALLBACK_STATE_CHANGED = 8,
 
 /**
  * Start a "status indicator" (here restricted to a progress bar type
@@ -172,25 +172,25 @@ typedef enum
  * loading a document and then constructing a LibreOfficeKitDocument
  * object.
  */
-LOK_CALLBACK_STATUS_INDICATOR_START,
+LOK_CALLBACK_STATUS_INDICATOR_START = 9,
 
 /**
  * Sets the numeric value of the status indicator.
  * The payload should be a percentage, an integer between 0 and 100.
  */
-LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE,
+LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE = 10,
 
 /**
  * Ends the status indicator.
  *
  * Not necessarily ever emitted.
  */
-LOK_CALLBACK_STATUS_INDICATOR_FINISH,
+LOK_CALLBACK_STATUS_INDICATOR_FINISH = 11,
 
 /**
  * No match was found for the search input
  */
-LOK_CALLBACK_SEARCH_NOT_FOUND,
+LOK_CALLBACK_SEARCH_NOT_FOUND = 12,
 
 /**
  * Size of the document changed.
@@ -198,14 +198,14 @@ typedef enum
  * Payload format is "width, height", i.e. clients get the new size without
  * having to do an explicit lok::Document::getDocumentSize() call.
  */
-LOK_CALLBACK_DOCUMENT_SIZE_CHANGED,
+LOK_CALLBACK_DOCUMENT_SIZE_CHANGED = 13,
 
 /**
  * The current part number is changed.
  *
  * Payload is a single 0-based integer.
  */
-LOK_CALLBACK_SET_PART,
+LOK_CALLBACK_SET_PART = 14,
 
 /**
  * Selection rectangles of the search result when find all is performed.
@@ -231,7 +231,7 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-11-15 Thread Jan Holesovsky
 include/LibreOfficeKit/LibreOfficeKit.hxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 6b4eaa7ee7837e7ff1439ebb06db9200b4b68b61
Author: Jan Holesovsky 
Date:   Tue Nov 15 13:07:16 2016 +0100

Add the missing lok::Office::registerCallback().

Change-Id: I0aebf12c4d685f69f094b9acbe6b04bb5b3234a4

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 1c9474f..447f44b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -512,6 +512,18 @@ public:
 
 #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /**
+ * Registers a callback. LOK will invoke this function when it wants to
+ * inform the client about events.
+ *
+ * @param pCallback the callback to invoke
+ * @param pData the user data, will be passed to the callback on invocation
+ */
+inline void registerCallback(LibreOfficeKitCallback pCallback, void* pData)
+{
+mpThis->pClass->registerCallback(mpThis, pCallback, pData);
+}
+
+/**
  * Returns details of filter types.
  *
  * Example returned string:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-10-21 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 84bfe584e4bd03a7b6e2c1e68c65bf99ae83c839
Author: Pranav Kant 
Date:   Tue Oct 18 17:27:00 2016 +0530

tdf#102511: Add (allow-none) for backward GI compatibility

(allow-none), though deprecated since GI 1.42, is required to
maintain the backward compatibility since (nullable), added in
GI 1.42, is not understood by GI tools < 1.42 preventing the
clients from passing a null parameter to various functions in the
widget.

We can remove this deprecated (allow-none) annotation once we
bump the GI version in LibreOffice to atleast 1.42

Change-Id: I98a1f3d2205ec5afd8060f16e69c5f938f229e26

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index cb96f20..a2312d6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -42,7 +42,7 @@ GType  lok_doc_view_get_type  
 (void) G_GNUC
 
 /**
  * lok_doc_view_new:
- * @pPath: (nullable): LibreOffice install path. Pass null to set it to default
+ * @pPath: (nullable): (allow-none): LibreOffice install path. Pass null to 
set it to default
  * path which in most cases would be $libdir/libreoffice/program
  * @cancellable: The cancellable object that you can use to cancel this
  * operation.
@@ -56,9 +56,9 @@ GtkWidget* lok_doc_view_new   
 (const gchar*
 
 /**
  * lok_doc_view_new_from_user_profile:
- * @pPath: (nullable): LibreOffice install path. Pass null to set it to default
+ * @pPath: (nullable): (allow-none): LibreOffice install path. Pass null to 
set it to default
  * path which in most cases would be $libdir/libreoffice/program
- * @pUserProfile: (nullable): User profile URL. Must be either a file URL or a
+ * @pUserProfile: (nullable): (allow-none): User profile URL. Must be either a 
file URL or a
  * special vnd.sun.star.pathname URL. Pass non-null to be able to use this
  * widget and LibreOffice itself in parallel.
  * @cancellable: The cancellable object that you can use to cancel this
@@ -75,7 +75,7 @@ GtkWidget* 
lok_doc_view_new_from_user_profile  (const gchar*
 /**
  * lok_doc_view_new_from_widget:
  * @pDocView: The #LOKDocView instance
- * @pRenderingArguments: (nullable): lok::Document::initializeForRendering() 
arguments.
+ * @pRenderingArguments: (nullable): (allow-none): 
lok::Document::initializeForRendering() arguments.
  *
  * Returns: (transfer none): The #LOKDocView widget instance.
  */
@@ -86,7 +86,7 @@ GtkWidget* lok_doc_view_new_from_widget   
 (LOKDocView*
  * lok_doc_view_open_document:
  * @pDocView: The #LOKDocView instance
  * @pPath: (transfer full): The path of the document that #LOKDocView widget 
should try to open
- * @pRenderingArguments: (nullable): lok::Document::initializeForRendering() 
arguments.
+ * @pRenderingArguments: (nullable): (allow-none): 
lok::Document::initializeForRendering() arguments.
  * @cancellable:
  * @callback:
  * @userdata:
@@ -309,7 +309,7 @@ gbooleanlok_doc_view_paste  
   (LOKDocView*
  * lok_doc_view_set_document_password:
  * @pDocView: The #LOKDocView instance
  * @pUrl: the URL of the document to set password for, as sent with signal 
`password-required`
- * @pPassword: (nullable): the password, NULL for no password
+ * @pPassword: (nullable): (allow-none): the password, NULL for no password
  *
  * Set the password for password protected documents
  */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/inc sw/source

2016-08-29 Thread Tor Lillqvist
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   23 
 libreofficekit/source/gtk/lokdocview.cxx |6 +++
 sw/inc/redline.hxx   |   14 ++-
 sw/source/core/doc/docredln.cxx  |   48 +++
 4 files changed, 75 insertions(+), 16 deletions(-)

New commits:
commit 8f96ab602a9e7cad1215abb693f33824a7b37679
Author: Tor Lillqvist 
Date:   Thu Aug 25 13:58:06 2016 +0300

Emit notification to a LibreOfficeKit client also when a redline is modified

Work in progress, not all modifications to a redline record cause
notifications yet.

Change-Id: I01614cd6ede9576e9cc329889fef86342567325f

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 0805e62..324318c 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -431,6 +431,29 @@ typedef enum
  */
 LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED,
 
+/**
+ * An entry in the change tracking table has been modified.
+ *
+ * The payload example:
+ * {
+ * "redline": {
+ * "action": "Modify",
+ * "index": "1",
+ * "author": "Unknown Author",
+ * "type": "Insert",
+ * "comment": "",
+ * "description": "Insert 'abcd'",
+ * "dateTime": "2016-08-18T13:13:00"
+ * }
+ * }
+ *
+ * The format is the same as an entry of
+ * lok::Document::getCommandValues('.uno:AcceptTrackedChanges'), extra
+ * fields:
+ *
+ * - 'action' is 'Modify'.
+ */
+LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 694ea62..fc8d3637 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -424,6 +424,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_VIEW_LOCK";
 case LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED:
 return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED";
+case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED:
+return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED";
 }
 g_assert(false);
 return nullptr;
@@ -1346,6 +1348,10 @@ callback (gpointer pData)
 {
 break;
 }
+case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED:
+{
+break;
+}
 default:
 g_assert(false);
 break;
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 0adc5c9..55d4076 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -190,6 +190,7 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM
 void CopyToSection();
 void DelCopyOfSection(size_t nMyPos);
 void MoveFromSection(size_t nMyPos);
+void MaybeNotifyModification();
 
 public:
 SwRangeRedline( RedlineType_t eType, const SwPaM& rPam );
@@ -211,16 +212,9 @@ public:
 bool IsVisible() const { return bIsVisible; }
 bool IsDelLastPara() const { return bDelLastPara; }
 
-void SetStart( const SwPosition& rPos, SwPosition* pSttPtr = nullptr )
-{
-if( !pSttPtr ) pSttPtr = Start();
-*pSttPtr = rPos;
-}
-void SetEnd( const SwPosition& rPos, SwPosition* pEndPtr = nullptr )
-{
-if( !pEndPtr ) pEndPtr = End();
-*pEndPtr = rPos;
-}
+void SetStart( const SwPosition& rPos, SwPosition* pSttPtr = nullptr );
+void SetEnd( const SwPosition& rPos, SwPosition* pEndPtr = nullptr );
+
 /// Do we have a valid selection?
 bool HasValidRange() const;
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 602b736..8a2e2be 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -57,6 +57,8 @@
 
 using namespace com::sun::star;
 
+enum class RedlineNotification { Add, Remove, Modify };
+
 #ifdef DBG_UTIL
 
 void sw_DebugRedline( const SwDoc* pDoc )
@@ -299,13 +301,15 @@ bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* 
pDoc, const SwTableBox&
 }
 
 /// Emits LOK notification about one addition / removal of a redline item.
-static void lcl_RedlineNotification(bool bAdd, size_t nPos, SwRangeRedline* 
pRedline)
+static void lcl_RedlineNotification(RedlineNotification nType, size_t nPos, 
SwRangeRedline* pRedline)
 {
 if (!comphelper::LibreOfficeKit::isActive())
 return;
 
 boost::property_tree::ptree aRedline;
-aRedline.put("action", (bAdd ? "Add" : "Remove"));
+aRedline.put("action", (nType == RedlineNotification::Add ? "Add" :
+(nType == RedlineNotification::Remove ? "Remove" :
+ (nType == RedlineNotification::Modify ? "Modify" 
: "???";
 aRedline.put("index", nPos);
 aRedline.put("author", pRedline->GetAuthorString(1).toUtf8().getStr());
 aRedline.put("type", 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2016-08-19 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |   24 ++
 libreofficekit/source/gtk/lokdocview.cxx   |6 +++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   32 ++-
 sw/source/core/doc/docredln.cxx|   42 +
 sw/source/core/inc/unoport.hxx |3 +
 sw/source/core/unocore/unoredline.cxx  |8 ++--
 6 files changed, 110 insertions(+), 5 deletions(-)

New commits:
commit 0bc553f3ef3c188a96ea4875f4722ad4d40da4a3
Author: Miklos Vajna 
Date:   Fri Aug 19 15:27:59 2016 +0200

sw lok: add callbacks for redline table insertion / removal

An alternative would be to follow the Manage Changes dialog approach and
subscribe to the SFX_HINT_DOCCHANGED notification in SwDocShell, cache
the old redline table and find out the differences to the current one,
but that way sound much more complex without benefits.

Change-Id: I20a45285b88255ccea9d6646c0b5288ac1c91879

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 651e9bc..2c3bcab 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -406,6 +406,30 @@ typedef enum
  */
 LOK_CALLBACK_VIEW_LOCK,
 
+/**
+ * The size of the change tracking table has changed.
+ *
+ * The payload example:
+ * {
+ * "redline": {
+ * "action": "Remove",
+ * "index": "1",
+ * "author": "Unknown Author",
+ * "type": "Delete",
+ * "comment": "",
+ * "dateTime": "2016-08-18T12:14:00"
+ * }
+ * }
+ *
+ * The format is the same as an entry of
+ * lok::Document::getCommandValues('.uno:AcceptTrackedChanges'), extra
+ * fields:
+ *
+ * - 'action' is either 'Add' or 'Remove', depending on if this is an
+ *   insertion into the table or a removal.
+ */
+LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED,
+
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 0156330..3af5d00 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -421,6 +421,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_ERROR";
 case LOK_CALLBACK_VIEW_LOCK:
 return "LOK_CALLBACK_VIEW_LOCK";
+case LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED:
+return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED";
 }
 g_assert(false);
 return nullptr;
@@ -1339,6 +1341,10 @@ callback (gpointer pData)
 gtk_widget_queue_draw(GTK_WIDGET(pDocView));
 break;
 }
+case LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED:
+{
+break;
+}
 default:
 g_assert(false);
 break;
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index ad8deaf..a8b7bf9 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -68,6 +68,7 @@ public:
 void testShapeTextUndoShells();
 void testShapeTextUndoGroupShells();
 void testTrackChanges();
+void testTrackChangesCallback();
 
 CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -101,6 +102,7 @@ public:
 CPPUNIT_TEST(testShapeTextUndoShells);
 CPPUNIT_TEST(testShapeTextUndoGroupShells);
 CPPUNIT_TEST(testTrackChanges);
+CPPUNIT_TEST(testTrackChangesCallback);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -116,13 +118,15 @@ private:
 int m_nSelectionBeforeSearchResult;
 int m_nSelectionAfterSearchResult;
 int m_nInvalidations;
+int m_nRedlineTableSizeChanged;
 };
 
 SwTiledRenderingTest::SwTiledRenderingTest()
 : m_bFound(true),
   m_nSelectionBeforeSearchResult(0),
   m_nSelectionAfterSearchResult(0),
-  m_nInvalidations(0)
+  m_nInvalidations(0),
+  m_nRedlineTableSizeChanged(0)
 {
 }
 
@@ -196,6 +200,11 @@ void SwTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 }
 }
 break;
+case LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED:
+{
+++m_nRedlineTableSizeChanged;
+}
+break;
 }
 }
 
@@ -1169,6 +1178,27 @@ void SwTiledRenderingTest::testTrackChanges()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SwTiledRenderingTest::testTrackChangesCallback()
+{
+// Load a document.
+comphelper::LibreOfficeKit::setActive();
+SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+
pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(::callback,
 this);
+
+// Turn on track changes and type "x".
+uno::Reference xPropertySet(mxComponent, 
uno::UNO_QUERY);
+xPropertySet->setPropertyValue("RecordChanges", 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-08-18 Thread Tor Lillqvist
 include/LibreOfficeKit/LibreOfficeKitInit.h |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 50e19b71a63741cfa353fdfdbb13c41784bfc55f
Author: Tor Lillqvist 
Date:   Thu Aug 18 09:39:28 2016 +0300

Better fix for Objective-C

Not sure what the exact mechanism of the problem is, but anyway, this
helps.

Change-Id: I5812381af0e4f12fcbdd06eafb1eedc170ffb608

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index bbef7d5..15b9a67 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -51,22 +51,34 @@ extern "C"
   );
 }
 
-inline char *lok_dlerror(void)
+#ifndef __OBJC__
+inline
+#endif
+char *lok_dlerror(void)
 {
 return dlerror();
 }
 
-inline void *lok_dlsym(void *Hnd, const char *pName)
+#ifndef __OBJC__
+inline
+#endif
+void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
 }
 
-inline int lok_dlclose(void *Hnd)
+#ifndef __OBJC__
+inline
+#endif
+int lok_dlclose(void *Hnd)
 {
 return dlclose(Hnd);
 }
 
-inline void extendUnoPath(const char *pPath)
+#ifndef __OBJC__
+inline
+#endif
+void extendUnoPath(const char *pPath)
 {
 (void)pPath;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-08-17 Thread Tor Lillqvist
 include/LibreOfficeKit/LibreOfficeKitInit.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bb10522fd92948b442cd5742677fcae65b8f8027
Author: Tor Lillqvist 
Date:   Wed Aug 17 18:25:46 2016 +0300

Revert "These 'inline' keywords are fairly pointless"

Nah, they are a good idea in most cases.

This reverts commit 1c8e4f74c63312fca5898452fae4ba32268fce65.

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index aedc606..bbef7d5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -51,22 +51,22 @@ extern "C"
   );
 }
 
-char *lok_dlerror(void)
+inline char *lok_dlerror(void)
 {
 return dlerror();
 }
 
-void *lok_dlsym(void *Hnd, const char *pName)
+inline void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
 }
 
-int lok_dlclose(void *Hnd)
+inline int lok_dlclose(void *Hnd)
 {
 return dlclose(Hnd);
 }
 
-void extendUnoPath(const char *pPath)
+inline void extendUnoPath(const char *pPath)
 {
 (void)pPath;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-08-09 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitInit.h |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 60cfbcf9e77d4d88aae94226d74300e2490f8549
Author: Miklos Vajna 
Date:   Tue Aug 9 09:37:29 2016 +0200

LOK init: strcpy() -> strncpy()

'strcpy' is insecure as it does not provide bounding of the memory
buffer in general, so let's avoid it even here.

Change-Id: If39319a2df7ddd9297938bc0be67fe5f8a2af962
Reviewed-on: https://gerrit.libreoffice.org/27999
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 47b9553..bbef7d5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -161,19 +161,20 @@ static void *lok_dlopen( const char *install_path, char 
** _imp_lib )
 
 // allocate large enough buffer
 partial_length = strlen(install_path);
-imp_lib = (char *) malloc(partial_length + sizeof(TARGET_LIB) + 
sizeof(TARGET_MERGED_LIB) + 2);
+size_t imp_lib_size = partial_length + sizeof(TARGET_LIB) + 
sizeof(TARGET_MERGED_LIB) + 2;
+imp_lib = (char *) malloc(imp_lib_size);
 if (!imp_lib)
 {
 fprintf( stderr, "failed to open library : not enough memory\n");
 return NULL;
 }
 
-strcpy(imp_lib, install_path);
+strncpy(imp_lib, install_path, imp_lib_size);
 
 extendUnoPath(install_path);
 
 imp_lib[partial_length++] = SEPARATOR;
-strcpy(imp_lib + partial_length, TARGET_LIB);
+strncpy(imp_lib + partial_length, TARGET_LIB, imp_lib_size - 
partial_length);
 
 dlhandle = lok_loadlib(imp_lib);
 if (!dlhandle)
@@ -191,7 +192,7 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
 return NULL;
 }
 
-strcpy(imp_lib + partial_length, TARGET_MERGED_LIB);
+strncpy(imp_lib + partial_length, TARGET_MERGED_LIB, imp_lib_size - 
partial_length);
 
 dlhandle = lok_loadlib(imp_lib);
 if (!dlhandle)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-08-04 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitInit.h |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 3f02b2aa51e32c46d5b6610480bc1ba22156a3ec
Author: Miklos Vajna 
Date:   Thu Aug 4 18:08:34 2016 +0200

LOK init: avoid non-inline function definition in header file

To prevent possible ODR violations.

Change-Id: Ic9538244a0bf3760808904d2bcf608151c53f899
Reviewed-on: https://gerrit.libreoffice.org/27883
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index bdda642..47b9553 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -42,7 +42,7 @@ extern "C"
 #endif
 #define SEPARATOR '/'
 
-void *lok_loadlib(const char *pFN)
+inline void *lok_loadlib(const char *pFN)
 {
 return dlopen(pFN, RTLD_LAZY
 #if defined LOK_LOADLIB_GLOBAL
@@ -51,22 +51,22 @@ extern "C"
   );
 }
 
-char *lok_dlerror(void)
+inline char *lok_dlerror(void)
 {
 return dlerror();
 }
 
-void *lok_dlsym(void *Hnd, const char *pName)
+inline void *lok_dlsym(void *Hnd, const char *pName)
 {
 return dlsym(Hnd, pName);
 }
 
-int lok_dlclose(void *Hnd)
+inline int lok_dlclose(void *Hnd)
 {
 return dlclose(Hnd);
 }
 
-void extendUnoPath(const char *pPath)
+inline void extendUnoPath(const char *pPath)
 {
 (void)pPath;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2016-07-22 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |   16 ++
 libreofficekit/source/gtk/lokdocview.cxx   |   59 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   49 
 sw/source/core/frmedt/feshview.cxx |7 ++
 sw/source/uibase/uiview/viewdraw.cxx   |9 +++
 5 files changed, 139 insertions(+), 1 deletion(-)

New commits:
commit 897189cfc6b3f6f3a9a0148b060ea25e5f8d9eaa
Author: Miklos Vajna 
Date:   Fri Jul 22 16:39:47 2016 +0200

sw: add new LOK_CALLBACK_VIEW_LOCK callback

When we're after SdrBeginTextEdit(), but before SdrEndTextEdit(), and
have multiple views, then only the active view paints the edited text,
the other views look like the shape has no text at all.

Add a new callback that exposes the position and size of the rectangle
where the shape text will be painted after text edit ended, so clients
can draw some kind of locking indicator there. This way the rendered
result can differ in the "shape has no text" and the "shape text is
edited in an other view" cases.

Change-Id: I6096479a8a05c2547d15222e6d997b848af02945
Reviewed-on: https://gerrit.libreoffice.org/27441
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 63abda8..651e9bc 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -390,6 +390,22 @@ typedef enum
  */
 LOK_CALLBACK_VIEW_CURSOR_VISIBLE,
 
+/**
+ * The size and/or the position of a lock rectangle in one of the other
+ * views has changed.
+ *
+ * The payload format:
+ *
+ * {
+ * "viewId": "..."
+ * "rectangle": "..."
+ * }
+ *
+ * - viewId is a value returned earlier by lok::Document::createView()
+ * - rectangle uses the format of LOK_CALLBACK_INVALIDATE_TILES.
+ */
+LOK_CALLBACK_VIEW_LOCK,
+
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index d5a1dd3..f604b58 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -190,6 +190,10 @@ struct LOKDocViewPrivateImpl
 /// Event source ID for handleTimeout() of this widget.
 guint m_nTimeoutId;
 
+/// Rectangles of view locks. The current view can only see
+/// them, can't modify them. Key is the view id.
+std::map m_aViewLockRectangles;
+
 LOKDocViewPrivateImpl()
 : m_aLOPath(nullptr),
 m_pUserProfileURL(nullptr),
@@ -415,6 +419,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_UNO_COMMAND_RESULT";
 case LOK_CALLBACK_ERROR:
 return "LOK_CALLBACK_ERROR";
+case LOK_CALLBACK_VIEW_LOCK:
+return "LOK_CALLBACK_VIEW_LOCK";
 }
 g_assert(false);
 return nullptr;
@@ -1314,6 +1320,25 @@ callback (gpointer pData)
 gtk_widget_queue_draw(GTK_WIDGET(pDocView));
 break;
 }
+case LOK_CALLBACK_VIEW_LOCK:
+{
+std::stringstream aStream(pCallback->m_aPayload);
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+int nViewId = aTree.get("viewId");
+int nPart = aTree.get("part");
+const std::string& rRectangle = aTree.get("rectangle");
+if (rRectangle != "EMPTY")
+priv->m_aViewLockRectangles[nViewId] = ViewRectangle(nPart, 
payloadToRectangle(pDocView, rRectangle.c_str()));
+else
+{
+auto it = priv->m_aViewLockRectangles.find(nViewId);
+if (it != priv->m_aViewLockRectangles.end())
+priv->m_aViewLockRectangles.erase(it);
+}
+gtk_widget_queue_draw(GTK_WIDGET(pDocView));
+break;
+}
 default:
 g_assert(false);
 break;
@@ -1746,6 +1771,40 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
 cairo_stroke(pCairo);
 }
 
+// View locks: they are colored.
+for (auto& rPair : priv->m_aViewLockRectangles)
+{
+const ViewRectangle& rRectangle = rPair.second;
+if (rRectangle.m_nPart != priv->m_nPartId)
+continue;
+
+// Draw a rectangle.
+const GdkRGBA& rDark = getDarkColor(rPair.first);
+cairo_set_source_rgb(pCairo, rDark.red, rDark.green, rDark.blue);
+cairo_rectangle(pCairo,
+twipToPixel(rRectangle.m_aRectangle.x, priv->m_fZoom),
+twipToPixel(rRectangle.m_aRectangle.y, priv->m_fZoom),
+twipToPixel(rRectangle.m_aRectangle.width, 
priv->m_fZoom),
+twipToPixel(rRectangle.m_aRectangle.height, 
priv->m_fZoom));
+cairo_set_line_width(pCairo, 2.0);
+

[Libreoffice-commits] core.git: include/LibreOfficeKit include/sfx2 libreofficekit/source sfx2/source sw/qa sw/source

2016-06-21 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |   16 +++-
 include/sfx2/lokhelper.hxx |4 
 libreofficekit/source/gtk/lokdocview.cxx   |7 +++
 sfx2/source/view/lokhelper.cxx |   25 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |2 +-
 sw/source/core/crsr/viscrs.cxx |   23 +++
 6 files changed, 55 insertions(+), 22 deletions(-)

New commits:
commit 9f66db9c474f71f43d7a3667230241fd4fa4183f
Author: Miklos Vajna 
Date:   Tue Jun 21 11:29:49 2016 +0200

sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTION

So a view can be aware where selections of other views are.

Change-Id: I5026b1ff2b99a4eedfd0bde32a05ceb8e2f424bc
Reviewed-on: https://gerrit.libreoffice.org/26542
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 4229e73..4dfb8be 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -316,7 +316,6 @@ typedef enum
  * The size and/or the position of the view cursor changed. A view cursor
  * is a cursor of an other view, the current view can't change it.
  *
- * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  * The payload format:
  *
  * {
@@ -329,6 +328,21 @@ typedef enum
  */
 LOK_CALLBACK_INVALIDATE_VIEW_CURSOR,
 
+/**
+ * The the text selection in one of the other views has changed.
+ *
+ * The payload format:
+ *
+ * {
+ * "viewId": "..."
+ * "selection": "..."
+ * }
+ *
+ * - viewId is a value returned earlier by lok::Document::createView()
+ * - selection uses the format of LOK_CALLBACK_TEXT_SELECTION.
+ */
+LOK_CALLBACK_TEXT_VIEW_SELECTION,
+
 }
 LibreOfficeKitCallbackType;
 
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index ec68ed6..4cfe081 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SfxViewShell;
 
@@ -29,6 +30,9 @@ public:
 static std::uintptr_t getView(SfxViewShell* pViewShell = nullptr);
 /// Get the number of views of the current object shell.
 static std::size_t getViews();
+
+/// Invoke the LOK callback of all views except pThisView, with a payload 
of rKey-rPayload.
+static void notifyOtherViews(SfxViewShell* pThisView, int nType, const 
OString& rKey, const OString& rPayload);
 };
 
 #endif
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 60d4cce..39676f3 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -346,6 +346,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_CONTEXT_MENU";
 case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
 return "LOK_CALLBACK_INVALIDATE_VIEW_CURSOR";
+case LOK_CALLBACK_TEXT_VIEW_SELECTION:
+return "LOK_CALLBACK_TEXT_VIEW_SELECTION";
 }
 return nullptr;
 }
@@ -1175,6 +1177,11 @@ callback (gpointer pData)
 gtk_widget_queue_draw(GTK_WIDGET(pDocView));
 break;
 }
+case LOK_CALLBACK_TEXT_VIEW_SELECTION:
+{
+// TODO: Implement me
+break;
+}
 default:
 g_assert(false);
 break;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index c994877..b44392c 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -8,6 +8,9 @@
  */
 
 #include 
+
+#include 
+
 #include 
 #include 
 #include 
@@ -86,4 +89,26 @@ std::size_t SfxLokHelper::getViews()
 return nRet;
 }
 
+void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const 
OString& rKey, const OString& rPayload)
+{
+if (SfxLokHelper::getViews() <= 1)
+return;
+
+SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+while (pViewShell)
+{
+if (pViewShell != pThisView)
+{
+boost::property_tree::ptree aTree;
+aTree.put("viewId", SfxLokHelper::getView(pThisView));
+aTree.put(rKey.getStr(), rPayload.getStr());
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree);
+OString aPayload = aStream.str().c_str();
+pViewShell->libreOfficeKitViewCallback(nType, aPayload.getStr());
+}
+pViewShell = SfxViewShell::GetNext(*pViewShell);
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index b244635..a24042f 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ 

[Libreoffice-commits] core.git: include/LibreOfficeKit include/vcl sc/inc sc/qa sc/source sd/inc sd/qa sd/source sw/inc sw/qa sw/source

2016-04-21 Thread Henry Castro
 include/LibreOfficeKit/LibreOfficeKit.h|4 
 include/LibreOfficeKit/LibreOfficeKit.hxx  |6 ++
 include/vcl/ITiledRenderable.hxx   |6 ++
 sc/inc/document.hxx|1 +
 sc/inc/docuno.hxx  |3 +++
 sc/inc/table.hxx   |2 ++
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   18 ++
 sc/source/core/data/document.cxx   |   13 +
 sc/source/core/data/table1.cxx |5 +
 sc/source/ui/unoobj/docuno.cxx |7 +++
 sd/inc/sdpage.hxx  |1 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   18 ++
 sd/source/core/sdpage.cxx  |5 +
 sd/source/ui/inc/unomodel.hxx  |2 ++
 sd/source/ui/unoidl/unomodel.cxx   |   12 
 sw/inc/unotxdoc.hxx|2 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   16 
 sw/source/uibase/uno/unotxdoc.cxx  |8 
 18 files changed, 129 insertions(+)

New commits:
commit 1a74c6333a79ccf0579b33ebc42ce2ccc23ccadb
Author: Henry Castro 
Date:   Wed Apr 20 13:52:31 2016 -0400

lokit: add getPartHash

In the tiled rendering case, the slides, no matter
if it is inserted or deleted, the part names always return
sequential names i.e. Slide 1, Slide 2, ..., Slide N.

However the client side needs to know what slides had been
deleted or inserted, so it is necessary to send the hash codes.

Change-Id: I0e9caeec660c3e42dd9f751bdce7690f9ad365a1
Reviewed-on: https://gerrit.libreoffice.org/24267
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index c98dd1f..863e377 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -118,6 +118,10 @@ struct _LibreOfficeKitDocumentClass
 char* (*getPartName) (LibreOfficeKitDocument* pThis,
   int nPart);
 
+/// @see lok::Document::getPartHash().
+char* (*getPartHash) (LibreOfficeKitDocument* pThis,
+  int nPart);
+
 /// @see lok::Document::setPartMode().
 void (*setPartMode) (LibreOfficeKitDocument* pThis,
  int nMode);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 44e321f..3e3a0e1 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -116,6 +116,12 @@ public:
 return mpDoc->pClass->getPartName(mpDoc, nPart);
 }
 
+/// Get the current part's hash.
+inline char* getPartHash(int nPart)
+{
+return mpDoc->pClass->getPartHash(mpDoc, nPart);
+}
+
 inline void setPartMode(int nMode)
 {
 mpDoc->pClass->setPartMode(mpDoc, nMode);
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index d9cd347..9c82ba8 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -83,6 +83,12 @@ public:
 return OUString("");
 }
 
+/**
+ * Get the hash of the currently displayed part, i.e. sheet in a 
spreadsheet
+ * or slide in a presentation.
+ */
+virtual OUString getPartHash(int nPart) = 0;
+
 /// @see lok::Document::setPartMode().
 virtual void setPartMode(int nPartMode)
 {
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index c0eeb18..958ffc4 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -638,6 +638,7 @@ public:
 SC_DLLPUBLIC void   SetVisibleTab(SCTAB nTab)   { nVisibleTab = 
nTab; }
 
 SC_DLLPUBLIC bool HasTable( SCTAB nTab ) const;
+SC_DLLPUBLIC bool GetHashCode( SCTAB nTab, sal_Int64& rHashCode) const;
 SC_DLLPUBLIC bool GetName( SCTAB nTab, OUString& rName ) const;
 SC_DLLPUBLIC bool GetCodeName( SCTAB nTab, OUString& rName ) const;
 SC_DLLPUBLIC bool SetCodeName( SCTAB nTab, const OUString& rName );
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index f0ac91e..80ab14d 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -375,6 +375,9 @@ public:
 /// @see vcl::ITiledRenderable::getPartName().
 virtual OUString getPartName(int nPart) override;
 
+/// @see vcl::ITiledRenderable::getPartHash().
+virtual OUString getPartHash( int nPart ) override;
+
 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
 virtual void initializeForTiledRendering(const 
css::uno::Sequence& rArguments) override;
 
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 57075d8..f9fff87 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -295,6 +295,8 @@ public:
 voidSetLink( ScLinkMode nMode, const 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2016-04-19 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   17 +
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   11 +
 libreofficekit/source/gtk/lokdocview.cxx|   37 +++-
 3 files changed, 63 insertions(+), 2 deletions(-)

New commits:
commit df784ec1bf3d1745a291056df28bec799d4fdee3
Author: Miklos Vajna 
Date:   Tue Apr 19 09:09:19 2016 +0200

tdf#99314 lokdocview: add new userprofileurl property

So that users of the widget can use a custom user profile, allowing
running widgets users and LibreOffice in parallel.

Change-Id: I1bd0a8e53aa3216adc721052cf30f0dd174327bd
Reviewed-on: https://gerrit.libreoffice.org/24237
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 5e24eb9..8a64bff 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -55,6 +55,23 @@ GtkWidget* lok_doc_view_new  
  (const gchar*
 GError 
**error);
 
 /**
+ * lok_doc_view_new_from_user_profile:
+ * @pPath: (nullable): LibreOffice install path. Pass null to set it to default
+ * path which in most cases would be $libdir/libreoffice/program
+ * @pUserProfile: (nullable): User profile URL. Pass non-null to be able to
+ * use this widget and LibreOffice itself in parallel.
+ * @cancellable: The cancellable object that you can use to cancel this
+ * operation.
+ * @error: The error that will be set if the object fails to initialize.
+ *
+ * Returns: (transfer none): The #LOKDocView widget instance.
+ */
+GtkWidget* lok_doc_view_new_from_user_profile  (const 
gchar* pPath,
+const 
gchar* pUserProfile,
+
GCancellable *cancellable,
+GError 
**error);
+
+/**
  * lok_doc_view_new_from_widget:
  * @pDocView: The #LOKDocView instance
  *
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index c0d4ac7..b3079a7 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -36,6 +36,7 @@ static int help()
 fprintf(stderr, "--background-color : Set custom background color, 
e.g. 'yellow'.\n");
 fprintf(stderr, "--hide-page-shadow: Hide page/slide shadow.\n");
 fprintf(stderr, "--hide-whitespace: Hide whitespace between pages in text 
documents.\n");
+fprintf(stderr, "--user-profile: Path to a custom user profile.\n");
 return 1;
 }
 
@@ -529,7 +530,15 @@ static void createView(GtkWidget* pButton, gpointer 
/*pItem*/)
 /// Creates a new model, i.e. LOK init and document load, one view implicitly.
 static void createModelAndView(const char* pLOPath, const char* pDocPath, 
const std::vector& rArguments)
 {
-GtkWidget* pDocView = lok_doc_view_new(pLOPath, nullptr, nullptr);
+std::string aUserProfile;
+for (size_t i = 0; i < rArguments.size(); ++i)
+{
+const std::string& rArgument = rArguments[i];
+if (rArgument == "--user-profile" && i + 1 < rArguments.size())
+aUserProfile = std::string("file://") + rArguments[i + 1].c_str();
+}
+const gchar* pUserProfile = aUserProfile.empty() ? nullptr : 
aUserProfile.c_str();
+GtkWidget* pDocView = lok_doc_view_new_from_user_profile(pLOPath, 
pUserProfile, nullptr, nullptr);
 
 setupWidgetAndCreateWindow(pDocView);
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 81ccb37..fdb07fe 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -48,6 +48,7 @@
 struct LOKDocViewPrivateImpl
 {
 const gchar* m_aLOPath;
+const gchar* m_pUserProfileURL;
 const gchar* m_aDocPath;
 std::string m_aRenderingArguments;
 gdouble m_nLoadProgress;
@@ -139,6 +140,7 @@ struct LOKDocViewPrivateImpl
 
 LOKDocViewPrivateImpl()
 : m_aLOPath(nullptr),
+m_pUserProfileURL(nullptr),
 m_aDocPath(nullptr),
 m_nLoadProgress(0),
 m_bIsLoading(false),
@@ -221,6 +223,7 @@ enum
 
 PROP_LO_PATH,
 PROP_LO_POINTER,
+PROP_USER_PROFILE_URL,
 PROP_DOC_PATH,
 PROP_DOC_POINTER,
 PROP_EDITABLE,
@@ -2013,6 +2016,9 @@ static void lok_doc_view_set_property (GObject* object, 
guint propId, const GVal
 case PROP_LO_POINTER:
 priv->m_pOffice = 
static_cast(g_value_get_pointer(value));
 break;
+case PROP_USER_PROFILE_URL:
+priv->m_pUserProfileURL = g_value_dup_string(value);
+break;
 case 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa

2016-03-07 Thread Stephan Bergmann
 include/LibreOfficeKit/LibreOfficeKitInit.h |5 +
 libreofficekit/qa/unit/tiledrendering.cxx   |8 +++-
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 5e79a328645e6bc2ac3cbd7f2d6b9298772c0598
Author: Stephan Bergmann 
Date:   Tue Mar 8 08:34:09 2016 +0100

New LOK_LOADLIB_GLOBAL to let clients control dlopen(RTLD_GLOBAL)

...in LibreOfficeKintInit.h's lok_loadlib, now that RTLD_GLOBAL isn't only
needed for UBSan (62b124b2704adf11a63681164d05a8eb49dfb105 "Ensure RTTI 
symbol
visibility for Linux Clang -fsanitize=function,vptr") but also for
-stdlib=libc++ on Linux (see
).

Change-Id: I24ed6612c3d922eba695423d46af5635c77f7077

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index a1b2ddc..f1e513e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -45,12 +45,9 @@ extern "C"
 void *lok_loadlib(const char *pFN)
 {
 return dlopen(pFN, RTLD_LAZY
-#if defined __clang__ && defined __linux__ \
-&& defined ENABLE_RUNTIME_OPTIMIZATIONS
-#if !ENABLE_RUNTIME_OPTIMIZATIONS
+#if defined LOK_LOADLIB_GLOBAL
   | RTLD_GLOBAL
 #endif
-#endif
   );
 }
 
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx 
b/libreofficekit/qa/unit/tiledrendering.cxx
index e28fece..1df2eff 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -19,8 +19,14 @@
 #include 
 #include 
 
+#if defined __clang__ && defined __linux__
+#include 
 #include 
-// see use of ENABLE_RUNTIME_OPTIMIZATIONS in LibreOfficeKintInit.h
+#if defined _LIBCPPABI_VERSION || !ENABLE_RUNTIME_OPTIMIZATIONS
+#define LOK_LOADLIB_GLOBAL
+#endif
+#endif
+
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-03-04 Thread Tor Lillqvist
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 02c0669017d4334e0746417178c8a8d9c6faa484
Author: Tor Lillqvist 
Date:   Fri Mar 4 12:03:54 2016 +0200

Mention that there are two disjunct sets of callbacks

Change-Id: Ia8f18666c766cafa63cc702bfdfa69e971cf0e71

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 901bf6b..80ed9de 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -66,6 +66,15 @@ typedef enum
 }
 LibreOfficeKitOptionalFeatures;
 
+// This enumerates the types of callbacks emitted to a LibreOfficeKit
+// object's callback function or to a LibreOfficeKitDocument object's
+// callback function. No callback type will be emitted to both. It is a
+// bit unfortunate that the same enum contains both kinds of
+// callbacks.
+
+// TODO: We should really add some indication at the documentation for
+// each enum value telling which type of callback it is.
+
 typedef enum
 {
 /**
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit sd/qa sd/source

2016-03-03 Thread Jan Holesovsky
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   12 ---
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  102 ++-
 sd/source/core/drawdoc2.cxx  |   16 
 3 files changed, 72 insertions(+), 58 deletions(-)

New commits:
commit 8fb170cbe929fcbf85b24284bf31ec6b06150fbe
Author: Jan Holesovsky 
Date:   Thu Mar 3 09:00:21 2016 +0100

sd lok: Remove LOK_CALLBACK_PARTS_COUNT_CHANGED from the API.

LOK_CALLBACK_PARTS_COUNT_CHANGED did not cover more complex scenarios, like
more pages deleted at the same time, etc.

Instead, we need to trigger the LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, and the
client has to be smart enough to update the previews in a way that does not
consume too much resources - ie. it has to have a link between the part 
names
(which are unique) and the previews, and request only the missing ones.

Change-Id: I36ff5dc86f360e3c7bd2c55fae8aaa99e054b4eb

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index e855b6a..901bf6b 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -280,18 +280,6 @@ typedef enum
  * }
  */
 LOK_CALLBACK_ERROR,
-
-/**
- * A part has been added to or removed from the document.
- *
- * {
- *  "action" : "PartInserted" | "PartDeleted"
- *  "part"   : "Part Index"
- * }
- *
- * Note: this is currently emitted by Impress.
- */
-LOK_CALLBACK_PARTS_COUNT_CHANGED
 }
 LibreOfficeKitCallbackType;
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 402734c..8ee50a3 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -93,9 +94,11 @@ private:
 sal_Int32 m_nPart;
 std::vector m_aSearchResultSelection;
 std::vector m_aSearchResultPart;
-std::vector m_aPageList;
 int m_nSelectionBeforeSearchResult;
 int m_nSelectionAfterSearchResult;
+
+/// For document size changed callback.
+osl::Condition m_aDocumentSizeCondition;
 #endif
 };
 
@@ -200,6 +203,11 @@ void SdTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 m_bFound = false;
 }
 break;
+case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
+{
+m_aDocumentSizeCondition.set();
+}
+break;
 case LOK_CALLBACK_SET_PART:
 {
 OUString aPayload = OUString::createFromAscii(pPayload);
@@ -220,19 +228,6 @@ void SdTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 }
 }
 break;
-case LOK_CALLBACK_PARTS_COUNT_CHANGED:
-{
-boost::property_tree::ptree aTree;
-std::stringstream aStream(pPayload);
-boost::property_tree::read_json(aStream, aTree);
-auto aAction = aTree.get("action", "");
-auto aPart = aTree.get("part", "");
-if (!aAction.empty() && !aPart.empty())
-{
-m_aPageList.push_back(std::atoi(aPart.data()));
-}
-}
-break;
 }
 }
 
@@ -516,6 +511,23 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
 CPPUNIT_ASSERT_EQUAL(OString("match"), 
pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
 }
 
+namespace {
+
+std::vector getCurrentParts(SdXImpressDocument* pDocument)
+{
+int parts = pDocument->getParts();
+std::vector result;
+
+for (int i = 0; i < parts; i++)
+{
+result.push_back(pDocument->getPartName(i));
+}
+
+return result;
+}
+
+}
+
 void SdTiledRenderingTest::testInsertDeletePage()
 {
 comphelper::LibreOfficeKit::setActive();
@@ -525,59 +537,84 @@ void SdTiledRenderingTest::testInsertDeletePage()
 SdDrawDocument* pDoc = pXImpressDocument->GetDocShell()->GetDoc();
 CPPUNIT_ASSERT(pDoc);
 
+std::vector aInserted = {
+"Slide 1", "Slide 2", "Slide 3", "Slide 4", "Slide 5",
+"Slide 6", "Slide 7", "Slide 8", "Slide 9", "Slide 10", "Slide 11"
+};
+
+std::vector aDeleted = {
+"Slide 1"
+};
+
 // the document has 1 slide
 CPPUNIT_ASSERT(pDoc->GetSdPageCount(PK_STANDARD) == 1);
 
 uno::Sequence aArgs;
 
 // Insert slides
+m_aDocumentSizeCondition.reset();
 for (unsigned it = 1; it <= 10; it++)
 comphelper::dispatchCommand(".uno:InsertPage", aArgs);
 
+TimeValue aTimeValue = { 2 , 0 }; // 2 seconds max
+osl::Condition::Result aResult = m_aDocumentSizeCondition.wait(aTimeValue);
+CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
+
 // Verify inserted slides
-for (auto i: m_aPageList)
+std::vector aPageList(getCurrentParts(pXImpressDocument));
+CPPUNIT_ASSERT_EQUAL(aPageList.size(), aInserted.size());
+
+for (auto it1 = aPageList.begin(), it2 = 

[Libreoffice-commits] core.git: include/LibreOfficeKit sd/qa sd/source

2016-02-16 Thread Henry Castro
 include/LibreOfficeKit/LibreOfficeKitEnums.h|   12 +
 sd/qa/unit/tiledrendering/data/insert-delete.odp|binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx|  128 
 sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx |4 
 sd/source/ui/slidesorter/model/SlideSorterModel.cxx |   36 +++-
 5 files changed, 170 insertions(+), 10 deletions(-)

New commits:
commit 80d7c5859b9e7a834a915d7e8bbbe9bc2130108a
Author: Henry Castro 
Date:   Fri Feb 12 07:12:07 2016 -0400

sd lok: add LOK_CALLBACK_PARTS_COUNT_CHANGED callback

In the tiled rendering case, when a slide is deleted or inserted
the sorted slides are updated on client side.

However, when .uno:Undo and .uno:Redo actions are requested on
client side the sorted slides are required to update all
sorted slides.

So every time when .uno:InsertPage, .uno:DeletePage, .uno:Undo, .uno:Redo
actions are requested, it will notify verbose action (PageInserted, 
PageDeleted)
with index on client side to update the sorted slide index.

Change-Id: Iebda2aa11be13aea8fbb6d0cc50442805d7485e9
Reviewed-on: https://gerrit.libreoffice.org/22309
Reviewed-by: Miklos Vajna 
Tested-by: Henry Castro 

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 901bf6b..e855b6a 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -280,6 +280,18 @@ typedef enum
  * }
  */
 LOK_CALLBACK_ERROR,
+
+/**
+ * A part has been added to or removed from the document.
+ *
+ * {
+ *  "action" : "PartInserted" | "PartDeleted"
+ *  "part"   : "Part Index"
+ * }
+ *
+ * Note: this is currently emitted by Impress.
+ */
+LOK_CALLBACK_PARTS_COUNT_CHANGED
 }
 LibreOfficeKitCallbackType;
 
diff --git a/sd/qa/unit/tiledrendering/data/insert-delete.odp 
b/sd/qa/unit/tiledrendering/data/insert-delete.odp
new file mode 100644
index 000..e388fb6
Binary files /dev/null and b/sd/qa/unit/tiledrendering/data/insert-delete.odp 
differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 4bf086a..770f03bd7 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -25,10 +25,14 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 using namespace css;
 
@@ -44,6 +48,7 @@ public:
 virtual void tearDown() override;
 
 #if !defined(WNT) && !defined(MACOSX)
+void testInsertPage();
 void testRegisterCallback();
 void testPostKeyEvent();
 void testPostMouseEvent();
@@ -60,6 +65,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 #if !defined(WNT) && !defined(MACOSX)
+CPPUNIT_TEST(testInsertPage);
 CPPUNIT_TEST(testRegisterCallback);
 CPPUNIT_TEST(testPostKeyEvent);
 CPPUNIT_TEST(testPostMouseEvent);
@@ -90,6 +96,7 @@ private:
 sal_Int32 m_nPart;
 std::vector m_aSearchResultSelection;
 std::vector m_aSearchResultPart;
+std::vector m_aPageList;
 int m_nSelectionBeforeSearchResult;
 int m_nSelectionAfterSearchResult;
 #endif
@@ -216,6 +223,19 @@ void SdTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 }
 }
 break;
+case LOK_CALLBACK_PARTS_COUNT_CHANGED:
+{
+boost::property_tree::ptree aTree;
+std::stringstream aStream(pPayload);
+boost::property_tree::read_json(aStream, aTree);
+auto aAction = aTree.get("action", "");
+auto aPart = aTree.get("part", "");
+if (!aAction.empty() && !aPart.empty())
+{
+m_aPageList.push_back(std::atoi(aPart.data()));
+}
+}
+break;
 }
 }
 
@@ -499,6 +519,114 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
 CPPUNIT_ASSERT_EQUAL(OString("match"), 
pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
 }
 
+void SdTiledRenderingTest::testInsertPage()
+{
+uno::Sequence aFilterOptions;
+uno::Reference xLoader(mxDesktop, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xLoader.is());
+
+uno::Reference xComponent;
+xComponent = xLoader->loadComponentFromURL(
+getURLFromSrc(DATA_DIRECTORY) + OUString("insert-delete.odp"),
+"_blank",
+0,
+aFilterOptions);
+CPPUNIT_ASSERT(xComponent.is());
+
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+CPPUNIT_ASSERT(pFoundShell);
+
+::sd::DrawDocShell* xDocSh = dynamic_cast(pFoundShell);
+CPPUNIT_ASSERT(xDocSh);
+
+sd::ViewShell* pViewShell = xDocSh->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+
+sd::slidesorter::SlideSorterViewShell* pSSVS = nullptr;
+for (int i 

[Libreoffice-commits] core.git: include/LibreOfficeKit sc/source sd/source sw/source

2016-02-06 Thread Jan Holesovsky
 include/LibreOfficeKit/LibreOfficeKitEnums.h |1 +
 sc/source/ui/view/viewfun2.cxx   |1 +
 sd/source/ui/view/Outliner.cxx   |2 ++
 sw/source/uibase/uiview/viewsrch.cxx |7 ---
 4 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 0d65937eefd8fbd8f8d08571266f1dcd5c10c6c4
Author: Jan Holesovsky 
Date:   Fri Feb 5 16:54:31 2016 +0100

lok: Search result should contain info if it is a 'search all' result.

Change-Id: Ia3ee81ced4f74c0d029a478bd59eff44d72ef327

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 5ce8610..901bf6b 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -197,6 +197,7 @@ typedef enum
  *
  * {
  * "searchString": "...",
+ * "highlightAll": true|false, // this is a result of 'search all'
  * "searchResultSelection": [
  * {
  * "part": "...",
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 8037a54..b264886 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1860,6 +1860,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* 
pSearchItem,
 
 boost::property_tree::ptree aTree;
 aTree.put("searchString", 
pSearchItem->GetSearchString().toUtf8().getStr());
+aTree.put("highlightAll", nCommand == SvxSearchCmd::FIND_ALL);
 
 boost::property_tree::ptree aSelections;
 for (const Rectangle& rLogicRect : aLogicRects)
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index c413cf9..0ad60d1 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -655,6 +655,7 @@ bool Outliner::SearchAndReplaceAll()
 {
 boost::property_tree::ptree aTree;
 aTree.put("searchString", 
mpSearchItem->GetSearchString().toUtf8().getStr());
+aTree.put("highlightAll", true);
 
 boost::property_tree::ptree aChildren;
 for (const SearchSelection& rSelection : aSelections)
@@ -803,6 +804,7 @@ bool 
Outliner::SearchAndReplaceOnce(std::vector* pSelections)
 // also about search result selections
 boost::property_tree::ptree aTree;
 aTree.put("searchString", 
mpSearchItem->GetSearchString().toUtf8().getStr());
+aTree.put("highlightAll", false);
 
 boost::property_tree::ptree aChildren;
 boost::property_tree::ptree aChild;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index 8918ff1..f3f216f 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -107,7 +107,7 @@ static void 
lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OSt
 }
 
 /// Emits LOK callbacks (count, selection) for search results.
-static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, 
SwWrtShell* pWrtShell)
+static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, 
SwWrtShell* pWrtShell, bool bHighlightAll)
 {
 // Emit a callback also about the selection rectangles, grouped by matches.
 if (SwPaM* pPaM = pWrtShell->GetCursor())
@@ -133,6 +133,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem* 
pSearchItem, SwWrtShell
 }
 boost::property_tree::ptree aTree;
 aTree.put("searchString", 
pSearchItem->GetSearchString().toUtf8().getStr());
+aTree.put("highlightAll", bHighlightAll);
 lcl_addContainerToJson(aTree, "searchResultSelection", aMatches);
 
 std::stringstream aStream;
@@ -252,7 +253,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
 {
 Scroll(m_pWrtShell->GetCharRect().SVRect());
 if (comphelper::LibreOfficeKit::isActive())
-lcl_emitSearchResultCallbacks(m_pSrchItem, 
m_pWrtShell);
+lcl_emitSearchResultCallbacks(m_pSrchItem, 
m_pWrtShell, /* bHighlightAll = */ false);
 }
 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
@@ -290,7 +291,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
 m_bFound = false;
 }
 else if (comphelper::LibreOfficeKit::isActive())
-lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell);
+lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell, /* 
bHighlightAll = */ true);
 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-02-04 Thread Riccardo Magliocchetti
 include/LibreOfficeKit/LibreOfficeKit.hxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 8dbdf538fea36748b5297299943e22b88ba62522
Author: Riccardo Magliocchetti 
Date:   Fri Jan 29 14:37:29 2016 +0100

LibreOfficeKit: document availability of some LibreOfficeKit C++ API

As done for C version in 80d1c914524bc61402c0e257b59377c5e47231ce

Change-Id: I879e070bc6a7cbf851594d748f603090f2e02459
Reviewed-on: https://gerrit.libreoffice.org/21901
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 1fbd784..7837904 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -428,6 +428,7 @@ public:
  *
  * @param pUrl the URL of the document to load
  * @param pFilterOptions options for the import filter, e.g. SkipImages.
+ * @since pFilterOptions argument added in LibreOffice 5.0
  */
 inline Document* documentLoad(const char* pUrl, const char* pFilterOptions 
= NULL)
 {
@@ -450,7 +451,11 @@ public:
 return mpThis->pClass->getError(mpThis);
 }
 
-/// Frees the memory pointed to by pFree.
+/**
+ * Frees the memory pointed to by pFree.
+ *
+ * @since LibreOffice 5.2
+ */
 inline void freeError(char* pFree)
 {
 mpThis->pClass->freeError(pFree);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-02-04 Thread coypu
 include/LibreOfficeKit/LibreOfficeKitInit.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d9835c81b1f929e524d4c92628811faa25bfc181
Author: coypu 
Date:   Wed Feb 3 15:32:40 2016 +0200

Include headers using OpenBSD too

OpenBSD ports patch: 
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/libreoffice/patches/patch-include_LibreOfficeKit_LibreOfficeKitInit_h

Change-Id: Ia3cebb41ca72bf022cc409814bed575cfbcfbf64
Reviewed-on: https://gerrit.libreoffice.org/22079
Reviewed-by: jan iversen 
Tested-by: jan iversen 
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 23e5772..a1b2ddc 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -19,7 +19,7 @@ extern "C"
 
 #if defined(__linux__) || defined (__FreeBSD_kernel__) || defined(_AIX) ||\
 defined(_WIN32) || defined(__APPLE__) || defined (__NetBSD__) ||\
-defined (__sun)
+defined (__sun) || defined(__OpenBSD__)
 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2016-02-02 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   12 ++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   50 +
 libreofficekit/source/gtk/lokdocview.cxx|  109 +++-
 3 files changed, 166 insertions(+), 5 deletions(-)

New commits:
commit 18fbddcca569c109ca2f46f7d791187e672d4d83
Author: Pranav Kant 
Date:   Wed Jan 27 16:56:14 2016 +0530

lokdocview: Handle password protected documents

Change-Id: I606a1112c8eb4c1cc4596d6947ce1223543cc87c
Reviewed-on: https://gerrit.libreoffice.org/21861
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index c3e4b28..229bac0 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -286,6 +286,18 @@ gbooleanlok_doc_view_paste 
(LOKDocView*
 gsize 
nSize);
 
 /**
+ * lok_doc_view_set_document_password:
+ * @pDocView: The #LOKDocView instance
+ * @pUrl: the URL of the document to set password for, as sent with signal 
`password-required`
+ * @pPassword: (nullable): the password, NULL for no password
+ *
+ * Set the password for password protected documents
+ */
+voidlok_doc_view_set_document_password 
(LOKDocView* pDocView,
+const 
gchar* pURL,
+const 
gchar* pPassword);
+
+/**
  * lok_doc_view_pixel_to_twip:
  * @pDocView: The #LOKDocView instance
  * @fInput: The value in pixels to convert to twips
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 45ac17e..c294430 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -486,10 +486,20 @@ static void toggleFindbar(GtkWidget* pButton, gpointer 
/*pItem*/)
 }
 }
 
+static void
+setLOKFeatures (GtkWidget* pDocView)
+{
+g_object_set(G_OBJECT(pDocView),
+ "doc-password", TRUE,
+ "doc-password-to-modify", TRUE,
+ nullptr);
+}
+
 /// Common initialization, regardless if it's just a new view or a full init.
 static TiledWindow& setupWidgetAndCreateWindow(GtkWidget* pDocView)
 {
 setupDocView(pDocView);
+setLOKFeatures(pDocView);
 TiledWindow aWindow;
 aWindow.m_pDocView = pDocView;
 GtkWidget* pWindow = createWindow(aWindow);
@@ -861,6 +871,45 @@ static void formulaChanged(LOKDocView* pLOKDocView, char* 
pPayload, gpointer /*p
 gtk_entry_set_text(GTK_ENTRY(rWindow.m_pFormulabarEntry), pPayload);
 }
 
+/// LOKDocView password is requried to open the document
+static void passwordRequired(LOKDocView* pLOKDocView, gchar* pUrl, gboolean 
bModify, gpointer /*pData*/)
+{
+GtkWidget* pPasswordDialog = gtk_dialog_new_with_buttons ("Password 
required",
+  GTK_WINDOW 
(gtk_widget_get_toplevel(GTK_WIDGET(pLOKDocView))),
+  GTK_DIALOG_MODAL,
+  "OK",
+  GTK_RESPONSE_OK,
+  nullptr);
+g_object_set(G_OBJECT(pPasswordDialog), "resizable", FALSE, nullptr);
+GtkWidget* pDialogMessageArea = gtk_dialog_get_content_area (GTK_DIALOG 
(pPasswordDialog));
+GtkWidget* pPasswordEntry = gtk_entry_new ();
+gtk_entry_set_visibility (GTK_ENTRY(pPasswordEntry), FALSE);
+gtk_entry_set_invisible_char (GTK_ENTRY(pPasswordEntry), '*');
+gtk_box_pack_end(GTK_BOX(pDialogMessageArea), pPasswordEntry, TRUE, TRUE, 
2);
+if (bModify)
+{
+GtkWidget* pSecondaryLabel = gtk_label_new ("Document requires 
password to edit");
+gtk_box_pack_end(GTK_BOX(pDialogMessageArea), pSecondaryLabel, TRUE, 
TRUE, 2);
+gtk_dialog_add_button (GTK_DIALOG (pPasswordDialog), "Open as 
read-only", GTK_RESPONSE_ACCEPT);
+}
+gtk_widget_show_all(pPasswordDialog);
+
+gint res = gtk_dialog_run (GTK_DIALOG(pPasswordDialog));
+switch (res)
+{
+case GTK_RESPONSE_OK:
+lok_doc_view_set_document_password (pLOKDocView, pUrl, 
gtk_entry_get_text(GTK_ENTRY(pPasswordEntry)));
+break;
+case GTK_RESPONSE_ACCEPT:
+// User accepts to open this document as read-only
+case GTK_RESPONSE_DELETE_EVENT:
+lok_doc_view_set_document_password (pLOKDocView, pUrl, nullptr);
+break;
+}
+
+gtk_widget_destroy(pPasswordDialog);
+}
+
 static void 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-01-29 Thread Riccardo Magliocchetti
 include/LibreOfficeKit/LibreOfficeKit.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 80d1c914524bc61402c0e257b59377c5e47231ce
Author: Riccardo Magliocchetti 
Date:   Thu Jan 28 12:41:43 2016 +0100

LibreOfficeKit: add doxygen since tag to _LibreOfficeKitClass struct

So it's easier for people adding language bindings know the
libreoffice version they depend on.

Change-Id: Ibe4526156663bb1250558b3f0e8517747a8add66
Reviewed-on: https://gerrit.libreoffice.org/21873
Tested-by: Jenkins 
Reviewed-by: Riccardo Magliocchetti 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index ee9ac1a..3411b6f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -53,9 +53,11 @@ struct _LibreOfficeKitClass
 
 char* (*getError) (LibreOfficeKit* pThis);
 
+/// @since LibreOffice 5.0
 LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis,
 const char* pURL,
 const char* pOptions);
+/// @since LibreOffice 5.2
 void (*freeError) (char* pFree);
 
 #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2016-01-19 Thread Oliver Specht
 include/LibreOfficeKit/LibreOfficeKit.h |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 23c2c7c9cb86db4a36f8a798e63402a053816ef2
Author: Oliver Specht 
Date:   Wed Jan 20 07:52:51 2016 +0100

freeError function moved to the end of the list

Change-Id: I4aed102b25ddcd5f2e8fa03395e2ffd89c858bb9
Reviewed-on: https://gerrit.libreoffice.org/21619
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 8057d75..80f8451 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -51,7 +51,6 @@ struct _LibreOfficeKitClass
  const char* pURL);
 
 char* (*getError) (LibreOfficeKit* pThis);
-void  (*freeError) (const char *pfree);
 
 LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis,
 const char* pURL,
@@ -64,6 +63,8 @@ struct _LibreOfficeKitClass
 /// @see lok::Office::getFilterTypes().
 char* (*getFilterTypes) (LibreOfficeKit* pThis);
 #endif
+void  (*freeError) (const char *pfree);
+
 };
 
 #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) 
LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2016-01-11 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h |4 +++-
 libreofficekit/source/gtk/lokdocview.cxx   |   29 +++--
 2 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit ba539fa91f9c3316107dcdf4a95718a49335d92e
Author: Pranav Kant 
Date:   Sat Dec 19 20:36:47 2015 +0530

tdf#96513: Limit LOKDocView's zoom in [0.25, 5.0]

Change-Id: Ibee485909dca1ea4a3774fca7a840afbf2d9883c
Reviewed-on: https://gerrit.libreoffice.org/20819
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 911bbdf..e06d154 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -107,7 +107,9 @@ LibreOfficeKitDocument*lok_doc_view_get_document
   (LOKDocView*
  * @pDocView: The #LOKDocView instance
  * @fZoom: The new zoom level that pDocView must set it into.
  *
- * Sets the new zoom level for the widget.
+ * Sets the new zoom level for the widget. Does nothing if fZoom is equal to
+ * existing zoom level. Values outside the range [0.25, 5.0] are clamped into
+ * the nearest allowed value in the interval.
  */
 void   lok_doc_view_set_zoom   
(LOKDocView* pDocView,
 float 
fZoom);
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index c1f550a..383f35f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -38,6 +38,10 @@
 #define CURSOR_HANDLE_DIR "/android/source/res/drawable/"
 // Number of handles around a graphic selection.
 #define GRAPHIC_HANDLE_COUNT 8
+// Maximum Zoom allowed
+#define MAX_ZOOM 5.0f
+// Minimum Zoom allowed
+#define MIN_ZOOM 0.25f
 
 /// Private struct used by this GObject type
 struct LOKDocViewPrivateImpl
@@ -124,8 +128,8 @@ struct LOKDocViewPrivateImpl
 m_aDocPath(nullptr),
 m_nLoadProgress(0),
 m_bIsLoading(false),
-m_bCanZoomIn(false),
-m_bCanZoomOut(false),
+m_bCanZoomIn(true),
+m_bCanZoomOut(true),
 m_pOffice(nullptr),
 m_pDocument(nullptr),
 lokThreadPool(nullptr),
@@ -2475,6 +2479,13 @@ lok_doc_view_set_zoom (LOKDocView* pDocView, float fZoom)
 LOKDocViewPrivate& priv = getPrivate(pDocView);
 GError* error = nullptr;
 
+// Clamp the input value in [MIN_ZOOM, MAX_ZOOM]
+fZoom = fZoom < MIN_ZOOM ? MIN_ZOOM : fZoom;
+fZoom = fZoom > MAX_ZOOM ? MAX_ZOOM : fZoom;
+
+if (fZoom == priv->m_fZoom)
+return;
+
 priv->m_fZoom = fZoom;
 long nDocumentWidthPixels = twipToPixel(priv->m_nDocumentWidthTwips, 
fZoom);
 long nDocumentHeightPixels = twipToPixel(priv->m_nDocumentHeightTwips, 
fZoom);
@@ -2489,6 +2500,20 @@ lok_doc_view_set_zoom (LOKDocView* pDocView, float fZoom)
 
 g_object_notify_by_pspec(G_OBJECT(pDocView), properties[PROP_ZOOM]);
 
+// set properties to indicate if view can be further zoomed in/out
+bool bCanZoomIn  = priv->m_fZoom < MAX_ZOOM;
+bool bCanZoomOut = priv->m_fZoom > MIN_ZOOM;
+if (bCanZoomIn != priv->m_bCanZoomIn)
+{
+priv->m_bCanZoomIn = bCanZoomIn;
+g_object_notify_by_pspec(G_OBJECT(pDocView), 
properties[PROP_CAN_ZOOM_IN]);
+}
+if (bCanZoomOut != priv->m_bCanZoomOut)
+{
+priv->m_bCanZoomOut = bCanZoomOut;
+g_object_notify_by_pspec(G_OBJECT(pDocView), 
properties[PROP_CAN_ZOOM_OUT]);
+}
+
 // Update the client's view size
 GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
 LOEvent* pLOEvent = new LOEvent(LOK_SET_CLIENT_ZOOM);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2015-12-17 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   10 +++--
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |3 +
 libreofficekit/source/gtk/lokdocview.cxx|   35 ++--
 3 files changed, 42 insertions(+), 6 deletions(-)

New commits:
commit df4a196b8f1e97d8a45d1d517942e01bd13182e7
Author: Pranav Kant 
Date:   Thu Dec 17 21:03:47 2015 +0530

lokdocview: Return if no document is set

For example, when document has been destroyed using
lok_doc_view_destroy_document()

Change-Id: I531b85018ffa25bcf88fb101c912b9f11b489a97
Reviewed-on: https://gerrit.libreoffice.org/20779
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 62d2e7f..911bbdf 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -125,7 +125,7 @@ gfloat lok_doc_view_get_zoom
   (LOKDocView*
  * @pDocView: The #LOKDocView instance
  *
  * Returns: Part refers to either individual sheets in a Calc, or slides in 
Impress,
- * and has no relevance for Writer.
+ * and has no relevance for Writer. Returns -1 if no document is set currently.
  */
 gint   lok_doc_view_get_parts  
(LOKDocView* pDocView);
 
@@ -133,7 +133,7 @@ gint   lok_doc_view_get_parts   
   (LOKDocView*
  * lok_doc_view_get_part:
  * @pDocView: The #LOKDocView instance
  *
- * Returns: Current part number of the document
+ * Returns: Current part number of the document. Returns -1 if no document is 
set currently.
  */
 gint   lok_doc_view_get_part   
(LOKDocView* pDocView);
 
@@ -150,7 +150,8 @@ void   lok_doc_view_set_part
   (LOKDocView*
  * @pDocView: The #LOKDocView instance
  * @nPart:
  *
- * Returns: Get current part name of loaded document
+ * Returns: Get current part name of loaded document. Returns null if no
+ * document is set, or document has been destroyed using 
lok_doc_view_destroy_document.
  */
 gchar* lok_doc_view_get_part_name  
(LOKDocView* pDocView,
 int nPart);
@@ -248,7 +249,8 @@ void   lok_doc_view_highlight_all   
   (LOKDocView*
  * @pUsedMimeType: (out): output parameter to inform about the determined 
format
  * (suggested or plain text).
  *
- * Returns: Selected text. The caller must free the returned buffer after use.
+ * Returns: Selected text. The caller must free the returned buffer after
+ * use. Returns null if no document is set.
  */
 gchar*  lok_doc_view_copy_selection
(LOKDocView* pDocView,
 const 
gchar* pMimeType,
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index e49b5a4..04d74d6 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -562,7 +562,10 @@ static void doCopy(GtkWidget* pButton, gpointer /*pItem*/)
 TiledWindow& rWindow = lcl_getTiledWindow(pButton);
 LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView);
 char* pUsedFormat = nullptr;
+// TODO: Should check `text-selection` signal before trying to copy
 char* pSelection = lok_doc_view_copy_selection(pLOKDocView, "text/html", 
);
+if (!pSelection)
+return;
 
 GtkClipboard* pClipboard = 
gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), 
GDK_SELECTION_CLIPBOARD);
 std::string aUsedFormat(pUsedFormat);
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 7d4e516..6b89955 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -341,6 +341,9 @@ doSearch(LOKDocView* pDocView, const char* pText, bool 
bBackwards, bool highligh
 cairo_rectangle_int_t cairoVisRect;
 int x, y;
 
+if (!priv->m_pDocument)
+return;
+
 cairo_region_get_rectangle(cairoVisRegion, 0, );
 x = pixelToTwip (cairoVisRect.x, priv->m_fZoom);
 y = pixelToTwip (cairoVisRect.y, priv->m_fZoom);
@@ -1629,8 +1632,6 @@ setClientZoomInThread(gpointer data)
 LOKDocViewPrivate& priv = getPrivate(pDocView);
 LOEvent* pLOEvent = static_cast(g_task_get_task_data(task));
 
-if (!priv->m_pDocument)
-return;
 priv->m_pDocument->pClass->setClientZoom(priv->m_pDocument,
  pLOEvent->m_nTilePixelWidth,
  pLOEvent->m_nTilePixelHeight,
@@ -2520,6 +2521,9 @@ SAL_DLLPUBLIC_EXPORT gint
 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2015-12-17 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 9c8c3acffa304e2d85dcbbdb5bf9decc9b255b13
Author: Pranav Kant 
Date:   Thu Dec 17 20:33:06 2015 +0530

lokdocview: Added some missing comments/annotations

Change-Id: I2f62bae37719ce96677a5ca6ffd93c8edb325a6a
Reviewed-on: https://gerrit.libreoffice.org/20777
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 903a742..25b15fa 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -123,12 +123,17 @@ float  lok_doc_view_get_zoom  
 (LOKDocView*
 /**
  * lok_doc_view_get_parts:
  * @pDocView: The #LOKDocView instance
+ *
+ * Returns: Part refers to either individual sheets in a Calc, or slides in 
Impress,
+ * and has no relevance for Writer.
  */
 intlok_doc_view_get_parts  
(LOKDocView* pDocView);
 
 /**
  * lok_doc_view_get_part:
  * @pDocView: The #LOKDocView instance
+ *
+ * Returns: Current part number of the document
  */
 intlok_doc_view_get_part   
(LOKDocView* pDocView);
 
@@ -144,6 +149,8 @@ void   lok_doc_view_set_part
   (LOKDocView*
  * lok_doc_view_get_part_name:
  * @pDocView: The #LOKDocView instance
  * @nPart:
+ *
+ * Returns: Get current part name of loaded document
  */
 char*  lok_doc_view_get_part_name  
(LOKDocView* pDocView,
 int nPart);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source

2015-12-17 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h |   12 ++--
 libreofficekit/source/gtk/lokdocview.cxx   |   12 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit b902432b431d01634c1f56e4758ec236a999650d
Author: Pranav Kant 
Date:   Thu Dec 17 20:35:23 2015 +0530

lokdocview: Use GLib basic types

Change-Id: I07add7b9dcb1dc53d7ed61ff71545489de3be155
Reviewed-on: https://gerrit.libreoffice.org/20778
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 25b15fa..62d2e7f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -118,7 +118,7 @@ void   lok_doc_view_set_zoom
   (LOKDocView*
  *
  * Returns: The current zoom factor value in float for pDocView
  */
-float  lok_doc_view_get_zoom   
(LOKDocView* pDocView);
+gfloat lok_doc_view_get_zoom   
(LOKDocView* pDocView);
 
 /**
  * lok_doc_view_get_parts:
@@ -127,7 +127,7 @@ float  lok_doc_view_get_zoom
   (LOKDocView*
  * Returns: Part refers to either individual sheets in a Calc, or slides in 
Impress,
  * and has no relevance for Writer.
  */
-intlok_doc_view_get_parts  
(LOKDocView* pDocView);
+gint   lok_doc_view_get_parts  
(LOKDocView* pDocView);
 
 /**
  * lok_doc_view_get_part:
@@ -135,7 +135,7 @@ intlok_doc_view_get_parts   
   (LOKDocView*
  *
  * Returns: Current part number of the document
  */
-intlok_doc_view_get_part   
(LOKDocView* pDocView);
+gint   lok_doc_view_get_part   
(LOKDocView* pDocView);
 
 /**
  * lok_doc_view_set_part:
@@ -152,7 +152,7 @@ void   lok_doc_view_set_part
   (LOKDocView*
  *
  * Returns: Get current part name of loaded document
  */
-char*  lok_doc_view_get_part_name  
(LOKDocView* pDocView,
+gchar* lok_doc_view_get_part_name  
(LOKDocView* pDocView,
 int nPart);
 
 /**
@@ -279,7 +279,7 @@ gbooleanlok_doc_view_paste  
   (LOKDocView*
  *
  * Returns: The corresponding value in twips
  */
-float  lok_doc_view_pixel_to_twip  
(LOKDocView* pDocView,
+gfloat lok_doc_view_pixel_to_twip  
(LOKDocView* pDocView,
 float 
fInput);
 
 /**
@@ -291,7 +291,7 @@ float  lok_doc_view_pixel_to_twip   
   (LOKDocView*
  *
  * Returns: The corresponding value in pixels
  */
-float  lok_doc_view_twip_to_pixel  
(LOKDocView* pDocView,
+gfloat lok_doc_view_twip_to_pixel  
(LOKDocView* pDocView,
 float 
fInput);
 
 G_END_DECLS
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index c78d008..7d4e516 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2509,14 +2509,14 @@ lok_doc_view_set_zoom (LOKDocView* pDocView, float 
fZoom)
 g_object_unref(task);
 }
 
-SAL_DLLPUBLIC_EXPORT float
+SAL_DLLPUBLIC_EXPORT gfloat
 lok_doc_view_get_zoom (LOKDocView* pDocView)
 {
 LOKDocViewPrivate& priv = getPrivate(pDocView);
 return priv->m_fZoom;
 }
 
-SAL_DLLPUBLIC_EXPORT int
+SAL_DLLPUBLIC_EXPORT gint
 lok_doc_view_get_parts (LOKDocView* pDocView)
 {
 LOKDocViewPrivate& priv = getPrivate(pDocView);
@@ -2524,7 +2524,7 @@ lok_doc_view_get_parts (LOKDocView* pDocView)
 return priv->m_pDocument->pClass->getParts( priv->m_pDocument );
 }
 
-SAL_DLLPUBLIC_EXPORT int
+SAL_DLLPUBLIC_EXPORT gint
 lok_doc_view_get_part (LOKDocView* pDocView)
 {
 LOKDocViewPrivate& priv = getPrivate(pDocView);
@@ -2552,7 +2552,7 @@ lok_doc_view_set_part (LOKDocView* pDocView, int nPart)
 g_object_unref(task);
 }
 
-SAL_DLLPUBLIC_EXPORT char*
+SAL_DLLPUBLIC_EXPORT gchar*
 lok_doc_view_get_part_name (LOKDocView* pDocView, int nPart)
 {
 LOKDocViewPrivate& priv = getPrivate(pDocView);
@@ -2720,14 +2720,14 @@ lok_doc_view_paste (LOKDocView* pDocView,
 return ret;
 }
 
-SAL_DLLPUBLIC_EXPORT float
+SAL_DLLPUBLIC_EXPORT gfloat
 lok_doc_view_pixel_to_twip (LOKDocView* pDocView, float fInput)
 {
 LOKDocViewPrivate& priv = getPrivate(pDocView);
 return pixelToTwip(fInput, priv->m_fZoom);
 }
 
-SAL_DLLPUBLIC_EXPORT float
+SAL_DLLPUBLIC_EXPORT gfloat
 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/Library_libreofficekitgtk.mk libreofficekit/source

2015-12-09 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |3 ++-
 libreofficekit/Library_libreofficekitgtk.mk |4 
 libreofficekit/source/gtk/lokdocview.cxx|2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 424c09b10d3d6ba6edfed2dcf560d5ce2c950b9d
Author: Pranav Kant 
Date:   Tue Dec 8 23:14:25 2015 +0530

lokdocview: Set a 'default' path for LOK init

When passed NULL to lok_doc_view_new, use the default path :
$libdir/libreoffice/program as LOK install path

Change-Id: I1e033c407184b29b1509cfb8c416b514591d67ce
Reviewed-on: https://gerrit.libreoffice.org/20476
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 8b6092c..2548c11 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -42,7 +42,8 @@ GType  lok_doc_view_get_type  
 (void) G_GNUC
 
 /**
  * lok_doc_view_new:
- * @pPath: LibreOffice install path.
+ * @pPath: (nullable): LibreOffice install path. Pass null to set it to default
+ * path which in most cases would be $libdir/libreoffice/program
  * @cancellable: The cancellable object that you can use to cancel this
  * operation.
  * @error: The error that will be set if the object fails to initialize.
diff --git a/libreofficekit/Library_libreofficekitgtk.mk 
b/libreofficekit/Library_libreofficekitgtk.mk
index 3eba939..fc62e72 100644
--- a/libreofficekit/Library_libreofficekitgtk.mk
+++ b/libreofficekit/Library_libreofficekitgtk.mk
@@ -28,6 +28,10 @@ $(eval $(call gb_Library_add_libs,libreofficekitgtk,\
 $(GTK3_LIBS) \
 ))
 
+$(eval $(call gb_Library_add_defs,libreofficekitgtk,\
+   -DLOK_PATH="\"$(LIBDIR)/libreoffice/$(LIBO_LIB_FOLDER)\"" \
+))
+
 ifeq ($(OS),$(filter LINUX %BSD SOLARIS, $(OS)))
 $(eval $(call gb_Library_add_libs,libreofficekitgtk,\
 $(DLOPEN_LIBS) -lm \
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index fecc66a..0a4543b 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2280,7 +2280,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
 SAL_DLLPUBLIC_EXPORT GtkWidget*
 lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError 
**error)
 {
-return GTK_WIDGET (g_initable_new (LOK_TYPE_DOC_VIEW, cancellable, error, 
"lopath", pPath, NULL));
+return GTK_WIDGET (g_initable_new (LOK_TYPE_DOC_VIEW, cancellable, error, 
"lopath", pPath == NULL ? LOK_PATH : pPath, NULL));
 }
 
 SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* 
pOldLOKDocView)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2015-12-09 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   38 +++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   46 ++--
 libreofficekit/source/gtk/lokdocview.cxx|  107 
 3 files changed, 139 insertions(+), 52 deletions(-)

New commits:
commit 0f64cf72ff3b930e306e937bb18f4cbe55a8026a
Author: Pranav Kant 
Date:   Wed Dec 9 10:33:05 2015 +0530

tdf#96318: Add searching API

Clients should now use these APIs to search for text in the
widget, rather than executing UNO commands directly on the
widget. This allows searching for text in the widget in view-only
mode too.

Change-Id: I013b6f96e69a634ec33367394d39c0f645a4994d
Reviewed-on: https://gerrit.libreoffice.org/20488
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 2548c11..1b03e46 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -196,6 +196,44 @@ void   lok_doc_view_post_command   
(LOKDocView*
 const 
gchar* pArguments,
 gboolean 
bNotifyWhenFinished);
 
+
+/**
+ * lok_doc_view_find_next:
+ * @pDocView: The #LOKDocView instance
+ * @pText: text to search for
+ * @bHighlightAll: Whether all the matches should be highlighted or not
+ *
+ * Highlights the next matching text in the view. `search-not-found` signal 
will
+ * be emitted when no search is found
+ */
+void   lok_doc_view_find_next  
(LOKDocView* pDocView,
+const 
gchar* pText,
+gboolean 
bHighlightAll);
+
+/**
+ * lok_doc_view_find_prev:
+ * @pDocView: The #LOKDocView instance
+ * @pText: text to search for
+ * @bHighlightAll: Whether all the matches should be highlighted or not
+ *
+ * Highlights the previous matching text in the view. `search-not-found` signal
+ * will be emitted when no search is found
+ */
+void   lok_doc_view_find_prev  
(LOKDocView* pDocView,
+const 
gchar* pText,
+gboolean 
bHighlightAll);
+
+/**
+ * lok_doc_view_highlight_all:
+ * @pDocView: The #LOKDocView instance
+ * @pText: text to search for
+ *
+ * Highlights all matching texts in the view. `search-not-found` signal
+ * will be emitted when no search is found
+ */
+void   lok_doc_view_highlight_all  
(LOKDocView* pDocView,
+const 
gchar* pText);
+
 /**
  * lok_doc_view_pixel_to_twip:
  * @pDocView: The #LOKDocView instance
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index e7b2216..8d43737 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -452,7 +452,11 @@ static void toggleEditing(GtkWidget* pButton, gpointer 
/*pItem*/)
 static void toggleFindAll(GtkWidget* pButton, gpointer /*pItem*/)
 {
 TiledWindow& rWindow = lcl_getTiledWindow(pButton);
+GtkEntry* pEntry = GTK_ENTRY(rWindow.m_pFindbarEntry);
+const char* pText = gtk_entry_get_text(pEntry);
+
 rWindow.m_bFindAll = !rWindow.m_bFindAll;
+lok_doc_view_highlight_all(LOK_DOC_VIEW(rWindow.m_pDocView), pText);
 }
 
 /// Toggle the visibility of the findbar.
@@ -611,48 +615,24 @@ static void doPaste(GtkWidget* pButton, gpointer 
/*pItem*/)
 pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", pText, 
strlen(pText));
 }
 
-/// Searches for the next or previous text of TiledWindow::m_pFindbarEntry.
-static void doSearch(GtkWidget* pButton, bool bBackwards)
+/// Click handler for the search next button.
+static void signalSearchNext(GtkWidget* pButton, gpointer /*pItem*/)
 {
 TiledWindow& rWindow = lcl_getTiledWindow(pButton);
 GtkEntry* pEntry = GTK_ENTRY(rWindow.m_pFindbarEntry);
 const char* pText = gtk_entry_get_text(pEntry);
-boost::property_tree::ptree aTree;
-
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchString/type",
 '/'), "string");
-
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchString/value",
 '/'), pText);
-
aTree.put(boost::property_tree::ptree::path_type("SearchItem.Backward/type", 
'/'), "boolean");
-
aTree.put(boost::property_tree::ptree::path_type("SearchItem.Backward/value", 
'/'), bBackwards);
-if (rWindow.m_bFindAll)
-{
-

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2015-12-09 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   29 +
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |8 +---
 libreofficekit/source/gtk/lokdocview.cxx|   33 +++-
 3 files changed, 64 insertions(+), 6 deletions(-)

New commits:
commit 7d7fad258dfde500c5ee99b5f1691172724383bd
Author: Pranav Kant 
Date:   Wed Dec 9 21:45:21 2015 +0530

tdf#96317: Add API for copy/paste from/to the widget

Change-Id: Iac869ddb65cbdd2227f96d047d83159ca7819f11
Reviewed-on: https://gerrit.libreoffice.org/20534
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 1b03e46..903a742 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -235,6 +235,35 @@ void   lok_doc_view_highlight_all  
(LOKDocView*
 const 
gchar* pText);
 
 /**
+ * lok_doc_view_copy_selection:
+ * @pDocView: The #LOKDocView instance
+ * @pMimeType: suggests the return format, for example text/plain;charset=utf-8
+ * @pUsedMimeType: (out): output parameter to inform about the determined 
format
+ * (suggested or plain text).
+ *
+ * Returns: Selected text. The caller must free the returned buffer after use.
+ */
+gchar*  lok_doc_view_copy_selection
(LOKDocView* pDocView,
+const 
gchar* pMimeType,
+gchar** 
pUsedMimeType);
+
+/**
+ * lok_doc_view_paste:
+ * @pDocView: The #LOKDocView instance
+ * @pMimeType: format of pData, for example text/plain;charset=utf-8
+ * @pData: the data to be pasted
+ * @nSize: length of data to be pasted
+ *
+ * Pastes the content at the current cursor position
+ *
+ * Returns: if pData was pasted successfully.
+ */
+gbooleanlok_doc_view_paste 
(LOKDocView* pDocView,
+const 
gchar* pMimeType,
+const 
gchar* pData,
+gsize 
nSize);
+
+/**
  * lok_doc_view_pixel_to_twip:
  * @pDocView: The #LOKDocView instance
  * @fInput: The value in pixels to convert to twips
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 8d43737..875fefc 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -561,9 +561,8 @@ static void doCopy(GtkWidget* pButton, gpointer /*pItem*/)
 {
 TiledWindow& rWindow = lcl_getTiledWindow(pButton);
 LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView);
-LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pLOKDocView);
 char* pUsedFormat = nullptr;
-char* pSelection = pDocument->pClass->getTextSelection(pDocument, 
"text/html", );
+char* pSelection = lok_doc_view_copy_selection(pLOKDocView, "text/html", 
);
 
 GtkClipboard* pClipboard = 
gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), 
GDK_SELECTION_CLIPBOARD);
 std::string aUsedFormat(pUsedFormat);
@@ -580,7 +579,6 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/)
 {
 TiledWindow& rWindow = lcl_getTiledWindow(pButton);
 LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView);
-LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pLOKDocView);
 
 GtkClipboard* pClipboard = 
gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), 
GDK_SELECTION_CLIPBOARD);
 
@@ -604,7 +602,7 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/)
 GtkSelectionData* pSelectionData = 
gtk_clipboard_wait_for_contents(pClipboard, *oTarget);
 gint nLength;
 const guchar* pData = 
gtk_selection_data_get_data_with_length(pSelectionData, );
-bool bSuccess = pDocument->pClass->paste(pDocument, "text/html", 
reinterpret_cast(pData), nLength);
+bool bSuccess = lok_doc_view_paste(pLOKDocView, "text/html", 
reinterpret_cast(pData), nLength);
 gtk_selection_data_free(pSelectionData);
 if (bSuccess)
 return;
@@ -612,7 +610,7 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/)
 
 gchar* pText = gtk_clipboard_wait_for_text(pClipboard);
 if (pText)
-pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", pText, 
strlen(pText));
+lok_doc_view_paste(pLOKDocView, "text/plain;charset=utf-8", pText, 
strlen(pText));
 }
 
 /// Click handler for the search next button.
diff --git 

[Libreoffice-commits] core.git: include/LibreOfficeKit

2015-12-06 Thread Pranav Kant
 include/LibreOfficeKit/LibreOfficeKitGtk.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e9703389e015d0f3520344715df6719559362e4
Author: Pranav Kant 
Date:   Sun Dec 6 23:41:57 2015 +0530

tdf#96246: Make pRenderingArguments nullable

Type gchar* is not nullable by convention.

See:

https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#Nullable_parameters

Change-Id: Ibfee816a3ef2d29c7376071fb61eda7bf0538efb
Reviewed-on: https://gerrit.libreoffice.org/20425
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index c947ce3..8b6092c 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -65,7 +65,7 @@ GtkWidget* lok_doc_view_new_from_widget   
 (LOKDocView*
  * lok_doc_view_open_document:
  * @pDocView: The #LOKDocView instance
  * @pPath: (transfer full): The path of the document that #LOKDocView widget 
should try to open
- * @pRenderingArguments: lok::Document::initializeForRendering() arguments.
+ * @pRenderingArguments: (nullable): lok::Document::initializeForRendering() 
arguments.
  * @cancellable:
  * @callback:
  * @userdata:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit

2015-11-10 Thread Stephan Bergmann
 include/LibreOfficeKit/LibreOfficeKit.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 37968fd404ca04333502921e5560f893c7933888
Author: Stephan Bergmann 
Date:   Tue Nov 10 13:21:28 2015 +0100

Missing include (for NULL)

Change-Id: I26e448de315b56f36cfeb74a66c0db6a9148d9b0

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 303f397..fe8c4d1 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_HXX
 #define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_HXX
 
+#include 
+
 #include "LibreOfficeKit.h"
 #include "LibreOfficeKitInit.h"
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2015-10-09 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |6 --
 libreofficekit/source/gtk/lokdocview.cxx   |   14 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   12 +---
 sw/source/uibase/uiview/viewsrch.cxx   |   14 +-
 4 files changed, 12 insertions(+), 34 deletions(-)

New commits:
commit f0e3fe840b6f103c589f044bbde18b2faa345279
Author: Miklos Vajna 
Date:   Fri Oct 9 08:08:48 2015 +0200

LOK: CALLBACK_SEARCH_RESULT_COUNT is redundant

1) The size of the searchResultSelection array in
LOK_CALLBACK_SEARCH_RESULT_SELECTION provides the same information.

2) None of the clients except lokdocview used it.

3) Only sw provided this callback, not sc/sd.

Change-Id: I9da639b6693f24634f298f9bc4773f705e944359

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index b87f69a..0da8769 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -158,12 +158,6 @@ typedef enum
 LOK_CALLBACK_SET_PART,
 
 /**
- * Number of search results followed by the original searched phrase.
- * count;phrase
- */
-LOK_CALLBACK_SEARCH_RESULT_COUNT,
-
-/**
  * Selection rectangles of the search result when find all is performed.
  *
  * Payload format example, in case of two matches:
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index f6eec2e..df78d13 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #define LOK_USE_UNSTABLE_API
@@ -227,8 +228,6 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_STATUS_INDICATOR_FINISH";
 case LOK_CALLBACK_SEARCH_NOT_FOUND:
 return "LOK_CALLBACK_SEARCH_NOT_FOUND";
-case LOK_CALLBACK_SEARCH_RESULT_COUNT:
-return "LOK_CALLBACK_SEARCH_RESULT_COUNT";
 case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
 return "LOK_CALLBACK_DOCUMENT_SIZE_CHANGED";
 case LOK_CALLBACK_SET_PART:
@@ -661,12 +660,6 @@ callback (gpointer pData)
 searchNotFound(pDocView, pCallback->m_aPayload);
 }
 break;
-case LOK_CALLBACK_SEARCH_RESULT_COUNT:
-{
-size_t nPos = pCallback->m_aPayload.find_first_of(";");
-searchResultCount(pDocView, pCallback->m_aPayload.substr(0, nPos));
-}
-break;
 case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
 {
 payloadToSize(pCallback->m_aPayload.c_str(), 
priv->m_nDocumentWidthTwips, priv->m_nDocumentHeightTwips);
@@ -684,6 +677,11 @@ callback (gpointer pData)
 break;
 case LOK_CALLBACK_SEARCH_RESULT_SELECTION:
 {
+boost::property_tree::ptree aTree;
+std::stringstream aStream(pCallback->m_aPayload);
+boost::property_tree::read_json(aStream, aTree);
+int nCount = aTree.get_child("searchResultSelection").size();
+searchResultCount(pDocView, std::to_string(nCount));
 }
 break;
 default:
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 1eb57de..eb59b62 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -72,13 +72,11 @@ private:
 Size m_aDocumentSize;
 OString m_aTextSelection;
 bool m_bFound;
-sal_Int32 m_nSearchResultCount;
 std::vector m_aSearchResultSelection;
 };
 
 SwTiledRenderingTest::SwTiledRenderingTest()
-: m_bFound(true),
-  m_nSearchResultCount(0)
+: m_bFound(true)
 {
 }
 
@@ -134,12 +132,6 @@ void SwTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 m_bFound = false;
 }
 break;
-case LOK_CALLBACK_SEARCH_RESULT_COUNT:
-{
-std::string aStrPayload(pPayload);
-m_nSearchResultCount = std::stoi(aStrPayload.substr(0, 
aStrPayload.find_first_of(";")));
-}
-break;
 case LOK_CALLBACK_SEARCH_RESULT_SELECTION:
 {
 m_aSearchResultSelection.clear();
@@ -485,8 +477,6 @@ void SwTiledRenderingTest::testSearchAll()
 }));
 comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
 // This was 0; should be 2 results in the body text.
-CPPUNIT_ASSERT_EQUAL(static_cast(2), m_nSearchResultCount);
-// Make sure that we get exactly as many rectangle lists as matches.
 CPPUNIT_ASSERT_EQUAL(static_cast(2), 
m_aSearchResultSelection.size());
 
 comphelper::LibreOfficeKit::setActive(false);
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index 9667fdc..e2b73f2 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -104,11 +104,8 @@ static void 
lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OSt
 }
 
 /// Emits LOK callbacks (count, selection) for 

[Libreoffice-commits] core.git: include/LibreOfficeKit libreofficekit/source sw/qa sw/source

2015-10-05 Thread Mihai Varga
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |6 +-
 libreofficekit/source/gtk/lokdocview.cxx   |   10 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |4 +++-
 sw/source/uibase/uiview/viewsrch.cxx   |2 +-
 4 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit c30defcf8e34daec6ea0455d772fe296cc26ecc9
Author: Mihai Varga 
Date:   Mon Oct 5 17:07:06 2015 +0300

LOK: add the search phrase to the search result count callback

We need this to notify the user for which search phrase no results were
found

Change-Id: I8cc7ab235b9129dfdcb022145456180ff7e4ca92

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index dc3e0f9..97c089f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -156,7 +156,11 @@ typedef enum
  * Payload is a single 0-based integer.
  */
 LOK_CALLBACK_SET_PART,
-/// Number of search results, in case something is found.
+
+/**
+ * Number of search results followed by the original searched phrase.
+ * count;phrase
+ */
 LOK_CALLBACK_SEARCH_RESULT_COUNT
 }
 LibreOfficeKitCallbackType;
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 2d34e58..2aa1916 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -658,6 +658,16 @@ callback (gpointer pData)
 searchNotFound(pDocView, pCallback->m_aPayload);
 }
 break;
+case LOK_CALLBACK_SEARCH_RESULT_COUNT:
+{
+size_t nPos = pCallback->m_aPayload.find_first_of(";");
+int nSearchResultCount = std::stoi(pCallback->m_aPayload.substr(0, 
nPos));
+if (nSearchResultCount == 0)
+{
+searchNotFound(pDocView, pCallback->m_aPayload.substr(nPos + 1));
+}
+}
+break;
 case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
 {
 payloadToSize(pCallback->m_aPayload.c_str(), 
priv->m_nDocumentWidthTwips, priv->m_nDocumentHeightTwips);
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index c836f4b..bcc328e 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static const char* DATA_DIRECTORY = "/sw/qa/extras/tiledrendering/data/";
 
@@ -132,7 +133,8 @@ void SwTiledRenderingTest::callbackImpl(int nType, const 
char* pPayload)
 break;
 case LOK_CALLBACK_SEARCH_RESULT_COUNT:
 {
-m_nSearchResultCount = OString(pPayload).toInt32();
+std::string aStrPayload(pPayload);
+m_nSearchResultCount = std::stoi(aStrPayload.substr(0, 
aStrPayload.find_first_of(";")));
 }
 break;
 }
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index dcb4452..20ffed6 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -225,7 +225,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
 }
 else
 {
-OString aPayload = OString::number(nFound);
+OString aPayload = OString::number(nFound) + ";" + 
m_pSrchItem->GetSearchString().toUtf8();
 
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_COUNT, 
aPayload.getStr());
 }
 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >