summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorDieter Loeschky <dl@openoffice.org>2001-03-26 13:37:56 +0000
committerDieter Loeschky <dl@openoffice.org>2001-03-26 13:37:56 +0000
commit4f19061dd8463f893fa66b48c067bea33f73408e (patch)
tree2e517e4a380d57faf9fad6c17315fb5e35c7b058 /sd/source/ui
parentfe352ddc82daede896a8d6fe6c6b0b7e90784a79 (diff)
#71359# bEmptyPresObj: undo/redo
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/func/futext.cxx73
-rw-r--r--sd/source/ui/view/sdview.cxx22
2 files changed, 45 insertions, 50 deletions
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 21abc317b1aa..b68a0f3bfbc0 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: futext.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: dl $ $Date: 2001-03-06 08:34:56 $
+ * last change: $Author: dl $ $Date: 2001-03-26 14:33:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -863,10 +863,8 @@ BOOL FuText::KeyInput(const KeyEvent& rKEvt)
pViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
- if ( pTextObj )
- {
- pTextObj->SetEmptyPresObj(FALSE);
- }
+// if ( pTextObj )
+// pTextObj->SetEmptyPresObj(FALSE);
}
else if (aKeyCode == KEY_ESCAPE)
{
@@ -1101,49 +1099,52 @@ BOOL FuText::RestoreDefaultText()
{
BOOL bRestored = FALSE;
- if ( pTextObj && !pTextObj->HasText() && (pTextObj == pView->GetTextEditObject()) )
+ if ( pTextObj && (pTextObj == pView->GetTextEditObject()) )
{
- SdPage* pPage = (SdPage*) pTextObj->GetPage();
-
- if (pPage)
+ if( !pTextObj->HasText() )
{
- PresObjKind ePresObjKind = pPage->GetPresObjKind(pTextObj);
+ SdPage* pPage = (SdPage*) pTextObj->GetPage();
- if (ePresObjKind == PRESOBJ_TITLE ||
- ePresObjKind == PRESOBJ_OUTLINE ||
- ePresObjKind == PRESOBJ_NOTES ||
- ePresObjKind == PRESOBJ_TEXT)
+ if (pPage)
{
- String aString = pPage->GetPresObjText(ePresObjKind);
+ PresObjKind ePresObjKind = pPage->GetPresObjKind(pTextObj);
- if (aString.Len())
+ if (ePresObjKind == PRESOBJ_TITLE ||
+ ePresObjKind == PRESOBJ_OUTLINE ||
+ ePresObjKind == PRESOBJ_NOTES ||
+ ePresObjKind == PRESOBJ_TEXT)
{
- SdOutliner* pInternalOutl = pDoc->GetInternalOutliner();
- pInternalOutl->SetMinDepth(0);
+ String aString = pPage->GetPresObjText(ePresObjKind);
+
+ if (aString.Len())
+ {
+ SdOutliner* pInternalOutl = pDoc->GetInternalOutliner();
+ pInternalOutl->SetMinDepth(0);
- BOOL bVertical = FALSE;
- OutlinerParaObject* pOldPara = pTextObj->GetOutlinerParaObject();
- if( pOldPara )
- bVertical = pOldPara->IsVertical(); // is old para object vertical?
+ BOOL bVertical = FALSE;
+ OutlinerParaObject* pOldPara = pTextObj->GetOutlinerParaObject();
+ if( pOldPara )
+ bVertical = pOldPara->IsVertical(); // is old para object vertical?
- pPage->SetObjText( pTextObj, pInternalOutl, ePresObjKind, aString );
+ pPage->SetObjText( pTextObj, pInternalOutl, ePresObjKind, aString );
- if( pOldPara )
- pTextObj->SetVerticalWriting( bVertical );
+ if( pOldPara )
+ pTextObj->SetVerticalWriting( bVertical );
- SdrOutliner* pOutliner = pView->GetTextEditOutliner();
- pTextObj->SetTextEditOutliner( NULL ); // to make stylesheet settings work
- pTextObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj(ePresObjKind), TRUE );
- pTextObj->SetTextEditOutliner( pOutliner );
+ SdrOutliner* pOutliner = pView->GetTextEditOutliner();
+ pTextObj->SetTextEditOutliner( NULL ); // to make stylesheet settings work
+ pTextObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj(ePresObjKind), TRUE );
+ pTextObj->SetTextEditOutliner( pOutliner );
- pInternalOutl->Clear();
- OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
+ pInternalOutl->Clear();
+ OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
- if (pOutliner)
- pOutliner->SetText(*pParaObj);
+ if (pOutliner)
+ pOutliner->SetText(*pParaObj);
- pTextObj->SetEmptyPresObj(TRUE);
- bRestored = TRUE;
+ pTextObj->SetEmptyPresObj(TRUE);
+ bRestored = TRUE;
+ }
}
}
}
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index f0e06561d5c1..14f4012c21d9 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdview.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: ka $ $Date: 2001-03-08 11:24:32 $
+ * last change: $Author: dl $ $Date: 2001-03-26 14:34:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -455,36 +455,30 @@ SdrEndTextEditKind SdView::EndTextEdit(BOOL bDontDeleteReally)
if ( pFunc && pFunc->ISA(FuText) )
{
+ SdrTextObj* pTextObj = ( (FuText*) pFunc)->GetTextObj();
BOOL bDefaultTextRestored = ( (FuText*) pFunc)->RestoreDefaultText();
-
eKind = FmFormView::EndTextEdit(bDontDeleteReally);
- SdrTextObj* pTextObj = ( (FuText*) pFunc)->GetTextObj();
+ if( bDefaultTextRestored )
+ pTextObj->SetEmptyPresObj( TRUE );
+
+ pTextObj = ( (FuText*) pFunc)->GetTextObj();
- if (pViewShell && pTextObj)
+ if ( pTextObj && pViewShell )
{
FuSlideShow* pFuSlideShow = pViewShell->GetSlideShow();
-
if (pFuSlideShow)
- {
pFuSlideShow->EndTextEdit(pTextObj);
- }
}
if (eKind == SDRENDTEXTEDIT_CHANGED && !bDefaultTextRestored)
- {
( (FuText*) pFunc)->ObjectChanged();
- }
}
else
- {
eKind = FmFormView::EndTextEdit(bDontDeleteReally);
- }
}
else
- {
eKind = FmFormView::EndTextEdit(bDontDeleteReally);
- }
if (bIsTextEdit)
{