include/svx/svdedxv.hxx |5 ++-
include/svx/textchaincursor.hxx | 17 ---
sd/source/ui/view/drviewse.cxx|3 +-
svx/source/svdraw/svdedxv.cxx | 36 ++--
svx/source/svdraw/textchaincursor.cxx | 50 +-
5 files changed, 84 insertions(+), 27 deletions(-)
New commits:
commit 8c4db4fe0f5bd10c06fb2a35b2e5cdaedad34bc3
Author: matteocam
Date: Fri Jul 24 16:29:47 2015 +0200
Handle DEL calling Sdr*View::KeyInput instead of OutlinerView::PostKeyEvent
Change-Id: I7f4483e5165d30786288462fe5397ee93e477673
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 516f487..a8bb8c1 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -939,7 +939,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
{
vcl::KeyCode aKCode(KEY_DELETE);
KeyEvent aKEvt( 0, aKCode);
-pOLV->PostKeyEvent(aKEvt);
+//pOLV->PostKeyEvent(aKEvt);
+mpDrawView->KeyInput(aKEvt, NULL);
}
}
else
commit ebe372b42c1e9667a60fb06e798e01dc11e2155b
Author: matteocam
Date: Fri Jul 24 12:04:31 2015 +0200
Handle Delete
Change-Id: I17a1886689785420fb881bea8f1d609ab3f35c4e
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index d45a12f..c7e9c99 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -34,6 +34,7 @@ class EditFieldInfo;
class ImpSdrEditPara;
struct PasteOrDropInfos;
class SdrUndoManager;
+class TextChainCursorManager;
enum class CursorChainingEvent;
class ESelection;
@@ -110,8 +111,8 @@ protected:
OutlinerView* ImpFindOutlinerView(vcl::Window* pWin) const;
-void ImpMoveCursorAfterChainingEvent();
-bool ImpHandleMotionThroughBoxesKeyInput(const KeyEvent& rKEvt,
vcl::Window* pWin);
+void ImpMoveCursorAfterChainingEvent(TextChainCursorManager
*pCursorManager);
+TextChainCursorManager *ImpHandleMotionThroughBoxesKeyInput(const
KeyEvent& rKEvt, vcl::Window* pWin, bool *bOutHandled);
// Create a new OutlinerView at the heap and initialize all required
parameters.
// pTextEditObj, pTextEditPV and pTextEditOutliner have to be initialized
diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 1d9c4de..7668773 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -31,19 +31,28 @@ class TextChainCursorManager
public:
TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj
*pTextObj);
-bool HandleKeyEvent( const KeyEvent& rKEvt ) const;
+bool HandleKeyEvent( const KeyEvent& rKEvt );
+
+// Used by HandledKeyEvent and basic building block for handling cursor
event
void HandleCursorEvent(const CursorChainingEvent aCurEvt,
- const ESelection aNewSel) const;
+ const ESelection aNewSel);
+
+// To be used after chaining event to deal with some nuisances
+void HandleCursorEventAfterChaining(const CursorChainingEvent aCurEvt,
+ const ESelection aNewSel);
private:
SdrObjEditView *mpEditView;
const SdrTextObj *mpTextObj;
-void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection
aNewSel) const;
+// flag for handling of CANC which is kind of an exceptional case
+bool mbHandlingDel;
+
+void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection
aNewSel);
void impDetectEvent(const KeyEvent& rKEvt,
CursorChainingEvent *pOutCursorEvt,
ESelection *pOutSel,
-bool *bOutHandled) const;
+bool *bOutHandled);
};
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ad35d29..cfc5d33 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -526,9 +526,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
}
-void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
+void SdrObjEditView::ImpMoveCursorAfterChainingEvent(TextChainCursorManager
*pCursorManager)
{
-if (!mxTextEditObj.is())
+if (!mxTextEditObj.is() || !pCursorManager)
return;
SdrTextObj* pTextObj = dynamic_cast(mxTextEditObj.get());
@@ -539,8 +539,8 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
TextChain *pTextChain = pTextObj->GetTextChain();
ESelection aNewSel = pTextChain->GetPostChainingSel(pTextObj);
-TextChainCursorManager aCursorManager(this, pTextObj);
-aCursorManager.HandleCursorEvent(
+
+pCursorManager->HandleCursorEventAfterChaining(
pTextChain->GetCursorEvent(pTextObj),
aNewSel);
@@ -1258,25 +1258,30 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point&
rHit) const
return bOk;
}
-bool