Kaydet (Commit) 472c175d authored tarafından Armin Le Grand's avatar Armin Le Grand

#120515# Implemented and finetuned the enhanced Undo feature (see #120498#) for sc

üst ddd94929
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <unotools/charclass.hxx> #include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx> #include <unotools/transliterationwrapper.hxx>
#include <tools/tenccvt.hxx> #include <tools/tenccvt.hxx>
#include <svx/sdrundomanager.hxx>
#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp>
...@@ -5290,7 +5291,11 @@ sal_Bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const ...@@ -5290,7 +5291,11 @@ sal_Bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const
SfxUndoManager* ScDocument::GetUndoManager() SfxUndoManager* ScDocument::GetUndoManager()
{ {
if (!mpUndoManager) if (!mpUndoManager)
mpUndoManager = new SfxUndoManager; {
// to support enhanced text edit for draw objects, use an SdrUndoManager
mpUndoManager = new SdrUndoManager;
}
return mpUndoManager; return mpUndoManager;
} }
......
...@@ -33,6 +33,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { class ...@@ -33,6 +33,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { class
class ScDocument; class ScDocument;
class ScViewData; class ScViewData;
class ScDrawObjData; class ScDrawObjData;
class SdrUndoManager;
class ScDrawView: public FmFormView class ScDrawView: public FmFormView
{ {
...@@ -58,6 +59,9 @@ protected: ...@@ -58,6 +59,9 @@ protected:
void ImplClearCalcDropMarker(); void ImplClearCalcDropMarker();
// support enhanced text edit for draw objects
virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const;
public: public:
ScDrawView( OutputDevice* pOut, ScViewData* pData ); ScDrawView( OutputDevice* pOut, ScViewData* pData );
virtual ~ScDrawView(); virtual ~ScDrawView();
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <svx/sdrpaintwindow.hxx> #include <svx/sdrpaintwindow.hxx>
#include <sfx2/bindings.hxx> #include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx> #include <sfx2/viewfrm.hxx>
#include <svx/sdrundomanager.hxx>
#include "drawview.hxx" #include "drawview.hxx"
#include "global.hxx" #include "global.hxx"
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
#include "userdat.hxx" #include "userdat.hxx"
#include "postit.hxx" #include "postit.hxx"
#include "undocell.hxx" #include "undocell.hxx"
#include "document.hxx"
#include "sc.hrc" #include "sc.hrc"
...@@ -814,28 +816,10 @@ void ScDrawView::MarkDropObj( SdrObject* pObj ) ...@@ -814,28 +816,10 @@ void ScDrawView::MarkDropObj( SdrObject* pObj )
} }
} }
//UNUSED2009-05 void ScDrawView::CaptionTextDirection( sal_uInt16 nSlot ) // support enhanced text edit for draw objects
//UNUSED2009-05 { SdrUndoManager* ScDrawView::getSdrUndoManagerForEnhancedTextEdit() const
//UNUSED2009-05 if(nSlot != SID_TEXTDIRECTION_LEFT_TO_RIGHT && nSlot != SID_TEXTDIRECTION_TOP_TO_BOTTOM) {
//UNUSED2009-05 return; return pDoc ? dynamic_cast< SdrUndoManager* >(pDoc->GetUndoManager()) : 0;
//UNUSED2009-05 }
//UNUSED2009-05 SdrObject* pObject = GetTextEditObject();
//UNUSED2009-05 if ( ScDrawLayer::IsNoteCaption( pObject ) ) // eof
//UNUSED2009-05 {
//UNUSED2009-05 if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
//UNUSED2009-05 {
//UNUSED2009-05 SfxItemSet aAttr(pCaption->GetMergedItemSet());
//UNUSED2009-05 aAttr.Put( SvxWritingModeItem(
//UNUSED2009-05 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
//UNUSED2009-05 com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
//UNUSED2009-05 SDRATTR_TEXTDIRECTION ) );
//UNUSED2009-05 pCaption->SetMergedItemSet(aAttr);
//UNUSED2009-05 FuPoor* pPoor = pViewData->GetView()->GetDrawFuncPtr();
//UNUSED2009-05 if ( pPoor )
//UNUSED2009-05 {
//UNUSED2009-05 FuText* pText = static_cast<FuText*>(pPoor);
//UNUSED2009-05 pText->StopEditMode(sal_True);
//UNUSED2009-05 }
//UNUSED2009-05 }
//UNUSED2009-05 }
//UNUSED2009-05 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment