summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-03-15 12:53:14 +0100
committerMichael Stahl <mst@openoffice.org>2010-03-15 12:53:14 +0100
commit0c81e6d9550c35717e578cf8c622356400f3bed5 (patch)
tree621b2bc540dd5715a7f07822bd872fb274db030e /sw/source/core
parent60854b557856981023cf739a20f4a4d0fd666b83 (diff)
odfmetadata4: sfx2::Metadatable: split CreateUndo() into 2 methods
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/docbm.cxx5
-rw-r--r--sw/source/core/undo/rolbck.cxx5
-rw-r--r--sw/source/core/undo/undel.cxx9
3 files changed, 11 insertions, 8 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 12edc1858b87..b7c9538f83e3 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -992,9 +992,8 @@ SaveBookmark::SaveBookmark(
m_aShortName = pBookmark->GetShortName();
m_aCode = pBookmark->GetKeyCode();
- ::sfx2::Metadatable * const pMetadatable(
- const_cast< ::sfx2::Metadatable * >( // CreateUndo should be const?
- dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)));
+ ::sfx2::Metadatable const*const pMetadatable(
+ dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
if (pMetadatable)
{
m_pMetadataUndo = pMetadatable->CreateUndo();
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index aae0b8de10ac..6df9f9aa24b8 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -614,9 +614,8 @@ SwHistoryBookmark::SwHistoryBookmark(
m_aKeycode = pBookmark->GetKeyCode();
m_aShortName = pBookmark->GetShortName();
- ::sfx2::Metadatable * const pMetadatable(
- const_cast< ::sfx2::Metadatable * >( // CreateUndo should be const?
- dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)));
+ ::sfx2::Metadatable const*const pMetadatable(
+ dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
if (pMetadatable)
{
m_pMetadataUndo = pMetadatable->CreateUndo();
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 593382fd999e..347a70190006 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -391,7 +391,9 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
bool emptied( pSttStr->Len() && !pSttTxtNd->Len() );
if (!bOneNode || emptied) // merging may overwrite xmlids...
{
- m_pMetadataUndoStart = pSttTxtNd->CreateUndo( emptied );
+ m_pMetadataUndoStart = (emptied)
+ ? pSttTxtNd->CreateUndoForDelete()
+ : pSttTxtNd->CreateUndo();
}
if( bOneNode )
@@ -425,7 +427,10 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
// METADATA: store
bool emptied( pEndStr->Len() && !pEndTxtNd->Len() );
- m_pMetadataUndoEnd = pEndTxtNd->CreateUndo( emptied );
+
+ m_pMetadataUndoEnd = (emptied)
+ ? pEndTxtNd->CreateUndoForDelete()
+ : pEndTxtNd->CreateUndo();
}
// sind es nur zwei Nodes, dann ist schon alles erledigt.