[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 2 commits - include/svx sd/source svx/source

2015-07-24 Thread matteocam
 include/svx/textchaincursor.hxx   |4 +++-
 sd/source/ui/view/sdview.cxx  |8 
 svx/source/svdraw/textchaincursor.cxx |4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 0fcd7e73bf81069289b6de5510fd39f9fc4697a1
Author: matteocam 
Date:   Fri Jul 24 17:38:14 2015 +0200

Handle Chaining after Paste in sd

Change-Id: I0891842228251a52a252a29adbaabbed3f8965ba

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 7668773..61e6939 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -20,13 +20,15 @@
 #ifndef INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 #define INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 
+#include 
+
 class SdrObjEditView;
 class SdrTextObj;
 class KeyEvent;
 class SdrOutliner;
 
 
-class TextChainCursorManager
+class SVX_DLLPUBLIC TextChainCursorManager
 {
 public:
 TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj 
*pTextObj);
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index b424cf7..9f2a83f 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -41,6 +41,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -1206,6 +1208,7 @@ void View::OnBeginPasteOrDrop( PasteOrDropInfos* 
/*pInfos*/ )
 get the correct style sheet. */
 void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 {
+/* Style Sheet handling */
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetTextEditObject() );
 SdrOutliner* pOutliner = GetTextEditOutliner();
 if( pOutliner && pTextObj && pTextObj->GetPage() )
@@ -1256,6 +1259,11 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 }
 }
 }
+
+/* Chaining handling */
+ImpChainingEventHdl(NULL);
+TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, 
pTextObj);
+ImpMoveCursorAfterChainingEvent(pCursorManager);
 }
 
 bool View::ShouldToggleOn(
commit f0aa62053f06c226a6394419ec8c345c2c634a94
Author: matteocam 
Date:   Fri Jul 24 17:16:08 2015 +0200

Detect DEL by KeyFuncType::DELETE

Change-Id: I062360a104e9ed07ac4b693536df0c45f18078b3

diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 35a339e..9f4e000 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -68,7 +68,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent& 
rKEvt,
 KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
 
 // We need to have this KeyFuncType
-if (eFunc !=  KeyFuncType::DONTKNOW)
+if (eFunc !=  KeyFuncType::DONTKNOW && eFunc != KeyFuncType::DELETE)
 {
 *pOutCursorEvt = CursorChainingEvent::NULL_EVENT;
 return;
@@ -94,7 +94,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent& 
rKEvt,
 }
 
 // Possibility: Are we "pushing" at the end of the object?
-if (nCode == KEY_DELETE && bAtEndOfTextContent && pNextLink)
+if (eFunc == KeyFuncType::DELETE && bAtEndOfTextContent && pNextLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_NEXT_LINK;
 // Selection unchanged: we are at the beginning of the box
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 2 commits - include/svx sd/source svx/source

2015-07-24 Thread matteocam
 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