[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 5 commits - desktop/source include/LibreOfficeKit include/vcl libreofficekit/source sc/inc sc/source sd/source sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Oct 7 02:47:08 PDT 2015
desktop/source/lib/init.cxx | 10
include/LibreOfficeKit/LibreOfficeKit.h | 4
include/LibreOfficeKit/LibreOfficeKit.hxx | 4
include/LibreOfficeKit/LibreOfficeKitEnums.h | 4
include/vcl/ITiledRenderable.hxx | 2
libreofficekit/source/gtk/lokdocview.cxx | 7
sc/inc/docuno.hxx | 3
sc/source/ui/unoobj/docuno.cxx | 5
sd/source/ui/inc/unomodel.hxx | 3
sd/source/ui/unoidl/unomodel.cxx | 5
sw/inc/unotxdoc.hxx | 3
sw/inc/view.hxx | 694 +++++++++++++++++++++++++++
sw/source/core/crsr/findtxt.cxx | 7
sw/source/core/view/viewsh.cxx | 2
sw/source/uibase/inc/view.hxx | 693 --------------------------
sw/source/uibase/uiview/viewsrch.cxx | 8
sw/source/uibase/uno/unotxdoc.cxx | 4
17 files changed, 741 insertions(+), 717 deletions(-)
New commits:
commit a84cbcc57637301c072814872dcc506cc2cb48b8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Oct 5 15:19:06 2015 +0200
sw: avoid hang with find-all and shape text
We can't easily have editeng & sw selection at the same time, so just
exlucde shapes in the find-all case for now: better than a hang.
(cherry picked from commit dce533e06d641d15c3171cd543875cb9fe835cd2)
Conflicts:
sw/source/core/crsr/findtxt.cxx
Change-Id: I1090595e8c4bc11eb38ffa486885ad5fab67ab86
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 99cb02f..40a9630 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -667,6 +667,7 @@ public:
SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const SAL_OVERRIDE;
SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window* pParent,
const SfxItemSet& rSet) SAL_OVERRIDE;
+ static SvxSearchItem* GetSearchItem() { return m_pSrchItem; }
};
inline long SwView::GetXScroll() const
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 741e307..243a57d 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -47,6 +47,7 @@
#include <docsh.hxx>
#include <PostItMgr.hxx>
#include <viewsh.hxx>
+#include <view.hxx>
using namespace ::com::sun::star;
using namespace util;
@@ -340,8 +341,10 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
}
}
- // If we just finished search in shape text, don't attept to do that again.
- if (!bEndedTextEdit)
+ // Writer and editeng selections are not supported in parallel.
+ SvxSearchItem* pSearchItem = SwView::GetSearchItem();
+ // If we just finished search in shape text, don't attempt to do that again.
+ if (!bEndedTextEdit && !(pSearchItem && pSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL))
{
// If there are any shapes anchored to this node, search there.
SwPaM aPaM(pNode->GetDoc()->GetNodes().GetEndOfContent());
commit 4900f91120433ef7273b2d13f93adf8eae66f4ee
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 15 09:12:13 2015 +0200
sw: avoid #include "../../uibase/inc/view.hxx"
Change-Id: If5b148e890cd7d165f9d2b533c04b2047ac6caea
(cherry picked from commit c3a8adb2e06888fc237aa6e3d43c32d805a46537)
diff --git a/sw/source/uibase/inc/view.hxx b/sw/inc/view.hxx
similarity index 99%
rename from sw/source/uibase/inc/view.hxx
rename to sw/inc/view.hxx
index 1524d60..99cb02f 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_VIEW_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_INC_VIEW_HXX
+#ifndef INCLUDED_SW_INC_VIEW_HXX
+#define INCLUDED_SW_INC_VIEW_HXX
#include <vcl/timer.hxx>
#include <vcl/field.hxx>
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0605438..8c16e2d 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -72,7 +72,7 @@
#include <wrtsh.hxx>
#include <DocumentSettingManager.hxx>
-#include "../../uibase/inc/view.hxx"
+#include <view.hxx>
#include <PostItMgr.hxx>
#include <vcl/dibtools.hxx>
#include <vcl/virdev.hxx>
commit 527a83d77c139427028ad08bef3a6349135716f7
Author: Mihai Varga <mihai.varga at collabora.com>
Date: Sun Oct 4 19:40:13 2015 +0300
LOK: added the button type and key modifier to postMouseEvent()
To get a better functionality we need to know the button type (left,
right, middle). We also need the key modifier (ctrl, alt, shift) for
actions such as ctrl+click (to open a link) or shift+click to select
(cherry picked from commit c90c08a65c480a1012182979d5e9218f17a2ba2e)
Conflicts:
libreofficekit/Library_libreofficekitgtk.mk
libreofficekit/source/gtk/lokdocview.cxx
libreofficekit/source/gtk/tilebuffer.hxx
Change-Id: Iaccb93b276f8a6870dd41cc5132dbb85d2bbf71b
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0c831b1..5f07d51 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -233,7 +233,9 @@ static void doc_postMouseEvent (LibreOfficeKitDocument* pThis,
int nType,
int nX,
int nY,
- int nCount);
+ int nCount,
+ int nButtons,
+ int nModifier);
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis,
const char* pCommand,
const char* pArguments);
@@ -927,7 +929,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* /*pThis*/, const char* pC
}
}
-static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount)
+static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
ITiledRenderable* pDoc = getTiledRenderable(pThis);
if (!pDoc)
@@ -936,7 +938,7 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
return;
}
- pDoc->postMouseEvent(nType, nX, nY, nCount);
+ pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier);
}
static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index d83dd49..83dcc98 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -137,7 +137,9 @@ struct _LibreOfficeKitDocumentClass
int nType,
int nX,
int nY,
- int nCount);
+ int nCount,
+ int nButtons,
+ int nModifier);
/// @see lok::Document::postUnoCommand
void (*postUnoCommand) (LibreOfficeKitDocument* pThis,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index cd12ad6..e9167c5 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -192,9 +192,9 @@ public:
* @param nY vertical position in document coordinates
* @param nCount number of clicks: 1 for single click, 2 for double click
*/
- inline void postMouseEvent(int nType, int nX, int nY, int nCount)
+ inline void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
- mpDoc->pClass->postMouseEvent(mpDoc, nType, nX, nY, nCount);
+ mpDoc->pClass->postMouseEvent(mpDoc, nType, nX, nY, nCount, nButtons, nModifier);
}
/**
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 69889fc..0014f4d 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -112,7 +112,7 @@ public:
*
* @see lok::Document::postMouseEvent().
*/
- virtual void postMouseEvent(int nType, int nX, int nY, int nCount) = 0;
+ virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) = 0;
/**
* Sets the start or end of a text selection.
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 1e5beae..e70e95f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -21,6 +21,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/event.hxx>
#if !GLIB_CHECK_VERSION(2,32,0)
#define G_SOURCE_REMOVE FALSE
@@ -461,7 +462,7 @@ gboolean LOKDocView_Impl::signalButtonImpl(GdkEventButton* pEvent)
if ((pEvent->time - m_nLastButtonPressTime) < 250)
nCount++;
m_nLastButtonPressTime = pEvent->time;
- m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), nCount);
+ m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), nCount, MOUSE_LEFT, 0);
break;
}
case GDK_BUTTON_RELEASE:
@@ -470,7 +471,7 @@ gboolean LOKDocView_Impl::signalButtonImpl(GdkEventButton* pEvent)
if ((pEvent->time - m_nLastButtonReleaseTime) < 250)
nCount++;
m_nLastButtonReleaseTime = pEvent->time;
- m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), nCount);
+ m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), nCount, MOUSE_LEFT, 0);
break;
}
default:
@@ -552,7 +553,7 @@ gboolean LOKDocView_Impl::signalMotionImpl(GdkEventButton* pEvent)
}
// Otherwise a mouse move, as on the desktop.
- m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEMOVE, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), 1);
+ m_pDocument->pClass->postMouseEvent(m_pDocument, LOK_MOUSEEVENT_MOUSEMOVE, pixelToTwip(pEvent->x), pixelToTwip(pEvent->y), 1, MOUSE_LEFT, 0);
return FALSE;
}
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index cd68885..cc13227 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -54,6 +54,7 @@
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <svl/itemprop.hxx>
+#include <vcl/event.hxx>
#include <vcl/ITiledRenderable.hxx>
#include "drwlayer.hxx"
@@ -401,7 +402,7 @@ public:
virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::postMouseEvent().
- virtual void postMouseEvent(int nType, int nX, int nY, int nCount) SAL_OVERRIDE;
+ virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons = MOUSE_LEFT, int nModifier = 0) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::setTextSelection().
virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 84b2857..26ce45b 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -576,7 +576,7 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode)
}
}
-void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount)
+void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
SolarMutexGuard aGuard;
@@ -592,7 +592,8 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount)
pViewData->SetZoom(Fraction(1, 1), Fraction(1, 1), true);
// Calc operates in pixels...
- MouseEvent aEvent(Point(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY()), nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
+ MouseEvent aEvent(Point(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY()), nCount,
+ MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
switch (nType)
{
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 009fb67..4d73148 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -45,6 +45,7 @@
#include <sfx2/sfxbasemodel.hxx>
#include <svx/fmdmod.hxx>
+#include <vcl/event.hxx>
#include <vcl/ITiledRenderable.hxx>
#include <editeng/unoipset.hxx>
@@ -248,7 +249,7 @@ public:
/// @see vcl::ITiledRenderable::postKeyEvent().
virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::postMouseEvent().
- virtual void postMouseEvent(int nType, int nX, int nY, int nCount) SAL_OVERRIDE;
+ virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons = MOUSE_LEFT, int nModifier = 0) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::setTextSelection().
virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::getTextSelection().
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 7e37836..b8be619 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2441,7 +2441,7 @@ void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
}
}
-void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount)
+void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
SolarMutexGuard aGuard;
@@ -2449,7 +2449,8 @@ void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount)
if (!pViewShell)
return;
- MouseEvent aEvent(Point(convertTwipToMm100(nX), convertTwipToMm100(nY)), nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
+ MouseEvent aEvent(Point(convertTwipToMm100(nX), convertTwipToMm100(nY)), nCount,
+ MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
switch (nType)
{
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 311147e..346cab6 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -66,6 +66,7 @@
#include <editeng/UnoForbiddenCharsTable.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase.hxx>
+#include <vcl/event.hxx>
#include <vcl/ITiledRenderable.hxx>
#include <com/sun/star/tiledrendering/XTiledRenderable.hpp>
@@ -422,7 +423,7 @@ public:
/// @see vcl::ITiledRenderable::postKeyEvent().
virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::postMouseEvent().
- virtual void postMouseEvent(int nType, int nX, int nY, int nCount) SAL_OVERRIDE;
+ virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons = MOUSE_LEFT, int nModifier = 0) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::setTextSelection().
virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE;
/// @see vcl::ITiledRenderable::getTextSelection().
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 0abbdfc..7cb32fc 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3273,12 +3273,12 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
}
}
-void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount)
+void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
SolarMutexGuard aGuard;
SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin();
- MouseEvent aEvent(Point(nX, nY), nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
+ MouseEvent aEvent(Point(nX, nY), nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier);
switch (nType)
{
commit 6818a61e94b7a7bfcab276e3ced3aa75c3deb16e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Oct 5 11:29:28 2015 +0200
LOK: add CALLBACK_SEARCH_RESULT_COUNT and implement in sw
Change-Id: I616b3f6d2881aaa479f6498d3121540980256c15
(cherry picked from commit 6c040ad18bd7b5a2d1d11130f4dbfd1c9d90055d)
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 5293aa9..df5f64d 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -158,7 +158,9 @@ typedef enum
*
* Payload is a single 0-based integer.
*/
- LOK_CALLBACK_SET_PART
+ LOK_CALLBACK_SET_PART,
+ /// Number of search results, in case something is found.
+ LOK_CALLBACK_SEARCH_RESULT_COUNT
}
LibreOfficeKitCallbackType;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 28fc2c9..1176412 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -209,7 +209,8 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
break;
case SvxSearchCmd::FIND_ALL:
{
- bool bRet = SearchAll();
+ sal_uInt16 nFound = 0;
+ bool bRet = SearchAll(&nFound);
if( !bRet )
{
#if HAVE_FEATURE_DESKTOP
@@ -222,6 +223,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#endif
m_bFound = false;
}
+ else
+ {
+ OString aPayload = OString::number(nFound);
+ m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_COUNT, aPayload.getStr());
+ }
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
#if HAVE_FEATURE_DESKTOP
{
commit 56af3c84d60b42c2e392f711e16cc19da0075af4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Oct 5 11:29:02 2015 +0200
desktop: handle sal_uInt16 in jsonToPropertyValues()
Change-Id: Ic0059404b7ccbc922703705e7818404d4904f324
(cherry picked from commit 44838c669b6bd02e14c394aebd9d19bcbf5ff409)
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 47a50b7..0c831b1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -905,6 +905,8 @@ static void jsonToPropertyValues(const char* pJSON, uno::Sequence<beans::Propert
aValue.Value <<= OString(rValue.c_str()).toFloat();
else if (rType == "long")
aValue.Value <<= OString(rValue.c_str()).toInt32();
+ else if (rType == "unsigned short")
+ aValue.Value <<= static_cast<sal_uInt16>(OString(rValue.c_str()).toUInt32());
else
SAL_WARN("desktop.lib", "jsonToPropertyValues: unhandled type '"<<rType<<"'");
aArguments.push_back(aValue);
More information about the Libreoffice-commits
mailing list