summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-11-13 09:48:14 +0200
committerMihai Varga <mihai.mv13@gmail.com>2015-11-16 15:03:01 +0200
commit8a5cf61b7b0dc6668c283fe9476b3474736d33bc (patch)
treeab649da5f57117168cdc1d5173ad6a5c9a65fc80
parentc4d5cbfa85dba8a695ccdc98a57685bd48bbbee8 (diff)
LOK: calc formula callback + formula bar implementation in gtk
We need the callback to be able implement the formula bar Change-Id: I1c78ab0b9ed9304c0465a9993a7101f8efb91052 Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h libreofficekit/source/gtk/lokdocview.cxx Conflicts: libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx libreofficekit/source/gtk/lokdocview.cxx
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h7
-rw-r--r--sc/source/ui/app/inputhdl.cxx8
2 files changed, 14 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 37837ea49b86..7b23fcbab1c3 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -209,7 +209,12 @@ typedef enum
*
* Payload is a css mouse pointer style.
*/
- LOK_CALLBACK_MOUSE_POINTER
+ LOK_CALLBACK_MOUSE_POINTER,
+
+ /**
+ * The text content of the formula bar in Calc.
+ */
+ LOK_CALLBACK_CELL_FORMULA
}
LibreOfficeKitCallbackType;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index fe9ef00e709f..fa2225e257bc 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -52,6 +52,7 @@
#include <tools/urlobj.hxx>
#include <comphelper/string.hxx>
#include <formula/formulahelper.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include "inputwin.hxx"
#include "tabvwsh.hxx"
@@ -2138,6 +2139,11 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
if ( pInputWin )
pInputWin->SetTextString( aText );
+
+ ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ if ( rDoc.GetDrawLayer()->isTiledRendering() )
+ rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
}
// If the cursor is before the end of a paragraph, parts are being pushed to
@@ -3474,6 +3480,8 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pInputWin )
pInputWin->SetTextString(aString);
+ else if ( rDoc.GetDrawLayer()->isTiledRendering() )
+ rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr());
}
if ( pInputWin ) // Named range input