summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-12 12:44:26 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-12 12:44:26 +0000
commita9d6b3e89964ce7d508de56e57ffa8ab393cc777 (patch)
tree95d2b25daf9d97ede3d00ddd5a7b006db884f32e /svx/source/table
parent3574a164c6225874afbc8ce9d67a67ad018883a7 (diff)
CWS-TOOLING: integrate CWS impress166
2009-01-27 11:42:29 +0100 af r266972 : #i98508# Handle non DrawViewShell view shells correctly. 2009-01-21 10:41:32 +0100 af r266635 : #i98069# Do not call PreModelChange() for every ModelLock. 2009-01-20 15:25:41 +0100 af r266588 : #i98069# Added friend declaration that became necessary on Solaris after recent changes. 2009-01-19 13:48:47 +0100 af r266493 : #i97478# Prevent SID_PARASPACE_(DE|IN)CREASE from crashing when style sheet is missing. 2009-01-16 11:52:37 +0100 af r266411 : #i97338# Check the dispatcher before using it to show a context menu. 2009-01-15 14:33:55 +0100 sj r266373 : #153716# taking care of font-independent line spacing (editmode and hittest) 2009-01-15 14:29:46 +0100 sj r266372 : #153716# taking care of font-independent line spacing also in presentation styles 2009-01-14 14:04:16 +0100 af r266301 : #i97634# Do view change synchronously. Use shared pointers for view shells. 2009-01-14 14:01:27 +0100 af r266300 : #i97634# Added non-API methods that update the configuration synchronously. 2009-01-14 13:34:40 +0100 af r266295 : #i98069# Be more carefull with handling model updates to avoid assertion regarding number of selected pages. 2009-01-14 11:34:57 +0100 cl r266270 : #i97261# force outliner para oibject after text edit 2009-01-14 10:49:08 +0100 cl r266269 : #i97413# dispose cell undo action if shape dies 2009-01-13 18:50:05 +0100 cl r266247 : #i97347# fixed cell undo crash 2009-01-12 14:16:56 +0100 af r266156 : #i97296# Using is() method to check WeakReference for validity. 2009-01-12 13:52:00 +0100 af r266155 : #i97190# Turned static_cast to dynamic_cast in CreateChildList. 2009-01-12 13:06:57 +0100 af r266153 : #i97552# Catching Exceptions caught while accessing OLE-Object that is to be inserted. 2009-01-12 13:06:37 +0100 cl r266152 : #i96164# applied patch to fix ambiguous operation
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/cell.cxx16
-rw-r--r--svx/source/table/cell.hxx2
-rw-r--r--svx/source/table/tableundo.cxx48
-rw-r--r--svx/source/table/tableundo.hxx5
4 files changed, 52 insertions, 19 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 158f9aced4..40e1456ffd 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -678,6 +678,9 @@ void Cell::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
{
SdrText::SetOutlinerParaObject( pTextObject );
maSelection.nStartPara = 0xffff;
+
+ if( pTextObject == 0 )
+ ForceOutlinerParaObject( OUTLINERMODE_TEXTOBJECT );
}
// -----------------------------------------------------------------------------
@@ -694,15 +697,22 @@ void Cell::AddUndo()
// -----------------------------------------------------------------------------
-sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell& rNewCell )
+sdr::properties::TextProperties* Cell::CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell )
{
- if( mpProperties )
- return new sdr::properties::CellProperties( *static_cast<sdr::properties::CellProperties*>(mpProperties), rNewObj, &rNewCell );
+ if( pProperties )
+ return new sdr::properties::CellProperties( *static_cast<sdr::properties::CellProperties*>(pProperties), rNewObj, &rNewCell );
else
return 0;
}
// -----------------------------------------------------------------------------
+
+sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell& rNewCell )
+{
+ return CloneProperties(mpProperties,rNewObj,rNewCell);
+}
+
+// -----------------------------------------------------------------------------
// XInterface
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index 8299aa5342..35aa44b1af 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -202,6 +202,8 @@ public:
sdr::properties::TextProperties* CloneProperties( SdrObject& rNewObj, Cell& rNewCell );
+ static sdr::properties::TextProperties* CloneProperties( sdr::properties::TextProperties* pProperties, SdrObject& rNewObj, Cell& rNewCell );
+
void notifyModified();
protected:
diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx
index b39d44ad43..a6c5ff1e3b 100644
--- a/svx/source/table/tableundo.cxx
+++ b/svx/source/table/tableundo.cxx
@@ -40,6 +40,7 @@
#include "tablerow.hxx"
#include "tablecolumn.hxx"
+
// -----------------------------------------------------------------------------
using ::rtl::OUString;
@@ -56,22 +57,36 @@ CellUndo::CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell )
, mxCell( xCell )
, mbUndo( true )
{
-
- getDataFromCell( maUndoData );
+ if( mxCell.is() && mxObjRef.is() )
+ {
+ getDataFromCell( maUndoData );
+ mxObjRef->AddObjectUser( *this );
+ }
}
CellUndo::~CellUndo()
{
- if( mbUndo )
- {
- delete maUndoData.mpProperties;
- delete maUndoData.mpOutlinerParaObject;
- }
- else
- {
- delete maRedoData.mpProperties;
- delete maRedoData.mpOutlinerParaObject;
- }
+ if( mxObjRef.is() )
+ mxObjRef->RemoveObjectUser( *this );
+ dispose();
+}
+
+void CellUndo::dispose()
+{
+ mxCell.clear();
+ delete maUndoData.mpProperties;
+ maUndoData.mpProperties = 0;
+ delete maRedoData.mpProperties;
+ maRedoData.mpProperties = 0;
+ delete maUndoData.mpOutlinerParaObject;
+ maUndoData.mpOutlinerParaObject = 0;
+ delete maRedoData.mpOutlinerParaObject;
+ maRedoData.mpOutlinerParaObject = 0;
+}
+
+void CellUndo::ObjectInDestruction(const SdrObject& )
+{
+ dispose();
}
void CellUndo::Undo()
@@ -88,7 +103,7 @@ void CellUndo::Undo()
void CellUndo::Redo()
{
- if( mxCell.is() && mbUndo )
+ if( mxCell.is() && !mbUndo )
{
setDataToCell( maRedoData );
mbUndo = true;
@@ -110,8 +125,11 @@ BOOL CellUndo::Merge( SfxUndoAction *pNextAction )
void CellUndo::setDataToCell( const Data& rData )
{
- mxCell->mpProperties = rData.mpProperties;
-
+ delete mxCell->mpProperties;
+ if( rData.mpProperties )
+ mxCell->mpProperties = Cell::CloneProperties( rData.mpProperties, *mxObjRef.get(), *mxCell.get() );
+ else
+ mxCell->mpProperties = 0;
if( rData.mpOutlinerParaObject )
mxCell->SetOutlinerParaObject( rData.mpOutlinerParaObject->Clone() );
diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx
index 8ab12a9428..36e71a254f 100644
--- a/svx/source/table/tableundo.hxx
+++ b/svx/source/table/tableundo.hxx
@@ -50,7 +50,7 @@ class OutlinerParaObject;
namespace sdr { namespace table {
-class CellUndo : public SdrUndoAction
+class CellUndo : public SdrUndoAction, public sdr::ObjectUser
{
public:
CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell );
@@ -60,6 +60,9 @@ public:
virtual void Redo();
virtual BOOL Merge( SfxUndoAction *pNextAction );
+ void dispose();
+ virtual void ObjectInDestruction(const SdrObject& rObject);
+
private:
struct Data
{